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