osdm_sys/models/reduction_granted.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/// ReductionGranted : reductions granted by a reduction card type. Either carrier or country must be provided.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ReductionGranted {
17 /// Identifies a company. For rail, a RICS company code or compatible ERA company code are used. E.g.: 'urn:uic:rics:1185:000011'
18 #[serde(rename = "carrier", skip_serializing_if = "Option::is_none")]
19 pub carrier: Option<String>,
20 /// ISO 3166-1 alpha-2 2 character country code
21 #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
22 pub country: Option<String>,
23 /// transport modes where the reduction is granted, any mode of the carrier in case the list is not provided.
24 #[serde(rename = "transportModes", skip_serializing_if = "Option::is_none")]
25 pub transport_modes: Option<Vec<models::Mode>>,
26 /// ServiceBrands where the reduction is granted, any service brand of the carrier in case the list is not provided.
27 #[serde(rename = "serviceBands", skip_serializing_if = "Option::is_none")]
28 pub service_bands: Option<Vec<String>>,
29 #[serde(rename = "description")]
30 pub description: Box<models::Text>,
31 #[serde(rename = "percentage", skip_serializing_if = "Option::is_none")]
32 pub percentage: Option<f32>,
33}
34
35impl ReductionGranted {
36 /// reductions granted by a reduction card type. Either carrier or country must be provided.
37 pub fn new(description: models::Text) -> ReductionGranted {
38 ReductionGranted {
39 carrier: None,
40 country: None,
41 transport_modes: None,
42 service_bands: None,
43 description: Box::new(description),
44 percentage: None,
45 }
46 }
47}
48