amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner APIs for Fulfillment Outbound
 *
 * The Selling Partner API for Fulfillment Outbound lets you create applications that help a seller fulfill Multi-Channel Fulfillment orders using their inventory in Amazon's fulfillment network. You can get information on both potential and existing fulfillment orders.
 *
 * The version of the OpenAPI document: 2020-07-01
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// FulfillmentPreview : Information about a fulfillment order preview, including delivery and fee information based on shipping method.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FulfillmentPreview {
    #[serde(rename = "shippingSpeedCategory")]
    pub shipping_speed_category: models::fulfillment_outbound_2020_07_01::ShippingSpeedCategory,
    #[serde(rename = "scheduledDeliveryInfo", skip_serializing_if = "Option::is_none")]
    pub scheduled_delivery_info: Option<Box<models::fulfillment_outbound_2020_07_01::ScheduledDeliveryInfo>>,
    /// When true, this fulfillment order preview is fulfillable.
    #[serde(rename = "isFulfillable")]
    pub is_fulfillable: bool,
    /// When true, this fulfillment order preview is for COD (Cash On Delivery).
    #[serde(rename = "isCODCapable")]
    pub is_cod_capable: bool,
    #[serde(rename = "estimatedShippingWeight", skip_serializing_if = "Option::is_none")]
    pub estimated_shipping_weight: Option<Box<models::fulfillment_outbound_2020_07_01::Weight>>,
    /// An array of fee type and cost pairs.
    #[serde(rename = "estimatedFees", skip_serializing_if = "Option::is_none")]
    pub estimated_fees: Option<Vec<models::fulfillment_outbound_2020_07_01::Fee>>,
    /// An array of fulfillment preview shipment information.
    #[serde(rename = "fulfillmentPreviewShipments", skip_serializing_if = "Option::is_none")]
    pub fulfillment_preview_shipments: Option<Vec<models::fulfillment_outbound_2020_07_01::FulfillmentPreviewShipment>>,
    /// An array of unfulfillable preview item information.
    #[serde(rename = "unfulfillablePreviewItems", skip_serializing_if = "Option::is_none")]
    pub unfulfillable_preview_items: Option<Vec<models::fulfillment_outbound_2020_07_01::UnfulfillablePreviewItem>>,
    /// String list
    #[serde(rename = "orderUnfulfillableReasons", skip_serializing_if = "Option::is_none")]
    pub order_unfulfillable_reasons: Option<Vec<String>>,
    /// The marketplace the fulfillment order is placed against.
    #[serde(rename = "marketplaceId")]
    pub marketplace_id: String,
    /// A list of features and their fulfillment policies to apply to the order.
    #[serde(rename = "featureConstraints", skip_serializing_if = "Option::is_none")]
    pub feature_constraints: Option<Vec<models::fulfillment_outbound_2020_07_01::FeatureSettings>>,
}

impl FulfillmentPreview {
    /// Information about a fulfillment order preview, including delivery and fee information based on shipping method.
    pub fn new(shipping_speed_category: models::fulfillment_outbound_2020_07_01::ShippingSpeedCategory, is_fulfillable: bool, is_cod_capable: bool, marketplace_id: String) -> FulfillmentPreview {
        FulfillmentPreview {
            shipping_speed_category,
            scheduled_delivery_info: None,
            is_fulfillable,
            is_cod_capable,
            estimated_shipping_weight: None,
            estimated_fees: None,
            fulfillment_preview_shipments: None,
            unfulfillable_preview_items: None,
            order_unfulfillable_reasons: None,
            marketplace_id,
            feature_constraints: None,
        }
    }
}