aws_sdk_location/operation/get_map_tile/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_map_tile::_get_map_tile_output::GetMapTileOutputBuilder;
3
4pub use crate::operation::get_map_tile::_get_map_tile_input::GetMapTileInputBuilder;
5
6impl crate::operation::get_map_tile::builders::GetMapTileInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::get_map_tile::GetMapTileOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_map_tile::GetMapTileError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_map_tile();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetMapTile`.
24///
25/// <important>
26/// <p>This operation is no longer current and may be deprecated in the future. We recommend upgrading to <a href="https://docs.aws.amazon.com/location/latest/APIReference/API_geomaps_GetTile.html"> <code>GetTile</code> </a> unless you require <code>Grab</code> data.</p>
27/// <ul>
28/// <li>
29/// <p><code>GetMapTile</code> is part of a previous Amazon Location Service Maps API (version 1) which has been superseded by a more intuitive, powerful, and complete API (version 2).</p></li>
30/// <li>
31/// <p>The version 2 <code>GetTile</code> operation gives a better user experience and is compatible with the remainder of the V2 Maps API.</p></li>
32/// <li>
33/// <p>If you are using an AWS SDK or the AWS CLI, note that the Maps API version 2 is found under <code>geo-maps</code> or <code>geo_maps</code>, not under <code>location</code>.</p></li>
34/// <li>
35/// <p>Since <code>Grab</code> is not yet fully supported in Maps API version 2, we recommend you continue using API version 1 when using <code>Grab</code>.</p></li>
36/// <li>
37/// <p>Start your version 2 API journey with the <a href="https://docs.aws.amazon.com/location/latest/APIReference/API_Operations_Amazon_Location_Service_Maps_V2.html">Maps V2 API Reference</a> or the <a href="https://docs.aws.amazon.com/location/latest/developerguide/maps.html">Developer Guide</a>.</p></li>
38/// </ul>
39/// </important>
40/// <p>Retrieves a vector data tile from the map resource. Map tiles are used by clients to render a map. they're addressed using a grid arrangement with an X coordinate, Y coordinate, and Z (zoom) level.</p>
41/// <p>The origin (0, 0) is the top left of the map. Increasing the zoom level by 1 doubles both the X and Y dimensions, so a tile containing data for the entire world at (0/0/0) will be split into 4 tiles at zoom 1 (1/0/0, 1/0/1, 1/1/0, 1/1/1).</p>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct GetMapTileFluentBuilder {
44    handle: ::std::sync::Arc<crate::client::Handle>,
45    inner: crate::operation::get_map_tile::builders::GetMapTileInputBuilder,
46    config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49    crate::client::customize::internal::CustomizableSend<
50        crate::operation::get_map_tile::GetMapTileOutput,
51        crate::operation::get_map_tile::GetMapTileError,
52    > for GetMapTileFluentBuilder
53{
54    fn send(
55        self,
56        config_override: crate::config::Builder,
57    ) -> crate::client::customize::internal::BoxFuture<
58        crate::client::customize::internal::SendResult<
59            crate::operation::get_map_tile::GetMapTileOutput,
60            crate::operation::get_map_tile::GetMapTileError,
61        >,
62    > {
63        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64    }
65}
66impl GetMapTileFluentBuilder {
67    /// Creates a new `GetMapTileFluentBuilder`.
68    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
69        Self {
70            handle,
71            inner: ::std::default::Default::default(),
72            config_override: ::std::option::Option::None,
73        }
74    }
75    /// Access the GetMapTile as a reference.
76    pub fn as_input(&self) -> &crate::operation::get_map_tile::builders::GetMapTileInputBuilder {
77        &self.inner
78    }
79    /// Sends the request and returns the response.
80    ///
81    /// If an error occurs, an `SdkError` will be returned with additional details that
82    /// can be matched against.
83    ///
84    /// By default, any retryable failures will be retried twice. Retry behavior
85    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
86    /// set when configuring the client.
87    pub async fn send(
88        self,
89    ) -> ::std::result::Result<
90        crate::operation::get_map_tile::GetMapTileOutput,
91        ::aws_smithy_runtime_api::client::result::SdkError<
92            crate::operation::get_map_tile::GetMapTileError,
93            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
94        >,
95    > {
96        let input = self
97            .inner
98            .build()
99            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
100        let runtime_plugins = crate::operation::get_map_tile::GetMapTile::operation_runtime_plugins(
101            self.handle.runtime_plugins.clone(),
102            &self.handle.conf,
103            self.config_override,
104        );
105        crate::operation::get_map_tile::GetMapTile::orchestrate(&runtime_plugins, input).await
106    }
107
108    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
109    pub fn customize(
110        self,
111    ) -> crate::client::customize::CustomizableOperation<
112        crate::operation::get_map_tile::GetMapTileOutput,
113        crate::operation::get_map_tile::GetMapTileError,
114        Self,
115    > {
116        crate::client::customize::CustomizableOperation::new(self)
117    }
118    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
119        self.set_config_override(::std::option::Option::Some(config_override.into()));
120        self
121    }
122
123    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
124        self.config_override = config_override;
125        self
126    }
127    /// <p>The map resource to retrieve the map tiles from.</p>
128    pub fn map_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.map_name(input.into());
130        self
131    }
132    /// <p>The map resource to retrieve the map tiles from.</p>
133    pub fn set_map_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_map_name(input);
135        self
136    }
137    /// <p>The map resource to retrieve the map tiles from.</p>
138    pub fn get_map_name(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_map_name()
140    }
141    /// <p>The zoom value for the map tile.</p>
142    pub fn z(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.inner = self.inner.z(input.into());
144        self
145    }
146    /// <p>The zoom value for the map tile.</p>
147    pub fn set_z(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.inner = self.inner.set_z(input);
149        self
150    }
151    /// <p>The zoom value for the map tile.</p>
152    pub fn get_z(&self) -> &::std::option::Option<::std::string::String> {
153        self.inner.get_z()
154    }
155    /// <p>The X axis value for the map tile.</p>
156    pub fn x(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
157        self.inner = self.inner.x(input.into());
158        self
159    }
160    /// <p>The X axis value for the map tile.</p>
161    pub fn set_x(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
162        self.inner = self.inner.set_x(input);
163        self
164    }
165    /// <p>The X axis value for the map tile.</p>
166    pub fn get_x(&self) -> &::std::option::Option<::std::string::String> {
167        self.inner.get_x()
168    }
169    /// <p>The Y axis value for the map tile.</p>
170    pub fn y(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.inner = self.inner.y(input.into());
172        self
173    }
174    /// <p>The Y axis value for the map tile.</p>
175    pub fn set_y(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.inner = self.inner.set_y(input);
177        self
178    }
179    /// <p>The Y axis value for the map tile.</p>
180    pub fn get_y(&self) -> &::std::option::Option<::std::string::String> {
181        self.inner.get_y()
182    }
183    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
184    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185        self.inner = self.inner.key(input.into());
186        self
187    }
188    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
189    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
190        self.inner = self.inner.set_key(input);
191        self
192    }
193    /// <p>The optional <a href="https://docs.aws.amazon.com/location/previous/developerguide/using-apikeys.html">API key</a> to authorize the request.</p>
194    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
195        self.inner.get_key()
196    }
197}