1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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
    async fn get_train_service_alert<S>(client: &C, skip: S) -> LTAResult<TrainServiceAlert>
    where
        S: Into<Option<u32>>,
    {
        client
            .build_req_with_skip::<TrainServiceAlertResp, _>(
                &concat_string!(client.base_url(), "/TrainServiceAlerts"),
                skip.into(),
            )
            .await
    }
}