osdm_sys/models/
offer_overview_trip_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/// OfferOverviewTripRequest : Defines the parameters needed to request an offer overview for a trip. One of tripSearchCriteria, a list of trip specifications, or a list of tripIds must be passed in to request offers. Travel class and flexibility are optional parameters to filter the desired offers. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OfferOverviewTripRequest {
17    #[serde(rename = "tripSpecifications", skip_serializing_if = "Option::is_none")]
18    pub trip_specifications: Option<Vec<models::TripSpecification>>,
19    #[serde(rename = "tripIds", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub trip_ids: Option<Option<Vec<String>>>,
21    #[serde(rename = "tripSearchCriteria", skip_serializing_if = "Option::is_none")]
22    pub trip_search_criteria: Option<Box<models::TripSearchCriteria>>,
23    #[serde(rename = "tripResponseParameters", skip_serializing_if = "Option::is_none")]
24    pub trip_response_parameters: Option<Box<models::TripResponseParameters>>,
25    #[serde(rename = "passengerSpecifications")]
26    pub passenger_specifications: Vec<models::AnonymousPassengerSpecification>,
27    /// Traditional first and second class. 
28    #[serde(rename = "travelClass", skip_serializing_if = "Option::is_none")]
29    pub travel_class: Option<String>,
30    #[serde(rename = "flexibility", skip_serializing_if = "Option::is_none")]
31    pub flexibility: Option<String>,
32}
33
34impl OfferOverviewTripRequest {
35    /// Defines the parameters needed to request an offer overview for a trip. One of tripSearchCriteria, a list of trip specifications, or a list of tripIds must be passed in to request offers. Travel class and flexibility are optional parameters to filter the desired offers. 
36    pub fn new(passenger_specifications: Vec<models::AnonymousPassengerSpecification>) -> OfferOverviewTripRequest {
37        OfferOverviewTripRequest {
38            trip_specifications: None,
39            trip_ids: None,
40            trip_search_criteria: None,
41            trip_response_parameters: None,
42            passenger_specifications,
43            travel_class: None,
44            flexibility: None,
45        }
46    }
47}
48