aws_sdk_geoplaces/operation/search_text/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::search_text::_search_text_output::SearchTextOutputBuilder;
3
4pub use crate::operation::search_text::_search_text_input::SearchTextInputBuilder;
5
6impl crate::operation::search_text::builders::SearchTextInputBuilder {
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::search_text::SearchTextOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::search_text::SearchTextError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.search_text();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SearchText`.
24///
25/// <p><code>SearchText</code> searches for geocode and place information. You can then complete a follow-up query suggested from the <code>Suggest</code> API via a query id.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SearchTextFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::search_text::builders::SearchTextInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::search_text::SearchTextOutput,
35        crate::operation::search_text::SearchTextError,
36    > for SearchTextFluentBuilder
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::search_text::SearchTextOutput,
44            crate::operation::search_text::SearchTextError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl SearchTextFluentBuilder {
51    /// Creates a new `SearchTextFluentBuilder`.
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 SearchText as a reference.
60    pub fn as_input(&self) -> &crate::operation::search_text::builders::SearchTextInputBuilder {
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::search_text::SearchTextOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::search_text::SearchTextError,
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::search_text::SearchText::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::search_text::SearchText::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::search_text::SearchTextOutput,
97        crate::operation::search_text::SearchTextError,
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    /// <p>The free-form text query to match addresses against. This is usually a partially typed address from an end user in an address box or form.</p><note>
112    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
113    /// </note>
114    pub fn query_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.query_text(input.into());
116        self
117    }
118    /// <p>The free-form text query to match addresses against. This is usually a partially typed address from an end user in an address box or form.</p><note>
119    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
120    /// </note>
121    pub fn set_query_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_query_text(input);
123        self
124    }
125    /// <p>The free-form text query to match addresses against. This is usually a partially typed address from an end user in an address box or form.</p><note>
126    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
127    /// </note>
128    pub fn get_query_text(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_query_text()
130    }
131    /// <p>The query Id returned by the suggest API. If passed in the request, the SearchText API will preform a SearchText query with the improved query terms for the original query made to the suggest API.</p><note>
132    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
133    /// </note>
134    pub fn query_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.inner = self.inner.query_id(input.into());
136        self
137    }
138    /// <p>The query Id returned by the suggest API. If passed in the request, the SearchText API will preform a SearchText query with the improved query terms for the original query made to the suggest API.</p><note>
139    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
140    /// </note>
141    pub fn set_query_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_query_id(input);
143        self
144    }
145    /// <p>The query Id returned by the suggest API. If passed in the request, the SearchText API will preform a SearchText query with the improved query terms for the original query made to the suggest API.</p><note>
146    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
147    /// </note>
148    pub fn get_query_id(&self) -> &::std::option::Option<::std::string::String> {
149        self.inner.get_query_id()
150    }
151    /// <p>An optional limit for the number of results returned in a single call.</p>
152    pub fn max_results(mut self, input: i32) -> Self {
153        self.inner = self.inner.max_results(input);
154        self
155    }
156    /// <p>An optional limit for the number of results returned in a single call.</p>
157    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
158        self.inner = self.inner.set_max_results(input);
159        self
160    }
161    /// <p>An optional limit for the number of results returned in a single call.</p>
162    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
163        self.inner.get_max_results()
164    }
165    ///
166    /// Appends an item to `BiasPosition`.
167    ///
168    /// To override the contents of this collection use [`set_bias_position`](Self::set_bias_position).
169    ///
170    /// <p>The position, in longitude and latitude, that the results should be close to. Typically, place results returned are ranked higher the closer they are to this position. Stored in <code>\[lng, lat\]</code> and in the WSG84 format.</p><note>
171    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
172    /// </note>
173    pub fn bias_position(mut self, input: f64) -> Self {
174        self.inner = self.inner.bias_position(input);
175        self
176    }
177    /// <p>The position, in longitude and latitude, that the results should be close to. Typically, place results returned are ranked higher the closer they are to this position. Stored in <code>\[lng, lat\]</code> and in the WSG84 format.</p><note>
178    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
179    /// </note>
180    pub fn set_bias_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
181        self.inner = self.inner.set_bias_position(input);
182        self
183    }
184    /// <p>The position, in longitude and latitude, that the results should be close to. Typically, place results returned are ranked higher the closer they are to this position. Stored in <code>\[lng, lat\]</code> and in the WSG84 format.</p><note>
185    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
186    /// </note>
187    pub fn get_bias_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
188        self.inner.get_bias_position()
189    }
190    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
191    pub fn filter(mut self, input: crate::types::SearchTextFilter) -> Self {
192        self.inner = self.inner.filter(input);
193        self
194    }
195    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
196    pub fn set_filter(mut self, input: ::std::option::Option<crate::types::SearchTextFilter>) -> Self {
197        self.inner = self.inner.set_filter(input);
198        self
199    }
200    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
201    pub fn get_filter(&self) -> &::std::option::Option<crate::types::SearchTextFilter> {
202        self.inner.get_filter()
203    }
204    ///
205    /// Appends an item to `AdditionalFeatures`.
206    ///
207    /// To override the contents of this collection use [`set_additional_features`](Self::set_additional_features).
208    ///
209    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
210    pub fn additional_features(mut self, input: crate::types::SearchTextAdditionalFeature) -> Self {
211        self.inner = self.inner.additional_features(input);
212        self
213    }
214    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
215    pub fn set_additional_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchTextAdditionalFeature>>) -> Self {
216        self.inner = self.inner.set_additional_features(input);
217        self
218    }
219    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
220    pub fn get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchTextAdditionalFeature>> {
221        self.inner.get_additional_features()
222    }
223    /// <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>
224    pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
225        self.inner = self.inner.language(input.into());
226        self
227    }
228    /// <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>
229    pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
230        self.inner = self.inner.set_language(input);
231        self
232    }
233    /// <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>
234    pub fn get_language(&self) -> &::std::option::Option<::std::string::String> {
235        self.inner.get_language()
236    }
237    /// <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>
238    pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
239        self.inner = self.inner.political_view(input.into());
240        self
241    }
242    /// <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>
243    pub fn set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
244        self.inner = self.inner.set_political_view(input);
245        self
246    }
247    /// <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>
248    pub fn get_political_view(&self) -> &::std::option::Option<::std::string::String> {
249        self.inner.get_political_view()
250    }
251    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
252    /// <p>Storing the response of an SearchText 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>
253    /// </note>
254    pub fn intended_use(mut self, input: crate::types::SearchTextIntendedUse) -> Self {
255        self.inner = self.inner.intended_use(input);
256        self
257    }
258    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
259    /// <p>Storing the response of an SearchText 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>
260    /// </note>
261    pub fn set_intended_use(mut self, input: ::std::option::Option<crate::types::SearchTextIntendedUse>) -> Self {
262        self.inner = self.inner.set_intended_use(input);
263        self
264    }
265    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
266    /// <p>Storing the response of an SearchText 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>
267    /// </note>
268    pub fn get_intended_use(&self) -> &::std::option::Option<crate::types::SearchTextIntendedUse> {
269        self.inner.get_intended_use()
270    }
271    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page.</p>
272    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273        self.inner = self.inner.next_token(input.into());
274        self
275    }
276    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page.</p>
277    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278        self.inner = self.inner.set_next_token(input);
279        self
280    }
281    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page.</p>
282    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
283        self.inner.get_next_token()
284    }
285    /// <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>
286    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
287        self.inner = self.inner.key(input.into());
288        self
289    }
290    /// <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>
291    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
292        self.inner = self.inner.set_key(input);
293        self
294    }
295    /// <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>
296    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
297        self.inner.get_key()
298    }
299}