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