osdm_sys/models/
place_group.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/// PlaceGroup : A place group groups places by service class and optionally by accommodation sub type. A place group not necessarily needs to be visualized (e.g. as a rectangle). Visualization can be done using ServiceIcons and GraphicElements.   Nevertheless, a place group can be useful for rendering of coach decks/places for which no place availabilities were returned, as further information (service class, accommodation sub type) can be displayed .   If availabilities were returned for a certain place, travel class and accommodation sub type values returned in the availability response must be displayed (they replace the static travel class / accommodation sub type defined on the place group). Reason: travel class and accommodation sub type values can dynamically change for each vehicle run.   Example 1: Class upgrade A customer with a second class reservation ticket might be placed on a first class seat.   Example 2: New/more specific AccommodationSubType AccommodationSubType=BUSINESS defined in static master data might be changed into AccommodationSubType=BUSINESS_COMFORT on certain vehicle runs. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PlaceGroup {
17    /// 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. 
18    #[serde(rename = "serviceClass")]
19    pub service_class: String,
20    /// Accommodation type definition out of the  [Accommodation Type Code List](https://osdm.io/spec/catalog-of-code-lists/#AccomodationType) Listed values here are examples. 
21    #[serde(rename = "accommodationType", skip_serializing_if = "Option::is_none")]
22    pub accommodation_type: Option<String>,
23    /// Accommodation sub type definition out of the  [Accommodation Sub Type Code List](https://osdm.io/spec/catalog-of-code-lists/#PlaceProperty) Listed values here are examples. 
24    #[serde(rename = "accommodationSubType", skip_serializing_if = "Option::is_none")]
25    pub accommodation_sub_type: Option<String>,
26    /// Seats or bicycle hooks in a coach compartment. 
27    #[serde(rename = "places")]
28    pub places: Vec<models::PlaceLayout>,
29}
30
31impl PlaceGroup {
32    /// A place group groups places by service class and optionally by accommodation sub type. A place group not necessarily needs to be visualized (e.g. as a rectangle). Visualization can be done using ServiceIcons and GraphicElements.   Nevertheless, a place group can be useful for rendering of coach decks/places for which no place availabilities were returned, as further information (service class, accommodation sub type) can be displayed .   If availabilities were returned for a certain place, travel class and accommodation sub type values returned in the availability response must be displayed (they replace the static travel class / accommodation sub type defined on the place group). Reason: travel class and accommodation sub type values can dynamically change for each vehicle run.   Example 1: Class upgrade A customer with a second class reservation ticket might be placed on a first class seat.   Example 2: New/more specific AccommodationSubType AccommodationSubType=BUSINESS defined in static master data might be changed into AccommodationSubType=BUSINESS_COMFORT on certain vehicle runs. 
33    pub fn new(service_class: String, places: Vec<models::PlaceLayout>) -> PlaceGroup {
34        PlaceGroup {
35            service_class,
36            accommodation_type: None,
37            accommodation_sub_type: None,
38            places,
39        }
40    }
41}
42