osdm_sys/models/
coach_availability.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 CoachAvailability {
16    /// Coach number 
17    #[serde(rename = "number")]
18    pub number: String,
19    /// 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 
20    #[serde(rename = "travelDirection")]
21    pub travel_direction: String,
22    /// Indicates that there is no passage to the next coach. 
23    #[serde(rename = "noPassageToNextCoach", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub no_passage_to_next_coach: Option<Option<bool>>,
25    /// The decks of a coach ordered in ascending order from the lowest to the highest deck. Optional as for some coaches (especially special/not reservable coach types) no coach layout might exist. 
26    #[serde(rename = "decks", skip_serializing_if = "Option::is_none")]
27    pub decks: Option<Vec<models::DeckAvailability>>,
28}
29
30impl CoachAvailability {
31    pub fn new(number: String, travel_direction: String) -> CoachAvailability {
32        CoachAvailability {
33            number,
34            travel_direction,
35            no_passage_to_next_coach: None,
36            decks: None,
37        }
38    }
39}
40