1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Selling Partner API for Retail Procurement Shipments
*
* The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// PackedQuantity : Details of item quantity.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PackedQuantity {
/// 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.
#[serde(rename = "amount")]
pub amount: i32,
/// Unit of measure for the shipped quantity.
#[serde(rename = "unitOfMeasure")]
pub unit_of_measure: UnitOfMeasure,
/// The case size, in the event that we ordered using cases. Otherwise, 1.
#[serde(rename = "unitSize", skip_serializing_if = "Option::is_none")]
pub unit_size: Option<i32>,
}
impl PackedQuantity {
/// Details of item quantity.
pub fn new(amount: i32, unit_of_measure: UnitOfMeasure) -> PackedQuantity {
PackedQuantity {
amount,
unit_of_measure,
unit_size: None,
}
}
}
/// Unit of measure for the shipped quantity.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum UnitOfMeasure {
#[serde(rename = "Cases")]
Cases,
#[serde(rename = "Eaches")]
Eaches,
}
impl Default for UnitOfMeasure {
fn default() -> UnitOfMeasure {
Self::Cases
}
}