osdm_sys/models/
identification_card.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/// IdentificationCard : Person identification information  to be exchanged for border control if legally required.  It is not allowed to send personal information not required in the offer reply. It is legally not allowed to send these personal data already in the offer request. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct IdentificationCard {
17    /// Identifier on the document. 
18    #[serde(rename = "id")]
19    pub id: String,
20    /// Refer to code list for values 
21    #[serde(rename = "type")]
22    pub r#type: String,
23    /// ICAO transliteration identical as written in the document 
24    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25    pub name: Option<Option<String>>,
26    /// ISO 3166-1 alpha-2 2 character country code 
27    #[serde(rename = "nationality", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub nationality: Option<Option<String>>,
29    #[serde(rename = "birthCity", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub birth_city: Option<Option<String>>,
31    /// place where the document is issued 
32    #[serde(rename = "issuingCity", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
33    pub issuing_city: Option<Option<String>>,
34    #[serde(rename = "residenceCity", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub residence_city: Option<Option<String>>,
36    /// ISO 3166-1 alpha-2 2 character country code 
37    #[serde(rename = "birthCountryCode", skip_serializing_if = "Option::is_none")]
38    pub birth_country_code: Option<String>,
39    /// ISO 3166-1 alpha-2 2 character country code 
40    #[serde(rename = "issuingCountryCode", skip_serializing_if = "Option::is_none")]
41    pub issuing_country_code: Option<String>,
42    /// ISO 3166-1 alpha-2 2 character country code 
43    #[serde(rename = "residenceCountryCode", skip_serializing_if = "Option::is_none")]
44    pub residence_country_code: Option<String>,
45    #[serde(rename = "issuingDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
46    pub issuing_date: Option<Option<String>>,
47    #[serde(rename = "gender", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
48    pub gender: Option<Option<models::Gender>>,
49    #[serde(rename = "expirationDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
50    pub expiration_date: Option<Option<String>>,
51}
52
53impl IdentificationCard {
54    /// Person identification information  to be exchanged for border control if legally required.  It is not allowed to send personal information not required in the offer reply. It is legally not allowed to send these personal data already in the offer request. 
55    pub fn new(id: String, r#type: String) -> IdentificationCard {
56        IdentificationCard {
57            id,
58            r#type,
59            name: None,
60            nationality: None,
61            birth_city: None,
62            issuing_city: None,
63            residence_city: None,
64            birth_country_code: None,
65            issuing_country_code: None,
66            residence_country_code: None,
67            issuing_date: None,
68            gender: None,
69            expiration_date: None,
70        }
71    }
72}
73