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

/// Item : An Amazon order item identifier and a quantity.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Item {
    /// An Amazon-defined identifier for an individual item in an order.
    #[serde(rename = "OrderItemId")]
    pub order_item_id: String,
    /// The number of items.
    #[serde(rename = "Quantity")]
    pub quantity: i32,
    #[serde(rename = "ItemWeight", skip_serializing_if = "Option::is_none")]
    pub item_weight: Option<Box<models::merchant_fulfillment_v0::Weight>>,
    /// The description of the item.
    #[serde(rename = "ItemDescription", skip_serializing_if = "Option::is_none")]
    pub item_description: Option<String>,
    /// A list of transparency codes.
    #[serde(rename = "TransparencyCodeList", skip_serializing_if = "Option::is_none")]
    pub transparency_code_list: Option<Vec<String>>,
    /// A list of additional seller input pairs required to purchase shipping.
    #[serde(rename = "ItemLevelSellerInputsList", skip_serializing_if = "Option::is_none")]
    pub item_level_seller_inputs_list: Option<Vec<models::merchant_fulfillment_v0::AdditionalSellerInputs>>,
    #[serde(rename = "LiquidVolume", skip_serializing_if = "Option::is_none")]
    pub liquid_volume: Option<Box<models::merchant_fulfillment_v0::LiquidVolume>>,
    /// When true, the item qualifies as hazardous materials (hazmat). Defaults to false.
    #[serde(rename = "IsHazmat", skip_serializing_if = "Option::is_none")]
    pub is_hazmat: Option<bool>,
    #[serde(rename = "DangerousGoodsDetails", skip_serializing_if = "Option::is_none")]
    pub dangerous_goods_details: Option<Box<models::merchant_fulfillment_v0::DangerousGoodsDetails>>,
}

impl Item {
    /// An Amazon order item identifier and a quantity.
    pub fn new(order_item_id: String, quantity: i32) -> Item {
        Item {
            order_item_id,
            quantity,
            item_weight: None,
            item_description: None,
            transparency_code_list: None,
            item_level_seller_inputs_list: None,
            liquid_volume: None,
            is_hazmat: None,
            dangerous_goods_details: None,
        }
    }
}