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
69
70
71
72
73
74
75
76
77
/*
 * Selling Partner API for Merchant Fulfillment
 *
 * The Selling Partner API for Merchant Fulfillment helps you build applications that let sellers purchase shipping for non-Prime and Prime orders using Amazon’s Buy Shipping Services.
 *
 * The version of the OpenAPI document: v0
 * 
 * Generated by: https://openapi-generator.tech
 */

/// Shipment : The details of a shipment, including the shipment status.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Shipment {
    /// An Amazon-defined shipment identifier.
    #[serde(default, rename = "ShipmentId")]
    pub shipment_id: String,
    /// An Amazon-defined order identifier, in 3-7-7 format.
    #[serde(default, rename = "AmazonOrderId")]
    pub amazon_order_id: String,
    /// A seller-defined order identifier.
    #[serde(default, rename = "SellerOrderId", skip_serializing_if = "Option::is_none")]
    pub seller_order_id: Option<String>,
    /// The list of items to be included in a shipment.
    #[serde(default, rename = "ItemList")]
    pub item_list: Vec<crate::models::Item>,
    #[serde(default, rename = "ShipFromAddress")]
    pub ship_from_address: Box<crate::models::Address>,
    #[serde(default, rename = "ShipToAddress")]
    pub ship_to_address: Box<crate::models::Address>,
    #[serde(default, rename = "PackageDimensions")]
    pub package_dimensions: Box<crate::models::PackageDimensions>,
    #[serde(default, rename = "Weight")]
    pub weight: Box<crate::models::Weight>,
    #[serde(default, rename = "Insurance")]
    pub insurance: Box<crate::models::CurrencyAmount>,
    #[serde(default, rename = "ShippingService")]
    pub shipping_service: Box<crate::models::ShippingService>,
    #[serde(default, rename = "Label")]
    pub label: Box<crate::models::Label>,
    #[serde(default, rename = "Status")]
    pub status: crate::models::ShipmentStatus,
    /// The shipment tracking identifier provided by the carrier.
    #[serde(default, rename = "TrackingId", skip_serializing_if = "Option::is_none")]
    pub tracking_id: Option<String>,
    #[serde(default, rename = "CreatedDate")]
    pub created_date: String,
    #[serde(default, rename = "LastUpdatedDate", skip_serializing_if = "Option::is_none")]
    pub last_updated_date: Option<String>,
}

impl Shipment {
    /// The details of a shipment, including the shipment status.
    pub fn new(shipment_id: String, amazon_order_id: String, item_list: Vec<crate::models::Item>, ship_from_address: crate::models::Address, ship_to_address: crate::models::Address, package_dimensions: crate::models::PackageDimensions, weight: crate::models::Weight, insurance: crate::models::CurrencyAmount, shipping_service: crate::models::ShippingService, label: crate::models::Label, status: crate::models::ShipmentStatus, created_date: String) -> Shipment {
        Shipment {
            shipment_id,
            amazon_order_id,
            seller_order_id: None,
            item_list,
            ship_from_address: Box::new(ship_from_address),
            ship_to_address: Box::new(ship_to_address),
            package_dimensions: Box::new(package_dimensions),
            weight: Box::new(weight),
            insurance: Box::new(insurance),
            shipping_service: Box::new(shipping_service),
            label: Box::new(label),
            status,
            tracking_id: None,
            created_date,
            last_updated_date: None,
        }
    }
}