osdm_sys/models/
coach_layout.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/// CoachLayout : coach layout providing data to draw a coach layout. The items of a coach are located via coordinates with (0,0) in the upper left corner. All coordinates are given without sign. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CoachLayout {
17    /// id of this coachLayout on this server 
18    #[serde(rename = "id")]
19    pub id: String,
20    /// A human-readable description of the coach layout. 
21    #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub summary: Option<Option<String>>,
23    /// list of places included in the layout 
24    #[serde(rename = "places", skip_serializing_if = "Option::is_none")]
25    pub places: Option<Vec<models::CoachLayoutPlace>>,
26    #[serde(rename = "signs", skip_serializing_if = "Option::is_none")]
27    pub signs: Option<Vec<models::CoachLayoutSign>>,
28    #[serde(rename = "internals", skip_serializing_if = "Option::is_none")]
29    pub internals: Option<Vec<models::CoachLayoutInternal>>,
30    #[serde(rename = "directedInternals", skip_serializing_if = "Option::is_none")]
31    pub directed_internals: Option<Vec<models::CoachLayoutDirectedInternal>>,
32    #[serde(rename = "compartmentNumbers", skip_serializing_if = "Option::is_none")]
33    pub compartment_numbers: Option<Vec<models::CoachLayoutCompartmentNumber>>,
34    #[serde(rename = "gridSize")]
35    pub grid_size: Box<models::CoachLayoutGridSize>,
36    /// Java Property Name: 'links' 
37    #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
38    pub _links: Option<Vec<models::Link>>,
39}
40
41impl CoachLayout {
42    /// coach layout providing data to draw a coach layout. The items of a coach are located via coordinates with (0,0) in the upper left corner. All coordinates are given without sign. 
43    pub fn new(id: String, grid_size: models::CoachLayoutGridSize) -> CoachLayout {
44        CoachLayout {
45            id,
46            summary: None,
47            places: None,
48            signs: None,
49            internals: None,
50            directed_internals: None,
51            compartment_numbers: None,
52            grid_size: Box::new(grid_size),
53            _links: None,
54        }
55    }
56}
57