osdm_sys/models/
reduction_card_account.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ReductionCardAccount {
16    /// Attribute is used as discriminator for inheritance between data types.
17    #[serde(rename = "objectType")]
18    pub object_type: String,
19    #[serde(rename = "holder", skip_serializing_if = "Option::is_none")]
20    pub holder: Option<Box<models::PersonDetail>>,
21    /// Identifies a company. For rail, a RICS company code or compatible ERA company code are used.  E.g.: 'urn:uic:rics:1185:000011' 
22    #[serde(rename = "issuer")]
23    pub issuer: String,
24    #[serde(rename = "validFrom")]
25    pub valid_from: String,
26    #[serde(rename = "validUntil")]
27    pub valid_until: String,
28    #[serde(rename = "number")]
29    pub number: String,
30    #[serde(rename = "type")]
31    pub r#type: Box<models::ReductionCardType>,
32}
33
34impl ReductionCardAccount {
35    pub fn new(object_type: String, issuer: String, valid_from: String, valid_until: String, number: String, r#type: models::ReductionCardType) -> ReductionCardAccount {
36        ReductionCardAccount {
37            object_type,
38            holder: None,
39            issuer,
40            valid_from,
41            valid_until,
42            number,
43            r#type: Box::new(r#type),
44        }
45    }
46}
47