osdm_sys/models/
passenger_category.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/// PassengerCategory : Passenger Category predefines a set of passenger specification properties that result to offer of a specific passenger type.  `title` is the localized name of the passenger category and `specification` describes exact passenger specification that may results into offer for selected passenger category. Passenger category specification doesn't guarante availability of expected passenger type on offered trip. `appliedPassengerType` must always be checked in the offer response. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PassengerCategory {
17    /// Indicate whether this passenger category should be preselected  as a default option in the passenger selection. Usually results  to a \"full fare\" or \"adult fare\" offers. 
18    #[serde(rename = "base", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19    pub base: Option<Option<bool>>,
20    /// Indicate whether this passenger category should be always visible in UI or folded into \"additional\" section. 
21    #[serde(rename = "additional", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub additional: Option<Option<bool>>,
23    #[serde(rename = "title")]
24    pub title: Box<models::Text>,
25    #[serde(rename = "specification")]
26    pub specification: Box<models::AnonymousPassengerSpecification>,
27}
28
29impl PassengerCategory {
30    /// Passenger Category predefines a set of passenger specification properties that result to offer of a specific passenger type.  `title` is the localized name of the passenger category and `specification` describes exact passenger specification that may results into offer for selected passenger category. Passenger category specification doesn't guarante availability of expected passenger type on offered trip. `appliedPassengerType` must always be checked in the offer response. 
31    pub fn new(title: models::Text, specification: models::AnonymousPassengerSpecification) -> PassengerCategory {
32        PassengerCategory {
33            base: None,
34            additional: None,
35            title: Box::new(title),
36            specification: Box::new(specification),
37        }
38    }
39}
40