1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Ancillary {
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")]
22 pub summary: Option<Option<String>>,
23 #[serde(rename = "createdOn")]
25 pub created_on: String,
26 #[serde(rename = "confirmableUntil", skip_serializing_if = "Option::is_none")]
28 pub confirmable_until: Option<String>,
29 #[serde(rename = "validFrom")]
30 pub valid_from: String,
31 #[serde(rename = "validUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33 pub valid_until: Option<Option<String>>,
34 #[serde(rename = "confirmedOn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35 pub confirmed_on: Option<Option<String>>,
36 #[serde(rename = "confirmedFulfillmentOptions", skip_serializing_if = "Option::is_none")]
37 pub confirmed_fulfillment_options: Option<Box<models::FulfillmentOption>>,
38 #[serde(rename = "price")]
39 pub price: Box<models::Price>,
40 #[serde(rename = "refundAmount", skip_serializing_if = "Option::is_none")]
41 pub refund_amount: Option<Box<models::Price>>,
42 #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
43 pub trip_coverage: Option<Box<models::TripCoverage>>,
44 #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
45 pub inbound_trip_coverage: Option<Box<models::TripCoverage>>,
46 #[serde(rename = "summaryProductId", skip_serializing_if = "Option::is_none")]
48 pub summary_product_id: Option<String>,
49 #[serde(rename = "products", skip_serializing_if = "Option::is_none")]
51 pub products: Option<Vec<models::ProductLegAssociation>>,
52 #[serde(rename = "status")]
53 pub status: models::BookingPartStatus,
54 #[serde(rename = "pricingStatus", skip_serializing_if = "Option::is_none")]
56 pub pricing_status: Option<String>,
57 #[serde(rename = "offerMode", skip_serializing_if = "Option::is_none")]
58 pub offer_mode: Option<models::OfferMode>,
59 #[serde(rename = "bookingPartCode", skip_serializing_if = "Option::is_none")]
61 pub booking_part_code: Option<String>,
62 #[serde(rename = "distributorBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
64 pub distributor_booking_ref: Option<Option<String>>,
65 #[serde(rename = "retailerBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
67 pub retailer_booking_ref: Option<Option<String>>,
68 #[serde(rename = "passengerIds")]
70 pub passenger_ids: Vec<String>,
71 #[serde(rename = "availableFulfillmentOptions", skip_serializing_if = "Option::is_none")]
72 pub available_fulfillment_options: Option<Vec<models::FulfillmentOption>>,
73 #[serde(rename = "refundable")]
74 pub refundable: models::RefundType,
75 #[serde(rename = "exchangeable")]
76 pub exchangeable: models::ExchangeableType,
77 #[serde(rename = "afterSaleConditions", skip_serializing_if = "Option::is_none")]
79 pub after_sale_conditions: Option<Vec<models::AfterSaleCondition>>,
80 #[serde(rename = "afterSalesOverrideDetails", skip_serializing_if = "Option::is_none")]
81 pub after_sales_override_details: Option<Box<models::AfterSalesOverrideDetails>>,
82 #[serde(rename = "appliedCorporateCodes", skip_serializing_if = "Option::is_none")]
83 pub applied_corporate_codes: Option<Vec<models::CorporateCode>>,
84 #[serde(rename = "appliedPassengerTypes", skip_serializing_if = "Option::is_none")]
85 pub applied_passenger_types: Option<Vec<models::AppliedPassengerType>>,
86 #[serde(rename = "appliedPromotionCodes", skip_serializing_if = "Option::is_none")]
87 pub applied_promotion_codes: Option<Vec<models::PromotionCode>>,
88 #[serde(rename = "appliedReductions", skip_serializing_if = "Option::is_none")]
89 pub applied_reductions: Option<Vec<models::CardReference>>,
90 #[serde(rename = "indicatedConsumption", skip_serializing_if = "Option::is_none")]
91 pub indicated_consumption: Option<Box<models::IndicatedConsumption>>,
92 #[serde(rename = "accountingRef", skip_serializing_if = "Option::is_none")]
93 pub accounting_ref: Option<Box<models::AccountingRef>>,
94 #[serde(rename = "grantedReductionAmounts", skip_serializing_if = "Option::is_none")]
95 pub granted_reduction_amounts: Option<Box<models::GrantedReductionAmounts>>,
96 #[serde(rename = "feeRefs", skip_serializing_if = "Option::is_none")]
97 pub fee_refs: Option<Vec<models::BookingPartReference>>,
98 #[serde(rename = "type")]
100 pub r#type: String,
101}
102
103impl Ancillary {
104 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, r#type: String) -> Ancillary {
105 Ancillary {
106 object_type,
107 id,
108 summary: None,
109 created_on,
110 confirmable_until: None,
111 valid_from,
112 valid_until: None,
113 confirmed_on: None,
114 confirmed_fulfillment_options: None,
115 price: Box::new(price),
116 refund_amount: None,
117 trip_coverage: None,
118 inbound_trip_coverage: None,
119 summary_product_id: None,
120 products: None,
121 status,
122 pricing_status: None,
123 offer_mode: None,
124 booking_part_code: None,
125 distributor_booking_ref: None,
126 retailer_booking_ref: None,
127 passenger_ids,
128 available_fulfillment_options: None,
129 refundable,
130 exchangeable,
131 after_sale_conditions: None,
132 after_sales_override_details: None,
133 applied_corporate_codes: None,
134 applied_passenger_types: None,
135 applied_promotion_codes: None,
136 applied_reductions: None,
137 indicated_consumption: None,
138 accounting_ref: None,
139 granted_reduction_amounts: None,
140 fee_refs: None,
141 r#type,
142 }
143 }
144}
145