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
64
65
66
67
68
/*
 * Selling Partner API for Retail Procurement Payments
 *
 * The Selling Partner API for Retail Procurement Payments provides programmatic access to vendors payments data.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

/// InvoiceItem : Details of the item being invoiced.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct InvoiceItem {
    /// Unique number related to this line item.
    #[serde(default, rename = "itemSequenceNumber")]
    pub item_sequence_number: i32,
    /// Amazon Standard Identification Number (ASIN) of an item.
    #[serde(default, rename = "amazonProductIdentifier", skip_serializing_if = "Option::is_none")]
    pub amazon_product_identifier: Option<String>,
    /// The vendor selected product identifier of the item. Should be the same as was provided in the purchase order.
    #[serde(default, rename = "vendorProductIdentifier", skip_serializing_if = "Option::is_none")]
    pub vendor_product_identifier: Option<String>,
    #[serde(default, rename = "invoicedQuantity")]
    pub invoiced_quantity: Box<crate::models::ItemQuantity>,
    #[serde(default, rename = "netCost")]
    pub net_cost: Box<crate::models::Money>,
    /// The Amazon purchase order number for this invoiced line item. Formatting Notes: 8-character alpha-numeric code. This value is mandatory only when invoiceType is Invoice, and is not required when invoiceType is CreditNote.
    #[serde(default, rename = "purchaseOrderNumber", skip_serializing_if = "Option::is_none")]
    pub purchase_order_number: Option<String>,
    /// HSN Tax code. The HSN number cannot contain alphabets.
    #[serde(default, rename = "hsnCode", skip_serializing_if = "Option::is_none")]
    pub hsn_code: Option<String>,
    #[serde(default, rename = "creditNoteDetails", skip_serializing_if = "Option::is_none")]
    pub credit_note_details: Option<Box<crate::models::CreditNoteDetails>>,
    /// Individual tax details per line item.
    #[serde(default, rename = "taxDetails", skip_serializing_if = "Option::is_none")]
    pub tax_details: Option<Vec<crate::models::TaxDetails>>,
    /// Individual charge details per line item.
    #[serde(default, rename = "chargeDetails", skip_serializing_if = "Option::is_none")]
    pub charge_details: Option<Vec<crate::models::ChargeDetails>>,
    /// Individual allowance details per line item.
    #[serde(default, rename = "allowanceDetails", skip_serializing_if = "Option::is_none")]
    pub allowance_details: Option<Vec<crate::models::AllowanceDetails>>,
}

impl InvoiceItem {
    /// Details of the item being invoiced.
    pub fn new(item_sequence_number: i32, invoiced_quantity: crate::models::ItemQuantity, net_cost: crate::models::Money) -> InvoiceItem {
        InvoiceItem {
            item_sequence_number,
            amazon_product_identifier: None,
            vendor_product_identifier: None,
            invoiced_quantity: Box::new(invoiced_quantity),
            net_cost: Box::new(net_cost),
            purchase_order_number: None,
            hsn_code: None,
            credit_note_details: None,
            tax_details: None,
            charge_details: None,
            allowance_details: None,
        }
    }
}