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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
/*
 * Selling Partner API for Retail Procurement Shipments
 *
 * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ShipmentConfirmation {
    /// Unique shipment ID (not used over the last 365 days).
    #[serde(default, rename = "shipmentIdentifier")]
    pub shipment_identifier: String,
    /// Indicates if this shipment confirmation is the initial confirmation, or intended to replace an already posted shipment confirmation. If replacing an existing shipment confirmation, be sure to provide the identical shipmentIdentifier and sellingParty information as in the previous confirmation.
    #[serde(default, rename = "shipmentConfirmationType")]
    pub shipment_confirmation_type: ShipmentConfirmationType,
    /// The type of shipment.
    #[serde(default, rename = "shipmentType", skip_serializing_if = "Option::is_none")]
    pub shipment_type: Option<ShipmentType>,
    /// Shipment hierarchical structure.
    #[serde(default, rename = "shipmentStructure", skip_serializing_if = "Option::is_none")]
    pub shipment_structure: Option<ShipmentStructure>,
    #[serde(default, rename = "transportationDetails", skip_serializing_if = "Option::is_none")]
    pub transportation_details: Option<Box<crate::models::TransportationDetails>>,
    /// The Amazon Reference Number is a unique identifier generated by Amazon for all Collect/WePay shipments when you submit  a routing request. This field is mandatory for Collect/WePay shipments.
    #[serde(default, rename = "amazonReferenceNumber", skip_serializing_if = "Option::is_none")]
    pub amazon_reference_number: Option<String>,
    /// Date on which the shipment confirmation was submitted.
    #[serde(default, rename = "shipmentConfirmationDate")]
    pub shipment_confirmation_date: String,
    /// The date and time of the departure of the shipment from the vendor's location. Vendors are requested to send ASNs within 30 minutes of departure from their warehouse/distribution center or at least 6 hours prior to the appointment time at the Amazon destination warehouse, whichever is sooner. Shipped date mentioned in the shipment confirmation should not be in the future.
    #[serde(default, rename = "shippedDate", skip_serializing_if = "Option::is_none")]
    pub shipped_date: Option<String>,
    /// The date and time on which the shipment is expected to reach buyer's warehouse. It needs to be an estimate based on the average transit time between ship from location and the destination. The exact appointment time will be provided by the buyer and is potentially not known when creating the shipment confirmation.
    #[serde(default, rename = "estimatedDeliveryDate", skip_serializing_if = "Option::is_none")]
    pub estimated_delivery_date: Option<String>,
    #[serde(default, rename = "sellingParty")]
    pub selling_party: Box<crate::models::PartyIdentification>,
    #[serde(default, rename = "shipFromParty")]
    pub ship_from_party: Box<crate::models::PartyIdentification>,
    #[serde(default, rename = "shipToParty")]
    pub ship_to_party: Box<crate::models::PartyIdentification>,
    #[serde(default, rename = "shipmentMeasurements", skip_serializing_if = "Option::is_none")]
    pub shipment_measurements: Option<Box<crate::models::ShipmentMeasurements>>,
    #[serde(default, rename = "importDetails", skip_serializing_if = "Option::is_none")]
    pub import_details: Option<Box<crate::models::ImportDetails>>,
    /// A list of the items in this shipment and their associated details. If any of the item detail fields are common at a carton or a pallet level, provide them at the corresponding carton or pallet level.
    #[serde(default, rename = "shippedItems")]
    pub shipped_items: Vec<crate::models::Item>,
    /// A list of the cartons in this shipment.
    #[serde(default, rename = "cartons", skip_serializing_if = "Option::is_none")]
    pub cartons: Option<Vec<crate::models::Carton>>,
    /// A list of the pallets in this shipment.
    #[serde(default, rename = "pallets", skip_serializing_if = "Option::is_none")]
    pub pallets: Option<Vec<crate::models::Pallet>>,
}

impl ShipmentConfirmation {
    pub fn new(shipment_identifier: String, shipment_confirmation_type: ShipmentConfirmationType, shipment_confirmation_date: String, selling_party: crate::models::PartyIdentification, ship_from_party: crate::models::PartyIdentification, ship_to_party: crate::models::PartyIdentification, shipped_items: Vec<crate::models::Item>) -> ShipmentConfirmation {
        ShipmentConfirmation {
            shipment_identifier,
            shipment_confirmation_type,
            shipment_type: None,
            shipment_structure: None,
            transportation_details: None,
            amazon_reference_number: None,
            shipment_confirmation_date,
            shipped_date: None,
            estimated_delivery_date: None,
            selling_party: Box::new(selling_party),
            ship_from_party: Box::new(ship_from_party),
            ship_to_party: Box::new(ship_to_party),
            shipment_measurements: None,
            import_details: None,
            shipped_items,
            cartons: None,
            pallets: None,
        }
    }
}

/// Indicates if this shipment confirmation is the initial confirmation, or intended to replace an already posted shipment confirmation. If replacing an existing shipment confirmation, be sure to provide the identical shipmentIdentifier and sellingParty information as in the previous confirmation.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ShipmentConfirmationType {
    #[serde(rename = "Original")]
    Original,
    #[serde(rename = "Replace")]
    Replace,
}

impl Default for ShipmentConfirmationType {
    fn default() -> ShipmentConfirmationType {
        Self::Original
    }
}
/// The type of shipment.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ShipmentType {
    #[serde(rename = "TruckLoad")]
    TruckLoad,
    #[serde(rename = "LessThanTruckLoad")]
    LessThanTruckLoad,
    #[serde(rename = "SmallParcel")]
    SmallParcel,
}

impl Default for ShipmentType {
    fn default() -> ShipmentType {
        Self::TruckLoad
    }
}
/// Shipment hierarchical structure.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ShipmentStructure {
    #[serde(rename = "PalletizedAssortmentCase")]
    PalletizedAssortmentCase,
    #[serde(rename = "LooseAssortmentCase")]
    LooseAssortmentCase,
    #[serde(rename = "PalletOfItems")]
    PalletOfItems,
    #[serde(rename = "PalletizedStandardCase")]
    PalletizedStandardCase,
    #[serde(rename = "LooseStandardCase")]
    LooseStandardCase,
    #[serde(rename = "MasterPallet")]
    MasterPallet,
    #[serde(rename = "MasterCase")]
    MasterCase,
}

impl Default for ShipmentStructure {
    fn default() -> ShipmentStructure {
        Self::PalletizedAssortmentCase
    }
}