amazon_spapi/models/shipping_v2/
item.rs

1/*
2 * Amazon Shipping API
3 *
4 * The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.
5 *
6 * The version of the OpenAPI document: v2
7 * Contact: swa-api-core@amazon.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Item : An item in a package.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Item {
17    #[serde(rename = "itemValue", skip_serializing_if = "Option::is_none")]
18    pub item_value: Option<Box<models::shipping_v2::Currency>>,
19    /// The product description of the item.
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
21    pub description: Option<String>,
22    /// A unique identifier for an item provided by the client.
23    #[serde(rename = "itemIdentifier", skip_serializing_if = "Option::is_none")]
24    pub item_identifier: Option<String>,
25    /// The number of units. This value is required.
26    #[serde(rename = "quantity")]
27    pub quantity: i32,
28    #[serde(rename = "weight", skip_serializing_if = "Option::is_none")]
29    pub weight: Option<Box<models::shipping_v2::Weight>>,
30    #[serde(rename = "liquidVolume", skip_serializing_if = "Option::is_none")]
31    pub liquid_volume: Option<Box<models::shipping_v2::LiquidVolume>>,
32    /// When true, the item qualifies as hazardous materials (hazmat). Defaults to false.
33    #[serde(rename = "isHazmat", skip_serializing_if = "Option::is_none")]
34    pub is_hazmat: Option<bool>,
35    #[serde(rename = "dangerousGoodsDetails", skip_serializing_if = "Option::is_none")]
36    pub dangerous_goods_details: Option<Box<models::shipping_v2::DangerousGoodsDetails>>,
37    /// The product type of the item.
38    #[serde(rename = "productType", skip_serializing_if = "Option::is_none")]
39    pub product_type: Option<String>,
40    #[serde(rename = "invoiceDetails", skip_serializing_if = "Option::is_none")]
41    pub invoice_details: Option<Box<models::shipping_v2::InvoiceDetails>>,
42    /// A list of unique serial numbers in an Amazon package that can be used to guarantee non-fraudulent items. The number of serial numbers in the list must be less than or equal to the quantity of items being shipped. Only applicable when channel source is Amazon.
43    #[serde(rename = "serialNumbers", skip_serializing_if = "Option::is_none")]
44    pub serial_numbers: Option<Vec<String>>,
45    #[serde(rename = "directFulfillmentItemIdentifiers", skip_serializing_if = "Option::is_none")]
46    pub direct_fulfillment_item_identifiers: Option<Box<models::shipping_v2::DirectFulfillmentItemIdentifiers>>,
47}
48
49impl Item {
50    /// An item in a package.
51    pub fn new(quantity: i32) -> Item {
52        Item {
53            item_value: None,
54            description: None,
55            item_identifier: None,
56            quantity,
57            weight: None,
58            liquid_volume: None,
59            is_hazmat: None,
60            dangerous_goods_details: None,
61            product_type: None,
62            invoice_details: None,
63            serial_numbers: None,
64            direct_fulfillment_item_identifiers: None,
65        }
66    }
67}
68