osdm_sys/models/place_restriction.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/// PlaceRestriction : Reservation based place selection criteria. Each requested place selection criterion will only be considered if it is covered by the referenced reservation fare/offerPart/bookingPart. E.g. place selection criterion serviceClass=HIGH will only be considered if reservationRef references a first/high class offer.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PlaceRestriction {
17 #[serde(rename = "reservationRef")]
18 pub reservation_ref: Box<models::ReservationReference>,
19 /// 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.
20 #[serde(rename = "serviceClass", skip_serializing_if = "Option::is_none")]
21 pub service_class: Option<String>,
22 /// Specifies the accommodation sub types for which place availabilities shall be returned.
23 #[serde(rename = "accommodationSubTypes", skip_serializing_if = "Option::is_none")]
24 pub accommodation_sub_types: Option<Vec<String>>,
25}
26
27impl PlaceRestriction {
28 /// Reservation based place selection criteria. Each requested place selection criterion will only be considered if it is covered by the referenced reservation fare/offerPart/bookingPart. E.g. place selection criterion serviceClass=HIGH will only be considered if reservationRef references a first/high class offer.
29 pub fn new(reservation_ref: models::ReservationReference) -> PlaceRestriction {
30 PlaceRestriction {
31 reservation_ref: Box::new(reservation_ref),
32 service_class: None,
33 accommodation_sub_types: None,
34 }
35 }
36}
37