amazon_spapi/models/vendor_shipments/dimensions.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/// Dimensions : Physical dimensional measurements of a container.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Dimensions {
17 /// 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+)?$`.
18 #[serde(rename = "length")]
19 pub length: String,
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 = "width")]
22 pub width: String,
23 /// 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+)?$`.
24 #[serde(rename = "height")]
25 pub height: String,
26 /// The unit of measure for dimensions.
27 #[serde(rename = "unitOfMeasure")]
28 pub unit_of_measure: UnitOfMeasure,
29}
30
31impl Dimensions {
32 /// Physical dimensional measurements of a container.
33 pub fn new(length: String, width: String, height: String, unit_of_measure: UnitOfMeasure) -> Dimensions {
34 Dimensions {
35 length,
36 width,
37 height,
38 unit_of_measure,
39 }
40 }
41}
42/// The unit of measure for dimensions.
43#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
44pub enum UnitOfMeasure {
45 #[serde(rename = "In")]
46 In,
47 #[serde(rename = "Ft")]
48 Ft,
49 #[serde(rename = "Meter")]
50 Meter,
51 #[serde(rename = "Yard")]
52 Yard,
53}
54
55impl Default for UnitOfMeasure {
56 fn default() -> UnitOfMeasure {
57 Self::In
58 }
59}
60