osdm_sys/models/line.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
14use serde_with::serde_as;
15
16/// Line : terminalStation - in case the product requires a destination within the zone (e.g. local ticket to go to the main rail station). entryStation - Station to enter the zone in case the product requires to enter the zone via a specific station (e.g. local zone ticket to start from the main rail station).
17#[serde_as]
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct Line {
20 /// Id to support local traffic standards (e.g. VDV,...).
21 #[serde_as(as = "super::DoubleOption<serde_with::base64::Base64>")]
22 #[serde(rename = "binaryLineId", default, skip_serializing_if = "Option::is_none")]
23 pub binary_line_id: Option<Option<Vec<u8>>>,
24 /// Identifies a company. For rail, a RICS company code or compatible ERA company code are used. E.g.: 'urn:uic:rics:1185:000011'
25 #[serde(rename = "carrier")]
26 pub carrier: String,
27 #[serde(rename = "city", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28 pub city: Option<Option<i32>>,
29 #[serde(rename = "entryStation", skip_serializing_if = "Option::is_none")]
30 pub entry_station: Option<Box<models::StopPlace>>,
31 #[serde(rename = "lineIds", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32 pub line_ids: Option<Option<Vec<String>>>,
33 #[serde(rename = "terminalStation", skip_serializing_if = "Option::is_none")]
34 pub terminal_station: Option<Box<models::StopPlace>>,
35 /// Nomenclature des units territoriales statistiques COMMISSION REGULATION (EU) No 31/2011
36 #[serde(rename = "nutsCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37 pub nuts_code: Option<Option<String>>,
38}
39
40impl Line {
41 /// terminalStation - in case the product requires a destination within the zone (e.g. local ticket to go to the main rail station). entryStation - Station to enter the zone in case the product requires to enter the zone via a specific station (e.g. local zone ticket to start from the main rail station).
42 pub fn new(carrier: String) -> Line {
43 Line {
44 binary_line_id: None,
45 carrier,
46 city: None,
47 entry_station: None,
48 line_ids: None,
49 terminal_station: None,
50 nuts_code: None,
51 }
52 }
53}
54