osdm_sys/models/
continuous_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/// ContinuousLeg : A leg of a journey that is not bound to a timetable. Provided by OJP. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ContinuousLeg {
17    #[serde(rename = "start")]
18    pub start: Box<models::Place>,
19    #[serde(rename = "end")]
20    pub end: Box<models::Place>,
21    #[serde(rename = "service")]
22    pub service: Box<models::ContinuousService>,
23    /// Time at which window begins. 
24    #[serde(rename = "timeWindowStart", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub time_window_start: Option<Option<String>>,
26    /// Time at which window ends. 
27    #[serde(rename = "timeWindowEnd", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub time_window_end: Option<Option<String>>,
29    /// Duration of this leg according to user preferences like walk speed. 
30    #[serde(rename = "duration", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub duration: Option<Option<String>>,
32    #[serde(rename = "situationFullRefs", skip_serializing_if = "Option::is_none")]
33    pub situation_full_refs: Option<Vec<String>>,
34    #[serde(rename = "co2Emission", skip_serializing_if = "Option::is_none")]
35    pub co2_emission: Option<Box<models::Quantity>>,
36}
37
38impl ContinuousLeg {
39    /// A leg of a journey that is not bound to a timetable. Provided by OJP. 
40    pub fn new(start: models::Place, end: models::Place, service: models::ContinuousService) -> ContinuousLeg {
41        ContinuousLeg {
42            start: Box::new(start),
43            end: Box::new(end),
44            service: Box::new(service),
45            time_window_start: None,
46            time_window_end: None,
47            duration: None,
48            situation_full_refs: None,
49            co2_emission: None,
50        }
51    }
52}
53