stripe/model/
source_order_item.rs

1use serde::{Serialize, Deserialize};
2///
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct SourceOrderItem {
5    ///The amount (price) for this order item.
6    #[serde(skip_serializing_if = "Option::is_none")]
7    pub amount: Option<i64>,
8    ///This currency of this order item. Required when `amount` is present.
9    #[serde(skip_serializing_if = "Option::is_none")]
10    pub currency: Option<String>,
11    ///Human-readable description for this order item.
12    #[serde(skip_serializing_if = "Option::is_none")]
13    pub description: Option<String>,
14    ///The ID of the associated object for this line item. Expandable if not null (e.g., expandable to a SKU).
15    #[serde(skip_serializing_if = "Option::is_none")]
16    pub parent: Option<String>,
17    ///The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered.
18    #[serde(skip_serializing_if = "Option::is_none")]
19    pub quantity: Option<i64>,
20    ///The type of this order item. Must be `sku`, `tax`, or `shipping`.
21    #[serde(rename = "type")]
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub type_: Option<String>,
24}
25impl std::fmt::Display for SourceOrderItem {
26    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
27        write!(f, "{}", serde_json::to_string(self).unwrap())
28    }
29}