Skip to main content

osdm_sys/models/
claimed_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
16pub struct ClaimedLeg {
17    #[serde(rename = "trainNumber", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
18    pub train_number: Option<Option<String>>,
19    /// connection missed due to a delay on the previous leg 
20    #[serde(rename = "connectionMissed", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub connection_missed: Option<Option<bool>>,
22    #[serde(rename = "serviceDegradation", skip_serializing_if = "Option::is_none")]
23    pub service_degradation: Option<Vec<String>>,
24    #[serde(rename = "departureStation", skip_serializing_if = "Option::is_none")]
25    pub departure_station: Option<Box<models::Place>>,
26    #[serde(rename = "arrivalStation", skip_serializing_if = "Option::is_none")]
27    pub arrival_station: Option<Box<models::Place>>,
28    #[serde(rename = "plannedDepartureTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub planned_departure_time: Option<Option<String>>,
30    #[serde(rename = "timetabledArrivalTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub timetabled_arrival_time: Option<Option<String>>,
32    #[serde(rename = "observedArrivalTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub observed_arrival_time: Option<Option<String>>,
34}
35
36impl ClaimedLeg {
37    pub fn new() -> ClaimedLeg {
38        ClaimedLeg {
39            train_number: None,
40            connection_missed: None,
41            service_degradation: None,
42            departure_station: None,
43            arrival_station: None,
44            planned_departure_time: None,
45            timetabled_arrival_time: None,
46            observed_arrival_time: None,
47        }
48    }
49}
50