Skip to main content

osdm_sys/models/
abstract_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/// AbstractOfferPart : Generic offer object that contains all common information about an offer. 
15#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
16#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
17#[serde(tag = "objectType")]
18pub enum AbstractOfferPart {
19    #[serde(rename="AdmissionOfferPart")]
20    AdmissionOfferPart {
21        #[serde(rename = "id")]
22        id: String,
23        /// A human-readable description of the Offer. 
24        #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
25        summary: Option<String>,
26        #[serde(rename = "createdOn")]
27        created_on: String,
28        /// Time from which on the offer can be used, e.g. travel. 
29        #[serde(rename = "validFrom")]
30        valid_from: String,
31        /// Time until the offer can be used, e.g. travel. 
32        #[serde(rename = "validUntil", skip_serializing_if = "Option::is_none")]
33        valid_until: Option<String>,
34        #[serde(rename = "price")]
35        price: Box<models::Price>,
36        #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
37        trip_coverage: Option<Box<models::TripCoverage>>,
38        #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
39        inbound_trip_coverage: Option<Box<models::TripCoverage>>,
40        /// Indicates until when the price for the given offer is guaranteed. 
41        #[serde(rename = "priceGuaranteedUntil", skip_serializing_if = "Option::is_none")]
42        price_guaranteed_until: Option<String>,
43        #[serde(rename = "offerMode")]
44        offer_mode: models::OfferMode,
45        /// Indicates whether the offerId can be used in more than one booking. 
46        #[serde(rename = "isReusable", skip_serializing_if = "Option::is_none")]
47        is_reusable: Option<bool>,
48        #[serde(rename = "passengerRefs")]
49        passenger_refs: Vec<String>,
50        /// 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. 
51        #[serde(rename = "numericAvailability", skip_serializing_if = "Option::is_none")]
52        numeric_availability: Option<i32>,
53        #[serde(rename = "refundable")]
54        refundable: models::RefundType,
55        #[serde(rename = "exchangeable")]
56        exchangeable: models::ExchangeableType,
57        #[serde(rename = "afterSalesConditions", skip_serializing_if = "Option::is_none")]
58        after_sales_conditions: Option<Vec<models::AfterSaleCondition>>,
59        /// 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. 
60        #[serde(rename = "tripTags", skip_serializing_if = "Option::is_none")]
61        trip_tags: Option<Vec<String>>,
62        /// 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. 
63        #[serde(rename = "returnTags", skip_serializing_if = "Option::is_none")]
64        return_tags: Option<Vec<String>>,
65        #[serde(rename = "offerTag", skip_serializing_if = "Option::is_none")]
66        offer_tag: Option<Box<models::OfferTag>>,
67        /// 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. 
68        #[serde(rename = "requestedInformation", skip_serializing_if = "Option::is_none")]
69        requested_information: Option<String>,
70        /// 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
71        #[serde(rename = "summaryProductId", skip_serializing_if = "Option::is_none")]
72        summary_product_id: Option<String>,
73        #[serde(rename = "products")]
74        products: Vec<models::ProductLegAssociation>,
75        #[serde(rename = "availableFulfillmentOptions")]
76        available_fulfillment_options: Vec<models::FulfillmentOption>,
77        #[serde(rename = "appliedCorporateCodes", skip_serializing_if = "Option::is_none")]
78        applied_corporate_codes: Option<Vec<models::CorporateCode>>,
79        #[serde(rename = "appliedPassengerTypes", skip_serializing_if = "Option::is_none")]
80        applied_passenger_types: Option<Vec<models::AppliedPassengerType>>,
81        #[serde(rename = "appliedPromotionCodes", skip_serializing_if = "Option::is_none")]
82        applied_promotion_codes: Option<Vec<models::PromotionCode>>,
83        #[serde(rename = "appliedReductionCardTypes", skip_serializing_if = "Option::is_none")]
84        applied_reduction_card_types: Option<Vec<models::ReductionCardType>>,
85        #[serde(rename = "regionalValiditySummary", skip_serializing_if = "Option::is_none")]
86        regional_validity_summary: Option<Box<models::RegionalValiditySummary>>,
87        #[serde(rename = "indicatedConsumption", skip_serializing_if = "Option::is_none")]
88        indicated_consumption: Option<Box<models::IndicatedConsumption>>,
89        #[serde(rename = "grantedReductionAmounts", skip_serializing_if = "Option::is_none")]
90        granted_reduction_amounts: Option<Box<models::GrantedReductionAmounts>>,
91        /// Java Property Name: 'links' 
92        #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
93        _links: Option<Vec<models::Link>>,
94    },
95    #[serde(rename="AncillaryOfferPart")]
96    AncillaryOfferPart {
97        #[serde(rename = "id")]
98        id: String,
99        /// A human-readable description of the Offer. 
100        #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
101        summary: Option<String>,
102        #[serde(rename = "createdOn")]
103        created_on: String,
104        /// Time from which on the offer can be used, e.g. travel. 
105        #[serde(rename = "validFrom")]
106        valid_from: String,
107        /// Time until the offer can be used, e.g. travel. 
108        #[serde(rename = "validUntil", skip_serializing_if = "Option::is_none")]
109        valid_until: Option<String>,
110        #[serde(rename = "price")]
111        price: Box<models::Price>,
112        #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
113        trip_coverage: Option<Box<models::TripCoverage>>,
114        #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
115        inbound_trip_coverage: Option<Box<models::TripCoverage>>,
116        /// Indicates until when the price for the given offer is guaranteed. 
117        #[serde(rename = "priceGuaranteedUntil", skip_serializing_if = "Option::is_none")]
118        price_guaranteed_until: Option<String>,
119        #[serde(rename = "offerMode")]
120        offer_mode: models::OfferMode,
121        /// Indicates whether the offerId can be used in more than one booking. 
122        #[serde(rename = "isReusable", skip_serializing_if = "Option::is_none")]
123        is_reusable: Option<bool>,
124        #[serde(rename = "passengerRefs")]
125        passenger_refs: Vec<String>,
126        /// 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. 
127        #[serde(rename = "numericAvailability", skip_serializing_if = "Option::is_none")]
128        numeric_availability: Option<i32>,
129        #[serde(rename = "refundable")]
130        refundable: models::RefundType,
131        #[serde(rename = "exchangeable")]
132        exchangeable: models::ExchangeableType,
133        #[serde(rename = "afterSalesConditions", skip_serializing_if = "Option::is_none")]
134        after_sales_conditions: Option<Vec<models::AfterSaleCondition>>,
135        /// 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. 
136        #[serde(rename = "tripTags", skip_serializing_if = "Option::is_none")]
137        trip_tags: Option<Vec<String>>,
138        /// 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. 
139        #[serde(rename = "returnTags", skip_serializing_if = "Option::is_none")]
140        return_tags: Option<Vec<String>>,
141        #[serde(rename = "offerTag", skip_serializing_if = "Option::is_none")]
142        offer_tag: Option<Box<models::OfferTag>>,
143        /// 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. 
144        #[serde(rename = "requestedInformation", skip_serializing_if = "Option::is_none")]
145        requested_information: Option<String>,
146        /// 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
147        #[serde(rename = "summaryProductId", skip_serializing_if = "Option::is_none")]
148        summary_product_id: Option<String>,
149        #[serde(rename = "products")]
150        products: Vec<models::ProductLegAssociation>,
151        #[serde(rename = "availableFulfillmentOptions")]
152        available_fulfillment_options: Vec<models::FulfillmentOption>,
153        #[serde(rename = "appliedCorporateCodes", skip_serializing_if = "Option::is_none")]
154        applied_corporate_codes: Option<Vec<models::CorporateCode>>,
155        #[serde(rename = "appliedPassengerTypes", skip_serializing_if = "Option::is_none")]
156        applied_passenger_types: Option<Vec<models::AppliedPassengerType>>,
157        #[serde(rename = "appliedPromotionCodes", skip_serializing_if = "Option::is_none")]
158        applied_promotion_codes: Option<Vec<models::PromotionCode>>,
159        #[serde(rename = "appliedReductionCardTypes", skip_serializing_if = "Option::is_none")]
160        applied_reduction_card_types: Option<Vec<models::ReductionCardType>>,
161        #[serde(rename = "regionalValiditySummary", skip_serializing_if = "Option::is_none")]
162        regional_validity_summary: Option<Box<models::RegionalValiditySummary>>,
163        #[serde(rename = "indicatedConsumption", skip_serializing_if = "Option::is_none")]
164        indicated_consumption: Option<Box<models::IndicatedConsumption>>,
165        #[serde(rename = "grantedReductionAmounts", skip_serializing_if = "Option::is_none")]
166        granted_reduction_amounts: Option<Box<models::GrantedReductionAmounts>>,
167        /// Java Property Name: 'links' 
168        #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
169        _links: Option<Vec<models::Link>>,
170    },
171    #[serde(rename="ReservationOfferPart")]
172    ReservationOfferPart {
173        #[serde(rename = "id")]
174        id: String,
175        /// A human-readable description of the Offer. 
176        #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
177        summary: Option<String>,
178        #[serde(rename = "createdOn")]
179        created_on: String,
180        /// Time from which on the offer can be used, e.g. travel. 
181        #[serde(rename = "validFrom")]
182        valid_from: String,
183        /// Time until the offer can be used, e.g. travel. 
184        #[serde(rename = "validUntil", skip_serializing_if = "Option::is_none")]
185        valid_until: Option<String>,
186        #[serde(rename = "price")]
187        price: Box<models::Price>,
188        #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
189        trip_coverage: Option<Box<models::TripCoverage>>,
190        #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
191        inbound_trip_coverage: Option<Box<models::TripCoverage>>,
192        /// Indicates until when the price for the given offer is guaranteed. 
193        #[serde(rename = "priceGuaranteedUntil", skip_serializing_if = "Option::is_none")]
194        price_guaranteed_until: Option<String>,
195        #[serde(rename = "offerMode")]
196        offer_mode: models::OfferMode,
197        /// Indicates whether the offerId can be used in more than one booking. 
198        #[serde(rename = "isReusable", skip_serializing_if = "Option::is_none")]
199        is_reusable: Option<bool>,
200        #[serde(rename = "passengerRefs")]
201        passenger_refs: Vec<String>,
202        /// 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. 
203        #[serde(rename = "numericAvailability", skip_serializing_if = "Option::is_none")]
204        numeric_availability: Option<i32>,
205        #[serde(rename = "refundable")]
206        refundable: models::RefundType,
207        #[serde(rename = "exchangeable")]
208        exchangeable: models::ExchangeableType,
209        #[serde(rename = "afterSalesConditions", skip_serializing_if = "Option::is_none")]
210        after_sales_conditions: Option<Vec<models::AfterSaleCondition>>,
211        /// 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. 
212        #[serde(rename = "tripTags", skip_serializing_if = "Option::is_none")]
213        trip_tags: Option<Vec<String>>,
214        /// 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. 
215        #[serde(rename = "returnTags", skip_serializing_if = "Option::is_none")]
216        return_tags: Option<Vec<String>>,
217        #[serde(rename = "offerTag", skip_serializing_if = "Option::is_none")]
218        offer_tag: Option<Box<models::OfferTag>>,
219        /// 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. 
220        #[serde(rename = "requestedInformation", skip_serializing_if = "Option::is_none")]
221        requested_information: Option<String>,
222        /// 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
223        #[serde(rename = "summaryProductId", skip_serializing_if = "Option::is_none")]
224        summary_product_id: Option<String>,
225        #[serde(rename = "products")]
226        products: Vec<models::ProductLegAssociation>,
227        #[serde(rename = "availableFulfillmentOptions")]
228        available_fulfillment_options: Vec<models::FulfillmentOption>,
229        #[serde(rename = "appliedCorporateCodes", skip_serializing_if = "Option::is_none")]
230        applied_corporate_codes: Option<Vec<models::CorporateCode>>,
231        #[serde(rename = "appliedPassengerTypes", skip_serializing_if = "Option::is_none")]
232        applied_passenger_types: Option<Vec<models::AppliedPassengerType>>,
233        #[serde(rename = "appliedPromotionCodes", skip_serializing_if = "Option::is_none")]
234        applied_promotion_codes: Option<Vec<models::PromotionCode>>,
235        #[serde(rename = "appliedReductionCardTypes", skip_serializing_if = "Option::is_none")]
236        applied_reduction_card_types: Option<Vec<models::ReductionCardType>>,
237        #[serde(rename = "regionalValiditySummary", skip_serializing_if = "Option::is_none")]
238        regional_validity_summary: Option<Box<models::RegionalValiditySummary>>,
239        #[serde(rename = "indicatedConsumption", skip_serializing_if = "Option::is_none")]
240        indicated_consumption: Option<Box<models::IndicatedConsumption>>,
241        #[serde(rename = "grantedReductionAmounts", skip_serializing_if = "Option::is_none")]
242        granted_reduction_amounts: Option<Box<models::GrantedReductionAmounts>>,
243        /// Java Property Name: 'links' 
244        #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
245        _links: Option<Vec<models::Link>>,
246    },
247}
248
249impl Default for AbstractOfferPart {
250    fn default() -> Self {
251        Self::AdmissionOfferPart {
252            id: Default::default(),
253            summary: Default::default(),
254            created_on: Default::default(),
255            valid_from: Default::default(),
256            valid_until: Default::default(),
257            price: Default::default(),
258            trip_coverage: Default::default(),
259            inbound_trip_coverage: Default::default(),
260            price_guaranteed_until: Default::default(),
261            offer_mode: Default::default(),
262            is_reusable: Default::default(),
263            passenger_refs: Default::default(),
264            numeric_availability: Default::default(),
265            refundable: Default::default(),
266            exchangeable: Default::default(),
267            after_sales_conditions: Default::default(),
268            trip_tags: Default::default(),
269            return_tags: Default::default(),
270            offer_tag: Default::default(),
271            requested_information: Default::default(),
272            summary_product_id: Default::default(),
273            products: Default::default(),
274            available_fulfillment_options: Default::default(),
275            applied_corporate_codes: Default::default(),
276            applied_passenger_types: Default::default(),
277            applied_promotion_codes: Default::default(),
278            applied_reduction_card_types: Default::default(),
279            regional_validity_summary: Default::default(),
280            indicated_consumption: Default::default(),
281            granted_reduction_amounts: Default::default(),
282            _links: Default::default(),
283        }
284        
285    }
286}
287
288