amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * The Selling Partner API for Amazon Warehousing and Distribution
 *
 * The Selling Partner API for Amazon Warehousing and Distribution (AWD) provides programmatic access to information about AWD shipments and inventory.
 *
 * The version of the OpenAPI document: 2024-05-09
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// InboundShipment : Represents an AWD inbound shipment.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InboundShipment {
    #[serde(rename = "carrierCode", skip_serializing_if = "Option::is_none")]
    pub carrier_code: Option<Box<models::awd_2024_05_09::CarrierCode>>,
    /// Timestamp when the shipment was created. The date is returned in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format.
    #[serde(rename = "createdAt", skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    #[serde(rename = "destinationAddress")]
    pub destination_address: Box<models::awd_2024_05_09::Address>,
    /// Client-provided reference ID that can correlate this shipment to client resources. For example, to map this shipment to an internal bookkeeping order record.
    #[serde(rename = "externalReferenceId", skip_serializing_if = "Option::is_none")]
    pub external_reference_id: Option<String>,
    /// The AWD inbound order ID that this inbound shipment belongs to.
    #[serde(rename = "orderId")]
    pub order_id: String,
    #[serde(rename = "originAddress")]
    pub origin_address: Box<models::awd_2024_05_09::Address>,
    /// Quantity received (at the receiving end) as part of this shipment.
    #[serde(rename = "receivedQuantity", skip_serializing_if = "Option::is_none")]
    pub received_quantity: Option<Vec<models::awd_2024_05_09::InventoryQuantity>>,
    /// Timestamp when the shipment will be shipped.
    #[serde(rename = "shipBy", skip_serializing_if = "Option::is_none")]
    pub ship_by: Option<String>,
    /// Packages that are part of this shipment.
    #[serde(rename = "shipmentContainerQuantities")]
    pub shipment_container_quantities: Vec<models::awd_2024_05_09::DistributionPackageQuantity>,
    /// Unique shipment ID.
    #[serde(rename = "shipmentId")]
    pub shipment_id: String,
    /// Quantity details at SKU level for the shipment. This attribute will only appear if the skuQuantities parameter in the request is set to SHOW.
    #[serde(rename = "shipmentSkuQuantities", skip_serializing_if = "Option::is_none")]
    pub shipment_sku_quantities: Option<Vec<models::awd_2024_05_09::SkuQuantity>>,
    /// Assigned region where the order will be shipped. This can differ from what was passed as preference. AWD currently supports following region IDs: [us-west, us-east, us-southcentral, us-southeast]
    #[serde(rename = "destinationRegion", skip_serializing_if = "Option::is_none")]
    pub destination_region: Option<String>,
    #[serde(rename = "shipmentStatus")]
    pub shipment_status: models::awd_2024_05_09::InboundShipmentStatus,
    /// Carrier-unique tracking ID for this shipment.
    #[serde(rename = "trackingId", skip_serializing_if = "Option::is_none")]
    pub tracking_id: Option<String>,
    /// Timestamp when the shipment was updated. The date is returned in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> format.
    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
    /// An AWD-provided reference ID that you can use to interact with the warehouse. For example, a carrier appointment booking.
    #[serde(rename = "warehouseReferenceId", skip_serializing_if = "Option::is_none")]
    pub warehouse_reference_id: Option<String>,
}

impl InboundShipment {
    /// Represents an AWD inbound shipment.
    pub fn new(destination_address: models::awd_2024_05_09::Address, order_id: String, origin_address: models::awd_2024_05_09::Address, shipment_container_quantities: Vec<models::awd_2024_05_09::DistributionPackageQuantity>, shipment_id: String, shipment_status: models::awd_2024_05_09::InboundShipmentStatus) -> InboundShipment {
        InboundShipment {
            carrier_code: None,
            created_at: None,
            destination_address: Box::new(destination_address),
            external_reference_id: None,
            order_id,
            origin_address: Box::new(origin_address),
            received_quantity: None,
            ship_by: None,
            shipment_container_quantities,
            shipment_id,
            shipment_sku_quantities: None,
            destination_region: None,
            shipment_status,
            tracking_id: None,
            updated_at: None,
            warehouse_reference_id: None,
        }
    }
}