amazon_spapi/models/vendor_shipments/
packed_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/// PackedQuantity : Details of item quantity.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PackedQuantity {
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}
27
28impl PackedQuantity {
29    /// Details of item quantity.
30    pub fn new(amount: i32, unit_of_measure: UnitOfMeasure) -> PackedQuantity {
31        PackedQuantity {
32            amount,
33            unit_of_measure,
34            unit_size: None,
35        }
36    }
37}
38/// Unit of measure for the shipped quantity.
39#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
40pub enum UnitOfMeasure {
41    #[serde(rename = "Cases")]
42    Cases,
43    #[serde(rename = "Eaches")]
44    Eaches,
45}
46
47impl Default for UnitOfMeasure {
48    fn default() -> UnitOfMeasure {
49        Self::Cases
50    }
51}
52