1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Reservation {
17 #[serde(rename = "objectType")]
19 pub object_type: String,
20 #[serde(rename = "id")]
21 pub id: String,
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")]
26 pub created_on: String,
27 #[serde(rename = "confirmableUntil", skip_serializing_if = "Option::is_none")]
29 pub confirmable_until: Option<String>,
30 #[serde(rename = "validFrom")]
31 pub valid_from: String,
32 #[serde(rename = "validUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34 pub valid_until: Option<Option<String>>,
35 #[serde(rename = "confirmedOn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36 pub confirmed_on: Option<Option<String>>,
37 #[serde(rename = "confirmedFulfillmentOptions", skip_serializing_if = "Option::is_none")]
38 pub confirmed_fulfillment_options: Option<Box<models::FulfillmentOption>>,
39 #[serde(rename = "price")]
40 pub price: Box<models::Price>,
41 #[serde(rename = "refundAmount", skip_serializing_if = "Option::is_none")]
42 pub refund_amount: Option<Box<models::Price>>,
43 #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
44 pub trip_coverage: Option<Box<models::TripCoverage>>,
45 #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
46 pub inbound_trip_coverage: Option<Box<models::TripCoverage>>,
47 #[serde(rename = "summaryProductId", skip_serializing_if = "Option::is_none")]
49 pub summary_product_id: Option<String>,
50 #[serde(rename = "products", skip_serializing_if = "Option::is_none")]
52 pub products: Option<Vec<models::ProductLegAssociation>>,
53 #[serde(rename = "status")]
54 pub status: models::BookingPartStatus,
55 #[serde(rename = "pricingStatus", skip_serializing_if = "Option::is_none")]
57 pub pricing_status: Option<String>,
58 #[serde(rename = "offerMode", skip_serializing_if = "Option::is_none")]
59 pub offer_mode: Option<models::OfferMode>,
60 #[serde(rename = "bookingPartCode", skip_serializing_if = "Option::is_none")]
62 pub booking_part_code: Option<String>,
63 #[serde(rename = "distributorBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
65 pub distributor_booking_ref: Option<Option<String>>,
66 #[serde(rename = "retailerBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
68 pub retailer_booking_ref: Option<Option<String>>,
69 #[serde(rename = "passengerIds")]
71 pub passenger_ids: Vec<String>,
72 #[serde(rename = "availableFulfillmentOptions", skip_serializing_if = "Option::is_none")]
73 pub available_fulfillment_options: Option<Vec<models::FulfillmentOption>>,
74 #[serde(rename = "refundable")]
75 pub refundable: models::RefundType,
76 #[serde(rename = "exchangeable")]
77 pub exchangeable: models::ExchangeableType,
78 #[serde(rename = "afterSaleConditions", skip_serializing_if = "Option::is_none")]
80 pub after_sale_conditions: Option<Vec<models::AfterSaleCondition>>,
81 #[serde(rename = "afterSalesOverrideDetails", skip_serializing_if = "Option::is_none")]
82 pub after_sales_override_details: Option<Box<models::AfterSalesOverrideDetails>>,
83 #[serde(rename = "appliedCorporateCodes", skip_serializing_if = "Option::is_none")]
84 pub applied_corporate_codes: Option<Vec<models::CorporateCode>>,
85 #[serde(rename = "appliedPassengerTypes", skip_serializing_if = "Option::is_none")]
86 pub applied_passenger_types: Option<Vec<models::AppliedPassengerType>>,
87 #[serde(rename = "appliedPromotionCodes", skip_serializing_if = "Option::is_none")]
88 pub applied_promotion_codes: Option<Vec<models::PromotionCode>>,
89 #[serde(rename = "appliedReductions", skip_serializing_if = "Option::is_none")]
90 pub applied_reductions: Option<Vec<models::CardReference>>,
91 #[serde(rename = "indicatedConsumption", skip_serializing_if = "Option::is_none")]
92 pub indicated_consumption: Option<Box<models::IndicatedConsumption>>,
93 #[serde(rename = "accountingRef", skip_serializing_if = "Option::is_none")]
94 pub accounting_ref: Option<Box<models::AccountingRef>>,
95 #[serde(rename = "grantedReductionAmounts", skip_serializing_if = "Option::is_none")]
96 pub granted_reduction_amounts: Option<Box<models::GrantedReductionAmounts>>,
97 #[serde(rename = "placeSelection", skip_serializing_if = "Option::is_none")]
98 pub place_selection: Option<Box<models::PlaceSelection>>,
99 #[serde(rename = "placeAllocation", skip_serializing_if = "Option::is_none")]
100 pub place_allocation: Option<Box<models::PlaceAllocation>>,
101 #[serde(rename = "feeRefs", skip_serializing_if = "Option::is_none")]
102 pub fee_refs: Option<Vec<models::BookingPartReference>>,
103 #[serde(rename = "ancillaryRefs", skip_serializing_if = "Option::is_none")]
105 pub ancillary_refs: Option<Vec<models::BookingPartReference>>,
106 #[serde(rename = "availablePlacePreferences", skip_serializing_if = "Option::is_none")]
108 pub available_place_preferences: Option<Vec<models::AvailablePlacePreferences>>,
109 #[serde(rename = "graphicalReservationSupported", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
111 pub graphical_reservation_supported: Option<Option<bool>>,
112 #[serde(rename = "supportedPlaceSelectionFlows", skip_serializing_if = "Option::is_none")]
114 pub supported_place_selection_flows: Option<Vec<String>>,
115}
116
117impl Reservation {
118 pub fn new(object_type: String, id: String, created_on: String, valid_from: String, price: models::Price, status: models::BookingPartStatus, passenger_ids: Vec<String>, refundable: models::RefundType, exchangeable: models::ExchangeableType) -> Reservation {
120 Reservation {
121 object_type,
122 id,
123 summary: None,
124 created_on,
125 confirmable_until: None,
126 valid_from,
127 valid_until: None,
128 confirmed_on: None,
129 confirmed_fulfillment_options: None,
130 price: Box::new(price),
131 refund_amount: None,
132 trip_coverage: None,
133 inbound_trip_coverage: None,
134 summary_product_id: None,
135 products: None,
136 status,
137 pricing_status: None,
138 offer_mode: None,
139 booking_part_code: None,
140 distributor_booking_ref: None,
141 retailer_booking_ref: None,
142 passenger_ids,
143 available_fulfillment_options: None,
144 refundable,
145 exchangeable,
146 after_sale_conditions: None,
147 after_sales_override_details: None,
148 applied_corporate_codes: None,
149 applied_passenger_types: None,
150 applied_promotion_codes: None,
151 applied_reductions: None,
152 indicated_consumption: None,
153 accounting_ref: None,
154 granted_reduction_amounts: None,
155 place_selection: None,
156 place_allocation: None,
157 fee_refs: None,
158 ancillary_refs: None,
159 available_place_preferences: None,
160 graphical_reservation_supported: None,
161 supported_place_selection_flows: None,
162 }
163 }
164}
165