stripe/model/
tax_calculation_line_item.rs

1use serde::{Serialize, Deserialize};
2use super::TaxProductResourceLineItemTaxBreakdown;
3///
4#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5pub struct TaxCalculationLineItem {
6    ///The line item amount in integer cents. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount.
7    pub amount: i64,
8    ///The amount of tax calculated for this line item, in integer cents.
9    pub amount_tax: i64,
10    ///Unique identifier for the object.
11    pub id: String,
12    ///Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
13    pub livemode: bool,
14    ///String representing the object's type. Objects of the same type share the same value.
15    pub object: String,
16    ///The ID of an existing [Product](https://stripe.com/docs/api/products/object).
17    #[serde(skip_serializing_if = "Option::is_none")]
18    pub product: Option<String>,
19    ///The number of units of the item being purchased. For reversals, this is the quantity reversed.
20    pub quantity: i64,
21    ///A custom identifier for this line item.
22    #[serde(skip_serializing_if = "Option::is_none")]
23    pub reference: Option<String>,
24    ///Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes.
25    pub tax_behavior: String,
26    ///Detailed account of taxes relevant to this line item.
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub tax_breakdown: Option<Vec<TaxProductResourceLineItemTaxBreakdown>>,
29    ///The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource.
30    pub tax_code: String,
31}
32impl std::fmt::Display for TaxCalculationLineItem {
33    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
34        write!(f, "{}", serde_json::to_string(self).unwrap())
35    }
36}