osdm_sys/models/
reservation_offer_part.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/// ReservationOfferPart : Reservation includes the reference to the in the initial offer. The offer needs to be updated with the selected places before the confirmation which creates the reservation details including the reserved places. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ReservationOfferPart {
17    /// Attribute is used as discriminator for inheritance between data types.
18    #[serde(rename = "objectType")]
19    pub object_type: String,
20    #[serde(rename = "id")]
21    pub id: String,
22    /// A human-readable description of the Offer. 
23    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub summary: Option<Option<String>>,
25    #[serde(rename = "createdOn")]
26    pub created_on: String,
27    /// Time from which on the offer can be used, e.g. travel. 
28    #[serde(rename = "validFrom")]
29    pub valid_from: String,
30    /// Time until the offer can be used, e.g. travel. 
31    #[serde(rename = "validUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub valid_until: Option<Option<String>>,
33    #[serde(rename = "price")]
34    pub price: Box<models::Price>,
35    #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
36    pub trip_coverage: Option<Box<models::TripCoverage>>,
37    #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
38    pub inbound_trip_coverage: Option<Box<models::TripCoverage>>,
39    /// Indicates until when the price for the given offer is guaranteed. 
40    #[serde(rename = "priceGuaranteedUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub price_guaranteed_until: Option<Option<String>>,
42    #[serde(rename = "offerMode")]
43    pub offer_mode: models::OfferMode,
44    /// Indicates whether the offerId can be used in more than one booking. 
45    #[serde(rename = "isReusable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
46    pub is_reusable: Option<Option<bool>>,
47    #[serde(rename = "passengerRefs")]
48    pub passenger_refs: Vec<String>,
49    /// Total amount of items of this type currently available. For reservation offers, this would be the total number of seats available, regardless of their properties. 
50    #[serde(rename = "numericAvailability", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
51    pub numeric_availability: Option<Option<i32>>,
52    #[serde(rename = "refundable")]
53    pub refundable: models::RefundType,
54    #[serde(rename = "exchangeable")]
55    pub exchangeable: models::ExchangeableType,
56    #[serde(rename = "afterSalesConditions", skip_serializing_if = "Option::is_none")]
57    pub after_sales_conditions: Option<Vec<models::AfterSaleCondition>>,
58    /// List of tags (and their type) that allow identifying sets of compatible offers when trying to combine multiple offers covering one single trip. At least one (not all) tripTags must be in common to allow combination If no tag is provided, there is no trip constraint on this specific offer. 
59    #[serde(rename = "tripTags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
60    pub trip_tags: Option<Option<Vec<String>>>,
61    /// List of tags (and their type) that allow identifying sets of compatible offers when booking a return trip involving return-specific fares. All returnTags must be present in the counterpart offer to allow combination If no tag is provided, there is no return constraint on this specific offer. 
62    #[serde(rename = "returnTags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
63    pub return_tags: Option<Option<Vec<String>>>,
64    #[serde(rename = "offerTag", skip_serializing_if = "Option::is_none")]
65    pub offer_tag: Option<Box<models::OfferTag>>,
66    /// Boolean-expression indicating the data that must be set in the data model in order to proceed to next step of the process.   The syntax and semantics of the expression is described in detail in the OSDM documentation. 
67    #[serde(rename = "requestedInformation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
68    pub requested_information: Option<Option<String>>,
69    /// Id of the product representing the commercial attributes of this offer part. Although not currently mandatory, this attribute should in all cases be facilitate product based processing at the client
70    #[serde(rename = "summaryProductId", skip_serializing_if = "Option::is_none")]
71    pub summary_product_id: Option<String>,
72    #[serde(rename = "products")]
73    pub products: Vec<models::ProductLegAssociation>,
74    #[serde(rename = "availableFulfillmentOptions")]
75    pub available_fulfillment_options: Vec<models::FulfillmentOption>,
76    #[serde(rename = "appliedCorporateCodes", skip_serializing_if = "Option::is_none")]
77    pub applied_corporate_codes: Option<Vec<models::CorporateCode>>,
78    #[serde(rename = "appliedPassengerTypes", skip_serializing_if = "Option::is_none")]
79    pub applied_passenger_types: Option<Vec<models::AppliedPassengerType>>,
80    #[serde(rename = "appliedPromotionCodes", skip_serializing_if = "Option::is_none")]
81    pub applied_promotion_codes: Option<Vec<models::PromotionCode>>,
82    #[serde(rename = "appliedReductionCardTypes", skip_serializing_if = "Option::is_none")]
83    pub applied_reduction_card_types: Option<Vec<models::ReductionCardType>>,
84    #[serde(rename = "regionalValiditySummary", skip_serializing_if = "Option::is_none")]
85    pub regional_validity_summary: Option<Box<models::RegionalValiditySummary>>,
86    #[serde(rename = "indicatedConsumption", skip_serializing_if = "Option::is_none")]
87    pub indicated_consumption: Option<Box<models::IndicatedConsumption>>,
88    #[serde(rename = "grantedReductionAmounts", skip_serializing_if = "Option::is_none")]
89    pub granted_reduction_amounts: Option<Box<models::GrantedReductionAmounts>>,
90    /// Java Property Name: 'links' 
91    #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
92    pub _links: Option<Vec<models::Link>>,
93    /// *DEPRECATED* Formerly OSDM allowed to link ancillaries to reservation. Since 3.7.0, it is recommended to only link reservations to admissions, ancillaries, and not the other way round. Referrence will be removed in 4.0.0 
94    #[serde(rename = "ancillaries", skip_serializing_if = "Option::is_none")]
95    pub ancillaries: Option<Vec<models::AncillaryRelation>>,
96    #[serde(rename = "availablePlaces", skip_serializing_if = "Option::is_none")]
97    pub available_places: Option<Vec<models::AvailablePlace>>,
98    #[serde(rename = "availablePlacePreferences", skip_serializing_if = "Option::is_none")]
99    pub available_place_preferences: Option<Vec<models::AvailablePlacePreferences>>,
100    #[serde(rename = "feeRefs", skip_serializing_if = "Option::is_none")]
101    pub fee_refs: Option<Vec<models::OfferPartReference>>,
102    #[serde(rename = "numberOfPrivateCompartments", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
103    pub number_of_private_compartments: Option<Option<i32>>,
104    /// Supported place selection flows might depend on available places. 
105    #[serde(rename = "supportedPlaceSelectionFlows", skip_serializing_if = "Option::is_none")]
106    pub supported_place_selection_flows: Option<Vec<String>>,
107}
108
109impl ReservationOfferPart {
110    /// Reservation includes the reference to the in the initial offer. The offer needs to be updated with the selected places before the confirmation which creates the reservation details including the reserved places. 
111    pub fn new(object_type: String, id: String, created_on: String, valid_from: String, price: models::Price, offer_mode: models::OfferMode, passenger_refs: Vec<String>, refundable: models::RefundType, exchangeable: models::ExchangeableType, products: Vec<models::ProductLegAssociation>, available_fulfillment_options: Vec<models::FulfillmentOption>) -> ReservationOfferPart {
112        ReservationOfferPart {
113            object_type,
114            id,
115            summary: None,
116            created_on,
117            valid_from,
118            valid_until: None,
119            price: Box::new(price),
120            trip_coverage: None,
121            inbound_trip_coverage: None,
122            price_guaranteed_until: None,
123            offer_mode,
124            is_reusable: None,
125            passenger_refs,
126            numeric_availability: None,
127            refundable,
128            exchangeable,
129            after_sales_conditions: None,
130            trip_tags: None,
131            return_tags: None,
132            offer_tag: None,
133            requested_information: None,
134            summary_product_id: None,
135            products,
136            available_fulfillment_options,
137            applied_corporate_codes: None,
138            applied_passenger_types: None,
139            applied_promotion_codes: None,
140            applied_reduction_card_types: None,
141            regional_validity_summary: None,
142            indicated_consumption: None,
143            granted_reduction_amounts: None,
144            _links: None,
145            ancillaries: None,
146            available_places: None,
147            available_place_preferences: None,
148            fee_refs: None,
149            number_of_private_compartments: None,
150            supported_place_selection_flows: None,
151        }
152    }
153}
154