Skip to main content

lta/get_taxi_availability/
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::Coordinates;
12/// Returns the coordinates of all taxis currently available for hire.
13///
14/// **Update freq**: 1 min
15#[derive(Debug, Clone, PartialEq)]
16pub struct GetTaxiAvailabilityInput {
17    /// Number of records to skip for pagination.
18    pub skip: Option<u32>,
19}
20impl GetTaxiAvailabilityInput {
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 GetTaxiAvailabilityInput {
30    fn default() -> Self {
31        Self::new()
32    }
33}
34/// Returns the coordinates of all taxis currently available for hire.
35///
36/// **Update freq**: 1 min
37#[derive(Debug, Clone, PartialEq)]
38pub enum GetTaxiAvailabilityResponse {
39    /// Successful Taxi Availability response.
40    Ok(Vec<Coordinates>),
41    UnexpectedStatus(http::StatusCode, Vec<u8>),
42}
43/// Returns the coordinates of all taxis currently available for hire.
44///
45/// **Update freq**: 1 min
46pub fn get_taxi_availability_parts(
47    input: GetTaxiAvailabilityInput,
48) -> Result<satay_runtime::RequestParts<()>, satay_runtime::Error> {
49    let mut uri = String::with_capacity(18);
50    uri.push_str("/Taxi-Availability");
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}