osdm_sys/models/
release_offer.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 ReleaseOffer {
16    /// id of the release offer 
17    #[serde(rename = "id")]
18    pub id: String,
19    /// A human-readable description of the refund offer. 
20    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub summary: Option<Option<String>>,
22    #[serde(rename = "createdOn")]
23    pub created_on: String,
24    #[serde(rename = "validFrom")]
25    pub valid_from: String,
26    /// time until the offer can be used 
27    #[serde(rename = "validUntil")]
28    pub valid_until: String,
29    #[serde(rename = "confirmedOn", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
30    pub confirmed_on: Option<Option<String>>,
31    #[serde(rename = "status")]
32    pub status: models::ReleaseStatus,
33    #[serde(rename = "fulfillments")]
34    pub fulfillments: Vec<models::Fulfillment>,
35    /// Reason for and type of an after sale, code list in IRS 90918-10. The PRM_SUPPORT_UNAVAILABLE overrule code shall only be used by the UIC PRM ABT tool. Values from the [Overrule Codes Code List](https://osdm.io/spec/catalog-of-code-lists/#OverruleCode) Listed values here are examples.    - 'CONNECTION_BROKEN' - 'DEATH' - 'EQUIPMENT_FAILURE' - 'PAYMENT_FAILURE' - 'PRM_SUPPORT_UNAVAILABLE' - 'SALES_STAFF_ERROR' - 'STOP_NOT_SERVED' - 'STRIKE' - 'TECHNICAL_FAILURE' - 'TICKET_NOT_USED' - 'INABILITY_TO_TRAVEL': Inability to travel due to accident or sickness. - 'EXTERNAL_COMPENSATION': Offer has been compensated outside of the provider system in another way. - 'DISRUPTION': Inability to operate due to disruption. - 'JOURNEY_OBSOLETE': Due to external factors it's senseless to start the trip, thus the travel is obsolete. - 'CERTIFIED_MEDICAL_CONDITION': A medical certificate certifies that the passenger is unable to travel. - 'DELAY_COMPENSATION': Allows to override conditions in context of passenger rights regulation (PRR). 
36    #[serde(rename = "appliedOverruleCode", skip_serializing_if = "Option::is_none")]
37    pub applied_overrule_code: Option<String>,
38    ///  Java Property Name: 'links' 
39    #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
40    pub _links: Option<Vec<models::Link>>,
41}
42
43impl ReleaseOffer {
44    pub fn new(id: String, created_on: String, valid_from: String, valid_until: String, status: models::ReleaseStatus, fulfillments: Vec<models::Fulfillment>) -> ReleaseOffer {
45        ReleaseOffer {
46            id,
47            summary: None,
48            created_on,
49            valid_from,
50            valid_until,
51            confirmed_on: None,
52            status,
53            fulfillments,
54            applied_overrule_code: None,
55            _links: None,
56        }
57    }
58}
59