osdm_sys/models/direction_type.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/// DirectionType : Direction of a place, defined optional as it might be omitted in case of berths in future. Code list according to UIC90918-1 Valid Values: - RIGHT: to right, RIGHT is the default. In case of walls it indicates a wall parallel with the x axis. - LEFT: to left - UP: up (from right side of a coach pointing to the middle of the aisle) - DOWN: down (from right side of the coach pointing to the middle of the aisle)
15/// Direction of a place, defined optional as it might be omitted in case of berths in future. Code list according to UIC90918-1 Valid Values: - RIGHT: to right, RIGHT is the default. In case of walls it indicates a wall parallel with the x axis. - LEFT: to left - UP: up (from right side of a coach pointing to the middle of the aisle) - DOWN: down (from right side of the coach pointing to the middle of the aisle)
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum DirectionType {
18 #[serde(rename = "RIGHT")]
19 Right,
20 #[serde(rename = "LEFT")]
21 Left,
22 #[serde(rename = "UP")]
23 Up,
24 #[serde(rename = "DOWN")]
25 Down,
26
27}
28
29impl std::fmt::Display for DirectionType {
30 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
31 match self {
32 Self::Right => write!(f, "RIGHT"),
33 Self::Left => write!(f, "LEFT"),
34 Self::Up => write!(f, "UP"),
35 Self::Down => write!(f, "DOWN"),
36 }
37 }
38}
39
40impl Default for DirectionType {
41 fn default() -> DirectionType {
42 Self::Right
43 }
44}
45