amazon_spapi/models/vendor_shipments/
volume.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/// Volume : The volume of the shipment.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Volume {
17    /// The unit of measurement.
18    #[serde(rename = "unitOfMeasure")]
19    pub unit_of_measure: UnitOfMeasure,
20    /// A decimal number with no loss of precision. Useful when precision loss is unacceptable, as with currencies. Follows RFC7159 for number representation. <br>**Pattern** : `^-?(0|([1-9]\\d*))(\\.\\d+)?([eE][+-]?\\d+)?$`.
21    #[serde(rename = "value")]
22    pub value: String,
23}
24
25impl Volume {
26    /// The volume of the shipment.
27    pub fn new(unit_of_measure: UnitOfMeasure, value: String) -> Volume {
28        Volume {
29            unit_of_measure,
30            value,
31        }
32    }
33}
34/// The unit of measurement.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum UnitOfMeasure {
37    #[serde(rename = "CuFt")]
38    CuFt,
39    #[serde(rename = "CuIn")]
40    CuIn,
41    #[serde(rename = "CuM")]
42    CuM,
43    #[serde(rename = "CuY")]
44    CuY,
45}
46
47impl Default for UnitOfMeasure {
48    fn default() -> UnitOfMeasure {
49        Self::CuFt
50    }
51}
52