1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*
* UIC 90918-10 - OSDM
*
* 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/)
*
* The version of the OpenAPI document: 3.7.0
* Contact: osdm@uic.org
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Passenger : Information about a passenger. Either the date of birth or the age at the time of travel needs to be set. We recommend to use date of birth as it is more stable than age.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct Passenger {
#[serde(rename = "id")]
pub id: String,
/// A human-readable description of the passenger.
#[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub summary: Option<Option<String>>,
/// A stable reference to a passenger from other elements, or from caller system. When passed in passenger specification in an offer request, it must be echoed back in the response.
#[serde(rename = "externalRef")]
pub external_ref: String,
/// date of birth of the passenger
#[serde(rename = "dateOfBirth", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub date_of_birth: Option<Option<String>>,
#[serde(rename = "age", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub age: Option<Option<i32>>,
/// Passenger type according to UIC passenger, i.e. passenger type list. Values from the [Passenger Type Code List](https://osdm.io/spec/catalog-of-code-lists/#PassengerType) Listed values here are examples. Proposed default PERSON
#[serde(rename = "type")]
pub r#type: String,
/// reduction or loyalty cards owned by the passenger
#[serde(rename = "cards", skip_serializing_if = "Option::is_none")]
pub cards: Option<Vec<models::CardReference>>,
#[serde(rename = "gender", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub gender: Option<Option<models::Gender>>,
#[serde(rename = "detail", skip_serializing_if = "Option::is_none")]
pub detail: Option<Box<models::PersonDetail>>,
#[serde(rename = "identificationCard", skip_serializing_if = "Option::is_none")]
pub identification_card: Option<Box<models::IdentificationCard>>,
#[serde(rename = "transportableDetails", skip_serializing_if = "Option::is_none")]
pub transportable_details: Option<Box<models::Transportable>>,
/// For the persons with reduced mobility (PRMs) its specific needs for support are expressed.
#[serde(rename = "prmNeeds", skip_serializing_if = "Option::is_none")]
pub prm_needs: Option<Vec<String>>,
/// Java Property Name: 'links'
#[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
pub _links: Option<Vec<models::Link>>,
}
impl Passenger {
/// Information about a passenger. Either the date of birth or the age at the time of travel needs to be set. We recommend to use date of birth as it is more stable than age.
pub fn new(id: String, external_ref: String, r#type: String) -> Passenger {
Passenger {
id,
summary: None,
external_ref,
date_of_birth: None,
age: None,
r#type,
cards: None,
gender: None,
detail: None,
identification_card: None,
transportable_details: None,
prm_needs: None,
_links: None,
}
}
}