Skip to main content

lta/get_bus_stops/
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::BusStop;
12/// Returns detailed information for all bus stops currently being serviced by buses, including bus stop codes and location coordinates.
13///
14/// **Update freq**: Ad-Hoc
15#[derive(Debug, Clone, PartialEq)]
16pub struct GetBusStopsInput {
17    /// Number of records to skip for pagination.
18    pub skip: Option<u32>,
19}
20impl GetBusStopsInput {
21    pub fn new() -> Self {
22        Self { skip: None }
23    }
24    pub fn skip(mut self, skip: u32) -> Self {
25        self.skip = Some(skip);
26        self
27    }
28}
29impl Default for GetBusStopsInput {
30    fn default() -> Self {
31        Self::new()
32    }
33}
34/// Returns detailed information for all bus stops currently being serviced by buses, including bus stop codes and location coordinates.
35///
36/// **Update freq**: Ad-Hoc
37#[derive(Debug, Clone, PartialEq)]
38pub enum GetBusStopsResponse {
39    /// Successful Bus Stops response.
40    Ok(Vec<BusStop>),
41    UnexpectedStatus(http::StatusCode, Vec<u8>),
42}
43/// Returns detailed information for all bus stops currently being serviced by buses, including bus stop codes and location coordinates.
44///
45/// **Update freq**: Ad-Hoc
46pub fn get_bus_stops_parts(
47    input: GetBusStopsInput,
48) -> Result<satay_runtime::RequestParts<()>, satay_runtime::Error> {
49    let mut uri = String::with_capacity(9);
50    uri.push_str("/BusStops");
51    let mut first_query = true;
52    if let Some(value) = &input.skip {
53        satay_runtime::append_query_pair(&mut uri, &mut first_query, "$skip", &value.to_string());
54    }
55    let headers = http::HeaderMap::new();
56    Ok(satay_runtime::RequestParts {
57        method: http::Method::GET,
58        uri,
59        headers,
60        body: (),
61    })
62}