osdm_sys/models/
continuous_service.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/// ContinuousService : A vehicle movement on a continuous, non-timetabled service. Service of this leg. May be 'walk' in most cases, but also cycling or taxi etc. Provided by OJP. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ContinuousService {
17    /// Types of modes that run at any time without a timetable. Provided by OJP. 
18    #[serde(rename = "continuousMode", skip_serializing_if = "Option::is_none")]
19    pub continuous_mode: Option<String>,
20    /// Modes which an individual powers themselves (such as walk, cycle). Provided by OJP. 
21    #[serde(rename = "individualMode", skip_serializing_if = "Option::is_none")]
22    pub individual_mode: Option<String>,
23    /// Reference to an operating day. Provided by OJP. 
24    #[serde(rename = "operatingDayRef", deserialize_with = "Option::deserialize")]
25    pub operating_day_ref: Option<String>,
26    /// Reference to a journey. Provided by OJP. 
27    #[serde(rename = "journeyRef", deserialize_with = "Option::deserialize")]
28    pub journey_ref: Option<String>,
29    #[serde(rename = "mode")]
30    pub mode: String,
31    #[serde(rename = "publishedServiceName")]
32    pub published_service_name: String,
33    #[serde(rename = "originText")]
34    pub origin_text: String,
35    #[serde(rename = "destinationText")]
36    pub destination_text: String,
37}
38
39impl ContinuousService {
40    /// A vehicle movement on a continuous, non-timetabled service. Service of this leg. May be 'walk' in most cases, but also cycling or taxi etc. Provided by OJP. 
41    pub fn new(operating_day_ref: Option<String>, journey_ref: Option<String>, mode: String, published_service_name: String, origin_text: String, destination_text: String) -> ContinuousService {
42        ContinuousService {
43            continuous_mode: None,
44            individual_mode: None,
45            operating_day_ref,
46            journey_ref,
47            mode,
48            published_service_name,
49            origin_text,
50            destination_text,
51        }
52    }
53}
54