Skip to main content

osdm_sys/models/
reserved_place.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/// ReservedPlace : In distributor mode placeProperties are mandatory to be returned. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
17pub struct ReservedPlace {
18    #[serde(rename = "id")]
19    pub id: String,
20    /// Id of the passenger 
21    #[serde(rename = "passengerIds")]
22    pub passenger_ids: Vec<String>,
23    /// vehicle number (e.g. train number) 
24    #[serde(rename = "vehicleNumber")]
25    pub vehicle_number: String,
26    #[serde(rename = "coachNumber")]
27    pub coach_number: String,
28    /// Compartment number as indicated at the compartment in the coach. A compartment number must be set if the compartment is selectable as a whole only. 
29    #[serde(rename = "compartmentNumber", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub compartment_number: Option<Option<String>>,
31    /// description of the places (e.g. 11-35,51) 
32    #[serde(rename = "placeDescription", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub place_description: Option<Option<String>>,
34    /// list of individual place numbers 
35    #[serde(rename = "placeNumbers", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub place_numbers: Option<Option<Vec<String>>>,
37    /// place properties to be indicated to the customer 
38    #[serde(rename = "placeProperties", skip_serializing_if = "Option::is_none")]
39    pub place_properties: Option<Vec<String>>,
40    #[serde(rename = "splitSection", skip_serializing_if = "Option::is_none")]
41    pub split_section: Option<Box<models::Section>>,
42}
43
44impl ReservedPlace {
45    /// In distributor mode placeProperties are mandatory to be returned. 
46    pub fn new(id: String, passenger_ids: Vec<String>, vehicle_number: String, coach_number: String) -> ReservedPlace {
47        ReservedPlace {
48            id,
49            passenger_ids,
50            vehicle_number,
51            coach_number,
52            compartment_number: None,
53            place_description: None,
54            place_numbers: None,
55            place_properties: None,
56            split_section: None,
57        }
58    }
59}
60