osdm_sys/models/
dated_journey.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/// DatedJourney : Vehicle journey that runs at a specific date. Provided by OJP. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DatedJourney {
17    /// Reference to an operating day. Provided by OJP. 
18    #[serde(rename = "operatingDayRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19    pub operating_day_ref: Option<Option<String>>,
20    #[serde(rename = "mode", skip_serializing_if = "Option::is_none")]
21    pub mode: Option<Box<models::Mode>>,
22    #[serde(rename = "productCategory", skip_serializing_if = "Option::is_none")]
23    pub product_category: Option<Box<models::ProductCategory>>,
24    /// Line name or service description as known to the public, f.e. '512', 'S8' or 'Circle Line' or 'ICE 488'. 
25    #[serde(rename = "publishedServiceName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub published_service_name: Option<Option<String>>,
27    #[serde(rename = "vehicleNumbers")]
28    pub vehicle_numbers: Vec<String>,
29    #[serde(rename = "lineNumbers", skip_serializing_if = "Option::is_none")]
30    pub line_numbers: Option<Vec<String>>,
31    #[serde(rename = "serviceStatus", skip_serializing_if = "Option::is_none")]
32    pub service_status: Option<Box<models::ServiceStatus>>,
33    #[serde(rename = "situationFullRefs", skip_serializing_if = "Option::is_none")]
34    pub situation_full_refs: Option<Vec<String>>,
35    #[serde(rename = "carriers")]
36    pub carriers: Vec<models::NamedCompany>,
37    #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")]
38    pub attributes: Option<Vec<models::GeneralAttribute>>,
39}
40
41impl DatedJourney {
42    /// Vehicle journey that runs at a specific date. Provided by OJP. 
43    pub fn new(vehicle_numbers: Vec<String>, carriers: Vec<models::NamedCompany>) -> DatedJourney {
44        DatedJourney {
45            operating_day_ref: None,
46            mode: None,
47            product_category: None,
48            published_service_name: None,
49            vehicle_numbers,
50            line_numbers: None,
51            service_status: None,
52            situation_full_refs: None,
53            carriers,
54            attributes: None,
55        }
56    }
57}
58