1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* UIC 90918-10 - OSDM
*
* 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/)
*
* The version of the OpenAPI document: 3.7.0
* Contact: osdm@uic.org
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// LegacyReservationParameter : reservation parameter to support the UIC 90918-1 interface for booking
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct LegacyReservationParameter {
/// 90918-1 class code in reservation
#[serde(rename = "travelClass")]
pub travel_class: String,
/// service level code defined in UIC 90918-1
#[serde(rename = "serviceLevelCode")]
pub service_level_code: String,
/// service code to be used in reservation
#[serde(rename = "serviceCode")]
pub service_code: String,
/// berth type code in UIC 90918-1 to be used in reservation
#[serde(rename = "berthType", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub berth_type: Option<Option<String>>,
/// coach type code in UIC 90918-1 to be used in reservation
#[serde(rename = "coachTypeCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub coach_type_code: Option<Option<String>>,
/// compartment type code in UIC 90918-1 to be used in reservation
#[serde(rename = "compartmentTypeCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub compartment_type_code: Option<Option<String>>,
/// tariff according to UIC 90918-1 to be used for booking
#[serde(rename = "tariffs", skip_serializing_if = "Option::is_none")]
pub tariffs: Option<Vec<models::LegacyReservationTariff>>,
}
impl LegacyReservationParameter {
/// reservation parameter to support the UIC 90918-1 interface for booking
pub fn new(travel_class: String, service_level_code: String, service_code: String) -> LegacyReservationParameter {
LegacyReservationParameter {
travel_class,
service_level_code,
service_code,
berth_type: None,
coach_type_code: None,
compartment_type_code: None,
tariffs: None,
}
}
}