Skip to main content

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