amazon_spapi/models/vendor_orders/
order_item.rs

1/*
2 * Selling Partner API for Retail Procurement Orders
3 *
4 * The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// OrderItem : Represents an individual item in an order, including item details, quantities, pricing, and backorder information.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OrderItem {
17    /// Numbering of the item on the purchase order. The first item will be 1, the second 2, and so on.
18    #[serde(rename = "itemSequenceNumber")]
19    pub item_sequence_number: String,
20    /// Amazon Standard Identification Number (ASIN) of an item.
21    #[serde(rename = "amazonProductIdentifier", skip_serializing_if = "Option::is_none")]
22    pub amazon_product_identifier: Option<String>,
23    /// The vendor selected product identification of the item.
24    #[serde(rename = "vendorProductIdentifier", skip_serializing_if = "Option::is_none")]
25    pub vendor_product_identifier: Option<String>,
26    #[serde(rename = "orderedQuantity")]
27    pub ordered_quantity: Box<models::vendor_orders::ItemQuantity>,
28    /// When true, we will accept backorder confirmations for this item.
29    #[serde(rename = "isBackOrderAllowed")]
30    pub is_back_order_allowed: bool,
31    #[serde(rename = "netCost", skip_serializing_if = "Option::is_none")]
32    pub net_cost: Option<Box<models::vendor_orders::Money>>,
33    #[serde(rename = "listPrice", skip_serializing_if = "Option::is_none")]
34    pub list_price: Option<Box<models::vendor_orders::Money>>,
35}
36
37impl OrderItem {
38    /// Represents an individual item in an order, including item details, quantities, pricing, and backorder information.
39    pub fn new(item_sequence_number: String, ordered_quantity: models::vendor_orders::ItemQuantity, is_back_order_allowed: bool) -> OrderItem {
40        OrderItem {
41            item_sequence_number,
42            amazon_product_identifier: None,
43            vendor_product_identifier: None,
44            ordered_quantity: Box::new(ordered_quantity),
45            is_back_order_allowed,
46            net_cost: None,
47            list_price: None,
48        }
49    }
50}
51