osdm_sys/models/offer_overview_route_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/// OfferOverviewRouteRequest : Defines the parameters needed to request an offer overview for a route. Travel class and flexibility are optional parameters to filter the desired offers.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OfferOverviewRouteRequest {
17 #[serde(rename = "routeSpecification")]
18 pub route_specification: Box<models::RouteSpecification>,
19 #[serde(rename = "passengerSpecifications")]
20 pub passenger_specifications: Vec<models::AnonymousPassengerSpecification>,
21 #[serde(rename = "startDateTime")]
22 pub start_date_time: String,
23 #[serde(rename = "endDateTime")]
24 pub end_date_time: String,
25 /// Defines the segmentation of the time frame for the offer overview. The default is DAY, which means that one price offer overview is given for each day of the requested time frame (provided there aren't more than one travel classes or flexibilities for one time segment).
26 #[serde(rename = "timeFrameSegmentation", skip_serializing_if = "Option::is_none")]
27 pub time_frame_segmentation: Option<models::TimeFrameSegmentation>,
28 /// Traditional first and second class.
29 #[serde(rename = "travelClass", skip_serializing_if = "Option::is_none")]
30 pub travel_class: Option<String>,
31 #[serde(rename = "flexibility", skip_serializing_if = "Option::is_none")]
32 pub flexibility: Option<String>,
33}
34
35impl OfferOverviewRouteRequest {
36 /// Defines the parameters needed to request an offer overview for a route. Travel class and flexibility are optional parameters to filter the desired offers.
37 pub fn new(route_specification: models::RouteSpecification, passenger_specifications: Vec<models::AnonymousPassengerSpecification>, start_date_time: String, end_date_time: String) -> OfferOverviewRouteRequest {
38 OfferOverviewRouteRequest {
39 route_specification: Box::new(route_specification),
40 passenger_specifications,
41 start_date_time,
42 end_date_time,
43 time_frame_segmentation: None,
44 travel_class: None,
45 flexibility: None,
46 }
47 }
48}
49