1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* 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 ProductItemReq {
/// only valid if product is a subscription
#[serde(rename = "addons", skip_serializing_if = "Option::is_none")]
pub addons: Option<Vec<models::AttachAddonReq>>,
/// Amount the customer pays if pay_what_you_want is enabled. If disabled then amount will be ignored Represented in the lowest denomination of the currency (e.g., cents for USD). For example, to charge $1.00, pass `100`. Only applicable for one time payments If amount is not set for pay_what_you_want product, customer is allowed to select the amount.
#[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
pub amount: Option<i32>,
/// unique id of the product
#[serde(rename = "product_id")]
pub product_id: String,
#[serde(rename = "quantity")]
pub quantity: i32,
}
impl ProductItemReq {
pub fn new(product_id: String, quantity: i32) -> ProductItemReq {
ProductItemReq {
addons: None,
amount: None,
product_id,
quantity,
}
}
}