amazon_spapi/models/shipping/dimensions.rs
1/*
2 * Selling Partner API for Shipping
3 *
4 * Provides programmatic access to Amazon Shipping APIs. **Note:** If you are new to the Amazon Shipping API, refer to the latest version of <a href=\"https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference\">Amazon Shipping API (v2)</a> on the <a href=\"https://developer-docs.amazon.com/amazon-shipping/\">Amazon Shipping Developer Documentation</a> site.
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 : A set of measurements for a three-dimensional object.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Dimensions {
17 /// The length of the container.
18 #[serde(rename = "length")]
19 pub length: f64,
20 /// The width of the container.
21 #[serde(rename = "width")]
22 pub width: f64,
23 /// The height of the container.
24 #[serde(rename = "height")]
25 pub height: f64,
26 /// The unit of these measurements.
27 #[serde(rename = "unit")]
28 pub unit: Unit,
29}
30
31impl Dimensions {
32 /// A set of measurements for a three-dimensional object.
33 pub fn new(length: f64, width: f64, height: f64, unit: Unit) -> Dimensions {
34 Dimensions {
35 length,
36 width,
37 height,
38 unit,
39 }
40 }
41}
42/// The unit of these measurements.
43#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
44pub enum Unit {
45 #[serde(rename = "IN")]
46 In,
47 #[serde(rename = "CM")]
48 Cm,
49}
50
51impl Default for Unit {
52 fn default() -> Unit {
53 Self::In
54 }
55}
56