amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Direct Fulfillment Shipping
 *
 * The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// ShipmentConfirmation : Represents the confirmation details of a shipment, including the purchase order number and other shipment details.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ShipmentConfirmation {
    /// Purchase order number corresponding to the shipment.
    #[serde(rename = "purchaseOrderNumber")]
    pub purchase_order_number: String,
    #[serde(rename = "shipmentDetails")]
    pub shipment_details: Box<models::vendor_direct_fulfillment_shipping_v1::ShipmentDetails>,
    #[serde(rename = "sellingParty")]
    pub selling_party: Box<models::vendor_direct_fulfillment_shipping_v1::PartyIdentification>,
    #[serde(rename = "shipFromParty")]
    pub ship_from_party: Box<models::vendor_direct_fulfillment_shipping_v1::PartyIdentification>,
    /// Provide the details of the items in this shipment. If any of the item details field is common at a package or a pallet level, then provide them at the corresponding package.
    #[serde(rename = "items")]
    pub items: Vec<models::vendor_direct_fulfillment_shipping_v1::Item>,
    /// Provide the details of the items in this shipment. If any of the item details field is common at a package or a pallet level, then provide them at the corresponding package.
    #[serde(rename = "containers", skip_serializing_if = "Option::is_none")]
    pub containers: Option<Vec<models::vendor_direct_fulfillment_shipping_v1::Container>>,
}

impl ShipmentConfirmation {
    /// Represents the confirmation details of a shipment, including the purchase order number and other shipment details.
    pub fn new(purchase_order_number: String, shipment_details: models::vendor_direct_fulfillment_shipping_v1::ShipmentDetails, selling_party: models::vendor_direct_fulfillment_shipping_v1::PartyIdentification, ship_from_party: models::vendor_direct_fulfillment_shipping_v1::PartyIdentification, items: Vec<models::vendor_direct_fulfillment_shipping_v1::Item>) -> ShipmentConfirmation {
        ShipmentConfirmation {
            purchase_order_number,
            shipment_details: Box::new(shipment_details),
            selling_party: Box::new(selling_party),
            ship_from_party: Box::new(ship_from_party),
            items,
            containers: None,
        }
    }
}