osdm_sys/models/
train_link.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 TrainLink {
16    #[serde(rename = "fromStation")]
17    pub from_station: Box<models::StopPlaceRef>,
18    #[serde(rename = "toStation")]
19    pub to_station: Box<models::StopPlaceRef>,
20    #[serde(rename = "train")]
21    pub train: String,
22    /// date and time of the departure where the train link starts 
23    #[serde(rename = "travelDate")]
24    pub travel_date: String,
25    /// Service brand codes. For public transport, a code list can be found in OSDM's code list. E.g., '163' denotes TGV Lyria and '175' denotes Glacier Express. 
26    #[serde(rename = "serviceBrandCode", skip_serializing_if = "Option::is_none")]
27    pub service_brand_code: Option<String>,
28    /// Abbreviation of the service brand, e.g. 'IC', 'TGV'. See the OSDM code list. Needs to match the service brand code. 
29    #[serde(rename = "serviceBrandAbbreviation")]
30    pub service_brand_abbreviation: String,
31}
32
33impl TrainLink {
34    pub fn new(from_station: models::StopPlaceRef, to_station: models::StopPlaceRef, train: String, travel_date: String, service_brand_abbreviation: String) -> TrainLink {
35        TrainLink {
36            from_station: Box::new(from_station),
37            to_station: Box::new(to_station),
38            train,
39            travel_date,
40            service_brand_code: None,
41            service_brand_abbreviation,
42        }
43    }
44}
45