osdm_sys/models/
offer_selection.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/// OfferSelection : The Ids of the offers to be booked need to be passed in. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OfferSelection {
17    /// id of the selected offer or exchangeOffer 
18    #[serde(rename = "offerId")]
19    pub offer_id: String,
20    /// A stable reference to the id of the offer in the caller's system. When received in input of a request, it must be persisted and echoed back in the response. 
21    #[serde(rename = "externalRef", skip_serializing_if = "Option::is_none")]
22    pub external_ref: Option<String>,
23    /// Mandatory reservations are booked when the booking is being booked. 
24    #[serde(rename = "optionalReservationSelections", skip_serializing_if = "Option::is_none")]
25    pub optional_reservation_selections: Option<Vec<models::ReservationSelection>>,
26    #[serde(rename = "optionalAncillarySelections", skip_serializing_if = "Option::is_none")]
27    pub optional_ancillary_selections: Option<Vec<models::AncillarySelection>>,
28    #[serde(rename = "placeSelections", skip_serializing_if = "Option::is_none")]
29    pub place_selections: Option<Vec<models::PlaceSelection>>,
30    /// in case the distributor has proposed this offer in conjunction with an offer of another provider constrained by a combinationTag, this flag must be set to true to indicate to the provider that after-sale must be done on the totality of the distributor's booking. Only after-sale requests triggered by the distributor can be safely processed on this offer. When the flag is not set, standard provider logic applies. 
31    #[serde(rename = "afterSaleByRetailerOnly", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub after_sale_by_retailer_only: Option<Option<bool>>,
33    #[serde(rename = "appliedRegulatoryCondition", skip_serializing_if = "Option::is_none")]
34    pub applied_regulatory_condition: Option<models::RegulatoryCondition>,
35    #[serde(rename = "passengerRefs")]
36    pub passenger_refs: Vec<String>,
37    #[serde(rename = "throughTicketTags", skip_serializing_if = "Option::is_none")]
38    pub through_ticket_tags: Option<Vec<String>>,
39}
40
41impl OfferSelection {
42    /// The Ids of the offers to be booked need to be passed in. 
43    pub fn new(offer_id: String, passenger_refs: Vec<String>) -> OfferSelection {
44        OfferSelection {
45            offer_id,
46            external_ref: None,
47            optional_reservation_selections: None,
48            optional_ancillary_selections: None,
49            place_selections: None,
50            after_sale_by_retailer_only: None,
51            applied_regulatory_condition: None,
52            passenger_refs,
53            through_ticket_tags: None,
54        }
55    }
56}
57