Skip to main content

amazon_spapi/models/shipping_v2/
liquid_volume.rs

1/*
2 * Amazon Shipping API
3 *
4 * The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.
5 *
6 * The version of the OpenAPI document: v2
7 * Contact: swa-api-core@amazon.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// LiquidVolume : Liquid Volume.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LiquidVolume {
17    /// The unit of measurement.
18    #[serde(rename = "unit")]
19    pub unit: Unit,
20    /// The measurement value.
21    #[serde(rename = "value")]
22    pub value: f64,
23}
24
25impl LiquidVolume {
26    /// Liquid Volume.
27    pub fn new(unit: Unit, value: f64) -> LiquidVolume {
28        LiquidVolume {
29            unit,
30            value,
31        }
32    }
33}
34/// The unit of measurement.
35#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
36pub enum Unit {
37    #[serde(rename = "ML")]
38    Ml,
39    #[serde(rename = "L")]
40    L,
41    #[serde(rename = "FL_OZ")]
42    FlOz,
43    #[serde(rename = "GAL")]
44    Gal,
45    #[serde(rename = "PT")]
46    Pt,
47    #[serde(rename = "QT")]
48    Qt,
49    #[serde(rename = "C")]
50    C,
51}
52
53impl Default for Unit {
54    fn default() -> Unit {
55        Self::Ml
56    }
57}
58