amazon_spapi/models/vendor_orders/
item_quantity.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/// ItemQuantity : Details of quantity ordered.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ItemQuantity {
17    /// Acknowledged quantity. This value should not be zero.
18    #[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
19    pub amount: Option<i32>,
20    /// Unit of measure for the acknowledged quantity.
21    #[serde(rename = "unitOfMeasure", skip_serializing_if = "Option::is_none")]
22    pub unit_of_measure: Option<UnitOfMeasure>,
23    /// The case size, in the event that we ordered using cases.
24    #[serde(rename = "unitSize", skip_serializing_if = "Option::is_none")]
25    pub unit_size: Option<i32>,
26}
27
28impl ItemQuantity {
29    /// Details of quantity ordered.
30    pub fn new() -> ItemQuantity {
31        ItemQuantity {
32            amount: None,
33            unit_of_measure: None,
34            unit_size: None,
35        }
36    }
37}
38/// Unit of measure for the acknowledged 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