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
53
54
55
56
/*
* Selling Partner API for Retail Procurement Orders
*
* The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.
*
* The version of the OpenAPI document: v1
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Money : An amount of money. Includes the currency code and an optional unit of measure for items priced by weight.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Money {
/// Three digit currency code in ISO 4217 format. String of length 3.
#[serde(rename = "currencyCode", skip_serializing_if = "Option::is_none")]
pub currency_code: Option<String>,
/// 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+)?$`.
#[serde(rename = "amount", skip_serializing_if = "Option::is_none")]
pub amount: Option<String>,
/// The unit of measure for prices of items sold by weight. If this field is absent, the item is sold by eaches.
#[serde(rename = "unitOfMeasure", skip_serializing_if = "Option::is_none")]
pub unit_of_measure: Option<UnitOfMeasure>,
}
impl Money {
/// An amount of money. Includes the currency code and an optional unit of measure for items priced by weight.
pub fn new() -> Money {
Money {
currency_code: None,
amount: None,
unit_of_measure: None,
}
}
}
/// The unit of measure for prices of items sold by weight. If this field is absent, the item is sold by eaches.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum UnitOfMeasure {
#[serde(rename = "POUNDS")]
Pounds,
#[serde(rename = "OUNCES")]
Ounces,
#[serde(rename = "GRAMS")]
Grams,
#[serde(rename = "KILOGRAMS")]
Kilograms,
}
impl Default for UnitOfMeasure {
fn default() -> UnitOfMeasure {
Self::Pounds
}
}