osdm-sys 0.1.0-alpha.2

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/)
Documentation
/*
 * UIC 90918-10 - OSDM
 *
 * 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/) 
 *
 * The version of the OpenAPI document: 3.7.0
 * Contact: osdm@uic.org
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct BookingSearchRequest {
    #[serde(rename = "origin", skip_serializing_if = "Option::is_none")]
    pub origin: Option<Box<models::PlaceRef>>,
    #[serde(rename = "destination", skip_serializing_if = "Option::is_none")]
    pub destination: Option<Box<models::PlaceRef>>,
    #[serde(rename = "passenger", skip_serializing_if = "Option::is_none")]
    pub passenger: Option<Box<models::PassengerSearchRequest>>,
    #[serde(rename = "purchaser", skip_serializing_if = "Option::is_none")]
    pub purchaser: Option<Box<models::PurchaserSearchRequest>>,
    #[serde(rename = "bookingId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub booking_id: Option<Option<String>>,
    /// reference to the booking in the downstream distributor system 
    #[serde(rename = "bookingCode", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub booking_code: Option<Option<String>>,
    /// reference to the booking in the retailer system
    #[serde(rename = "externalRef", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub external_ref: Option<Option<String>>,
    /// reference to the booking in the downstream distributor system 
    #[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 = "fulfillmentId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub fulfillment_id: Option<Option<String>>,
    #[serde(rename = "fulfillmentControlNumber", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub fulfillment_control_number: Option<Option<String>>,
    #[serde(rename = "travelDateRange", skip_serializing_if = "Option::is_none")]
    pub travel_date_range: Option<Box<models::DateRange>>,
    #[serde(rename = "purchaseDateRange", skip_serializing_if = "Option::is_none")]
    pub purchase_date_range: Option<Box<models::DateRange>>,
    #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")]
    pub parameters: Option<Box<models::BookingSearchParameters>>,
}

impl BookingSearchRequest {
    pub fn new() -> BookingSearchRequest {
        BookingSearchRequest {
            origin: None,
            destination: None,
            passenger: None,
            purchaser: None,
            booking_id: None,
            booking_code: None,
            external_ref: None,
            distributor_booking_ref: None,
            retailer_booking_ref: None,
            fulfillment_id: None,
            fulfillment_control_number: None,
            travel_date_range: None,
            purchase_date_range: None,
            parameters: None,
        }
    }
}