Skip to main content

lta/get_facilities_maintenance/
parts.rs

1// @generated by satay. Do not edit by hand.
2#![allow(
3    clippy::doc_markdown,
4    clippy::missing_errors_doc,
5    clippy::must_use_candidate,
6    clippy::needless_pass_by_value,
7    clippy::return_self_not_must_use,
8    clippy::single_match_else
9)]
10
11use super::super::types::StationCode;
12/// Returns links to facility maintenance data files for a queried MRT/LRT station. Each link points to a JSON file describing the maintenance works currently in progress at that station.
13///
14/// **Update freq**: Ad-Hoc
15#[derive(Debug, Clone, PartialEq)]
16pub struct GetFacilitiesMaintenanceInput {
17    /// MRT/LRT station code.
18    pub station_code: StationCode,
19}
20impl GetFacilitiesMaintenanceInput {
21    pub fn new(station_code: StationCode) -> Self {
22        Self { station_code }
23    }
24}
25/// Returns links to facility maintenance data files for a queried MRT/LRT station. Each link points to a JSON file describing the maintenance works currently in progress at that station.
26///
27/// **Update freq**: Ad-Hoc
28#[derive(Debug, Clone, PartialEq)]
29pub enum GetFacilitiesMaintenanceResponse {
30    /// Successful Facilities Maintenance response.
31    Ok(Vec<String>),
32    UnexpectedStatus(http::StatusCode, Vec<u8>),
33}
34/// Returns links to facility maintenance data files for a queried MRT/LRT station. Each link points to a JSON file describing the maintenance works currently in progress at that station.
35///
36/// **Update freq**: Ad-Hoc
37pub fn get_facilities_maintenance_parts(
38    input: GetFacilitiesMaintenanceInput,
39) -> Result<satay_runtime::RequestParts<()>, satay_runtime::Error> {
40    let mut uri = String::with_capacity(22);
41    uri.push_str("/FacilitiesMaintenance");
42    let mut first_query = true;
43    satay_runtime::append_query_pair(
44        &mut uri,
45        &mut first_query,
46        "StationCode",
47        input.station_code.as_ref(),
48    );
49    let headers = http::HeaderMap::new();
50    Ok(satay_runtime::RequestParts {
51        method: http::Method::GET,
52        uri,
53        headers,
54        body: (),
55    })
56}