Skip to main content

lta/get_traffic_images/
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::TrafficImage;
12/// Returns links to images from traffic cameras located around Singapore, together with each camera's location coordinates.
13/// **Update freq**: 20 sec
14#[derive(Debug, Clone, PartialEq)]
15pub struct GetTrafficImagesInput {
16    /// Number of records to skip for pagination.
17    pub skip: Option<u32>,
18}
19impl GetTrafficImagesInput {
20    pub fn new() -> Self {
21        Self { skip: None }
22    }
23    pub fn skip(mut self, skip: u32) -> Self {
24        self.skip = Some(skip);
25        self
26    }
27}
28impl Default for GetTrafficImagesInput {
29    fn default() -> Self {
30        Self::new()
31    }
32}
33/// Returns links to images from traffic cameras located around Singapore, together with each camera's location coordinates.
34/// **Update freq**: 20 sec
35#[derive(Debug, Clone, PartialEq)]
36pub enum GetTrafficImagesResponse {
37    /// Successful Traffic Images response.
38    Ok(Vec<TrafficImage>),
39    UnexpectedStatus(http::StatusCode, Vec<u8>),
40}
41/// Returns links to images from traffic cameras located around Singapore, together with each camera's location coordinates.
42/// **Update freq**: 20 sec
43pub fn get_traffic_images_parts(
44    input: GetTrafficImagesInput,
45) -> Result<satay_runtime::RequestParts<()>, satay_runtime::Error> {
46    let mut uri = String::with_capacity(17);
47    uri.push_str("/Traffic-Imagesv2");
48    let mut first_query = true;
49    if let Some(value) = &input.skip {
50        satay_runtime::append_query_pair(&mut uri, &mut first_query, "$skip", &value.to_string());
51    }
52    let headers = http::HeaderMap::new();
53    Ok(satay_runtime::RequestParts {
54        method: http::Method::GET,
55        uri,
56        headers,
57        body: (),
58    })
59}