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};

/// ReservedPlace : In distributor mode placeProperties are mandatory to be returned. 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct ReservedPlace {
    #[serde(rename = "id")]
    pub id: String,
    /// Id of the passenger 
    #[serde(rename = "passengerIds")]
    pub passenger_ids: Vec<String>,
    /// vehicle number (e.g. train number) 
    #[serde(rename = "vehicleNumber")]
    pub vehicle_number: String,
    #[serde(rename = "coachNumber")]
    pub coach_number: String,
    /// Compartment number as indicated at the compartment in the coach. A compartment number must be set if the compartment is selectable as a whole only. 
    #[serde(rename = "compartmentNumber", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub compartment_number: Option<Option<String>>,
    /// description of the places (e.g. 11-35,51) 
    #[serde(rename = "placeDescription", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub place_description: Option<Option<String>>,
    /// list of individual place numbers 
    #[serde(rename = "placeNumbers", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub place_numbers: Option<Option<Vec<String>>>,
    /// place properties to be indicated to the customer 
    #[serde(rename = "placeProperties", skip_serializing_if = "Option::is_none")]
    pub place_properties: Option<Vec<String>>,
    #[serde(rename = "splitSection", skip_serializing_if = "Option::is_none")]
    pub split_section: Option<Box<models::Section>>,
}

impl ReservedPlace {
    /// In distributor mode placeProperties are mandatory to be returned. 
    pub fn new(id: String, passenger_ids: Vec<String>, vehicle_number: String, coach_number: String) -> ReservedPlace {
        ReservedPlace {
            id,
            passenger_ids,
            vehicle_number,
            coach_number,
            compartment_number: None,
            place_description: None,
            place_numbers: None,
            place_properties: None,
            split_section: None,
        }
    }
}