aws_sdk_geoplaces/operation/reverse_geocode/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::reverse_geocode::_reverse_geocode_output::ReverseGeocodeOutputBuilder;
3
4pub use crate::operation::reverse_geocode::_reverse_geocode_input::ReverseGeocodeInputBuilder;
5
6impl crate::operation::reverse_geocode::builders::ReverseGeocodeInputBuilder {
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::reverse_geocode::ReverseGeocodeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::reverse_geocode::ReverseGeocodeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.reverse_geocode();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ReverseGeocode`.
24///
25/// <p><code>ReverseGeocode</code> converts geographic coordinates into a human-readable address or place. You can obtain address component, and other related information such as place type, category, street information. The Reverse Geocode API supports filtering to on place type so that you can refine result based on your need. Also, The Reverse Geocode API can also provide additional features such as time zone information and the inclusion of political views.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ReverseGeocodeFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::reverse_geocode::builders::ReverseGeocodeInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::reverse_geocode::ReverseGeocodeOutput,
35        crate::operation::reverse_geocode::ReverseGeocodeError,
36    > for ReverseGeocodeFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::reverse_geocode::ReverseGeocodeOutput,
44            crate::operation::reverse_geocode::ReverseGeocodeError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ReverseGeocodeFluentBuilder {
51    /// Creates a new `ReverseGeocodeFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the ReverseGeocode as a reference.
60    pub fn as_input(&self) -> &crate::operation::reverse_geocode::builders::ReverseGeocodeInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::reverse_geocode::ReverseGeocodeOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::reverse_geocode::ReverseGeocodeError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::reverse_geocode::ReverseGeocode::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::reverse_geocode::ReverseGeocode::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::reverse_geocode::ReverseGeocodeOutput,
97        crate::operation::reverse_geocode::ReverseGeocodeError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    ///
112    /// Appends an item to `QueryPosition`.
113    ///
114    /// To override the contents of this collection use [`set_query_position`](Self::set_query_position).
115    ///
116    /// <p>The position, in <code>\[lng, lat\]</code> for which you are querying nearby results for. Results closer to the position will be ranked higher then results further away from the position</p>
117    pub fn query_position(mut self, input: f64) -> Self {
118        self.inner = self.inner.query_position(input);
119        self
120    }
121    /// <p>The position, in <code>\[lng, lat\]</code> for which you are querying nearby results for. Results closer to the position will be ranked higher then results further away from the position</p>
122    pub fn set_query_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
123        self.inner = self.inner.set_query_position(input);
124        self
125    }
126    /// <p>The position, in <code>\[lng, lat\]</code> for which you are querying nearby results for. Results closer to the position will be ranked higher then results further away from the position</p>
127    pub fn get_query_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
128        self.inner.get_query_position()
129    }
130    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p>
131    pub fn query_radius(mut self, input: i64) -> Self {
132        self.inner = self.inner.query_radius(input);
133        self
134    }
135    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p>
136    pub fn set_query_radius(mut self, input: ::std::option::Option<i64>) -> Self {
137        self.inner = self.inner.set_query_radius(input);
138        self
139    }
140    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p>
141    pub fn get_query_radius(&self) -> &::std::option::Option<i64> {
142        self.inner.get_query_radius()
143    }
144    /// <p>An optional limit for the number of results returned in a single call.</p>
145    pub fn max_results(mut self, input: i32) -> Self {
146        self.inner = self.inner.max_results(input);
147        self
148    }
149    /// <p>An optional limit for the number of results returned in a single call.</p>
150    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
151        self.inner = self.inner.set_max_results(input);
152        self
153    }
154    /// <p>An optional limit for the number of results returned in a single call.</p>
155    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
156        self.inner.get_max_results()
157    }
158    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
159    pub fn filter(mut self, input: crate::types::ReverseGeocodeFilter) -> Self {
160        self.inner = self.inner.filter(input);
161        self
162    }
163    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
164    pub fn set_filter(mut self, input: ::std::option::Option<crate::types::ReverseGeocodeFilter>) -> Self {
165        self.inner = self.inner.set_filter(input);
166        self
167    }
168    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
169    pub fn get_filter(&self) -> &::std::option::Option<crate::types::ReverseGeocodeFilter> {
170        self.inner.get_filter()
171    }
172    ///
173    /// Appends an item to `AdditionalFeatures`.
174    ///
175    /// To override the contents of this collection use [`set_additional_features`](Self::set_additional_features).
176    ///
177    /// <p>A list of optional additional parameters, such as time zone that can be requested for each result.</p>
178    pub fn additional_features(mut self, input: crate::types::ReverseGeocodeAdditionalFeature) -> Self {
179        self.inner = self.inner.additional_features(input);
180        self
181    }
182    /// <p>A list of optional additional parameters, such as time zone that can be requested for each result.</p>
183    pub fn set_additional_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReverseGeocodeAdditionalFeature>>) -> Self {
184        self.inner = self.inner.set_additional_features(input);
185        self
186    }
187    /// <p>A list of optional additional parameters, such as time zone that can be requested for each result.</p>
188    pub fn get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReverseGeocodeAdditionalFeature>> {
189        self.inner.get_additional_features()
190    }
191    /// <p>A list of <a href="https://en.wikipedia.org/wiki/IETF_language_tag">BCP 47</a> compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry.</p>
192    pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.inner = self.inner.language(input.into());
194        self
195    }
196    /// <p>A list of <a href="https://en.wikipedia.org/wiki/IETF_language_tag">BCP 47</a> compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry.</p>
197    pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198        self.inner = self.inner.set_language(input);
199        self
200    }
201    /// <p>A list of <a href="https://en.wikipedia.org/wiki/IETF_language_tag">BCP 47</a> compliant language codes for the results to be rendered in. If there is no data for the result in the requested language, data will be returned in the default language for the entry.</p>
202    pub fn get_language(&self) -> &::std::option::Option<::std::string::String> {
203        self.inner.get_language()
204    }
205    /// <p>The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.</p>
206    pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.inner = self.inner.political_view(input.into());
208        self
209    }
210    /// <p>The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.</p>
211    pub fn set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.inner = self.inner.set_political_view(input);
213        self
214    }
215    /// <p>The alpha-2 or alpha-3 character code for the political view of a country. The political view applies to the results of the request to represent unresolved territorial claims through the point of view of the specified country.</p>
216    pub fn get_political_view(&self) -> &::std::option::Option<::std::string::String> {
217        self.inner.get_political_view()
218    }
219    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
220    /// <p>Storing the response of an ReverseGeocode query is required to comply with service terms, but charged at a higher cost per request. Please review the <a href="https://aws.amazon.com/location/sla/">user agreement</a> and <a href="https://aws.amazon.com/location/pricing/">service pricing structure</a> to determine the correct setting for your use case.</p>
221    /// </note>
222    pub fn intended_use(mut self, input: crate::types::ReverseGeocodeIntendedUse) -> Self {
223        self.inner = self.inner.intended_use(input);
224        self
225    }
226    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
227    /// <p>Storing the response of an ReverseGeocode query is required to comply with service terms, but charged at a higher cost per request. Please review the <a href="https://aws.amazon.com/location/sla/">user agreement</a> and <a href="https://aws.amazon.com/location/pricing/">service pricing structure</a> to determine the correct setting for your use case.</p>
228    /// </note>
229    pub fn set_intended_use(mut self, input: ::std::option::Option<crate::types::ReverseGeocodeIntendedUse>) -> Self {
230        self.inner = self.inner.set_intended_use(input);
231        self
232    }
233    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
234    /// <p>Storing the response of an ReverseGeocode query is required to comply with service terms, but charged at a higher cost per request. Please review the <a href="https://aws.amazon.com/location/sla/">user agreement</a> and <a href="https://aws.amazon.com/location/pricing/">service pricing structure</a> to determine the correct setting for your use case.</p>
235    /// </note>
236    pub fn get_intended_use(&self) -> &::std::option::Option<crate::types::ReverseGeocodeIntendedUse> {
237        self.inner.get_intended_use()
238    }
239    /// <p>Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.</p>
240    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
241        self.inner = self.inner.key(input.into());
242        self
243    }
244    /// <p>Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.</p>
245    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246        self.inner = self.inner.set_key(input);
247        self
248    }
249    /// <p>Optional: The API key to be used for authorization. Either an API key or valid SigV4 signature must be provided when making a request.</p>
250    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
251        self.inner.get_key()
252    }
253}