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

/// ShippingServiceOptions : Extra services provided by a carrier.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ShippingServiceOptions {
    #[serde(rename = "DeliveryExperience")]
    pub delivery_experience: models::merchant_fulfillment_v0::DeliveryExperienceType,
    #[serde(rename = "DeclaredValue", skip_serializing_if = "Option::is_none")]
    pub declared_value: Option<Box<models::merchant_fulfillment_v0::CurrencyAmount>>,
    /// When true, the carrier will pick up the package. Note: Scheduled carrier pickup is available only using Dynamex (US), DPD (UK), and Royal Mail (UK).
    #[serde(rename = "CarrierWillPickUp")]
    pub carrier_will_pick_up: bool,
    #[serde(rename = "CarrierWillPickUpOption", skip_serializing_if = "Option::is_none")]
    pub carrier_will_pick_up_option: Option<models::merchant_fulfillment_v0::CarrierWillPickUpOption>,
    #[serde(rename = "LabelFormat", skip_serializing_if = "Option::is_none")]
    pub label_format: Option<models::merchant_fulfillment_v0::LabelFormat>,
}

impl ShippingServiceOptions {
    /// Extra services provided by a carrier.
    pub fn new(delivery_experience: models::merchant_fulfillment_v0::DeliveryExperienceType, carrier_will_pick_up: bool) -> ShippingServiceOptions {
        ShippingServiceOptions {
            delivery_experience,
            declared_value: None,
            carrier_will_pick_up,
            carrier_will_pick_up_option: None,
            label_format: None,
        }
    }
}