amazon_spapi/models/vendor_shipments/
item_quantity.rs

1/*
2 * Selling Partner API for Retail Procurement Shipments
3 *
4 * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
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/// ItemQuantity : Details of item quantity.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ItemQuantity {
17    /// Amount of units shipped for a specific item at a shipment level. If the item is present only in certain cartons or pallets within the shipment, please provide this at the appropriate carton or pallet level.
18    #[serde(rename = "amount")]
19    pub amount: i32,
20    /// Unit of measure for the shipped quantity.
21    #[serde(rename = "unitOfMeasure")]
22    pub unit_of_measure: UnitOfMeasure,
23    /// The case size, in the event that we ordered using cases. Otherwise, 1.
24    #[serde(rename = "unitSize", skip_serializing_if = "Option::is_none")]
25    pub unit_size: Option<i32>,
26    #[serde(rename = "totalWeight", skip_serializing_if = "Option::is_none")]
27    pub total_weight: Option<Box<models::vendor_shipments::TotalWeight>>,
28}
29
30impl ItemQuantity {
31    /// Details of item quantity.
32    pub fn new(amount: i32, unit_of_measure: UnitOfMeasure) -> ItemQuantity {
33        ItemQuantity {
34            amount,
35            unit_of_measure,
36            unit_size: None,
37            total_weight: None,
38        }
39    }
40}
41/// Unit of measure for the shipped quantity.
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum UnitOfMeasure {
44    #[serde(rename = "Cases")]
45    Cases,
46    #[serde(rename = "Eaches")]
47    Eaches,
48}
49
50impl Default for UnitOfMeasure {
51    fn default() -> UnitOfMeasure {
52        Self::Cases
53    }
54}
55