amazon_spapi/models/vendor_shipments/
shipment_confirmation.rs

1/*
2 * Selling Partner API for Retail Procurement Shipments
3 *
4 * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ShipmentConfirmation : A list of one or more shipment confirmations.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ShipmentConfirmation {
17    /// Unique shipment ID (not used over the last 365 days).
18    #[serde(rename = "shipmentIdentifier")]
19    pub shipment_identifier: String,
20    /// 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.
21    #[serde(rename = "shipmentConfirmationType")]
22    pub shipment_confirmation_type: ShipmentConfirmationType,
23    /// The type of shipment.
24    #[serde(rename = "shipmentType", skip_serializing_if = "Option::is_none")]
25    pub shipment_type: Option<ShipmentType>,
26    /// Shipment hierarchical structure.
27    #[serde(rename = "shipmentStructure", skip_serializing_if = "Option::is_none")]
28    pub shipment_structure: Option<ShipmentStructure>,
29    #[serde(rename = "transportationDetails", skip_serializing_if = "Option::is_none")]
30    pub transportation_details: Option<Box<models::vendor_shipments::TransportationDetailsForShipmentConfirmation>>,
31    /// 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.
32    #[serde(rename = "amazonReferenceNumber", skip_serializing_if = "Option::is_none")]
33    pub amazon_reference_number: Option<String>,
34    /// Date on which the shipment confirmation was submitted.
35    #[serde(rename = "shipmentConfirmationDate")]
36    pub shipment_confirmation_date: String,
37    /// 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 buyer destination warehouse, whichever is sooner. Shipped date mentioned in the shipment confirmation should not be in the future.
38    #[serde(rename = "shippedDate", skip_serializing_if = "Option::is_none")]
39    pub shipped_date: Option<String>,
40    /// The date and time on which the shipment is estimated 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.
41    #[serde(rename = "estimatedDeliveryDate", skip_serializing_if = "Option::is_none")]
42    pub estimated_delivery_date: Option<String>,
43    #[serde(rename = "sellingParty")]
44    pub selling_party: Box<models::vendor_shipments::PartyIdentification>,
45    #[serde(rename = "shipFromParty")]
46    pub ship_from_party: Box<models::vendor_shipments::PartyIdentification>,
47    #[serde(rename = "shipToParty")]
48    pub ship_to_party: Box<models::vendor_shipments::PartyIdentification>,
49    #[serde(rename = "shipmentMeasurements", skip_serializing_if = "Option::is_none")]
50    pub shipment_measurements: Option<Box<models::vendor_shipments::ShipmentMeasurements>>,
51    #[serde(rename = "importDetails", skip_serializing_if = "Option::is_none")]
52    pub import_details: Option<Box<models::vendor_shipments::ImportDetails>>,
53    /// 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.
54    #[serde(rename = "shippedItems")]
55    pub shipped_items: Vec<models::vendor_shipments::Item>,
56    /// A list of the cartons in this shipment.
57    #[serde(rename = "cartons", skip_serializing_if = "Option::is_none")]
58    pub cartons: Option<Vec<models::vendor_shipments::Carton>>,
59    /// A list of the pallets in this shipment.
60    #[serde(rename = "pallets", skip_serializing_if = "Option::is_none")]
61    pub pallets: Option<Vec<models::vendor_shipments::Pallet>>,
62}
63
64impl ShipmentConfirmation {
65    /// A list of one or more shipment confirmations.
66    pub fn new(shipment_identifier: String, shipment_confirmation_type: ShipmentConfirmationType, shipment_confirmation_date: String, selling_party: models::vendor_shipments::PartyIdentification, ship_from_party: models::vendor_shipments::PartyIdentification, ship_to_party: models::vendor_shipments::PartyIdentification, shipped_items: Vec<models::vendor_shipments::Item>) -> ShipmentConfirmation {
67        ShipmentConfirmation {
68            shipment_identifier,
69            shipment_confirmation_type,
70            shipment_type: None,
71            shipment_structure: None,
72            transportation_details: None,
73            amazon_reference_number: None,
74            shipment_confirmation_date,
75            shipped_date: None,
76            estimated_delivery_date: None,
77            selling_party: Box::new(selling_party),
78            ship_from_party: Box::new(ship_from_party),
79            ship_to_party: Box::new(ship_to_party),
80            shipment_measurements: None,
81            import_details: None,
82            shipped_items,
83            cartons: None,
84            pallets: None,
85        }
86    }
87}
88/// 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.
89#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
90pub enum ShipmentConfirmationType {
91    #[serde(rename = "Original")]
92    Original,
93    #[serde(rename = "Replace")]
94    Replace,
95}
96
97impl Default for ShipmentConfirmationType {
98    fn default() -> ShipmentConfirmationType {
99        Self::Original
100    }
101}
102/// The type of shipment.
103#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
104pub enum ShipmentType {
105    #[serde(rename = "TruckLoad")]
106    TruckLoad,
107    #[serde(rename = "LessThanTruckLoad")]
108    LessThanTruckLoad,
109    #[serde(rename = "SmallParcel")]
110    SmallParcel,
111}
112
113impl Default for ShipmentType {
114    fn default() -> ShipmentType {
115        Self::TruckLoad
116    }
117}
118/// Shipment hierarchical structure.
119#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
120pub enum ShipmentStructure {
121    #[serde(rename = "PalletizedAssortmentCase")]
122    PalletizedAssortmentCase,
123    #[serde(rename = "LooseAssortmentCase")]
124    LooseAssortmentCase,
125    #[serde(rename = "PalletOfItems")]
126    PalletOfItems,
127    #[serde(rename = "PalletizedStandardCase")]
128    PalletizedStandardCase,
129    #[serde(rename = "LooseStandardCase")]
130    LooseStandardCase,
131    #[serde(rename = "MasterPallet")]
132    MasterPallet,
133    #[serde(rename = "MasterCase")]
134    MasterCase,
135}
136
137impl Default for ShipmentStructure {
138    fn default() -> ShipmentStructure {
139        Self::PalletizedAssortmentCase
140    }
141}
142