osdm_sys/models/
granted_reduction_amount.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/// GrantedReductionAmount : Applied passenger types and reductions per passenger, per offerpart, booking part and per part of the trip.  Passengers might be omitted in case the reduction applies to the complete booking part. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct GrantedReductionAmount {
17    /// Clear text representation of the actual passenger type, suitable to be presented to a client. 
18    #[serde(rename = "description")]
19    pub description: String,
20    #[serde(rename = "grantedAmount")]
21    pub granted_amount: Box<models::Price>,
22    /// ids of the passengers that were granted the reduction 
23    #[serde(rename = "passengerRefs", skip_serializing_if = "Option::is_none")]
24    pub passenger_refs: Option<Vec<String>>,
25    #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
26    pub trip_coverage: Option<Box<models::TripCoverage>>,
27    #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
28    pub inbound_trip_coverage: Option<Box<models::TripCoverage>>,
29    #[serde(rename = "appliedPassengerTypes", skip_serializing_if = "Option::is_none")]
30    pub applied_passenger_types: Option<Vec<String>>,
31    #[serde(rename = "appliedReductions", skip_serializing_if = "Option::is_none")]
32    pub applied_reductions: Option<Vec<models::CardReference>>,
33    #[serde(rename = "appliedCorporateCodes", skip_serializing_if = "Option::is_none")]
34    pub applied_corporate_codes: Option<Vec<models::CorporateCode>>,
35    #[serde(rename = "appliedPromotionCodes", skip_serializing_if = "Option::is_none")]
36    pub applied_promotion_codes: Option<Vec<models::PromotionCode>>,
37}
38
39impl GrantedReductionAmount {
40    /// Applied passenger types and reductions per passenger, per offerpart, booking part and per part of the trip.  Passengers might be omitted in case the reduction applies to the complete booking part. 
41    pub fn new(description: String, granted_amount: models::Price) -> GrantedReductionAmount {
42        GrantedReductionAmount {
43            description,
44            granted_amount: Box::new(granted_amount),
45            passenger_refs: None,
46            trip_coverage: None,
47            inbound_trip_coverage: None,
48            applied_passenger_types: None,
49            applied_reductions: None,
50            applied_corporate_codes: None,
51            applied_promotion_codes: None,
52        }
53    }
54}
55