osdm_sys/models/vehicle_availability.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/// VehicleAvailability : A vehicle run for which place availabilities were requested.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
17pub struct VehicleAvailability {
18 /// List of the coaches in a vehicle run ordered according to the physical ordering of the vehicle. Empty if train composition data is missing or specific place selection is not supported.
19 #[serde(rename = "coaches", skip_serializing_if = "Option::is_none")]
20 pub coaches: Option<Vec<models::CoachAvailability>>,
21 /// List of direction changes (in direction of travel).
22 #[serde(rename = "directionChanges", skip_serializing_if = "Option::is_none")]
23 pub direction_changes: Option<Vec<models::DirectionChange>>,
24 #[serde(rename = "preSelectedPlaces", skip_serializing_if = "Option::is_none")]
25 pub pre_selected_places: Option<Vec<models::PlacePreSelection>>,
26 #[serde(rename = "preSelectedCompartments", skip_serializing_if = "Option::is_none")]
27 pub pre_selected_compartments: Option<Vec<models::CompartmentPreSelection>>,
28}
29
30impl VehicleAvailability {
31 /// A vehicle run for which place availabilities were requested.
32 pub fn new() -> VehicleAvailability {
33 VehicleAvailability {
34 coaches: None,
35 direction_changes: None,
36 pre_selected_places: None,
37 pre_selected_compartments: None,
38 }
39 }
40}
41