Skip to main content

osdm_sys/models/
place_ref.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, Debug, PartialEq, Serialize, Deserialize)]
15#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
16#[serde(tag = "objectType")]
17pub enum PlaceRef {
18    #[serde(rename = "AddressRef")]
19    AddressRef {
20        /// Reference to an address by id.
21        #[serde(rename = "addressRef")]
22        address_ref: String,
23    },
24    #[serde(rename = "FareConnectionPointRef")]
25    FareConnectionPointRef {
26        /// Reference to a fare connection point by id.
27        #[serde(rename = "fareConnectionPointRef")]
28        fare_connection_point_ref: String,
29    },
30    #[serde(rename = "GeoPositionRef")]
31    GeoPositionRef {
32        /// Latitude from equator. -90 (South) to +90 (North). Decimal degrees. e.g. 56.356.
33        #[serde(rename = "latitude")]
34        latitude: f64,
35        /// Longitude from Greenwich Meridian. -180 (West) to +180 (East). Decimal degrees. eg 2.356.
36        #[serde(rename = "longitude")]
37        longitude: f64,
38    },
39    #[serde(rename = "PointOfInterestRef")]
40    PointOfInterestRef {
41        /// Reference to a point of interest by id.
42        #[serde(rename = "pointOfInterestRef")]
43        point_of_interest_ref: String,
44    },
45    #[serde(rename = "StopPlaceRef")]
46    StopPlaceRef {
47        /// Reference to a stop place using URNs to define code. For UIC see UIC MERITS/TAP-TSI station codes.
48        #[serde(rename = "stopPlaceRef")]
49        stop_place_ref: String,
50    },
51}
52
53impl Default for PlaceRef {
54    fn default() -> Self {
55        Self::AddressRef {
56            address_ref: Default::default(),
57        }
58    }
59}