amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * The Selling Partner API for FBA inbound operations.
 *
 * The Selling Partner API for Fulfillment By Amazon (FBA) Inbound. The FBA Inbound API enables building inbound workflows to create, manage, and send shipments into Amazon's fulfillment network. The API has interoperability with the Send-to-Amazon user interface.
 *
 * The version of the OpenAPI document: 2024-03-20
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Shipment : Contains information pertaining to a shipment in an inbound plan.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Shipment {
    /// A unique identifier created by Amazon that identifies this Amazon-partnered, Less Than Truckload/Full Truckload (LTL/FTL) shipment.
    #[serde(rename = "amazonReferenceId", skip_serializing_if = "Option::is_none")]
    pub amazon_reference_id: Option<String>,
    #[serde(rename = "contactInformation", skip_serializing_if = "Option::is_none")]
    pub contact_information: Option<Box<models::fulfillment_inbound_2024_03_20::ContactInformation>>,
    #[serde(rename = "dates", skip_serializing_if = "Option::is_none")]
    pub dates: Option<Box<models::fulfillment_inbound_2024_03_20::Dates>>,
    #[serde(rename = "destination")]
    pub destination: Box<models::fulfillment_inbound_2024_03_20::ShipmentDestination>,
    #[serde(rename = "freightInformation", skip_serializing_if = "Option::is_none")]
    pub freight_information: Option<Box<models::fulfillment_inbound_2024_03_20::FreightInformation>>,
    /// The name of the shipment.
    #[serde(rename = "name", skip_serializing_if = "Option::is_none")]
    pub name: Option<String>,
    /// The identifier of a placement option. A placement option represents the shipment splits and destinations of SKUs.
    #[serde(rename = "placementOptionId")]
    pub placement_option_id: String,
    #[serde(rename = "selectedDeliveryWindow", skip_serializing_if = "Option::is_none")]
    pub selected_delivery_window: Option<Box<models::fulfillment_inbound_2024_03_20::SelectedDeliveryWindow>>,
    /// Identifier of a transportation option. A transportation option represent one option for how to send a shipment.
    #[serde(rename = "selectedTransportationOptionId", skip_serializing_if = "Option::is_none")]
    pub selected_transportation_option_id: Option<String>,
    /// List of self ship appointment details.
    #[serde(rename = "selfShipAppointmentDetails", skip_serializing_if = "Option::is_none")]
    pub self_ship_appointment_details: Option<Vec<models::fulfillment_inbound_2024_03_20::SelfShipAppointmentDetails>>,
    /// The confirmed shipment ID which shows up on labels (for example, `FBA1234ABCD`).
    #[serde(rename = "shipmentConfirmationId", skip_serializing_if = "Option::is_none")]
    pub shipment_confirmation_id: Option<String>,
    /// Identifier of a shipment. A shipment contains the boxes and units being inbounded.
    #[serde(rename = "shipmentId")]
    pub shipment_id: String,
    #[serde(rename = "source")]
    pub source: Box<models::fulfillment_inbound_2024_03_20::ShipmentSource>,
    /// The status of a shipment. The state of the shipment will typically start as `UNCONFIRMED`, then transition to `WORKING` after a placement option has been confirmed, and then to `READY_TO_SHIP` once labels are generated.  Possible values: `ABANDONED`, `CANCELLED`, `CHECKED_IN`, `CLOSED`, `DELETED`, `DELIVERED`, `IN_TRANSIT`, `MIXED`, `READY_TO_SHIP`, `RECEIVING`, `SHIPPED`, `UNCONFIRMED`, `WORKING`
    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    #[serde(rename = "trackingDetails", skip_serializing_if = "Option::is_none")]
    pub tracking_details: Option<Box<models::fulfillment_inbound_2024_03_20::TrackingDetails>>,
}

impl Shipment {
    /// Contains information pertaining to a shipment in an inbound plan.
    pub fn new(destination: models::fulfillment_inbound_2024_03_20::ShipmentDestination, placement_option_id: String, shipment_id: String, source: models::fulfillment_inbound_2024_03_20::ShipmentSource) -> Shipment {
        Shipment {
            amazon_reference_id: None,
            contact_information: None,
            dates: None,
            destination: Box::new(destination),
            freight_information: None,
            name: None,
            placement_option_id,
            selected_delivery_window: None,
            selected_transportation_option_id: None,
            self_ship_appointment_details: None,
            shipment_confirmation_id: None,
            shipment_id,
            source: Box::new(source),
            status: None,
            tracking_details: None,
        }
    }
}