1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct AncillaryOfferPart {
16 #[serde(rename = "objectType")]
18 pub object_type: String,
19 #[serde(rename = "id")]
20 pub id: String,
21 #[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 #[serde(rename = "validFrom")]
28 pub valid_from: String,
29 #[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 #[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 #[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 #[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 #[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 #[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 #[serde(rename = "requestedInformation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
67 pub requested_information: Option<Option<String>>,
68 #[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 #[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 #[serde(rename = "category", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
96 pub category: Option<Option<String>>,
97 #[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