osdm_sys/models/
exchange_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/// ExchangeOfferCollectionRequest : Defines the parameters needed to request an exchange offer, either based on either an existing trip (that is then passed in) plus a set of offer search criteria, or based on trip-search and offer search criteria. At least one of the trip or tripSearchCriteria must be set. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ExchangeOfferCollectionRequest {
17    #[serde(rename = "fulfillmentIds")]
18    pub fulfillment_ids: Vec<String>,
19    /// Reason for and type of an after sale, code list in IRS 90918-10. The PRM_SUPPORT_UNAVAILABLE overrule code shall only be used by the UIC PRM ABT tool. Values from the [Overrule Codes Code List](https://osdm.io/spec/catalog-of-code-lists/#OverruleCode) Listed values here are examples.    - 'CONNECTION_BROKEN' - 'DEATH' - 'EQUIPMENT_FAILURE' - 'PAYMENT_FAILURE' - 'PRM_SUPPORT_UNAVAILABLE' - 'SALES_STAFF_ERROR' - 'STOP_NOT_SERVED' - 'STRIKE' - 'TECHNICAL_FAILURE' - 'TICKET_NOT_USED' - 'INABILITY_TO_TRAVEL': Inability to travel due to accident or sickness. - 'EXTERNAL_COMPENSATION': Offer has been compensated outside of the provider system in another way. - 'DISRUPTION': Inability to operate due to disruption. - 'JOURNEY_OBSOLETE': Due to external factors it's senseless to start the trip, thus the travel is obsolete. - 'CERTIFIED_MEDICAL_CONDITION': A medical certificate certifies that the passenger is unable to travel. - 'DELAY_COMPENSATION': Allows to override conditions in context of passenger rights regulation (PRR). 
20    #[serde(rename = "overruleCode", skip_serializing_if = "Option::is_none")]
21    pub overrule_code: Option<String>,
22    #[serde(rename = "tripSpecifications", skip_serializing_if = "Option::is_none")]
23    pub trip_specifications: Option<Vec<models::TripSpecification>>,
24    #[serde(rename = "tripIds", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub trip_ids: Option<Option<Vec<String>>>,
26    #[serde(rename = "tripSearchCriteria", skip_serializing_if = "Option::is_none")]
27    pub trip_search_criteria: Option<Box<models::TripSearchCriteria>>,
28    #[serde(rename = "nonTripSearchCriteria", skip_serializing_if = "Option::is_none")]
29    pub non_trip_search_criteria: Option<Box<models::NonTripSearchCriteria>>,
30    #[serde(rename = "requestedSections", skip_serializing_if = "Option::is_none")]
31    pub requested_sections: Option<Vec<models::Section>>,
32    #[serde(rename = "offerSearchCriteria", skip_serializing_if = "Option::is_none")]
33    pub offer_search_criteria: Option<Box<models::OfferSearchCriteria>>,
34    #[serde(rename = "anonymousPassengerSpecifications")]
35    pub anonymous_passenger_specifications: Vec<models::AnonymousPassengerSpecification>,
36    #[serde(rename = "corporateCodes", skip_serializing_if = "Option::is_none")]
37    pub corporate_codes: Option<Vec<models::CorporateCode>>,
38    #[serde(rename = "promotionCodes", skip_serializing_if = "Option::is_none")]
39    pub promotion_codes: Option<Vec<models::PromotionCode>>,
40    #[serde(rename = "requestedFulfillmentOptions", skip_serializing_if = "Option::is_none")]
41    pub requested_fulfillment_options: Option<Vec<models::FulfillmentOption>>,
42    #[serde(rename = "embed", skip_serializing_if = "Option::is_none")]
43    pub embed: Option<Vec<models::OfferCollectionResponseContent>>,
44}
45
46impl ExchangeOfferCollectionRequest {
47    /// Defines the parameters needed to request an exchange offer, either based on either an existing trip (that is then passed in) plus a set of offer search criteria, or based on trip-search and offer search criteria. At least one of the trip or tripSearchCriteria must be set. 
48    pub fn new(fulfillment_ids: Vec<String>, anonymous_passenger_specifications: Vec<models::AnonymousPassengerSpecification>) -> ExchangeOfferCollectionRequest {
49        ExchangeOfferCollectionRequest {
50            fulfillment_ids,
51            overrule_code: None,
52            trip_specifications: None,
53            trip_ids: None,
54            trip_search_criteria: None,
55            non_trip_search_criteria: None,
56            requested_sections: None,
57            offer_search_criteria: None,
58            anonymous_passenger_specifications,
59            corporate_codes: None,
60            promotion_codes: None,
61            requested_fulfillment_options: None,
62            embed: None,
63        }
64    }
65}
66