osdm_sys/models/fare_connection_point.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/// FareConnectionPoint : Connection point connecting two fare regimes. The connection is possible between stations of the two provided station sets. A legacy border point code (id) might be provided as an additional code within the stations (code list BORDER_POINT provided in URN). In case the connection point is a real station this station is indicated. In case the connection point is between stations for each side of the border real stations must be provided. Multiple sets of station can be provided in the rare case that the connection point connects more than two station (A-B and A-C). Multiple stations within a set at one side of the border might be provided in case of changes (new stations build near the border). Providing the UIC code for the station is mandatory.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct FareConnectionPoint {
17 /// Attribute is used as discriminator for inheritance between data types.
18 #[serde(rename = "objectType")]
19 pub object_type: String,
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 pub 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", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25 pub alternative_ids: Option<Option<Vec<String>>>,
26 #[serde(rename = "geoPosition", skip_serializing_if = "Option::is_none")]
27 pub geo_position: Option<Box<models::GeoPosition>>,
28 #[serde(rename = "ref", skip_serializing_if = "Option::is_none")]
29 pub r#ref: Option<Box<models::PlaceRef>>,
30 /// Java Property Name: 'links'
31 #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
32 pub _links: Option<Vec<models::Link>>,
33 #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34 pub name: Option<Option<String>>,
35 #[serde(rename = "stationSets")]
36 pub station_sets: Vec<models::StationSet>,
37}
38
39impl FareConnectionPoint {
40 /// Connection point connecting two fare regimes. The connection is possible between stations of the two provided station sets. A legacy border point code (id) might be provided as an additional code within the stations (code list BORDER_POINT provided in URN). In case the connection point is a real station this station is indicated. In case the connection point is between stations for each side of the border real stations must be provided. Multiple sets of station can be provided in the rare case that the connection point connects more than two station (A-B and A-C). Multiple stations within a set at one side of the border might be provided in case of changes (new stations build near the border). Providing the UIC code for the station is mandatory.
41 pub fn new(object_type: String, id: String, station_sets: Vec<models::StationSet>) -> FareConnectionPoint {
42 FareConnectionPoint {
43 object_type,
44 id,
45 alternative_ids: None,
46 geo_position: None,
47 r#ref: None,
48 _links: None,
49 name: None,
50 station_sets,
51 }
52 }
53}
54