osdm_sys/models/
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 Offer {
16    #[serde(rename = "offerId")]
17    pub offer_id: String,
18    /// A human-readable description of the offer. 
19    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub summary: Option<Option<String>>,
21    #[serde(rename = "offerSummary", skip_serializing_if = "Option::is_none")]
22    pub offer_summary: Option<Box<models::OfferSummary>>,
23    #[serde(rename = "createdOn")]
24    pub created_on: String,
25    /// time until the offer can be pre-booked, however its availability is not guaranteed 
26    #[serde(rename = "preBookableUntil")]
27    pub pre_bookable_until: String,
28    #[serde(rename = "passengerRefs")]
29    pub passenger_refs: Vec<String>,
30    #[serde(rename = "products", skip_serializing_if = "Option::is_none")]
31    pub products: Option<Vec<models::Product>>,
32    #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
33    pub trip_coverage: Option<Box<models::TripCoverage>>,
34    #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
35    pub inbound_trip_coverage: Option<Box<models::TripCoverage>>,
36    #[serde(rename = "admissionOfferParts", skip_serializing_if = "Option::is_none")]
37    pub admission_offer_parts: Option<Vec<models::AdmissionOfferPart>>,
38    #[serde(rename = "reservationOfferParts", skip_serializing_if = "Option::is_none")]
39    pub reservation_offer_parts: Option<Vec<models::ReservationOfferPart>>,
40    #[serde(rename = "ancillaryOfferParts", skip_serializing_if = "Option::is_none")]
41    pub ancillary_offer_parts: Option<Vec<models::AncillaryOfferPart>>,
42    #[serde(rename = "continuousServiceOfferParts", skip_serializing_if = "Option::is_none")]
43    pub continuous_service_offer_parts: Option<Vec<models::ContinuousServiceOfferPart>>,
44    #[serde(rename = "fees", skip_serializing_if = "Option::is_none")]
45    pub fees: Option<Vec<models::Fee>>,
46    #[serde(rename = "fares", skip_serializing_if = "Option::is_none")]
47    pub fares: Option<Vec<models::Fare>>,
48    ///  Java Property Name: 'links' 
49    #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
50    pub _links: Option<Vec<models::Link>>,
51}
52
53impl Offer {
54    pub fn new(offer_id: String, created_on: String, pre_bookable_until: String, passenger_refs: Vec<String>) -> Offer {
55        Offer {
56            offer_id,
57            summary: None,
58            offer_summary: None,
59            created_on,
60            pre_bookable_until,
61            passenger_refs,
62            products: None,
63            trip_coverage: None,
64            inbound_trip_coverage: None,
65            admission_offer_parts: None,
66            reservation_offer_parts: None,
67            ancillary_offer_parts: None,
68            continuous_service_offer_parts: None,
69            fees: None,
70            fares: None,
71            _links: None,
72        }
73    }
74}
75