lta/get_bus_stops/
parts.rs1#![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#[derive(Debug, Clone, PartialEq)]
16pub struct GetBusStopsInput {
17 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#[derive(Debug, Clone, PartialEq)]
38pub enum GetBusStopsResponse {
39 Ok(Vec<BusStop>),
41 UnexpectedStatus(http::StatusCode, Vec<u8>),
42}
43pub 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}