amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Shipping
 *
 * 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.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// Container : Container in the shipment.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Container {
    /// The type of physical container being used. (always 'PACKAGE')
    #[serde(rename = "containerType", skip_serializing_if = "Option::is_none")]
    pub container_type: Option<ContainerType>,
    /// An identifier for the container. This must be unique within all the containers in the same shipment.
    #[serde(rename = "containerReferenceId")]
    pub container_reference_id: String,
    #[serde(rename = "value")]
    pub value: Box<models::shipping::Currency>,
    #[serde(rename = "dimensions")]
    pub dimensions: Box<models::shipping::Dimensions>,
    /// A list of the items in the container.
    #[serde(rename = "items")]
    pub items: Vec<models::shipping::ContainerItem>,
    #[serde(rename = "weight")]
    pub weight: Box<models::shipping::Weight>,
}

impl Container {
    /// Container in the shipment.
    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 {
        Container {
            container_type: None,
            container_reference_id,
            value: Box::new(value),
            dimensions: Box::new(dimensions),
            items,
            weight: Box::new(weight),
        }
    }
}
/// The type of physical container being used. (always 'PACKAGE')
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ContainerType {
    #[serde(rename = "PACKAGE")]
    Package,
}

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