google_maps2/elevation/request/
mod.rs

1//! **Look in this module for documentation on building your _Elevation API_
2//! query**. In particular, look at the _Request_ struct for examples of the
3//! builder pattern. This module contains the tools (enums, structs, methods)
4//! for building your Google Maps Platform request.
5
6mod build;
7#[cfg(feature = "enable-reqwest")]
8mod execute;
9mod for_positional_request;
10mod for_sampled_path_request;
11#[cfg(feature = "enable-reqwest")]
12mod get;
13pub mod locations;
14mod new;
15mod query_url;
16mod validate;
17
18// -----------------------------------------------------------------------------
19
20use crate::{client::GoogleMapsClient, elevation::request::locations::Locations};
21
22// -----------------------------------------------------------------------------
23//
24/// **Look at this `Request` struct for documentation on how to build your
25/// _Elevation API_ query**. The methods implemented for this struct are what's
26/// used to build your request.
27
28#[derive(Debug)]
29pub struct Request<'a> {
30    // Required parameters:
31    // --------------------
32    /// This structure contains the application's API key and other
33    /// user-definable settings such as "maximum retries."
34    client: &'a GoogleMapsClient,
35
36    // Positional Requests:
37    // --------------------
38    /// Defines the location(s) on the earth from which to return elevation
39    /// data. This parameter takes either a single location as a
40    /// latitude/longitude pair, multiple latitude/longitude pairs, or an
41    /// encoded polyline.
42    locations: Option<Locations>,
43
44    // Sampled Path Requests:
45    // ----------------------
46    /// Defines a path on the earth for which to return elevation data. This
47    /// parameter defines a set of two or more ordered latitude/longitude
48    /// pairs defining a path along the surface of the earth. This parameter
49    /// must be used in conjunction with the `samples` parameter described
50    /// below.
51    path: Option<Locations>,
52
53    /// Specifies the number of sample points along a path for which to return
54    /// elevation data. The samples parameter divides the given path into an
55    /// ordered set of equidistant points along the path.
56    samples: Option<u8>,
57
58    // Internal use only:
59    // ------------------
60    /// Query string that is to be submitted to the Google Cloud Maps Platform.
61    query: Option<String>,
62
63    /// Has the request been validated?
64    validated: bool,
65} // struct