osdm_sys/models/
coach_layout.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
17pub struct CoachLayout {
18 #[serde(rename = "id")]
20 pub id: String,
21 #[serde(rename = "summary", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23 pub summary: Option<Option<String>>,
24 #[serde(rename = "places", skip_serializing_if = "Option::is_none")]
26 pub places: Option<Vec<models::CoachLayoutPlace>>,
27 #[serde(rename = "signs", skip_serializing_if = "Option::is_none")]
28 pub signs: Option<Vec<models::CoachLayoutSign>>,
29 #[serde(rename = "internals", skip_serializing_if = "Option::is_none")]
30 pub internals: Option<Vec<models::CoachLayoutInternal>>,
31 #[serde(rename = "directedInternals", skip_serializing_if = "Option::is_none")]
32 pub directed_internals: Option<Vec<models::CoachLayoutDirectedInternal>>,
33 #[serde(rename = "compartmentNumbers", skip_serializing_if = "Option::is_none")]
34 pub compartment_numbers: Option<Vec<models::CoachLayoutCompartmentNumber>>,
35 #[serde(rename = "gridSize")]
36 pub grid_size: Box<models::CoachLayoutGridSize>,
37 #[serde(rename = "_links", skip_serializing_if = "Option::is_none")]
39 pub _links: Option<Vec<models::Link>>,
40}
41
42impl CoachLayout {
43 pub fn new(id: String, grid_size: models::CoachLayoutGridSize) -> CoachLayout {
45 CoachLayout {
46 id,
47 summary: None,
48 places: None,
49 signs: None,
50 internals: None,
51 directed_internals: None,
52 compartment_numbers: None,
53 grid_size: Box::new(grid_size),
54 _links: None,
55 }
56 }
57}
58