use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct AncillaryOfferPart {
#[serde(rename = "objectType")]
pub object_type: String,
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub summary: Option<Option<String>>,
#[serde(rename = "createdOn")]
pub created_on: String,
#[serde(rename = "validFrom")]
pub valid_from: String,
#[serde(rename = "validUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub valid_until: Option<Option<String>>,
#[serde(rename = "price")]
pub price: Box<models::Price>,
#[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
pub trip_coverage: Option<Box<models::TripCoverage>>,
#[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
pub inbound_trip_coverage: Option<Box<models::TripCoverage>>,
#[serde(rename = "priceGuaranteedUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub price_guaranteed_until: Option<Option<String>>,
#[serde(rename = "offerMode")]
pub offer_mode: models::OfferMode,
#[serde(rename = "isReusable", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub is_reusable: Option<Option<bool>>,
#[serde(rename = "passengerRefs")]
pub passenger_refs: Vec<String>,
#[serde(rename = "numericAvailability", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub numeric_availability: Option<Option<i32>>,
#[serde(rename = "refundable")]
pub refundable: models::RefundType,
#[serde(rename = "exchangeable")]
pub exchangeable: models::ExchangeableType,
#[serde(rename = "afterSalesConditions", skip_serializing_if = "Option::is_none")]
pub after_sales_conditions: Option<Vec<models::AfterSaleCondition>>,
#[serde(rename = "tripTags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub trip_tags: Option<Option<Vec<String>>>,
#[serde(rename = "returnTags", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub return_tags: Option<Option<Vec<String>>>,
#[serde(rename = "offerTag", skip_serializing_if = "Option::is_none")]
pub offer_tag: Option<Box<models::OfferTag>>,
#[serde(rename = "requestedInformation", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub requested_information: Option<Option<String>>,
#[serde(rename = "summaryProductId", skip_serializing_if = "Option::is_none")]
pub summary_product_id: Option<String>,
#[serde(rename = "products")]
pub products: Vec<models::ProductLegAssociation>,
#[serde(rename = "availableFulfillmentOptions")]
pub available_fulfillment_options: Vec<models::FulfillmentOption>,
#[serde(rename = "appliedCorporateCodes", skip_serializing_if = "Option::is_none")]
pub applied_corporate_codes: Option<Vec<models::CorporateCode>>,
#[serde(rename = "appliedPassengerTypes", skip_serializing_if = "Option::is_none")]
pub applied_passenger_types: Option<Vec<models::AppliedPassengerType>>,
#[serde(rename = "appliedPromotionCodes", skip_serializing_if = "Option::is_none")]
pub applied_promotion_codes: Option<Vec<models::PromotionCode>>,
#[serde(rename = "appliedReductionCardTypes", skip_serializing_if = "Option::is_none")]
pub applied_reduction_card_types: Option<Vec<models::ReductionCardType>>,
#[serde(rename = "regionalValiditySummary", skip_serializing_if = "Option::is_none")]
pub regional_validity_summary: Option<Box<models::RegionalValiditySummary>>,
#[serde(rename = "indicatedConsumption", skip_serializing_if = "Option::is_none")]
pub indicated_consumption: Option<Box<models::IndicatedConsumption>>,
#[serde(rename = "grantedReductionAmounts", skip_serializing_if = "Option::is_none")]
pub granted_reduction_amounts: Option<Box<models::GrantedReductionAmounts>>,
#[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
pub _links: Option<Vec<models::Link>>,
#[serde(rename = "feeRefs", skip_serializing_if = "Option::is_none")]
pub fee_refs: Option<Vec<models::OfferPartReference>>,
#[serde(rename = "category", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub category: Option<Option<String>>,
#[serde(rename = "type")]
pub r#type: String,
#[serde(rename = "reservations", skip_serializing_if = "Option::is_none")]
pub reservations: Option<Vec<models::ReservationRelation>>,
}
impl AncillaryOfferPart {
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 {
AncillaryOfferPart {
object_type,
id,
summary: None,
created_on,
valid_from,
valid_until: None,
price: Box::new(price),
trip_coverage: None,
inbound_trip_coverage: None,
price_guaranteed_until: None,
offer_mode,
is_reusable: None,
passenger_refs,
numeric_availability: None,
refundable,
exchangeable,
after_sales_conditions: None,
trip_tags: None,
return_tags: None,
offer_tag: None,
requested_information: None,
summary_product_id: None,
products,
available_fulfillment_options,
applied_corporate_codes: None,
applied_passenger_types: None,
applied_promotion_codes: None,
applied_reduction_card_types: None,
regional_validity_summary: None,
indicated_consumption: None,
granted_reduction_amounts: None,
_links: None,
fee_refs: None,
category: None,
r#type,
reservations: None,
}
}
}