Skip to main content

osdm_sys/models/
mode.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/// Mode : A method of transportation such as bus, rail, etc. Provided by OJP. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
17pub struct Mode {
18    /// TAP-TSI/UIC contains a sensible subset of SIRI Transport Modes. Values from the [Transport Mode Code List](https://osdm.io/spec/catalog-of-code-lists/#TransportMode) Listed values here are examples. 
19    #[serde(rename = "ptMode")]
20    pub pt_mode: String,
21    /// Name of the mode 
22    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub name: Option<Option<String>>,
24    /// Short name or acronym of the mode 
25    #[serde(rename = "shortName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub short_name: Option<Option<String>>,
27    /// Additional text that further describes the mode 
28    #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub description: Option<Option<String>>,
30}
31
32impl Mode {
33    /// A method of transportation such as bus, rail, etc. Provided by OJP. 
34    pub fn new(pt_mode: String) -> Mode {
35        Mode {
36            pt_mode,
37            name: None,
38            short_name: None,
39            description: None,
40        }
41    }
42}
43