osdm_sys/models/
admission.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/// Admission : An admission represents a travel right, or the entitlement to travel onboard a train between the given origin and destination, following the given route. It does not include a seat reservation. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Admission {
17    /// Attribute is used as discriminator for inheritance between data types.
18    #[serde(rename = "objectType")]
19    pub object_type: String,
20    #[serde(rename = "id")]
21    pub id: String,
22    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub summary: Option<Option<String>>,
24    /// Validity of offer towards passenger 
25    #[serde(rename = "createdOn")]
26    pub created_on: String,
27    /// 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. 
28    #[serde(rename = "confirmableUntil", skip_serializing_if = "Option::is_none")]
29    pub confirmable_until: Option<String>,
30    #[serde(rename = "validFrom")]
31    pub valid_from: String,
32    /// Validity of offer towards passenger 
33    #[serde(rename = "validUntil", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34    pub valid_until: Option<Option<String>>,
35    #[serde(rename = "confirmedOn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub confirmed_on: Option<Option<String>>,
37    #[serde(rename = "confirmedFulfillmentOptions", skip_serializing_if = "Option::is_none")]
38    pub confirmed_fulfillment_options: Option<Box<models::FulfillmentOption>>,
39    #[serde(rename = "price")]
40    pub price: Box<models::Price>,
41    #[serde(rename = "refundAmount", skip_serializing_if = "Option::is_none")]
42    pub refund_amount: Option<Box<models::Price>>,
43    #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
44    pub trip_coverage: Option<Box<models::TripCoverage>>,
45    #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
46    pub inbound_trip_coverage: Option<Box<models::TripCoverage>>,
47    /// 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 
48    #[serde(rename = "summaryProductId", skip_serializing_if = "Option::is_none")]
49    pub summary_product_id: Option<String>,
50    /// 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. 
51    #[serde(rename = "products", skip_serializing_if = "Option::is_none")]
52    pub products: Option<Vec<models::ProductLegAssociation>>,
53    #[serde(rename = "status")]
54    pub status: models::BookingPartStatus,
55    /// payment status in post-payment scenarios
56    #[serde(rename = "pricingStatus", skip_serializing_if = "Option::is_none")]
57    pub pricing_status: Option<String>,
58    #[serde(rename = "offerMode", skip_serializing_if = "Option::is_none")]
59    pub offer_mode: Option<models::OfferMode>,
60    /// The unique booking code for the part in the provider system. 
61    #[serde(rename = "bookingPartCode", skip_serializing_if = "Option::is_none")]
62    pub booking_part_code: Option<String>,
63    /// reference to the booking in the downstream distributor system 
64    #[serde(rename = "distributorBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
65    pub distributor_booking_ref: Option<Option<String>>,
66    /// reference to the booking in the downstream distributor system 
67    #[serde(rename = "retailerBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
68    pub retailer_booking_ref: Option<Option<String>>,
69    /// Id of the passenger 
70    #[serde(rename = "passengerIds")]
71    pub passenger_ids: Vec<String>,
72    #[serde(rename = "availableFulfillmentOptions", skip_serializing_if = "Option::is_none")]
73    pub available_fulfillment_options: Option<Vec<models::FulfillmentOption>>,
74    #[serde(rename = "refundable")]
75    pub refundable: models::RefundType,
76    #[serde(rename = "exchangeable")]
77    pub exchangeable: models::ExchangeableType,
78    /// Fine grained specification of the after sale condition of the booking. 
79    #[serde(rename = "afterSaleConditions", skip_serializing_if = "Option::is_none")]
80    pub after_sale_conditions: Option<Vec<models::AfterSaleCondition>>,
81    #[serde(rename = "afterSalesOverrideDetails", skip_serializing_if = "Option::is_none")]
82    pub after_sales_override_details: Option<Box<models::AfterSalesOverrideDetails>>,
83    #[serde(rename = "appliedCorporateCodes", skip_serializing_if = "Option::is_none")]
84    pub applied_corporate_codes: Option<Vec<models::CorporateCode>>,
85    #[serde(rename = "appliedPassengerTypes", skip_serializing_if = "Option::is_none")]
86    pub applied_passenger_types: Option<Vec<models::AppliedPassengerType>>,
87    #[serde(rename = "appliedPromotionCodes", skip_serializing_if = "Option::is_none")]
88    pub applied_promotion_codes: Option<Vec<models::PromotionCode>>,
89    #[serde(rename = "appliedReductions", skip_serializing_if = "Option::is_none")]
90    pub applied_reductions: Option<Vec<models::CardReference>>,
91    #[serde(rename = "indicatedConsumption", skip_serializing_if = "Option::is_none")]
92    pub indicated_consumption: Option<Box<models::IndicatedConsumption>>,
93    #[serde(rename = "accountingRef", skip_serializing_if = "Option::is_none")]
94    pub accounting_ref: Option<Box<models::AccountingRef>>,
95    #[serde(rename = "grantedReductionAmounts", skip_serializing_if = "Option::is_none")]
96    pub granted_reduction_amounts: Option<Box<models::GrantedReductionAmounts>>,
97    #[serde(rename = "regionalValidity", skip_serializing_if = "Option::is_none")]
98    pub regional_validity: Option<Box<models::RegionalValidity>>,
99    /// This contains multiple regional validities for this item and replaces the `regionalValidity` (deprecated) attribute.
100    #[serde(rename = "regionalValidities", skip_serializing_if = "Option::is_none")]
101    pub regional_validities: Option<Vec<models::RegionalValidity>>,
102    #[serde(rename = "isReservationRequired", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
103    pub is_reservation_required: Option<Option<bool>>,
104    #[serde(rename = "feeRefs", skip_serializing_if = "Option::is_none")]
105    pub fee_refs: Option<Vec<models::BookingPartReference>>,
106    #[serde(rename = "reservationRefs", skip_serializing_if = "Option::is_none")]
107    pub reservation_refs: Option<Vec<models::BookingPartReference>>,
108    #[serde(rename = "ancillaryRefs", skip_serializing_if = "Option::is_none")]
109    pub ancillary_refs: Option<Vec<models::BookingPartReference>>,
110    #[serde(rename = "regulatoryConditions", skip_serializing_if = "Option::is_none")]
111    pub regulatory_conditions: Option<Vec<models::RegulatoryCondition>>,
112}
113
114impl Admission {
115    /// An admission represents a travel right, or the entitlement to travel onboard a train between the given origin and destination, following the given route. It does not include a seat reservation. 
116    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) -> Admission {
117        Admission {
118            object_type,
119            id,
120            summary: None,
121            created_on,
122            confirmable_until: None,
123            valid_from,
124            valid_until: None,
125            confirmed_on: None,
126            confirmed_fulfillment_options: None,
127            price: Box::new(price),
128            refund_amount: None,
129            trip_coverage: None,
130            inbound_trip_coverage: None,
131            summary_product_id: None,
132            products: None,
133            status,
134            pricing_status: None,
135            offer_mode: None,
136            booking_part_code: None,
137            distributor_booking_ref: None,
138            retailer_booking_ref: None,
139            passenger_ids,
140            available_fulfillment_options: None,
141            refundable,
142            exchangeable,
143            after_sale_conditions: None,
144            after_sales_override_details: None,
145            applied_corporate_codes: None,
146            applied_passenger_types: None,
147            applied_promotion_codes: None,
148            applied_reductions: None,
149            indicated_consumption: None,
150            accounting_ref: None,
151            granted_reduction_amounts: None,
152            regional_validity: None,
153            regional_validities: None,
154            is_reservation_required: None,
155            fee_refs: None,
156            reservation_refs: None,
157            ancillary_refs: None,
158            regulatory_conditions: None,
159        }
160    }
161}
162