amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Retail Procurement Shipments
 *
 * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Carton : Details of the carton/package being shipped.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Carton {
    /// A list of carton identifiers.
    #[serde(rename = "cartonIdentifiers", skip_serializing_if = "Option::is_none")]
    pub carton_identifiers: Option<Vec<models::vendor_shipments::ContainerIdentification>>,
    /// 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.
    #[serde(rename = "cartonSequenceNumber")]
    pub carton_sequence_number: String,
    #[serde(rename = "dimensions", skip_serializing_if = "Option::is_none")]
    pub dimensions: Option<Box<models::vendor_shipments::Dimensions>>,
    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
    pub weight: Option<Box<models::vendor_shipments::Weight>>,
    /// This is required to be provided for every carton in the small parcel shipments.
    #[serde(rename = "trackingNumber", skip_serializing_if = "Option::is_none")]
    pub tracking_number: Option<String>,
    /// A list of container item details.
    #[serde(rename = "items")]
    pub items: Vec<models::vendor_shipments::ContainerItem>,
}

impl Carton {
    /// Details of the carton/package being shipped.
    pub fn new(carton_sequence_number: String, items: Vec<models::vendor_shipments::ContainerItem>) -> Carton {
        Carton {
            carton_identifiers: None,
            carton_sequence_number,
            dimensions: None,
            weight: None,
            tracking_number: None,
            items,
        }
    }
}