use crate::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct ContinuousServiceBookingPart {
#[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 = "confirmableUntil", skip_serializing_if = "Option::is_none")]
pub confirmable_until: Option<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 = "confirmedOn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub confirmed_on: Option<Option<String>>,
#[serde(rename = "confirmedFulfillmentOptions", skip_serializing_if = "Option::is_none")]
pub confirmed_fulfillment_options: Option<Box<models::FulfillmentOption>>,
#[serde(rename = "price")]
pub price: Box<models::Price>,
#[serde(rename = "refundAmount", skip_serializing_if = "Option::is_none")]
pub refund_amount: Option<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 = "summaryProductId", skip_serializing_if = "Option::is_none")]
pub summary_product_id: Option<String>,
#[serde(rename = "products", skip_serializing_if = "Option::is_none")]
pub products: Option<Vec<models::ProductLegAssociation>>,
#[serde(rename = "status")]
pub status: models::BookingPartStatus,
#[serde(rename = "pricingStatus", skip_serializing_if = "Option::is_none")]
pub pricing_status: Option<String>,
#[serde(rename = "offerMode", skip_serializing_if = "Option::is_none")]
pub offer_mode: Option<models::OfferMode>,
#[serde(rename = "bookingPartCode", skip_serializing_if = "Option::is_none")]
pub booking_part_code: Option<String>,
#[serde(rename = "distributorBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub distributor_booking_ref: Option<Option<String>>,
#[serde(rename = "retailerBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub retailer_booking_ref: Option<Option<String>>,
#[serde(rename = "passengerIds")]
pub passenger_ids: Vec<String>,
#[serde(rename = "availableFulfillmentOptions", skip_serializing_if = "Option::is_none")]
pub available_fulfillment_options: Option<Vec<models::FulfillmentOption>>,
#[serde(rename = "refundable")]
pub refundable: models::RefundType,
#[serde(rename = "exchangeable")]
pub exchangeable: models::ExchangeableType,
#[serde(rename = "afterSaleConditions", skip_serializing_if = "Option::is_none")]
pub after_sale_conditions: Option<Vec<models::AfterSaleCondition>>,
#[serde(rename = "afterSalesOverrideDetails", skip_serializing_if = "Option::is_none")]
pub after_sales_override_details: Option<Box<models::AfterSalesOverrideDetails>>,
#[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 = "appliedReductions", skip_serializing_if = "Option::is_none")]
pub applied_reductions: Option<Vec<models::CardReference>>,
#[serde(rename = "indicatedConsumption", skip_serializing_if = "Option::is_none")]
pub indicated_consumption: Option<Box<models::IndicatedConsumption>>,
#[serde(rename = "accountingRef", skip_serializing_if = "Option::is_none")]
pub accounting_ref: Option<Box<models::AccountingRef>>,
#[serde(rename = "grantedReductionAmounts", skip_serializing_if = "Option::is_none")]
pub granted_reduction_amounts: Option<Box<models::GrantedReductionAmounts>>,
#[serde(rename = "pickUpPlaces")]
pub pick_up_places: Vec<models::ContinuousServicePickUpPlace>,
#[serde(rename = "tipRef", skip_serializing_if = "Option::is_none")]
pub tip_ref: Option<String>,
}
impl ContinuousServiceBookingPart {
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, pick_up_places: Vec<models::ContinuousServicePickUpPlace>) -> ContinuousServiceBookingPart {
ContinuousServiceBookingPart {
object_type,
id,
summary: None,
created_on,
confirmable_until: None,
valid_from,
valid_until: None,
confirmed_on: None,
confirmed_fulfillment_options: None,
price: Box::new(price),
refund_amount: None,
trip_coverage: None,
inbound_trip_coverage: None,
summary_product_id: None,
products: None,
status,
pricing_status: None,
offer_mode: None,
booking_part_code: None,
distributor_booking_ref: None,
retailer_booking_ref: None,
passenger_ids,
available_fulfillment_options: None,
refundable,
exchangeable,
after_sale_conditions: None,
after_sales_override_details: None,
applied_corporate_codes: None,
applied_passenger_types: None,
applied_promotion_codes: None,
applied_reductions: None,
indicated_consumption: None,
accounting_ref: None,
granted_reduction_amounts: None,
pick_up_places,
tip_ref: None,
}
}
}