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
56
/*
* 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};
/// Compartment : Areas within a coach that holds places. Areas might be selectable as a whole. Usual areas would be classic compartments.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct Compartment {
#[serde(rename = "places")]
pub places: Vec<models::PlacePosition>,
/// Compartment number
#[serde(rename = "number", skip_serializing_if = "Option::is_none")]
pub number: Option<String>,
/// Indicates whether compartments are selectable as a whole only
#[serde(rename = "isSelectable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub is_selectable: Option<Option<bool>>,
/// references to the reservations/fares for which this place can be selected. The reservation ids must be part of the list of reservation ids for which the consumer has requested the available places and the consumer must accept a list by setting singleSelectionMapsRequired to false
#[serde(rename = "reservationRefs", skip_serializing_if = "Option::is_none")]
pub reservation_refs: Option<Vec<String>>,
#[serde(rename = "status", skip_serializing_if = "Option::is_none")]
pub status: Option<models::AvailabilityStatus>,
/// Traditional first and second class.
#[serde(rename = "travelClass", skip_serializing_if = "Option::is_none")]
pub travel_class: Option<String>,
/// Type of quality level, finer grained than the comfort class. Values from the [Service Class Code List](https://osdm.io/spec/catalog-of-code-lists/#ServiceClass) Listed values here are examples.
#[serde(rename = "serviceClass", skip_serializing_if = "Option::is_none")]
pub service_class: Option<String>,
#[serde(rename = "selectionFee", skip_serializing_if = "Option::is_none")]
pub selection_fee: Option<Box<models::SelectionFee>>,
}
impl Compartment {
/// Areas within a coach that holds places. Areas might be selectable as a whole. Usual areas would be classic compartments.
pub fn new(places: Vec<models::PlacePosition>) -> Compartment {
Compartment {
places,
number: None,
is_selectable: None,
reservation_refs: None,
status: None,
travel_class: None,
service_class: None,
selection_fee: None,
}
}
}