osdm_sys/models/
ancillary.rs

1/*
2 * UIC 90918-10 - OSDM
3 *
4 * Specifications for the OSDM API standard. The OSDM specification supports two modes of operation: Retailer Mode and Distributor Mode. The API works identically in both modes, except that in distributor mode the API also returns fare information.  The following resources are key to get started:    -  [Processes](https://osdm.io/spec/processes/)   -  [Models](https://osdm.io/spec/models/)   -  [Getting started](https://osdm.io/spec/getting-started/) 
5 *
6 * The version of the OpenAPI document: 3.7.0
7 * Contact: osdm@uic.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Ancillary {
16    /// Attribute is used as discriminator for inheritance between data types.
17    #[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    /// Validity of offer towards passenger 
24    #[serde(rename = "createdOn")]
25    pub created_on: String,
26    /// confirmationTimeLimit in booking should be used. Date until the booking part needs to be confirmed. Must be provided for a booking part in PREBOOKED stated. For later states, the value is ignored and can be null. 
27    #[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    /// Validity of offer towards passenger 
32    #[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    /// Id of the product representing the commercial attributes of this booking part. Although not currently mandatory, this attribute should in all cases be filled in order to allow matching a booking response to the data in the booking request 
47    #[serde(rename = "summaryProductId", skip_serializing_if = "Option::is_none")]
48    pub summary_product_id: Option<String>,
49    /// In offer mode, in almost all cases exactly one product is referenced. Only on some French trips consisting of a TGV and a TER two products need to be used. In fare mode, no product exists as first needs to created from the different fares. 
50    #[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    /// payment status in post-payment scenarios
55    #[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    /// The unique booking code for the part in the provider system. 
60    #[serde(rename = "bookingPartCode", skip_serializing_if = "Option::is_none")]
61    pub booking_part_code: Option<String>,
62    /// reference to the booking in the downstream distributor system 
63    #[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    /// reference to the booking in the downstream distributor system 
66    #[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    /// Id of the passenger 
69    #[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    /// Fine grained specification of the after sale condition of the booking. 
78    #[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    /// Values from the [Ancillary Category Code List](https://osdm.io/spec/catalog-of-code-lists/#AncillaryCategory) Listed values here are examples. 
99    #[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