osdm_sys/models/
trip_summary.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/// TripSummary : Trip summary. Provided by OJP. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct TripSummary {
17    /// Id of this trip for referencing purposes. Unique within trip response. 
18    #[serde(rename = "id")]
19    pub id: String,
20    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub summary: Option<Option<String>>,
22    #[serde(rename = "externalRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub external_ref: Option<Option<String>>,
24    /// Departure time at origin. 
25    #[serde(rename = "startTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub start_time: Option<Option<String>>,
27    /// Arrival time at destination. 
28    #[serde(rename = "endTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub end_time: Option<Option<String>>,
30    /// Overall duration of the trip. 
31    #[serde(rename = "duration", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub duration: Option<Option<String>>,
33    #[serde(rename = "origin", skip_serializing_if = "Option::is_none")]
34    pub origin: Option<Box<models::PlaceRef>>,
35    /// Name of the origin place
36    #[serde(rename = "originName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub origin_name: Option<Option<String>>,
38    #[serde(rename = "destination", skip_serializing_if = "Option::is_none")]
39    pub destination: Option<Box<models::PlaceRef>>,
40    /// Name of the destination place
41    #[serde(rename = "destinationName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
42    pub destination_name: Option<Option<String>>,
43    #[serde(rename = "transfers", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
44    pub transfers: Option<Option<i32>>,
45    #[serde(rename = "distance", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
46    pub distance: Option<Option<i32>>,
47}
48
49impl TripSummary {
50    /// Trip summary. Provided by OJP. 
51    pub fn new(id: String) -> TripSummary {
52        TripSummary {
53            id,
54            summary: None,
55            external_ref: None,
56            start_time: None,
57            end_time: None,
58            duration: None,
59            origin: None,
60            origin_name: None,
61            destination: None,
62            destination_name: None,
63            transfers: None,
64            distance: None,
65        }
66    }
67}
68