amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Selling Partner API for Retail Procurement Orders
 *
 * The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

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

/// OrderItem : Represents an individual item in an order, including item details, quantities, pricing, and backorder information.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderItem {
    /// Numbering of the item on the purchase order. The first item will be 1, the second 2, and so on.
    #[serde(rename = "itemSequenceNumber")]
    pub item_sequence_number: String,
    /// Amazon Standard Identification Number (ASIN) of an item.
    #[serde(rename = "amazonProductIdentifier", skip_serializing_if = "Option::is_none")]
    pub amazon_product_identifier: Option<String>,
    /// The vendor selected product identification of the item.
    #[serde(rename = "vendorProductIdentifier", skip_serializing_if = "Option::is_none")]
    pub vendor_product_identifier: Option<String>,
    #[serde(rename = "orderedQuantity")]
    pub ordered_quantity: Box<models::vendor_orders::ItemQuantity>,
    /// When true, we will accept backorder confirmations for this item.
    #[serde(rename = "isBackOrderAllowed")]
    pub is_back_order_allowed: bool,
    #[serde(rename = "netCost", skip_serializing_if = "Option::is_none")]
    pub net_cost: Option<Box<models::vendor_orders::Money>>,
    #[serde(rename = "listPrice", skip_serializing_if = "Option::is_none")]
    pub list_price: Option<Box<models::vendor_orders::Money>>,
}

impl OrderItem {
    /// Represents an individual item in an order, including item details, quantities, pricing, and backorder information.
    pub fn new(item_sequence_number: String, ordered_quantity: models::vendor_orders::ItemQuantity, is_back_order_allowed: bool) -> OrderItem {
        OrderItem {
            item_sequence_number,
            amazon_product_identifier: None,
            vendor_product_identifier: None,
            ordered_quantity: Box::new(ordered_quantity),
            is_back_order_allowed,
            net_cost: None,
            list_price: None,
        }
    }
}