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)]
16pub struct Mode {
17 /// 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.
18 #[serde(rename = "ptMode")]
19 pub pt_mode: String,
20 /// Name of the mode
21 #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22 pub name: Option<Option<String>>,
23 /// Short name or acronym of the mode
24 #[serde(rename = "shortName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25 pub short_name: Option<Option<String>>,
26 /// Additional text that further describes the mode
27 #[serde(rename = "description", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28 pub description: Option<Option<String>>,
29}
30
31impl Mode {
32 /// A method of transportation such as bus, rail, etc. Provided by OJP.
33 pub fn new(pt_mode: String) -> Mode {
34 Mode {
35 pt_mode,
36 name: None,
37 short_name: None,
38 description: None,
39 }
40 }
41}
42