amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Merchant Fulfillment
 *
 * With the Selling Partner API for Merchant Fulfillment, you can build applications that sellers can use to purchase shipping for non-Prime and Prime orders using Amazon's Buy Shipping Services.
 *
 * The version of the OpenAPI document: v0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// ShipmentRequestDetails : Shipment information required for requesting shipping service offers or for creating a shipment.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ShipmentRequestDetails {
    /// An Amazon-defined order identifier, in 3-7-7 format.
    #[serde(rename = "AmazonOrderId")]
    pub amazon_order_id: String,
    /// A seller-defined order identifier.
    #[serde(rename = "SellerOrderId", skip_serializing_if = "Option::is_none")]
    pub seller_order_id: Option<String>,
    /// The list of items you want to include in a shipment.
    #[serde(rename = "ItemList")]
    pub item_list: Vec<models::merchant_fulfillment_v0::Item>,
    #[serde(rename = "ShipFromAddress")]
    pub ship_from_address: Box<models::merchant_fulfillment_v0::Address>,
    #[serde(rename = "PackageDimensions")]
    pub package_dimensions: Box<models::merchant_fulfillment_v0::PackageDimensions>,
    #[serde(rename = "Weight")]
    pub weight: Box<models::merchant_fulfillment_v0::Weight>,
    /// Date-time formatted timestamp.
    #[serde(rename = "MustArriveByDate", skip_serializing_if = "Option::is_none")]
    pub must_arrive_by_date: Option<String>,
    /// Date-time formatted timestamp.
    #[serde(rename = "ShipDate", skip_serializing_if = "Option::is_none")]
    pub ship_date: Option<String>,
    #[serde(rename = "ShippingServiceOptions")]
    pub shipping_service_options: Box<models::merchant_fulfillment_v0::ShippingServiceOptions>,
    #[serde(rename = "LabelCustomization", skip_serializing_if = "Option::is_none")]
    pub label_customization: Option<Box<models::merchant_fulfillment_v0::LabelCustomization>>,
}

impl ShipmentRequestDetails {
    /// Shipment information required for requesting shipping service offers or for creating a shipment.
    pub fn new(amazon_order_id: String, item_list: Vec<models::merchant_fulfillment_v0::Item>, ship_from_address: models::merchant_fulfillment_v0::Address, package_dimensions: models::merchant_fulfillment_v0::PackageDimensions, weight: models::merchant_fulfillment_v0::Weight, shipping_service_options: models::merchant_fulfillment_v0::ShippingServiceOptions) -> ShipmentRequestDetails {
        ShipmentRequestDetails {
            amazon_order_id,
            seller_order_id: None,
            item_list,
            ship_from_address: Box::new(ship_from_address),
            package_dimensions: Box::new(package_dimensions),
            weight: Box::new(weight),
            must_arrive_by_date: None,
            ship_date: None,
            shipping_service_options: Box::new(shipping_service_options),
            label_customization: None,
        }
    }
}