osdm_sys/models/
transfer_leg.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/// TransferLeg : A leg which links other legs of a trip where a transfer between different places is required. Provided by OJP. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TransferLeg {
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 dedicated to perform transfers. Provided by OJP. 
21    #[serde(rename = "transferMode", skip_serializing_if = "Option::is_none")]
22    pub transfer_mode: Option<String>,
23    #[serde(rename = "start")]
24    pub start: Box<models::PlaceRef>,
25    #[serde(rename = "end")]
26    pub end: Box<models::PlaceRef>,
27    /// Time at which window begins. 
28    #[serde(rename = "timeWindowStart", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub time_window_start: Option<Option<String>>,
30    /// Time at which window ends. 
31    #[serde(rename = "timeWindowEnd", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub time_window_end: Option<Option<String>>,
33    /// Overall duration of this interchange. 
34    #[serde(rename = "duration", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub duration: Option<Option<String>>,
36    #[serde(rename = "situationFullRefs", skip_serializing_if = "Option::is_none")]
37    pub situation_full_refs: Option<Vec<String>>,
38    #[serde(rename = "co2Emission", skip_serializing_if = "Option::is_none")]
39    pub co2_emission: Option<Box<models::Quantity>>,
40}
41
42impl TransferLeg {
43    /// A leg which links other legs of a trip where a transfer between different places is required. Provided by OJP. 
44    pub fn new(start: models::PlaceRef, end: models::PlaceRef) -> TransferLeg {
45        TransferLeg {
46            continuous_mode: None,
47            transfer_mode: None,
48            start: Box::new(start),
49            end: Box::new(end),
50            time_window_start: None,
51            time_window_end: None,
52            duration: None,
53            situation_full_refs: None,
54            co2_emission: None,
55        }
56    }
57}
58