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

/// FulfillmentPreviewItem : Item information for a shipment in a fulfillment order preview.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct FulfillmentPreviewItem {
    /// The seller SKU of the item.
    #[serde(rename = "sellerSku")]
    pub seller_sku: String,
    /// The item quantity.
    #[serde(rename = "quantity")]
    pub quantity: i32,
    /// A fulfillment order item identifier that the seller created with a call to the `createFulfillmentOrder` operation.
    #[serde(rename = "sellerFulfillmentOrderItemId")]
    pub seller_fulfillment_order_item_id: String,
    #[serde(rename = "estimatedShippingWeight", skip_serializing_if = "Option::is_none")]
    pub estimated_shipping_weight: Option<Box<models::fulfillment_outbound_2020_07_01::Weight>>,
    /// The method used to calculate the estimated shipping weight.
    #[serde(rename = "shippingWeightCalculationMethod", skip_serializing_if = "Option::is_none")]
    pub shipping_weight_calculation_method: Option<ShippingWeightCalculationMethod>,
}

impl FulfillmentPreviewItem {
    /// Item information for a shipment in a fulfillment order preview.
    pub fn new(seller_sku: String, quantity: i32, seller_fulfillment_order_item_id: String) -> FulfillmentPreviewItem {
        FulfillmentPreviewItem {
            seller_sku,
            quantity,
            seller_fulfillment_order_item_id,
            estimated_shipping_weight: None,
            shipping_weight_calculation_method: None,
        }
    }
}
/// The method used to calculate the estimated shipping weight.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ShippingWeightCalculationMethod {
    #[serde(rename = "Package")]
    Package,
    #[serde(rename = "Dimensional")]
    Dimensional,
}

impl Default for ShippingWeightCalculationMethod {
    fn default() -> ShippingWeightCalculationMethod {
        Self::Package
    }
}