osdm_sys/models/
product_request_offer_selection.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/// ProductRequestOfferSelection : product selection by product code or product tag for an offer request (exactly one of `productCode` and `productTag` must be provided). The number of items indicates the quantity  to be required. Passengers must be referenced in case the product is intended for passengers. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ProductRequestOfferSelection {
17    #[serde(rename = "productCode", skip_serializing_if = "Option::is_none")]
18    pub product_code: Option<String>,
19    #[serde(rename = "productTag", skip_serializing_if = "Option::is_none")]
20    pub product_tag: Option<String>,
21    #[serde(rename = "numberOfItems", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub number_of_items: Option<Option<i32>>,
23    #[serde(rename = "externalPassengerRefs", skip_serializing_if = "Option::is_none")]
24    pub external_passenger_refs: Option<Vec<String>>,
25}
26
27impl ProductRequestOfferSelection {
28    /// product selection by product code or product tag for an offer request (exactly one of `productCode` and `productTag` must be provided). The number of items indicates the quantity  to be required. Passengers must be referenced in case the product is intended for passengers. 
29    pub fn new() -> ProductRequestOfferSelection {
30        ProductRequestOfferSelection {
31            product_code: None,
32            product_tag: None,
33            number_of_items: None,
34            external_passenger_refs: None,
35        }
36    }
37}
38