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

/// TransportationOption : Contains information pertaining to a transportation option and the related carrier.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct TransportationOption {
    #[serde(rename = "carrier")]
    pub carrier: Box<models::fulfillment_inbound_2024_03_20::Carrier>,
    #[serde(rename = "carrierAppointment", skip_serializing_if = "Option::is_none")]
    pub carrier_appointment: Option<Box<models::fulfillment_inbound_2024_03_20::CarrierAppointment>>,
    /// Identifies a list of preconditions for confirming the transportation option.
    #[serde(rename = "preconditions")]
    pub preconditions: Vec<String>,
    #[serde(rename = "quote", skip_serializing_if = "Option::is_none")]
    pub quote: Option<Box<models::fulfillment_inbound_2024_03_20::Quote>>,
    /// Identifier of a shipment. A shipment contains the boxes and units being inbounded.
    #[serde(rename = "shipmentId")]
    pub shipment_id: String,
    /// Mode of shipment transportation that this option will provide.  Possible values: `GROUND_SMALL_PARCEL`, `FREIGHT_LTL`, `FREIGHT_FTL_PALLET`, `FREIGHT_FTL_NONPALLET`, `OCEAN_LCL`, `OCEAN_FCL`, `AIR_SMALL_PARCEL`, `AIR_SMALL_PARCEL_EXPRESS`.
    #[serde(rename = "shippingMode")]
    pub shipping_mode: String,
    /// Shipping program for the option. Possible values: `AMAZON_PARTNERED_CARRIER`, `USE_YOUR_OWN_CARRIER`.
    #[serde(rename = "shippingSolution")]
    pub shipping_solution: String,
    /// Identifier of a transportation option. A transportation option represent one option for how to send a shipment.
    #[serde(rename = "transportationOptionId")]
    pub transportation_option_id: String,
}

impl TransportationOption {
    /// Contains information pertaining to a transportation option and the related carrier.
    pub fn new(carrier: models::fulfillment_inbound_2024_03_20::Carrier, preconditions: Vec<String>, shipment_id: String, shipping_mode: String, shipping_solution: String, transportation_option_id: String) -> TransportationOption {
        TransportationOption {
            carrier: Box::new(carrier),
            carrier_appointment: None,
            preconditions,
            quote: None,
            shipment_id,
            shipping_mode,
            shipping_solution,
            transportation_option_id,
        }
    }
}