aws_sdk_geoplaces/operation/suggest/
_suggest_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct SuggestInput {
6    /// <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>
7    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
8    /// </note>
9    pub query_text: ::std::option::Option<::std::string::String>,
10    /// <p>An optional limit for the number of results returned in a single call.</p>
11    pub max_results: ::std::option::Option<i32>,
12    /// <p>Maximum number of query terms to be returned for use with a search text query.</p>
13    pub max_query_refinements: ::std::option::Option<i32>,
14    /// <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>
15    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
16    /// </note>
17    pub bias_position: ::std::option::Option<::std::vec::Vec<f64>>,
18    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
19    pub filter: ::std::option::Option<crate::types::SuggestFilter>,
20    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
21    pub additional_features: ::std::option::Option<::std::vec::Vec<crate::types::SuggestAdditionalFeature>>,
22    /// <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>
23    pub language: ::std::option::Option<::std::string::String>,
24    /// <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>
25    pub political_view: ::std::option::Option<::std::string::String>,
26    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
27    pub intended_use: ::std::option::Option<crate::types::SuggestIntendedUse>,
28    /// <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>
29    pub key: ::std::option::Option<::std::string::String>,
30}
31impl SuggestInput {
32    /// <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>
33    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
34    /// </note>
35    pub fn query_text(&self) -> ::std::option::Option<&str> {
36        self.query_text.as_deref()
37    }
38    /// <p>An optional limit for the number of results returned in a single call.</p>
39    pub fn max_results(&self) -> ::std::option::Option<i32> {
40        self.max_results
41    }
42    /// <p>Maximum number of query terms to be returned for use with a search text query.</p>
43    pub fn max_query_refinements(&self) -> ::std::option::Option<i32> {
44        self.max_query_refinements
45    }
46    /// <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>
47    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
48    /// </note>
49    ///
50    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.bias_position.is_none()`.
51    pub fn bias_position(&self) -> &[f64] {
52        self.bias_position.as_deref().unwrap_or_default()
53    }
54    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
55    pub fn filter(&self) -> ::std::option::Option<&crate::types::SuggestFilter> {
56        self.filter.as_ref()
57    }
58    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
59    ///
60    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.additional_features.is_none()`.
61    pub fn additional_features(&self) -> &[crate::types::SuggestAdditionalFeature] {
62        self.additional_features.as_deref().unwrap_or_default()
63    }
64    /// <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>
65    pub fn language(&self) -> ::std::option::Option<&str> {
66        self.language.as_deref()
67    }
68    /// <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>
69    pub fn political_view(&self) -> ::std::option::Option<&str> {
70        self.political_view.as_deref()
71    }
72    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
73    pub fn intended_use(&self) -> ::std::option::Option<&crate::types::SuggestIntendedUse> {
74        self.intended_use.as_ref()
75    }
76    /// <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>
77    pub fn key(&self) -> ::std::option::Option<&str> {
78        self.key.as_deref()
79    }
80}
81impl ::std::fmt::Debug for SuggestInput {
82    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
83        let mut formatter = f.debug_struct("SuggestInput");
84        formatter.field("query_text", &"*** Sensitive Data Redacted ***");
85        formatter.field("max_results", &self.max_results);
86        formatter.field("max_query_refinements", &self.max_query_refinements);
87        formatter.field("bias_position", &"*** Sensitive Data Redacted ***");
88        formatter.field("filter", &self.filter);
89        formatter.field("additional_features", &self.additional_features);
90        formatter.field("language", &self.language);
91        formatter.field("political_view", &"*** Sensitive Data Redacted ***");
92        formatter.field("intended_use", &self.intended_use);
93        formatter.field("key", &"*** Sensitive Data Redacted ***");
94        formatter.finish()
95    }
96}
97impl SuggestInput {
98    /// Creates a new builder-style object to manufacture [`SuggestInput`](crate::operation::suggest::SuggestInput).
99    pub fn builder() -> crate::operation::suggest::builders::SuggestInputBuilder {
100        crate::operation::suggest::builders::SuggestInputBuilder::default()
101    }
102}
103
104/// A builder for [`SuggestInput`](crate::operation::suggest::SuggestInput).
105#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
106#[non_exhaustive]
107pub struct SuggestInputBuilder {
108    pub(crate) query_text: ::std::option::Option<::std::string::String>,
109    pub(crate) max_results: ::std::option::Option<i32>,
110    pub(crate) max_query_refinements: ::std::option::Option<i32>,
111    pub(crate) bias_position: ::std::option::Option<::std::vec::Vec<f64>>,
112    pub(crate) filter: ::std::option::Option<crate::types::SuggestFilter>,
113    pub(crate) additional_features: ::std::option::Option<::std::vec::Vec<crate::types::SuggestAdditionalFeature>>,
114    pub(crate) language: ::std::option::Option<::std::string::String>,
115    pub(crate) political_view: ::std::option::Option<::std::string::String>,
116    pub(crate) intended_use: ::std::option::Option<crate::types::SuggestIntendedUse>,
117    pub(crate) key: ::std::option::Option<::std::string::String>,
118}
119impl SuggestInputBuilder {
120    /// <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>
121    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
122    /// </note>
123    /// This field is required.
124    pub fn query_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.query_text = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <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>
129    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
130    /// </note>
131    pub fn set_query_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.query_text = input;
133        self
134    }
135    /// <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>
136    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
137    /// </note>
138    pub fn get_query_text(&self) -> &::std::option::Option<::std::string::String> {
139        &self.query_text
140    }
141    /// <p>An optional limit for the number of results returned in a single call.</p>
142    pub fn max_results(mut self, input: i32) -> Self {
143        self.max_results = ::std::option::Option::Some(input);
144        self
145    }
146    /// <p>An optional limit for the number of results returned in a single call.</p>
147    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
148        self.max_results = input;
149        self
150    }
151    /// <p>An optional limit for the number of results returned in a single call.</p>
152    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
153        &self.max_results
154    }
155    /// <p>Maximum number of query terms to be returned for use with a search text query.</p>
156    pub fn max_query_refinements(mut self, input: i32) -> Self {
157        self.max_query_refinements = ::std::option::Option::Some(input);
158        self
159    }
160    /// <p>Maximum number of query terms to be returned for use with a search text query.</p>
161    pub fn set_max_query_refinements(mut self, input: ::std::option::Option<i32>) -> Self {
162        self.max_query_refinements = input;
163        self
164    }
165    /// <p>Maximum number of query terms to be returned for use with a search text query.</p>
166    pub fn get_max_query_refinements(&self) -> &::std::option::Option<i32> {
167        &self.max_query_refinements
168    }
169    /// Appends an item to `bias_position`.
170    ///
171    /// To override the contents of this collection use [`set_bias_position`](Self::set_bias_position).
172    ///
173    /// <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>
174    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
175    /// </note>
176    pub fn bias_position(mut self, input: f64) -> Self {
177        let mut v = self.bias_position.unwrap_or_default();
178        v.push(input);
179        self.bias_position = ::std::option::Option::Some(v);
180        self
181    }
182    /// <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>
183    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
184    /// </note>
185    pub fn set_bias_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
186        self.bias_position = input;
187        self
188    }
189    /// <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>
190    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
191    /// </note>
192    pub fn get_bias_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
193        &self.bias_position
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 filter(mut self, input: crate::types::SuggestFilter) -> Self {
197        self.filter = ::std::option::Option::Some(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 set_filter(mut self, input: ::std::option::Option<crate::types::SuggestFilter>) -> Self {
202        self.filter = input;
203        self
204    }
205    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
206    pub fn get_filter(&self) -> &::std::option::Option<crate::types::SuggestFilter> {
207        &self.filter
208    }
209    /// Appends an item to `additional_features`.
210    ///
211    /// To override the contents of this collection use [`set_additional_features`](Self::set_additional_features).
212    ///
213    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
214    pub fn additional_features(mut self, input: crate::types::SuggestAdditionalFeature) -> Self {
215        let mut v = self.additional_features.unwrap_or_default();
216        v.push(input);
217        self.additional_features = ::std::option::Option::Some(v);
218        self
219    }
220    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
221    pub fn set_additional_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SuggestAdditionalFeature>>) -> Self {
222        self.additional_features = input;
223        self
224    }
225    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
226    pub fn get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SuggestAdditionalFeature>> {
227        &self.additional_features
228    }
229    /// <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>
230    pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.language = ::std::option::Option::Some(input.into());
232        self
233    }
234    /// <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>
235    pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236        self.language = input;
237        self
238    }
239    /// <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>
240    pub fn get_language(&self) -> &::std::option::Option<::std::string::String> {
241        &self.language
242    }
243    /// <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>
244    pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.political_view = ::std::option::Option::Some(input.into());
246        self
247    }
248    /// <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>
249    pub fn set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.political_view = input;
251        self
252    }
253    /// <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>
254    pub fn get_political_view(&self) -> &::std::option::Option<::std::string::String> {
255        &self.political_view
256    }
257    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
258    pub fn intended_use(mut self, input: crate::types::SuggestIntendedUse) -> Self {
259        self.intended_use = ::std::option::Option::Some(input);
260        self
261    }
262    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
263    pub fn set_intended_use(mut self, input: ::std::option::Option<crate::types::SuggestIntendedUse>) -> Self {
264        self.intended_use = input;
265        self
266    }
267    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
268    pub fn get_intended_use(&self) -> &::std::option::Option<crate::types::SuggestIntendedUse> {
269        &self.intended_use
270    }
271    /// <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>
272    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273        self.key = ::std::option::Option::Some(input.into());
274        self
275    }
276    /// <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>
277    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278        self.key = input;
279        self
280    }
281    /// <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>
282    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
283        &self.key
284    }
285    /// Consumes the builder and constructs a [`SuggestInput`](crate::operation::suggest::SuggestInput).
286    pub fn build(self) -> ::std::result::Result<crate::operation::suggest::SuggestInput, ::aws_smithy_types::error::operation::BuildError> {
287        ::std::result::Result::Ok(crate::operation::suggest::SuggestInput {
288            query_text: self.query_text,
289            max_results: self.max_results,
290            max_query_refinements: self.max_query_refinements,
291            bias_position: self.bias_position,
292            filter: self.filter,
293            additional_features: self.additional_features,
294            language: self.language,
295            political_view: self.political_view,
296            intended_use: self.intended_use,
297            key: self.key,
298        })
299    }
300}
301impl ::std::fmt::Debug for SuggestInputBuilder {
302    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
303        let mut formatter = f.debug_struct("SuggestInputBuilder");
304        formatter.field("query_text", &"*** Sensitive Data Redacted ***");
305        formatter.field("max_results", &self.max_results);
306        formatter.field("max_query_refinements", &self.max_query_refinements);
307        formatter.field("bias_position", &"*** Sensitive Data Redacted ***");
308        formatter.field("filter", &self.filter);
309        formatter.field("additional_features", &self.additional_features);
310        formatter.field("language", &self.language);
311        formatter.field("political_view", &"*** Sensitive Data Redacted ***");
312        formatter.field("intended_use", &self.intended_use);
313        formatter.field("key", &"*** Sensitive Data Redacted ***");
314        formatter.finish()
315    }
316}