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

/// ShipmentInformation : Shipment Information details for Label request.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ShipmentInformation {
    #[serde(rename = "vendorDetails", skip_serializing_if = "Option::is_none")]
    pub vendor_details: Option<Box<models::vendor_shipments::VendorDetails>>,
    /// The buyer reference number is a unique identifier generated by the buyer for all Collect and WePay shipments.
    #[serde(rename = "buyerReferenceNumber", skip_serializing_if = "Option::is_none")]
    pub buyer_reference_number: Option<String>,
    #[serde(rename = "shipToParty", skip_serializing_if = "Option::is_none")]
    pub ship_to_party: Option<Box<models::vendor_shipments::PartyIdentification>>,
    #[serde(rename = "shipFromParty", skip_serializing_if = "Option::is_none")]
    pub ship_from_party: Option<Box<models::vendor_shipments::PartyIdentification>>,
    /// Vendor Warehouse ID from where the shipment is scheduled to be picked up by buyer / Carrier.
    #[serde(rename = "warehouseId", skip_serializing_if = "Option::is_none")]
    pub warehouse_id: Option<String>,
    /// Unique Id with  which  the shipment can be tracked for Small Parcels.
    #[serde(rename = "masterTrackingId", skip_serializing_if = "Option::is_none")]
    pub master_tracking_id: Option<String>,
    /// Number of Labels that are created as part of this shipment.
    #[serde(rename = "totalLabelCount", skip_serializing_if = "Option::is_none")]
    pub total_label_count: Option<i32>,
    /// Type of shipment whether it is Small Parcel
    #[serde(rename = "shipMode", skip_serializing_if = "Option::is_none")]
    pub ship_mode: Option<ShipMode>,
}

impl ShipmentInformation {
    /// Shipment Information details for Label request.
    pub fn new() -> ShipmentInformation {
        ShipmentInformation {
            vendor_details: None,
            buyer_reference_number: None,
            ship_to_party: None,
            ship_from_party: None,
            warehouse_id: None,
            master_tracking_id: None,
            total_label_count: None,
            ship_mode: None,
        }
    }
}
/// Type of shipment whether it is Small Parcel
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ShipMode {
    #[serde(rename = "SmallParcel")]
    SmallParcel,
    #[serde(rename = "LTL")]
    Ltl,
}

impl Default for ShipMode {
    fn default() -> ShipMode {
        Self::SmallParcel
    }
}