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
/*
 * 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
 */

/// Carton : Details of the carton/package being shipped.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Carton {
    /// A list of carton identifiers.
    #[serde(default, rename = "cartonIdentifiers", skip_serializing_if = "Option::is_none")]
    pub carton_identifiers: Option<Vec<crate::models::ContainerIdentification>>,
    /// Carton sequence number for the carton. The first carton will be 001, the second 002, and so on. This number is used as a reference to refer to this carton from the pallet level.
    #[serde(default, rename = "cartonSequenceNumber")]
    pub carton_sequence_number: String,
    #[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>>,
    /// This is required to be provided for every carton in the small parcel shipments.
    #[serde(default, rename = "trackingNumber", skip_serializing_if = "Option::is_none")]
    pub tracking_number: Option<String>,
    /// A list of container item details.
    #[serde(default, rename = "items")]
    pub items: Vec<crate::models::ContainerItem>,
}

impl Carton {
    /// Details of the carton/package being shipped.
    pub fn new(carton_sequence_number: String, items: Vec<crate::models::ContainerItem>) -> Carton {
        Carton {
            carton_identifiers: None,
            carton_sequence_number,
            dimensions: None,
            weight: None,
            tracking_number: None,
            items,
        }
    }
}