Skip to main content

osdm_sys/models/
luggage_dimension_enum.rs

1/*
2 * UIC 90918-10 - OSDM
3 *
4 * Specifications for the OSDM API standard. The OSDM specification supports two modes of operation: Retailer Mode and Distributor Mode. The API works identically in both modes, except that in distributor mode the API also returns fare information.  The following resources are key to get started:    -  [Processes](https://osdm.io/spec/processes/)   -  [Models](https://osdm.io/spec/models/)   -  [Getting started](https://osdm.io/spec/getting-started/) 
5 *
6 * The version of the OpenAPI document: 3.7.0
7 * Contact: osdm@uic.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// LuggageDimensionEnum : Type of the dimension. Combined sizes are the sum of the sizes.  Explanation:  WIDTH_HEIGHT_LENGTH = sum of width, hight and length in cm (= linear equivalent). 
15/// Type of the dimension. Combined sizes are the sum of the sizes.  Explanation:  WIDTH_HEIGHT_LENGTH = sum of width, hight and length in cm (= linear equivalent). 
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
18pub enum LuggageDimensionEnum {
19    #[serde(rename = "HEIGHT")]
20    Height,
21    #[serde(rename = "LENGTH")]
22    Length,
23    #[serde(rename = "WEIGHT")]
24    Weight,
25    #[serde(rename = "WIDTH")]
26    Width,
27    #[serde(rename = "WIDTH_HEIGHT")]
28    WidthHeight,
29    #[serde(rename = "WIDTH_HEIGHT_LENGTH")]
30    WidthHeightLength,
31    #[serde(rename = "VOLUME")]
32    Volume,
33
34}
35
36impl std::fmt::Display for LuggageDimensionEnum {
37    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
38        match self {
39            Self::Height => write!(f, "HEIGHT"),
40            Self::Length => write!(f, "LENGTH"),
41            Self::Weight => write!(f, "WEIGHT"),
42            Self::Width => write!(f, "WIDTH"),
43            Self::WidthHeight => write!(f, "WIDTH_HEIGHT"),
44            Self::WidthHeightLength => write!(f, "WIDTH_HEIGHT_LENGTH"),
45            Self::Volume => write!(f, "VOLUME"),
46        }
47    }
48}
49
50impl Default for LuggageDimensionEnum {
51    fn default() -> LuggageDimensionEnum {
52        Self::Height
53    }
54}
55