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};

/// InboundOrder : Represents an AWD inbound order.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct InboundOrder {
    /// Date when this order was created.
    #[serde(rename = "createdAt")]
    pub created_at: String,
    #[serde(rename = "destinationDetails", skip_serializing_if = "Option::is_none")]
    pub destination_details: Option<Box<models::awd_2024_05_09::DestinationDetails>>,
    /// Reference ID that can be used to correlate the order with partner resources.
    #[serde(rename = "externalReferenceId", skip_serializing_if = "Option::is_none")]
    pub external_reference_id: Option<String>,
    /// Inbound order ID.
    #[serde(rename = "orderId")]
    pub order_id: String,
    #[serde(rename = "orderStatus")]
    pub order_status: models::awd_2024_05_09::InboundStatus,
    #[serde(rename = "originAddress")]
    pub origin_address: Box<models::awd_2024_05_09::Address>,
    /// List of packages to be inbounded.
    #[serde(rename = "packagesToInbound")]
    pub packages_to_inbound: Vec<models::awd_2024_05_09::DistributionPackageQuantity>,
    #[serde(rename = "preferences", skip_serializing_if = "Option::is_none")]
    pub preferences: Option<Box<models::awd_2024_05_09::InboundPreferences>>,
    /// Date when this order was last updated.
    #[serde(rename = "updatedAt", skip_serializing_if = "Option::is_none")]
    pub updated_at: Option<String>,
}

impl InboundOrder {
    /// Represents an AWD inbound order.
    pub fn new(created_at: String, order_id: String, order_status: models::awd_2024_05_09::InboundStatus, origin_address: models::awd_2024_05_09::Address, packages_to_inbound: Vec<models::awd_2024_05_09::DistributionPackageQuantity>) -> InboundOrder {
        InboundOrder {
            created_at,
            destination_details: None,
            external_reference_id: None,
            order_id,
            order_status,
            origin_address: Box::new(origin_address),
            packages_to_inbound,
            preferences: None,
            updated_at: None,
        }
    }
}