osdm_sys/models/
offer_collection_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/// OfferCollectionRequest : Defines the parameters needed to request an offer. Either a tripSearchCriteria, a list of trip specifications, or a list of tripIds can be passed in to request offers.  If you are searching for fares you pass in the complete trip and the use the requestedSections attribute to define which part(s) you need fares (including virtual border points). 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OfferCollectionRequest {
17    /// ID of trips representing single or outbound trips to be offered.
18    #[serde(rename = "tripIds", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19    pub trip_ids: Option<Option<Vec<String>>>,
20    /// ID of trips representing return or inbound trips to be offered. Fill in only When requesting return products or fares. 
21    #[serde(rename = "inboundTripIds", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub inbound_trip_ids: Option<Option<Vec<String>>>,
23    #[serde(rename = "tripSpecifications", skip_serializing_if = "Option::is_none")]
24    pub trip_specifications: Option<Vec<models::TripSpecification>>,
25    #[serde(rename = "inboundTripSpecifications", skip_serializing_if = "Option::is_none")]
26    pub inbound_trip_specifications: Option<Vec<models::TripSpecification>>,
27    #[serde(rename = "tripSearchCriteria", skip_serializing_if = "Option::is_none")]
28    pub trip_search_criteria: Option<Box<models::TripSearchCriteria>>,
29    #[serde(rename = "tripResponseParameters", skip_serializing_if = "Option::is_none")]
30    pub trip_response_parameters: Option<Box<models::TripResponseParameters>>,
31    #[serde(rename = "nonTripSearchCriteria", skip_serializing_if = "Option::is_none")]
32    pub non_trip_search_criteria: Option<Box<models::NonTripSearchCriteria>>,
33    #[serde(rename = "requestedSections", skip_serializing_if = "Option::is_none")]
34    pub requested_sections: Option<Vec<models::Section>>,
35    #[serde(rename = "offerSearchCriteria", skip_serializing_if = "Option::is_none")]
36    pub offer_search_criteria: Option<Box<models::OfferSearchCriteria>>,
37    #[serde(rename = "anonymousPassengerSpecifications")]
38    pub anonymous_passenger_specifications: Vec<models::AnonymousPassengerSpecification>,
39    #[serde(rename = "corporateCodes", skip_serializing_if = "Option::is_none")]
40    pub corporate_codes: Option<Vec<models::CorporateCode>>,
41    #[serde(rename = "promotionCodes", skip_serializing_if = "Option::is_none")]
42    pub promotion_codes: Option<Vec<models::PromotionCode>>,
43    #[serde(rename = "requestedFulfillmentOptions", skip_serializing_if = "Option::is_none")]
44    pub requested_fulfillment_options: Option<Vec<models::FulfillmentOption>>,
45    /// Influences whether referenced resources are returned in full or as references only. Proposed default ALL 
46    #[serde(rename = "embed", skip_serializing_if = "Option::is_none")]
47    pub embed: Option<Vec<models::OfferCollectionResponseContent>>,
48}
49
50impl OfferCollectionRequest {
51    /// Defines the parameters needed to request an offer. Either a tripSearchCriteria, a list of trip specifications, or a list of tripIds can be passed in to request offers.  If you are searching for fares you pass in the complete trip and the use the requestedSections attribute to define which part(s) you need fares (including virtual border points). 
52    pub fn new(anonymous_passenger_specifications: Vec<models::AnonymousPassengerSpecification>) -> OfferCollectionRequest {
53        OfferCollectionRequest {
54            trip_ids: None,
55            inbound_trip_ids: None,
56            trip_specifications: None,
57            inbound_trip_specifications: None,
58            trip_search_criteria: None,
59            trip_response_parameters: None,
60            non_trip_search_criteria: None,
61            requested_sections: None,
62            offer_search_criteria: None,
63            anonymous_passenger_specifications,
64            corporate_codes: None,
65            promotion_codes: None,
66            requested_fulfillment_options: None,
67            embed: None,
68        }
69    }
70}
71