amazon_spapi/models/vendor_shipments/
containers.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/// Containers : A list of the items in this transportation and their associated inner container 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.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Containers {
17    /// The type of container.
18    #[serde(rename = "containerType")]
19    pub container_type: ContainerType,
20    /// An integer that must be submitted for multi-box shipments only, where one item may come in separate packages.
21    #[serde(rename = "containerSequenceNumber", skip_serializing_if = "Option::is_none")]
22    pub container_sequence_number: Option<String>,
23    /// A list of carton identifiers.
24    #[serde(rename = "containerIdentifiers")]
25    pub container_identifiers: Vec<models::vendor_shipments::ContainerIdentification>,
26    /// The tracking number used for identifying the shipment.
27    #[serde(rename = "trackingNumber", skip_serializing_if = "Option::is_none")]
28    pub tracking_number: Option<String>,
29    #[serde(rename = "dimensions", skip_serializing_if = "Option::is_none")]
30    pub dimensions: Option<Box<models::vendor_shipments::Dimensions>>,
31    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
32    pub weight: Option<Box<models::vendor_shipments::Weight>>,
33    /// Number of layers per pallet.
34    #[serde(rename = "tier", skip_serializing_if = "Option::is_none")]
35    pub tier: Option<i32>,
36    /// Number of cartons per layer on the pallet.
37    #[serde(rename = "block", skip_serializing_if = "Option::is_none")]
38    pub block: Option<i32>,
39    #[serde(rename = "innerContainersDetails", skip_serializing_if = "Option::is_none")]
40    pub inner_containers_details: Option<Box<models::vendor_shipments::InnerContainersDetails>>,
41    /// A list of packed items.
42    #[serde(rename = "packedItems", skip_serializing_if = "Option::is_none")]
43    pub packed_items: Option<Vec<models::vendor_shipments::PackedItems>>,
44}
45
46impl Containers {
47    /// A list of the items in this transportation and their associated inner container 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.
48    pub fn new(container_type: ContainerType, container_identifiers: Vec<models::vendor_shipments::ContainerIdentification>) -> Containers {
49        Containers {
50            container_type,
51            container_sequence_number: None,
52            container_identifiers,
53            tracking_number: None,
54            dimensions: None,
55            weight: None,
56            tier: None,
57            block: None,
58            inner_containers_details: None,
59            packed_items: None,
60        }
61    }
62}
63/// The type of container.
64#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
65pub enum ContainerType {
66    #[serde(rename = "carton")]
67    Carton,
68    #[serde(rename = "pallet")]
69    Pallet,
70}
71
72impl Default for ContainerType {
73    fn default() -> ContainerType {
74        Self::Carton
75    }
76}
77