amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Direct Fulfillment Shipping
 *
 * The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// Item : Details of the item being shipped.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Item {
    /// Item Sequence Number for the item. This must be the same value as sent in order for a given item.
    #[serde(rename = "itemSequenceNumber")]
    pub item_sequence_number: i32,
    /// Buyer's Standard Identification Number (ASIN) of an item. Either buyerProductIdentifier or vendorProductIdentifier is required.
    #[serde(rename = "buyerProductIdentifier", skip_serializing_if = "Option::is_none")]
    pub buyer_product_identifier: Option<String>,
    /// The vendor selected product identification of the item. Should be the same as was sent in the purchase order, like SKU Number.
    #[serde(rename = "vendorProductIdentifier", skip_serializing_if = "Option::is_none")]
    pub vendor_product_identifier: Option<String>,
    #[serde(rename = "shippedQuantity")]
    pub shipped_quantity: Box<models::vendor_direct_fulfillment_shipping_v1::ItemQuantity>,
}

impl Item {
    /// Details of the item being shipped.
    pub fn new(item_sequence_number: i32, shipped_quantity: models::vendor_direct_fulfillment_shipping_v1::ItemQuantity) -> Item {
        Item {
            item_sequence_number,
            buyer_product_identifier: None,
            vendor_product_identifier: None,
            shipped_quantity: Box::new(shipped_quantity),
        }
    }
}