Skip to main content

osdm_sys/models/
booking_search_request.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)]
15#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
16pub struct BookingSearchRequest {
17    #[serde(rename = "origin", skip_serializing_if = "Option::is_none")]
18    pub origin: Option<Box<models::PlaceRef>>,
19    #[serde(rename = "destination", skip_serializing_if = "Option::is_none")]
20    pub destination: Option<Box<models::PlaceRef>>,
21    #[serde(rename = "passenger", skip_serializing_if = "Option::is_none")]
22    pub passenger: Option<Box<models::PassengerSearchRequest>>,
23    #[serde(rename = "purchaser", skip_serializing_if = "Option::is_none")]
24    pub purchaser: Option<Box<models::PurchaserSearchRequest>>,
25    #[serde(rename = "bookingId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
26    pub booking_id: Option<Option<String>>,
27    /// reference to the booking in the downstream distributor system 
28    #[serde(rename = "bookingCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub booking_code: Option<Option<String>>,
30    /// reference to the booking in the retailer system
31    #[serde(rename = "externalRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
32    pub external_ref: Option<Option<String>>,
33    /// reference to the booking in the downstream distributor system 
34    #[serde(rename = "distributorBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub distributor_booking_ref: Option<Option<String>>,
36    #[serde(rename = "retailerBookingRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub retailer_booking_ref: Option<Option<String>>,
38    #[serde(rename = "fulfillmentId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
39    pub fulfillment_id: Option<Option<String>>,
40    #[serde(rename = "fulfillmentControlNumber", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
41    pub fulfillment_control_number: Option<Option<String>>,
42    #[serde(rename = "travelDateRange", skip_serializing_if = "Option::is_none")]
43    pub travel_date_range: Option<Box<models::DateRange>>,
44    #[serde(rename = "purchaseDateRange", skip_serializing_if = "Option::is_none")]
45    pub purchase_date_range: Option<Box<models::DateRange>>,
46    #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")]
47    pub parameters: Option<Box<models::BookingSearchParameters>>,
48}
49
50impl BookingSearchRequest {
51    pub fn new() -> BookingSearchRequest {
52        BookingSearchRequest {
53            origin: None,
54            destination: None,
55            passenger: None,
56            purchaser: None,
57            booking_id: None,
58            booking_code: None,
59            external_ref: None,
60            distributor_booking_ref: None,
61            retailer_booking_ref: None,
62            fulfillment_id: None,
63            fulfillment_control_number: None,
64            travel_date_range: None,
65            purchase_date_range: None,
66            parameters: None,
67        }
68    }
69}
70