osdm_sys/models/card_reference.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/// CardReference : Number and issuer are needed to identify a travel account, the code identifies a reduction card.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CardReference {
17 /// Code of the card type according to issuer. E.g. BahnCard50. Predefined values from the [Reduction Card Code List](https://osdm.io/spec/catalog-of-code-lists/#ReductionCard)
18 #[serde(rename = "code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19 pub code: Option<Option<String>>,
20 /// Number identifying the travel account, need issuer to be unique.
21 #[serde(rename = "number", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22 pub number: Option<Option<String>>,
23 /// Identifies a company. For rail, a RICS company code or compatible ERA company code are used. E.g.: 'urn:uic:rics:1185:000011'
24 #[serde(rename = "issuer", skip_serializing_if = "Option::is_none")]
25 pub issuer: Option<String>,
26 #[serde(rename = "type")]
27 pub r#type: models::TravelAccountType,
28}
29
30impl CardReference {
31 /// Number and issuer are needed to identify a travel account, the code identifies a reduction card.
32 pub fn new(r#type: models::TravelAccountType) -> CardReference {
33 CardReference {
34 code: None,
35 number: None,
36 issuer: None,
37 r#type,
38 }
39 }
40}
41