Skip to main content

osdm_sys/models/
legacy_reservation_parameter.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/// LegacyReservationParameter : reservation parameter to support the UIC 90918-1 interface for booking 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
17pub struct LegacyReservationParameter {
18    /// 90918-1 class code in reservation 
19    #[serde(rename = "travelClass")]
20    pub travel_class: String,
21    /// service level code defined in UIC 90918-1 
22    #[serde(rename = "serviceLevelCode")]
23    pub service_level_code: String,
24    /// service code to be used in reservation 
25    #[serde(rename = "serviceCode")]
26    pub service_code: String,
27    /// berth type code in UIC 90918-1 to be used in reservation 
28    #[serde(rename = "berthType", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub berth_type: Option<Option<String>>,
30    /// coach type code in UIC 90918-1 to be used in reservation 
31    #[serde(rename = "coachTypeCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub coach_type_code: Option<Option<String>>,
33    /// compartment type code in UIC 90918-1 to be used in reservation 
34    #[serde(rename = "compartmentTypeCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub compartment_type_code: Option<Option<String>>,
36    /// tariff according to UIC 90918-1 to be used for booking 
37    #[serde(rename = "tariffs", skip_serializing_if = "Option::is_none")]
38    pub tariffs: Option<Vec<models::LegacyReservationTariff>>,
39}
40
41impl LegacyReservationParameter {
42    /// reservation parameter to support the UIC 90918-1 interface for booking 
43    pub fn new(travel_class: String, service_level_code: String, service_code: String) -> LegacyReservationParameter {
44        LegacyReservationParameter {
45            travel_class,
46            service_level_code,
47            service_code,
48            berth_type: None,
49            coach_type_code: None,
50            compartment_type_code: None,
51            tariffs: None,
52        }
53    }
54}
55