amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * The Selling Partner API for FBA inbound operations.
 *
 * The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability with the Send-to-Amazon user interface.
 *
 * The version of the OpenAPI document: 2024-03-20
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Box : Contains information about a box that is used in the inbound plan. The box is a container that holds multiple items.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Box {
    /// The ID provided by Amazon that identifies a given box. This ID is comprised of the external shipment ID (which is generated after transportation has been confirmed) and the index of the box.
    #[serde(rename = "boxId", skip_serializing_if = "Option::is_none")]
    pub box_id: Option<String>,
    #[serde(rename = "contentInformationSource", skip_serializing_if = "Option::is_none")]
    pub content_information_source: Option<models::fulfillment_inbound_2024_03_20::BoxContentInformationSource>,
    #[serde(rename = "destinationRegion", skip_serializing_if = "Option::is_none")]
    pub destination_region: Option<std::boxed::Box<models::fulfillment_inbound_2024_03_20::Region>>,
    #[serde(rename = "dimensions", skip_serializing_if = "Option::is_none")]
    pub dimensions: Option<std::boxed::Box<models::fulfillment_inbound_2024_03_20::Dimensions>>,
    /// The external identifier for this container / box.
    #[serde(rename = "externalContainerIdentifier", skip_serializing_if = "Option::is_none")]
    pub external_container_identifier: Option<String>,
    /// Type of the external identifier used. Can be: `AMAZON`, `SSCC`.
    #[serde(rename = "externalContainerIdentifierType", skip_serializing_if = "Option::is_none")]
    pub external_container_identifier_type: Option<String>,
    /// Items contained within the box.
    #[serde(rename = "items", skip_serializing_if = "Option::is_none")]
    pub items: Option<Vec<models::fulfillment_inbound_2024_03_20::Item>>,
    /// Primary key to uniquely identify a Package (Box or Pallet).
    #[serde(rename = "packageId")]
    pub package_id: String,
    /// The number of containers where all other properties like weight or dimensions are identical.
    #[serde(rename = "quantity", skip_serializing_if = "Option::is_none")]
    pub quantity: Option<i32>,
    /// Template name of the box.
    #[serde(rename = "templateName", skip_serializing_if = "Option::is_none")]
    pub template_name: Option<String>,
    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
    pub weight: Option<std::boxed::Box<models::fulfillment_inbound_2024_03_20::Weight>>,
}

impl Box {
    /// Contains information about a box that is used in the inbound plan. The box is a container that holds multiple items.
    pub fn new(package_id: String) -> Box {
        Box {
            box_id: None,
            content_information_source: None,
            destination_region: None,
            dimensions: None,
            external_container_identifier: None,
            external_container_identifier_type: None,
            items: None,
            package_id,
            quantity: None,
            template_name: None,
            weight: None,
        }
    }
}