osdm_sys/models/return_search_parameters.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/// ReturnSearchParameters : This property can be used in case a return trip is being requested. This will allow to benefit from return-specific fares or product. Only one of `outwardTripIds`, `outwardOfferIds`, or should be provided. `inwardReturnDate` and `outwardOfferTag` should not be used as they are deprecated in 3.7.0 and will be removed in 4.0.0.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ReturnSearchParameters {
17 /// Needs to be provided when creating the collection of outbound travels so that the provider knows when a inbound travel can be expected and propose appropriate product and fares. Superseded by `OfferSearchCriteria.inboundDate`.
18 #[serde(rename = "inwardReturnDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19 pub inward_return_date: Option<Option<String>>,
20 /// Needs to be provided when creating collection of offers covering both outbound and inbound (return) journey.
21 #[serde(rename = "outboundTripIds", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22 pub outbound_trip_ids: Option<Option<Vec<String>>>,
23 /// Needs to be provided when creating the collection of inbound travels so that the provider can relate the inbound travels to the outbound travels context.
24 #[serde(rename = "outwardOfferIds", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25 pub outward_offer_ids: Option<Option<Vec<String>>>,
26 /// Needs to be provided when creating the collection of inbound travels so that the provider knows what the outbound offer is and and propose compatible offers only if desired or mandatory.
27 #[serde(rename = "outwardOfferTag", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28 pub outward_offer_tag: Option<Option<String>>,
29 /// Needs to be in local date time format of the stop. Exactly one of `departureTime` and `arrivalTime` must be provided.
30 #[serde(rename = "departureTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31 pub departure_time: Option<Option<String>>,
32 /// Needs to in be local date time format of the stop. Exactly one of `departureTime` and `arrivalTime` must be provided.
33 #[serde(rename = "arrivalTime", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34 pub arrival_time: Option<Option<String>>,
35 /// Ordered series of points where the journey must pass through. If more than one via point is given all of them must be obeyed - in the correct order. The server is allowed to replace a via stop by equivalent stops. TripDataFilters given at a via apply to the section after that via. To apply a TripDataFilter for the first section (between the origin and the first via), use the TripDataFilter within the TripParameters structure.
36 #[serde(rename = "vias", skip_serializing_if = "Option::is_none")]
37 pub vias: Option<Vec<models::TripVia>>,
38 #[serde(rename = "parameters", skip_serializing_if = "Option::is_none")]
39 pub parameters: Option<Box<models::TripParameters>>,
40}
41
42impl ReturnSearchParameters {
43 /// This property can be used in case a return trip is being requested. This will allow to benefit from return-specific fares or product. Only one of `outwardTripIds`, `outwardOfferIds`, or should be provided. `inwardReturnDate` and `outwardOfferTag` should not be used as they are deprecated in 3.7.0 and will be removed in 4.0.0.
44 pub fn new() -> ReturnSearchParameters {
45 ReturnSearchParameters {
46 inward_return_date: None,
47 outbound_trip_ids: None,
48 outward_offer_ids: None,
49 outward_offer_tag: None,
50 departure_time: None,
51 arrival_time: None,
52 vias: None,
53 parameters: None,
54 }
55 }
56}
57