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

/// ShippingService : A shipping service offer made by a carrier.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ShippingService {
    /// A plain text representation of a carrier's shipping service. For example, \"UPS Ground\" or \"FedEx Standard Overnight\". 
    #[serde(rename = "ShippingServiceName")]
    pub shipping_service_name: String,
    /// The name of the carrier.
    #[serde(rename = "CarrierName")]
    pub carrier_name: String,
    /// An Amazon-defined shipping service identifier.
    #[serde(rename = "ShippingServiceId")]
    pub shipping_service_id: String,
    /// An Amazon-defined shipping service offer identifier.
    #[serde(rename = "ShippingServiceOfferId")]
    pub shipping_service_offer_id: String,
    /// Date-time formatted timestamp.
    #[serde(rename = "ShipDate")]
    pub ship_date: String,
    /// Date-time formatted timestamp.
    #[serde(rename = "EarliestEstimatedDeliveryDate", skip_serializing_if = "Option::is_none")]
    pub earliest_estimated_delivery_date: Option<String>,
    /// Date-time formatted timestamp.
    #[serde(rename = "LatestEstimatedDeliveryDate", skip_serializing_if = "Option::is_none")]
    pub latest_estimated_delivery_date: Option<String>,
    #[serde(rename = "Rate")]
    pub rate: Box<models::merchant_fulfillment_v0::CurrencyAmount>,
    #[serde(rename = "ShippingServiceOptions")]
    pub shipping_service_options: Box<models::merchant_fulfillment_v0::ShippingServiceOptions>,
    #[serde(rename = "AvailableShippingServiceOptions", skip_serializing_if = "Option::is_none")]
    pub available_shipping_service_options: Option<Box<models::merchant_fulfillment_v0::AvailableShippingServiceOptions>>,
    /// List of label formats.
    #[serde(rename = "AvailableLabelFormats", skip_serializing_if = "Option::is_none")]
    pub available_label_formats: Option<Vec<models::merchant_fulfillment_v0::LabelFormat>>,
    /// The available label formats.
    #[serde(rename = "AvailableFormatOptionsForLabel", skip_serializing_if = "Option::is_none")]
    pub available_format_options_for_label: Option<Vec<models::merchant_fulfillment_v0::LabelFormatOption>>,
    /// When true, additional seller inputs are required.
    #[serde(rename = "RequiresAdditionalSellerInputs")]
    pub requires_additional_seller_inputs: bool,
    #[serde(rename = "Benefits", skip_serializing_if = "Option::is_none")]
    pub benefits: Option<Box<models::merchant_fulfillment_v0::Benefits>>,
}

impl ShippingService {
    /// A shipping service offer made by a carrier.
    pub fn new(shipping_service_name: String, carrier_name: String, shipping_service_id: String, shipping_service_offer_id: String, ship_date: String, rate: models::merchant_fulfillment_v0::CurrencyAmount, shipping_service_options: models::merchant_fulfillment_v0::ShippingServiceOptions, requires_additional_seller_inputs: bool) -> ShippingService {
        ShippingService {
            shipping_service_name,
            carrier_name,
            shipping_service_id,
            shipping_service_offer_id,
            ship_date,
            earliest_estimated_delivery_date: None,
            latest_estimated_delivery_date: None,
            rate: Box::new(rate),
            shipping_service_options: Box::new(shipping_service_options),
            available_shipping_service_options: None,
            available_label_formats: None,
            available_format_options_for_label: None,
            requires_additional_seller_inputs,
            benefits: None,
        }
    }
}