osdm_sys/models/place.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/// Place : A geographic place of any type which may be specified as the origin or destination of a trip. Provided by OJP.
15#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
16#[serde(tag = "objectType")]
17pub enum Place {
18 #[serde(rename="Address")]
19 Address {
20 /// id defining the place. The code is provided as URN, relative URNs are allowed with base path urn:uic:stn '0850000'
21 #[serde(rename = "id")]
22 id: String,
23 /// For a place with ids in different reference systems, the alternative ids can be returned. The reference system is encoded in the string. E.g.: 'urn:uic:std:80000', 'x_swe:stn:10000', 'ch:1:sloid:343434'
24 #[serde(rename = "alternativeIds", skip_serializing_if = "Option::is_none")]
25 alternative_ids: Option<Vec<String>>,
26 #[serde(rename = "geoPosition", skip_serializing_if = "Option::is_none")]
27 geo_position: Option<Box<models::GeoPosition>>,
28 #[serde(rename = "ref", skip_serializing_if = "Option::is_none")]
29 r#ref: Option<Box<models::PlaceRef>>,
30 /// Java Property Name: 'links'
31 #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
32 _links: Option<Vec<models::Link>>,
33 },
34 #[serde(rename="FareConnectionPoint")]
35 FareConnectionPoint {
36 /// id defining the place. The code is provided as URN, relative URNs are allowed with base path urn:uic:stn '0850000'
37 #[serde(rename = "id")]
38 id: String,
39 /// For a place with ids in different reference systems, the alternative ids can be returned. The reference system is encoded in the string. E.g.: 'urn:uic:std:80000', 'x_swe:stn:10000', 'ch:1:sloid:343434'
40 #[serde(rename = "alternativeIds", skip_serializing_if = "Option::is_none")]
41 alternative_ids: Option<Vec<String>>,
42 #[serde(rename = "geoPosition", skip_serializing_if = "Option::is_none")]
43 geo_position: Option<Box<models::GeoPosition>>,
44 #[serde(rename = "ref", skip_serializing_if = "Option::is_none")]
45 r#ref: Option<Box<models::PlaceRef>>,
46 /// Java Property Name: 'links'
47 #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
48 _links: Option<Vec<models::Link>>,
49 },
50 #[serde(rename="PointOfInterest")]
51 PointOfInterest {
52 /// id defining the place. The code is provided as URN, relative URNs are allowed with base path urn:uic:stn '0850000'
53 #[serde(rename = "id")]
54 id: String,
55 /// For a place with ids in different reference systems, the alternative ids can be returned. The reference system is encoded in the string. E.g.: 'urn:uic:std:80000', 'x_swe:stn:10000', 'ch:1:sloid:343434'
56 #[serde(rename = "alternativeIds", skip_serializing_if = "Option::is_none")]
57 alternative_ids: Option<Vec<String>>,
58 #[serde(rename = "geoPosition", skip_serializing_if = "Option::is_none")]
59 geo_position: Option<Box<models::GeoPosition>>,
60 #[serde(rename = "ref", skip_serializing_if = "Option::is_none")]
61 r#ref: Option<Box<models::PlaceRef>>,
62 /// Java Property Name: 'links'
63 #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
64 _links: Option<Vec<models::Link>>,
65 },
66 #[serde(rename="StopPlace")]
67 StopPlace {
68 /// id defining the place. The code is provided as URN, relative URNs are allowed with base path urn:uic:stn '0850000'
69 #[serde(rename = "id")]
70 id: String,
71 /// For a place with ids in different reference systems, the alternative ids can be returned. The reference system is encoded in the string. E.g.: 'urn:uic:std:80000', 'x_swe:stn:10000', 'ch:1:sloid:343434'
72 #[serde(rename = "alternativeIds", skip_serializing_if = "Option::is_none")]
73 alternative_ids: Option<Vec<String>>,
74 #[serde(rename = "geoPosition", skip_serializing_if = "Option::is_none")]
75 geo_position: Option<Box<models::GeoPosition>>,
76 #[serde(rename = "ref", skip_serializing_if = "Option::is_none")]
77 r#ref: Option<Box<models::PlaceRef>>,
78 /// Java Property Name: 'links'
79 #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
80 _links: Option<Vec<models::Link>>,
81 },
82}
83
84impl Default for Place {
85 fn default() -> Self {
86 Self::Address {
87 id: Default::default(),
88 alternative_ids: Default::default(),
89 geo_position: Default::default(),
90 r#ref: Default::default(),
91 _links: Default::default(),
92 }
93
94 }
95}
96
97