osdm_sys/models/
ancillary_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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AncillaryOfferPart {
16    /// Attribute is used as discriminator for inheritance between data types.
17    #[serde(rename = "objectType")]
18    pub object_type: String,
19    #[serde(rename = "id")]
20    pub id: String,
21    /// A human-readable description of the Offer. 
22    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub summary: Option<Option<String>>,
24    #[serde(rename = "createdOn")]
25    pub created_on: String,
26    /// Time from which on the offer can be used, e.g. travel. 
27    #[serde(rename = "validFrom")]
28    pub valid_from: String,
29    /// Time until the offer can be used, e.g. travel. 
30    #[serde(rename = "validUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31    pub valid_until: Option<Option<String>>,
32    #[serde(rename = "price")]
33    pub price: Box<models::Price>,
34    #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
35    pub trip_coverage: Option<Box<models::TripCoverage>>,
36    #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
37    pub inbound_trip_coverage: Option<Box<models::TripCoverage>>,
38    /// Indicates until when the price for the given offer is guaranteed. 
39    #[serde(rename = "priceGuaranteedUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
40    pub price_guaranteed_until: Option<Option<String>>,
41    #[serde(rename = "offerMode")]
42    pub offer_mode: models::OfferMode,
43    /// Indicates whether the offerId can be used in more than one booking. 
44    #[serde(rename = "isReusable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
45    pub is_reusable: Option<Option<bool>>,
46    #[serde(rename = "passengerRefs")]
47    pub passenger_refs: Vec<String>,
48    /// 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. 
49    #[serde(rename = "numericAvailability", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
50    pub numeric_availability: Option<Option<i32>>,
51    #[serde(rename = "refundable")]
52    pub refundable: models::RefundType,
53    #[serde(rename = "exchangeable")]
54    pub exchangeable: models::ExchangeableType,
55    #[serde(rename = "afterSalesConditions", skip_serializing_if = "Option::is_none")]
56    pub after_sales_conditions: Option<Vec<models::AfterSaleCondition>>,
57    /// 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. 
58    #[serde(rename = "tripTags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
59    pub trip_tags: Option<Option<Vec<String>>>,
60    /// 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. 
61    #[serde(rename = "returnTags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
62    pub return_tags: Option<Option<Vec<String>>>,
63    #[serde(rename = "offerTag", skip_serializing_if = "Option::is_none")]
64    pub offer_tag: Option<Box<models::OfferTag>>,
65    /// 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. 
66    #[serde(rename = "requestedInformation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
67    pub requested_information: Option<Option<String>>,
68    /// 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
69    #[serde(rename = "summaryProductId", skip_serializing_if = "Option::is_none")]
70    pub summary_product_id: Option<String>,
71    #[serde(rename = "products")]
72    pub products: Vec<models::ProductLegAssociation>,
73    #[serde(rename = "availableFulfillmentOptions")]
74    pub available_fulfillment_options: Vec<models::FulfillmentOption>,
75    #[serde(rename = "appliedCorporateCodes", skip_serializing_if = "Option::is_none")]
76    pub applied_corporate_codes: Option<Vec<models::CorporateCode>>,
77    #[serde(rename = "appliedPassengerTypes", skip_serializing_if = "Option::is_none")]
78    pub applied_passenger_types: Option<Vec<models::AppliedPassengerType>>,
79    #[serde(rename = "appliedPromotionCodes", skip_serializing_if = "Option::is_none")]
80    pub applied_promotion_codes: Option<Vec<models::PromotionCode>>,
81    #[serde(rename = "appliedReductionCardTypes", skip_serializing_if = "Option::is_none")]
82    pub applied_reduction_card_types: Option<Vec<models::ReductionCardType>>,
83    #[serde(rename = "regionalValiditySummary", skip_serializing_if = "Option::is_none")]
84    pub regional_validity_summary: Option<Box<models::RegionalValiditySummary>>,
85    #[serde(rename = "indicatedConsumption", skip_serializing_if = "Option::is_none")]
86    pub indicated_consumption: Option<Box<models::IndicatedConsumption>>,
87    #[serde(rename = "grantedReductionAmounts", skip_serializing_if = "Option::is_none")]
88    pub granted_reduction_amounts: Option<Box<models::GrantedReductionAmounts>>,
89    /// Java Property Name: 'links' 
90    #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
91    pub _links: Option<Vec<models::Link>>,
92    #[serde(rename = "feeRefs", skip_serializing_if = "Option::is_none")]
93    pub fee_refs: Option<Vec<models::OfferPartReference>>,
94    /// Categorization of the ancillary such as 'Meal' or 'Gift'. 
95    #[serde(rename = "category", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
96    pub category: Option<Option<String>>,
97    /// Values from the [Ancillary Category Code List](https://osdm.io/spec/catalog-of-code-lists/#AncillaryCategory) Listed values here are examples. 
98    #[serde(rename = "type")]
99    pub r#type: String,
100    #[serde(rename = "reservations", skip_serializing_if = "Option::is_none")]
101    pub reservations: Option<Vec<models::ReservationRelation>>,
102}
103
104impl AncillaryOfferPart {
105    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>, r#type: String) -> AncillaryOfferPart {
106        AncillaryOfferPart {
107            object_type,
108            id,
109            summary: None,
110            created_on,
111            valid_from,
112            valid_until: None,
113            price: Box::new(price),
114            trip_coverage: None,
115            inbound_trip_coverage: None,
116            price_guaranteed_until: None,
117            offer_mode,
118            is_reusable: None,
119            passenger_refs,
120            numeric_availability: None,
121            refundable,
122            exchangeable,
123            after_sales_conditions: None,
124            trip_tags: None,
125            return_tags: None,
126            offer_tag: None,
127            requested_information: None,
128            summary_product_id: None,
129            products,
130            available_fulfillment_options,
131            applied_corporate_codes: None,
132            applied_passenger_types: None,
133            applied_promotion_codes: None,
134            applied_reduction_card_types: None,
135            regional_validity_summary: None,
136            indicated_consumption: None,
137            granted_reduction_amounts: None,
138            _links: None,
139            fee_refs: None,
140            category: None,
141            r#type,
142            reservations: None,
143        }
144    }
145}
146