osdm-sys 0.1.0-alpha.3

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/)
Documentation
/*
 * UIC 90918-10 - OSDM
 *
 * 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/) 
 *
 * The version of the OpenAPI document: 3.7.0
 * Contact: osdm@uic.org
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// BookedOffer : The attribute 'offerSummary' is meaningful at trip-offer-collection response time only. The offerSummary must be provided for product based offers. It is not needed for fares. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct BookedOffer {
    /// Note that the offerId returned does not necessarily match the offerId given in the Booking Request.
    #[serde(rename = "offerId")]
    pub offer_id: String,
    /// A stable reference to the id of the booked offer in the caller's system. When received in input of a request, it must be persisted and echoed back in the response. 
    #[serde(rename = "externalRef", skip_serializing_if = "Option::is_none")]
    pub external_ref: Option<String>,
    /// A human-readable description of the booked offer. 
    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub summary: Option<Option<String>>,
    #[serde(rename = "admissions", skip_serializing_if = "Option::is_none")]
    pub admissions: Option<Vec<models::Admission>>,
    #[serde(rename = "reservations", skip_serializing_if = "Option::is_none")]
    pub reservations: Option<Vec<models::Reservation>>,
    #[serde(rename = "ancillaries", skip_serializing_if = "Option::is_none")]
    pub ancillaries: Option<Vec<models::Ancillary>>,
    #[serde(rename = "continuousServices", skip_serializing_if = "Option::is_none")]
    pub continuous_services: Option<Vec<models::ContinuousServiceBookingPart>>,
    #[serde(rename = "fees", skip_serializing_if = "Option::is_none")]
    pub fees: Option<Vec<models::Fee>>,
    #[serde(rename = "fares", skip_serializing_if = "Option::is_none")]
    pub fares: Option<Vec<models::Fare>>,
    #[serde(rename = "tripCoverage", skip_serializing_if = "Option::is_none")]
    pub trip_coverage: Option<Box<models::TripCoverage>>,
    #[serde(rename = "inboundTripCoverage", skip_serializing_if = "Option::is_none")]
    pub inbound_trip_coverage: Option<Box<models::TripCoverage>>,
    #[serde(rename = "appliedThroughTicketTags", skip_serializing_if = "Option::is_none")]
    pub applied_through_ticket_tags: Option<Vec<String>>,
    #[serde(rename = "products", skip_serializing_if = "Option::is_none")]
    pub products: Option<Vec<models::Product>>,
}

impl BookedOffer {
    /// The attribute 'offerSummary' is meaningful at trip-offer-collection response time only. The offerSummary must be provided for product based offers. It is not needed for fares. 
    pub fn new(offer_id: String) -> BookedOffer {
        BookedOffer {
            offer_id,
            external_ref: None,
            summary: None,
            admissions: None,
            reservations: None,
            ancillaries: None,
            continuous_services: None,
            fees: None,
            fares: None,
            trip_coverage: None,
            inbound_trip_coverage: None,
            applied_through_ticket_tags: None,
            products: None,
        }
    }
}