amazon_spapi/models/shipping/
container.rs

1/*
2 * Selling Partner API for Shipping
3 *
4 * Provides programmatic access to Amazon Shipping APIs.   **Note:** If you are new to the Amazon Shipping API, refer to the latest version of <a href=\"https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference\">Amazon Shipping API (v2)</a> on the <a href=\"https://developer-docs.amazon.com/amazon-shipping/\">Amazon Shipping Developer Documentation</a> site.
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/// Container : Container in the shipment.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Container {
17    /// The type of physical container being used. (always 'PACKAGE')
18    #[serde(rename = "containerType", skip_serializing_if = "Option::is_none")]
19    pub container_type: Option<ContainerType>,
20    /// An identifier for the container. This must be unique within all the containers in the same shipment.
21    #[serde(rename = "containerReferenceId")]
22    pub container_reference_id: String,
23    #[serde(rename = "value")]
24    pub value: Box<models::shipping::Currency>,
25    #[serde(rename = "dimensions")]
26    pub dimensions: Box<models::shipping::Dimensions>,
27    /// A list of the items in the container.
28    #[serde(rename = "items")]
29    pub items: Vec<models::shipping::ContainerItem>,
30    #[serde(rename = "weight")]
31    pub weight: Box<models::shipping::Weight>,
32}
33
34impl Container {
35    /// Container in the shipment.
36    pub fn new(container_reference_id: String, value: models::shipping::Currency, dimensions: models::shipping::Dimensions, items: Vec<models::shipping::ContainerItem>, weight: models::shipping::Weight) -> Container {
37        Container {
38            container_type: None,
39            container_reference_id,
40            value: Box::new(value),
41            dimensions: Box::new(dimensions),
42            items,
43            weight: Box::new(weight),
44        }
45    }
46}
47/// The type of physical container being used. (always 'PACKAGE')
48#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
49pub enum ContainerType {
50    #[serde(rename = "PACKAGE")]
51    Package,
52}
53
54impl Default for ContainerType {
55    fn default() -> ContainerType {
56        Self::Package
57    }
58}
59