osdm_sys/models/
alight.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 Alight {
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 = "status", skip_serializing_if = "Option::is_none")]
31 pub status: Option<Box<models::StopCallStatus>>,
32}
33
34impl Alight {
35 pub fn new(stop_place_ref: models::StopPlaceRef, stop_place_name: String, service_arrival: models::ServiceTime) -> Alight {
37 Alight {
38 stop_place_ref: Box::new(stop_place_ref),
39 stop_place_name,
40 planned_stop_point_name: None,
41 estimated_stop_point_name: None,
42 service_arrival: Box::new(service_arrival),
43 status: None,
44 }
45 }
46}
47