Skip to main content

lta/get_road_works/
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::RoadDetails;
12/// Returns road works currently in progress or planned, together with event details and the responsible agency.
13///
14/// **Update freq**: 24 hours – whenever there are updates
15#[derive(Debug, Clone, PartialEq)]
16pub struct GetRoadWorksInput {
17    /// Number of records to skip for pagination.
18    pub skip: Option<u32>,
19}
20impl GetRoadWorksInput {
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 GetRoadWorksInput {
30    fn default() -> Self {
31        Self::new()
32    }
33}
34/// Returns road works currently in progress or planned, together with event details and the responsible agency.
35///
36/// **Update freq**: 24 hours – whenever there are updates
37#[derive(Debug, Clone, PartialEq)]
38pub enum GetRoadWorksResponse {
39    /// Successful Road Works response.
40    Ok(Vec<RoadDetails>),
41    UnexpectedStatus(http::StatusCode, Vec<u8>),
42}
43/// Returns road works currently in progress or planned, together with event details and the responsible agency.
44///
45/// **Update freq**: 24 hours – whenever there are updates
46pub fn get_road_works_parts(
47    input: GetRoadWorksInput,
48) -> Result<satay_runtime::RequestParts<()>, satay_runtime::Error> {
49    let mut uri = String::with_capacity(10);
50    uri.push_str("/RoadWorks");
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}