amazon_spapi/models/vendor_shipments/
carton.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/// Carton : Details of the carton/package being shipped.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Carton {
17    /// A list of carton identifiers.
18    #[serde(rename = "cartonIdentifiers", skip_serializing_if = "Option::is_none")]
19    pub carton_identifiers: Option<Vec<models::vendor_shipments::ContainerIdentification>>,
20    /// 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.
21    #[serde(rename = "cartonSequenceNumber")]
22    pub carton_sequence_number: String,
23    #[serde(rename = "dimensions", skip_serializing_if = "Option::is_none")]
24    pub dimensions: Option<Box<models::vendor_shipments::Dimensions>>,
25    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
26    pub weight: Option<Box<models::vendor_shipments::Weight>>,
27    /// This is required to be provided for every carton in the small parcel shipments.
28    #[serde(rename = "trackingNumber", skip_serializing_if = "Option::is_none")]
29    pub tracking_number: Option<String>,
30    /// A list of container item details.
31    #[serde(rename = "items")]
32    pub items: Vec<models::vendor_shipments::ContainerItem>,
33}
34
35impl Carton {
36    /// Details of the carton/package being shipped.
37    pub fn new(carton_sequence_number: String, items: Vec<models::vendor_shipments::ContainerItem>) -> Carton {
38        Carton {
39            carton_identifiers: None,
40            carton_sequence_number,
41            dimensions: None,
42            weight: None,
43            tracking_number: None,
44            items,
45        }
46    }
47}
48