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