osdm_sys/models/zone.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/// Zone : carrier - carrier responsible for the transport. 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). terminalStation - Terminal station in case the product requires a destination within the zone (e.g. local ticket to go to the main rail station).
17#[serde_as]
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct Zone {
20 /// Id to support local traffic standards (e.g. VDV,...)
21 #[serde_as(as = "super::DoubleOption<serde_with::base64::Base64>")]
22 #[serde(rename = "binaryZoneId", default, skip_serializing_if = "Option::is_none")]
23 pub binary_zone_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", skip_serializing_if = "Option::is_none")]
26 pub carrier: Option<String>,
27 #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28 pub name: Option<Option<String>>,
29 #[serde(rename = "entryStation", skip_serializing_if = "Option::is_none")]
30 pub entry_station: Option<Box<models::StopPlace>>,
31 #[serde(rename = "terminalStation", skip_serializing_if = "Option::is_none")]
32 pub terminal_station: Option<Box<models::StopPlace>>,
33 /// to be used in bar codes
34 #[serde(rename = "zoneIds", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35 pub zone_ids: Option<Option<Vec<i32>>>,
36 /// Nomenclature des units territoriales statistiques COMMISSION REGULATION (EU) No 31/2011
37 #[serde(rename = "nutsCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38 pub nuts_code: Option<Option<String>>,
39 #[serde(rename = "validFrom", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40 pub valid_from: Option<Option<String>>,
41 #[serde(rename = "validUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42 pub valid_until: Option<Option<String>>,
43}
44
45impl Zone {
46 /// carrier - carrier responsible for the transport. 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). terminalStation - Terminal station in case the product requires a destination within the zone (e.g. local ticket to go to the main rail station).
47 pub fn new() -> Zone {
48 Zone {
49 binary_zone_id: None,
50 carrier: None,
51 name: None,
52 entry_station: None,
53 terminal_station: None,
54 zone_ids: None,
55 nuts_code: None,
56 valid_from: None,
57 valid_until: None,
58 }
59 }
60}
61