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>Use the <code>SearchText</code> operation to search 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>
112    pub fn query_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.query_text(input.into());
114        self
115    }
116    /// <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>
117    pub fn set_query_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_query_text(input);
119        self
120    }
121    /// <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>
122    pub fn get_query_text(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_query_text()
124    }
125    /// <p>The query Id.</p>
126    pub fn query_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.query_id(input.into());
128        self
129    }
130    /// <p>The query Id.</p>
131    pub fn set_query_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_query_id(input);
133        self
134    }
135    /// <p>The query Id.</p>
136    pub fn get_query_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_query_id()
138    }
139    /// <p>An optional limit for the number of results returned in a single call.</p>
140    pub fn max_results(mut self, input: i32) -> Self {
141        self.inner = self.inner.max_results(input);
142        self
143    }
144    /// <p>An optional limit for the number of results returned in a single call.</p>
145    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
146        self.inner = self.inner.set_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 get_max_results(&self) -> &::std::option::Option<i32> {
151        self.inner.get_max_results()
152    }
153    ///
154    /// Appends an item to `BiasPosition`.
155    ///
156    /// To override the contents of this collection use [`set_bias_position`](Self::set_bias_position).
157    ///
158    /// <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>
159    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
160    /// </note>
161    pub fn bias_position(mut self, input: f64) -> Self {
162        self.inner = self.inner.bias_position(input);
163        self
164    }
165    /// <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>
166    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
167    /// </note>
168    pub fn set_bias_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
169        self.inner = self.inner.set_bias_position(input);
170        self
171    }
172    /// <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>
173    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
174    /// </note>
175    pub fn get_bias_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
176        self.inner.get_bias_position()
177    }
178    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
179    pub fn filter(mut self, input: crate::types::SearchTextFilter) -> Self {
180        self.inner = self.inner.filter(input);
181        self
182    }
183    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
184    pub fn set_filter(mut self, input: ::std::option::Option<crate::types::SearchTextFilter>) -> Self {
185        self.inner = self.inner.set_filter(input);
186        self
187    }
188    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
189    pub fn get_filter(&self) -> &::std::option::Option<crate::types::SearchTextFilter> {
190        self.inner.get_filter()
191    }
192    ///
193    /// Appends an item to `AdditionalFeatures`.
194    ///
195    /// To override the contents of this collection use [`set_additional_features`](Self::set_additional_features).
196    ///
197    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
198    pub fn additional_features(mut self, input: crate::types::SearchTextAdditionalFeature) -> Self {
199        self.inner = self.inner.additional_features(input);
200        self
201    }
202    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
203    pub fn set_additional_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchTextAdditionalFeature>>) -> Self {
204        self.inner = self.inner.set_additional_features(input);
205        self
206    }
207    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
208    pub fn get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchTextAdditionalFeature>> {
209        self.inner.get_additional_features()
210    }
211    /// <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>
212    pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
213        self.inner = self.inner.language(input.into());
214        self
215    }
216    /// <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>
217    pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
218        self.inner = self.inner.set_language(input);
219        self
220    }
221    /// <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>
222    pub fn get_language(&self) -> &::std::option::Option<::std::string::String> {
223        self.inner.get_language()
224    }
225    /// <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>
226    pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227        self.inner = self.inner.political_view(input.into());
228        self
229    }
230    /// <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>
231    pub fn set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232        self.inner = self.inner.set_political_view(input);
233        self
234    }
235    /// <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>
236    pub fn get_political_view(&self) -> &::std::option::Option<::std::string::String> {
237        self.inner.get_political_view()
238    }
239    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
240    pub fn intended_use(mut self, input: crate::types::SearchTextIntendedUse) -> Self {
241        self.inner = self.inner.intended_use(input);
242        self
243    }
244    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
245    pub fn set_intended_use(mut self, input: ::std::option::Option<crate::types::SearchTextIntendedUse>) -> Self {
246        self.inner = self.inner.set_intended_use(input);
247        self
248    }
249    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
250    pub fn get_intended_use(&self) -> &::std::option::Option<crate::types::SearchTextIntendedUse> {
251        self.inner.get_intended_use()
252    }
253    /// <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>
254    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
255        self.inner = self.inner.next_token(input.into());
256        self
257    }
258    /// <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>
259    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
260        self.inner = self.inner.set_next_token(input);
261        self
262    }
263    /// <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>
264    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
265        self.inner.get_next_token()
266    }
267    /// <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>
268    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
269        self.inner = self.inner.key(input.into());
270        self
271    }
272    /// <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>
273    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
274        self.inner = self.inner.set_key(input);
275        self
276    }
277    /// <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>
278    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
279        self.inner.get_key()
280    }
281}