Skip to main content

osdm_sys/models/
available_place.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/// AvailablePlace : Describes the details of the available places. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
17pub struct AvailablePlace {
18    /// Accommodation type definition out of the  [Accommodation Type Code List](https://osdm.io/spec/catalog-of-code-lists/#AccomodationType) Listed values here are examples. 
19    #[serde(rename = "accommodationType")]
20    pub accommodation_type: String,
21    /// 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. 
22    #[serde(rename = "accommodationSubType")]
23    pub accommodation_sub_type: String,
24    /// Selectable place properties for the offer. For AccommodationSubType=ANY_SEAT all available and bookable properties need to be returned to give a sales tool a list of possible selections. 
25    #[serde(rename = "placeProperties", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub place_properties: Option<Option<Vec<String>>>,
27    /// For the AccommodationSubType=ANY_SEAT the total amount of places for the combination of AccommodationType and AccommodationSubType needs to returned. 
28    #[serde(rename = "numericAvailability", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub numeric_availability: Option<Option<i32>>,
30    #[serde(rename = "tripLegCoverage")]
31    pub trip_leg_coverage: Box<models::TripLegCoverage>,
32}
33
34impl AvailablePlace {
35    /// Describes the details of the available places. 
36    pub fn new(accommodation_type: String, accommodation_sub_type: String, trip_leg_coverage: models::TripLegCoverage) -> AvailablePlace {
37        AvailablePlace {
38            accommodation_type,
39            accommodation_sub_type,
40            place_properties: None,
41            numeric_availability: None,
42            trip_leg_coverage: Box::new(trip_leg_coverage),
43        }
44    }
45}
46