1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
16pub struct AncillaryOfferPart {
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")]
24 pub summary: Option<Option<String>>,
25 #[serde(rename = "createdOn")]
26 pub created_on: String,
27 #[serde(rename = "validFrom")]
29 pub valid_from: String,
30 #[serde(rename = "validUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32 pub valid_until: Option<Option<String>>,
33 #[serde(rename = "price")]
34 pub price: Box<models::Price>,
35 #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
36 pub trip_coverage: Option<Box<models::TripCoverage>>,
37 #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
38 pub inbound_trip_coverage: Option<Box<models::TripCoverage>>,
39 #[serde(rename = "priceGuaranteedUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41 pub price_guaranteed_until: Option<Option<String>>,
42 #[serde(rename = "offerMode")]
43 pub offer_mode: models::OfferMode,
44 #[serde(rename = "isReusable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
46 pub is_reusable: Option<Option<bool>>,
47 #[serde(rename = "passengerRefs")]
48 pub passenger_refs: Vec<String>,
49 #[serde(rename = "numericAvailability", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
51 pub numeric_availability: Option<Option<i32>>,
52 #[serde(rename = "refundable")]
53 pub refundable: models::RefundType,
54 #[serde(rename = "exchangeable")]
55 pub exchangeable: models::ExchangeableType,
56 #[serde(rename = "afterSalesConditions", skip_serializing_if = "Option::is_none")]
57 pub after_sales_conditions: Option<Vec<models::AfterSaleCondition>>,
58 #[serde(rename = "tripTags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
60 pub trip_tags: Option<Option<Vec<String>>>,
61 #[serde(rename = "returnTags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
63 pub return_tags: Option<Option<Vec<String>>>,
64 #[serde(rename = "offerTag", skip_serializing_if = "Option::is_none")]
65 pub offer_tag: Option<Box<models::OfferTag>>,
66 #[serde(rename = "requestedInformation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
68 pub requested_information: Option<Option<String>>,
69 #[serde(rename = "summaryProductId", skip_serializing_if = "Option::is_none")]
71 pub summary_product_id: Option<String>,
72 #[serde(rename = "products")]
73 pub products: Vec<models::ProductLegAssociation>,
74 #[serde(rename = "availableFulfillmentOptions")]
75 pub available_fulfillment_options: Vec<models::FulfillmentOption>,
76 #[serde(rename = "appliedCorporateCodes", skip_serializing_if = "Option::is_none")]
77 pub applied_corporate_codes: Option<Vec<models::CorporateCode>>,
78 #[serde(rename = "appliedPassengerTypes", skip_serializing_if = "Option::is_none")]
79 pub applied_passenger_types: Option<Vec<models::AppliedPassengerType>>,
80 #[serde(rename = "appliedPromotionCodes", skip_serializing_if = "Option::is_none")]
81 pub applied_promotion_codes: Option<Vec<models::PromotionCode>>,
82 #[serde(rename = "appliedReductionCardTypes", skip_serializing_if = "Option::is_none")]
83 pub applied_reduction_card_types: Option<Vec<models::ReductionCardType>>,
84 #[serde(rename = "regionalValiditySummary", skip_serializing_if = "Option::is_none")]
85 pub regional_validity_summary: Option<Box<models::RegionalValiditySummary>>,
86 #[serde(rename = "indicatedConsumption", skip_serializing_if = "Option::is_none")]
87 pub indicated_consumption: Option<Box<models::IndicatedConsumption>>,
88 #[serde(rename = "grantedReductionAmounts", skip_serializing_if = "Option::is_none")]
89 pub granted_reduction_amounts: Option<Box<models::GrantedReductionAmounts>>,
90 #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
92 pub _links: Option<Vec<models::Link>>,
93 #[serde(rename = "feeRefs", skip_serializing_if = "Option::is_none")]
94 pub fee_refs: Option<Vec<models::OfferPartReference>>,
95 #[serde(rename = "category", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
97 pub category: Option<Option<String>>,
98 #[serde(rename = "type")]
100 pub r#type: String,
101 #[serde(rename = "reservations", skip_serializing_if = "Option::is_none")]
102 pub reservations: Option<Vec<models::ReservationRelation>>,
103}
104
105impl AncillaryOfferPart {
106 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 {
107 AncillaryOfferPart {
108 object_type,
109 id,
110 summary: None,
111 created_on,
112 valid_from,
113 valid_until: None,
114 price: Box::new(price),
115 trip_coverage: None,
116 inbound_trip_coverage: None,
117 price_guaranteed_until: None,
118 offer_mode,
119 is_reusable: None,
120 passenger_refs,
121 numeric_availability: None,
122 refundable,
123 exchangeable,
124 after_sales_conditions: None,
125 trip_tags: None,
126 return_tags: None,
127 offer_tag: None,
128 requested_information: None,
129 summary_product_id: None,
130 products,
131 available_fulfillment_options,
132 applied_corporate_codes: None,
133 applied_passenger_types: None,
134 applied_promotion_codes: None,
135 applied_reduction_card_types: None,
136 regional_validity_summary: None,
137 indicated_consumption: None,
138 granted_reduction_amounts: None,
139 _links: None,
140 fee_refs: None,
141 category: None,
142 r#type,
143 reservations: None,
144 }
145 }
146}
147