osdm_sys/models/
coach.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Coach {
16    #[serde(rename = "compartments", skip_serializing_if = "Option::is_none")]
17    pub compartments: Option<Vec<models::Compartment>>,
18    /// coach number 
19    #[serde(rename = "number")]
20    pub number: String,
21    /// Id to identify the coach layout. In case of two deck vehicles,  both upper and lower deck layouts are provided next to each other. 
22    #[serde(rename = "layoutId")]
23    pub layout_id: String,
24    /// id to identify a layout for the upper deck in a double deck coach 
25    #[serde(rename = "layoutIdUpperDeck", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub layout_id_upper_deck: Option<Option<String>>,
27    /// id to identify a layout for the lower deck in a double deck coach 
28    #[serde(rename = "layoutIdLowerDeck", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub layout_id_lower_deck: Option<Option<String>>,
30    /// Indicated travel direction of a coach. Standard direction is left to right with ascending coordinates in the layout values. To get the direction of travel for a place the direction information of the coach needs to be combined with the direction of the seat in the coach layout. Values from the [Travel Direction Code List](https://osdm.io/spec/catalog-of-code-lists/#TravelDirection) Listed values here are examples. <br><br> Known Values: - UNSPECIFIED - IN_DIRECTION - OPPOSITE_DIRECTION - CHANGING - @Deprecated STARING_IN_DIRECTION:      <br><br>     Deprecated: Substituted by STARTING_IN_DIRECTION (since: 3.5.0, removed with: 4.0.0) - STARTING_IN_DIRECTION - STARTING_OPPOSITE_TO_DIRECTION 
31    #[serde(rename = "direction", skip_serializing_if = "Option::is_none")]
32    pub direction: Option<String>,
33    /// Identifies a company. For rail, a RICS company code or compatible ERA company code are used.  E.g.: 'urn:uic:rics:1185:000011' 
34    #[serde(rename = "owner", skip_serializing_if = "Option::is_none")]
35    pub owner: Option<String>,
36    /// indication of special coach 
37    #[serde(rename = "specialCoach", skip_serializing_if = "Option::is_none")]
38    pub special_coach: Option<String>,
39    /// references to the reservations/fares for which all places in the coach can be selected. The reservation ids must be part of the list of reservation ids for which the consumer has requested the available places and the consumer must accept a list by setting singleSelectionMapsRequired to false 
40    #[serde(rename = "reservationRefs", skip_serializing_if = "Option::is_none")]
41    pub reservation_refs: Option<Vec<String>>,
42}
43
44impl Coach {
45    pub fn new(number: String, layout_id: String) -> Coach {
46        Coach {
47            compartments: None,
48            number,
49            layout_id,
50            layout_id_upper_deck: None,
51            layout_id_lower_deck: None,
52            direction: None,
53            owner: None,
54            special_coach: None,
55            reservation_refs: None,
56        }
57    }
58}
59