1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use crate::models::train::prelude::*;
use crate::{Client, LTAResult};
use concat_string::concat_string;

use super::ClientExt;

pub trait TrainRequests<C: Client + ClientExt> {
    /// Returns detailed information on train service unavailability during scheduled
    /// operating hours, such as affected line and stations etc.
    ///
    /// **Update freq**: ad-hoc
    fn get_train_service_alert(
        client: &C,
        skip: impl Into<Option<u32>>,
    ) -> LTAResult<TrainServiceAlert> {
        client.build_req_with_skip::<TrainServiceAlertResp, _>(
            &concat_string!(client.base_url(), "/TrainServiceAlerts"),
            skip.into(),
        )
    }
}