osdm_sys/models/
coach_layout.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CoachLayout {
17 #[serde(rename = "id")]
19 pub id: String,
20 #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22 pub summary: Option<Option<String>>,
23 #[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 #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
38 pub _links: Option<Vec<models::Link>>,
39}
40
41impl CoachLayout {
42 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