osdm_sys/models/corporate_code.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/// CorporateCode : The corporate code is a token that reduces the price of an offer or enables offers that are not available without it. Needs with a commercial agreement between parties.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CorporateCode {
17 /// The corporate code issued by the referenced company.
18 #[serde(rename = "code")]
19 pub code: String,
20 /// The name of the party that benefits from the corporate code, intended to be presented to the end user.
21 #[serde(rename = "beneficiary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22 pub beneficiary: 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")]
25 pub issuer: String,
26}
27
28impl CorporateCode {
29 /// The corporate code is a token that reduces the price of an offer or enables offers that are not available without it. Needs with a commercial agreement between parties.
30 pub fn new(code: String, issuer: String) -> CorporateCode {
31 CorporateCode {
32 code,
33 beneficiary: None,
34 issuer,
35 }
36 }
37}
38