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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
 * Selling Partner API for Direct Fulfillment Orders
 *
 * The Selling Partner API for Direct Fulfillment Orders provides programmatic access to a direct fulfillment vendor's order data.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct TaxDetails {
    /// A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation.
    #[serde(default, rename = "taxRate", skip_serializing_if = "Option::is_none")]
    pub tax_rate: Option<String>,
    #[serde(default, rename = "taxAmount")]
    pub tax_amount: Box<crate::models::Money>,
    #[serde(default, rename = "taxableAmount", skip_serializing_if = "Option::is_none")]
    pub taxable_amount: Option<Box<crate::models::Money>>,
    /// Tax type.
    #[serde(default, rename = "type", skip_serializing_if = "Option::is_none")]
    pub _type: Option<Type>,
}

impl TaxDetails {
    pub fn new(tax_amount: crate::models::Money) -> TaxDetails {
        TaxDetails {
            tax_rate: None,
            tax_amount: Box::new(tax_amount),
            taxable_amount: None,
            _type: None,
        }
    }
}

/// Tax type.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Type {
    #[serde(rename = "CONSUMPTION")]
    CONSUMPTION,
    #[serde(rename = "GST")]
    GST,
    #[serde(rename = "MwSt.")]
    MwSt,
    #[serde(rename = "PST")]
    PST,
    #[serde(rename = "TOTAL")]
    TOTAL,
    #[serde(rename = "TVA")]
    TVA,
    #[serde(rename = "VAT")]
    VAT,
}

impl Default for Type {
    fn default() -> Type {
        Self::CONSUMPTION
    }
}