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
/*
 * Selling Partner APIs for Fulfillment Outbound
 *
 * The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders.
 *
 * The version of the OpenAPI document: 2020-07-01
 * 
 * Generated by: https://openapi-generator.tech
 */

/// FulfillmentShipment : Delivery and item information for a shipment in a fulfillment order.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct FulfillmentShipment {
    /// A shipment identifier assigned by Amazon.
    #[serde(default, rename = "amazonShipmentId")]
    pub amazon_shipment_id: String,
    /// An identifier for the fulfillment center that the shipment will be sent from.
    #[serde(default, rename = "fulfillmentCenterId")]
    pub fulfillment_center_id: String,
    /// The current status of the shipment.
    #[serde(default, rename = "fulfillmentShipmentStatus")]
    pub fulfillment_shipment_status: FulfillmentShipmentStatus,
    #[serde(default, rename = "shippingDate", skip_serializing_if = "Option::is_none")]
    pub shipping_date: Option<String>,
    #[serde(default, rename = "estimatedArrivalDate", skip_serializing_if = "Option::is_none")]
    pub estimated_arrival_date: Option<String>,
    /// Provides additional insight into shipment timeline. Primairly used to communicate that actual delivery dates aren't available.
    #[serde(default, rename = "shippingNotes", skip_serializing_if = "Option::is_none")]
    pub shipping_notes: Option<Vec<String>>,
    /// An array of fulfillment shipment item information.
    #[serde(default, rename = "fulfillmentShipmentItem")]
    pub fulfillment_shipment_item: Vec<crate::models::FulfillmentShipmentItem>,
    /// An array of fulfillment shipment package information.
    #[serde(default, rename = "fulfillmentShipmentPackage", skip_serializing_if = "Option::is_none")]
    pub fulfillment_shipment_package: Option<Vec<crate::models::FulfillmentShipmentPackage>>,
}

impl FulfillmentShipment {
    /// Delivery and item information for a shipment in a fulfillment order.
    pub fn new(amazon_shipment_id: String, fulfillment_center_id: String, fulfillment_shipment_status: FulfillmentShipmentStatus, fulfillment_shipment_item: Vec<crate::models::FulfillmentShipmentItem>) -> FulfillmentShipment {
        FulfillmentShipment {
            amazon_shipment_id,
            fulfillment_center_id,
            fulfillment_shipment_status,
            shipping_date: None,
            estimated_arrival_date: None,
            shipping_notes: None,
            fulfillment_shipment_item,
            fulfillment_shipment_package: None,
        }
    }
}

/// The current status of the shipment.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FulfillmentShipmentStatus {
    #[serde(rename = "PENDING")]
    PENDING,
    #[serde(rename = "SHIPPED")]
    SHIPPED,
    #[serde(rename = "CANCELLED_BY_FULFILLER")]
    CANCELLEDBYFULFILLER,
    #[serde(rename = "CANCELLED_BY_SELLER")]
    CANCELLEDBYSELLER,
}

impl Default for FulfillmentShipmentStatus {
    fn default() -> FulfillmentShipmentStatus {
        Self::PENDING
    }
}