osdm-sys 0.1.0-alpha.3

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/)
Documentation
/*
 * 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};

/// 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. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct IdentificationCard {
    /// Identifier on the document. 
    #[serde(rename = "id")]
    pub id: String,
    /// Refer to code list for values 
    #[serde(rename = "type")]
    pub r#type: String,
    /// ICAO transliteration identical as written in the document 
    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub name: Option<Option<String>>,
    /// ISO 3166-1 alpha-2 2 character country code 
    #[serde(rename = "nationality", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub nationality: Option<Option<String>>,
    #[serde(rename = "birthCity", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub birth_city: Option<Option<String>>,
    /// place where the document is issued 
    #[serde(rename = "issuingCity", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub issuing_city: Option<Option<String>>,
    #[serde(rename = "residenceCity", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub residence_city: Option<Option<String>>,
    /// ISO 3166-1 alpha-2 2 character country code 
    #[serde(rename = "birthCountryCode", skip_serializing_if = "Option::is_none")]
    pub birth_country_code: Option<String>,
    /// ISO 3166-1 alpha-2 2 character country code 
    #[serde(rename = "issuingCountryCode", skip_serializing_if = "Option::is_none")]
    pub issuing_country_code: Option<String>,
    /// ISO 3166-1 alpha-2 2 character country code 
    #[serde(rename = "residenceCountryCode", skip_serializing_if = "Option::is_none")]
    pub residence_country_code: Option<String>,
    #[serde(rename = "issuingDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub issuing_date: Option<Option<String>>,
    #[serde(rename = "gender", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub gender: Option<Option<models::Gender>>,
    #[serde(rename = "expirationDate", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub expiration_date: Option<Option<String>>,
}

impl 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. 
    pub fn new(id: String, r#type: String) -> IdentificationCard {
        IdentificationCard {
            id,
            r#type,
            name: None,
            nationality: None,
            birth_city: None,
            issuing_city: None,
            residence_city: None,
            birth_country_code: None,
            issuing_country_code: None,
            residence_country_code: None,
            issuing_date: None,
            gender: None,
            expiration_date: None,
        }
    }
}