osdm_sys/models/
intermediate.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 Intermediate {
18 #[serde(rename = "stopPlaceRef")]
19 pub stop_place_ref: Box<models::StopPlaceRef>,
20 #[serde(rename = "stopPlaceName")]
21 pub stop_place_name: String,
22 #[serde(rename = "plannedStopPointName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24 pub planned_stop_point_name: Option<Option<String>>,
25 #[serde(rename = "estimatedStopPointName", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27 pub estimated_stop_point_name: Option<Option<String>>,
28 #[serde(rename = "serviceArrival")]
29 pub service_arrival: Box<models::ServiceTime>,
30 #[serde(rename = "serviceDeparture")]
31 pub service_departure: Box<models::ServiceTime>,
32 #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
33 pub status: Option<Box<models::StopCallStatus>>,
34}
35
36impl Intermediate {
37 pub fn new(stop_place_ref: models::StopPlaceRef, stop_place_name: String, service_arrival: models::ServiceTime, service_departure: models::ServiceTime) -> Intermediate {
39 Intermediate {
40 stop_place_ref: Box::new(stop_place_ref),
41 stop_place_name,
42 planned_stop_point_name: None,
43 estimated_stop_point_name: None,
44 service_arrival: Box::new(service_arrival),
45 service_departure: Box::new(service_departure),
46 status: None,
47 }
48 }
49}
50