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
/*
 * Selling Partner API for Direct Fulfillment Shipping
 *
 * The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Container {
    /// The type of container.
    #[serde(default, rename = "containerType")]
    pub container_type: ContainerType,
    /// The container identifier.
    #[serde(default, rename = "containerIdentifier")]
    pub container_identifier: String,
    /// The tracking number.
    #[serde(default, rename = "trackingNumber", skip_serializing_if = "Option::is_none")]
    pub tracking_number: Option<String>,
    /// The manifest identifier.
    #[serde(default, rename = "manifestId", skip_serializing_if = "Option::is_none")]
    pub manifest_id: Option<String>,
    /// The date of the manifest.
    #[serde(default, rename = "manifestDate", skip_serializing_if = "Option::is_none")]
    pub manifest_date: Option<String>,
    /// The shipment method.
    #[serde(default, rename = "shipMethod", skip_serializing_if = "Option::is_none")]
    pub ship_method: Option<String>,
    /// SCAC code required for NA VOC vendors only.
    #[serde(default, rename = "scacCode", skip_serializing_if = "Option::is_none")]
    pub scac_code: Option<String>,
    /// Carrier required for EU VOC vendors only.
    #[serde(default, rename = "carrier", skip_serializing_if = "Option::is_none")]
    pub carrier: Option<String>,
    /// An integer that must be submitted for multi-box shipments only, where one item may come in separate packages.
    #[serde(default, rename = "containerSequenceNumber", skip_serializing_if = "Option::is_none")]
    pub container_sequence_number: Option<i32>,
    #[serde(default, rename = "dimensions", skip_serializing_if = "Option::is_none")]
    pub dimensions: Option<Box<crate::models::Dimensions>>,
    #[serde(default, rename = "weight", skip_serializing_if = "Option::is_none")]
    pub weight: Option<Box<crate::models::Weight>>,
    /// A list of packed items.
    #[serde(default, rename = "packedItems")]
    pub packed_items: Vec<crate::models::PackedItem>,
}

impl Container {
    pub fn new(container_type: ContainerType, container_identifier: String, packed_items: Vec<crate::models::PackedItem>) -> Container {
        Container {
            container_type,
            container_identifier,
            tracking_number: None,
            manifest_id: None,
            manifest_date: None,
            ship_method: None,
            scac_code: None,
            carrier: None,
            container_sequence_number: None,
            dimensions: None,
            weight: None,
            packed_items,
        }
    }
}

/// The type of container.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ContainerType {
    #[serde(rename = "carton")]
    Carton,
    #[serde(rename = "pallet")]
    Pallet,
}

impl Default for ContainerType {
    fn default() -> ContainerType {
        Self::Carton
    }
}