Skip to main content

lta/get_road_openings/
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 all planned road openings, including the new road name and the responsible agency.
13/// **Update freq**: 24 hours – whenever there are updates
14#[derive(Debug, Clone, PartialEq)]
15pub struct GetRoadOpeningsInput {
16    /// Number of records to skip for pagination.
17    pub skip: Option<u32>,
18}
19impl GetRoadOpeningsInput {
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 GetRoadOpeningsInput {
29    fn default() -> Self {
30        Self::new()
31    }
32}
33/// Returns all planned road openings, including the new road name and the responsible agency.
34/// **Update freq**: 24 hours – whenever there are updates
35#[derive(Debug, Clone, PartialEq)]
36pub enum GetRoadOpeningsResponse {
37    /// Successful Road Openings response.
38    Ok(Vec<RoadDetails>),
39    UnexpectedStatus(http::StatusCode, Vec<u8>),
40}
41/// Returns all planned road openings, including the new road name and the responsible agency.
42/// **Update freq**: 24 hours – whenever there are updates
43pub fn get_road_openings_parts(
44    input: GetRoadOpeningsInput,
45) -> Result<satay_runtime::RequestParts<()>, satay_runtime::Error> {
46    let mut uri = String::with_capacity(13);
47    uri.push_str("/RoadOpenings");
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}