dodopayments_rust 2.2.1

Rust SDK for Dodo Payments API
Documentation
/*
 * public
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.87.0
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OnDemandSubscriptionReq {
    /// Whether adaptive currency fees should be included in the product_price (true) or added on top (false). This field is ignored if adaptive pricing is not enabled for the business.
    #[serde(rename = "adaptive_currency_fees_inclusive", skip_serializing_if = "Option::is_none")]
    pub adaptive_currency_fees_inclusive: Option<bool>,
    /// If set as True, does not perform any charge and only authorizes payment method details for future use.
    #[serde(rename = "mandate_only")]
    pub mandate_only: bool,
    /// Optional currency of the product price. If not specified, defaults to the currency of the product.
    #[serde(rename = "product_currency", skip_serializing_if = "Option::is_none")]
    pub product_currency: Option<models::Currency>,
    /// Optional product description override for billing and line items. If not specified, the stored description of the product will be used.
    #[serde(rename = "product_description", skip_serializing_if = "Option::is_none")]
    pub product_description: Option<String>,
    /// Product price for the initial charge to customer If not specified the stored price of the product will be used Represented in the lowest denomination of the currency (e.g., cents for USD). For example, to charge $1.00, pass `100`.
    #[serde(rename = "product_price", skip_serializing_if = "Option::is_none")]
    pub product_price: Option<i32>,
}

impl OnDemandSubscriptionReq {
    pub fn new(mandate_only: bool) -> OnDemandSubscriptionReq {
        OnDemandSubscriptionReq {
            adaptive_currency_fees_inclusive: None,
            mandate_only,
            product_currency: None,
            product_description: None,
            product_price: None,
        }
    }
}