aws_sdk_geoplaces/operation/autocomplete/
_autocomplete_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 AutocompleteInput {
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>
7    pub query_text: ::std::option::Option<::std::string::String>,
8    /// <p>An optional limit for the number of results returned in a single call.</p>
9    pub max_results: ::std::option::Option<i32>,
10    /// <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>
11    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
12    /// </note>
13    pub bias_position: ::std::option::Option<::std::vec::Vec<f64>>,
14    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
15    pub filter: ::std::option::Option<crate::types::AutocompleteFilter>,
16    /// <p>The <code>PostalCodeMode</code> affects how postal code results are returned. If a postal code spans multiple localities and this value is empty, partial district or locality information may be returned under a single postal code result entry. If it's populated with the value <code>cityLookup</code>, all cities in that postal code are returned.</p>
17    pub postal_code_mode: ::std::option::Option<crate::types::PostalCodeMode>,
18    /// <p>A list of optional additional parameters that can be requested for each result.</p>
19    pub additional_features: ::std::option::Option<::std::vec::Vec<crate::types::AutocompleteAdditionalFeature>>,
20    /// <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>
21    pub language: ::std::option::Option<::std::string::String>,
22    /// <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>
23    pub political_view: ::std::option::Option<::std::string::String>,
24    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
25    pub intended_use: ::std::option::Option<crate::types::AutocompleteIntendedUse>,
26    /// <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>
27    pub key: ::std::option::Option<::std::string::String>,
28}
29impl AutocompleteInput {
30    /// <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>
31    pub fn query_text(&self) -> ::std::option::Option<&str> {
32        self.query_text.as_deref()
33    }
34    /// <p>An optional limit for the number of results returned in a single call.</p>
35    pub fn max_results(&self) -> ::std::option::Option<i32> {
36        self.max_results
37    }
38    /// <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>
39    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
40    /// </note>
41    ///
42    /// 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()`.
43    pub fn bias_position(&self) -> &[f64] {
44        self.bias_position.as_deref().unwrap_or_default()
45    }
46    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
47    pub fn filter(&self) -> ::std::option::Option<&crate::types::AutocompleteFilter> {
48        self.filter.as_ref()
49    }
50    /// <p>The <code>PostalCodeMode</code> affects how postal code results are returned. If a postal code spans multiple localities and this value is empty, partial district or locality information may be returned under a single postal code result entry. If it's populated with the value <code>cityLookup</code>, all cities in that postal code are returned.</p>
51    pub fn postal_code_mode(&self) -> ::std::option::Option<&crate::types::PostalCodeMode> {
52        self.postal_code_mode.as_ref()
53    }
54    /// <p>A list of optional additional parameters that can be requested for each result.</p>
55    ///
56    /// 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()`.
57    pub fn additional_features(&self) -> &[crate::types::AutocompleteAdditionalFeature] {
58        self.additional_features.as_deref().unwrap_or_default()
59    }
60    /// <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>
61    pub fn language(&self) -> ::std::option::Option<&str> {
62        self.language.as_deref()
63    }
64    /// <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>
65    pub fn political_view(&self) -> ::std::option::Option<&str> {
66        self.political_view.as_deref()
67    }
68    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
69    pub fn intended_use(&self) -> ::std::option::Option<&crate::types::AutocompleteIntendedUse> {
70        self.intended_use.as_ref()
71    }
72    /// <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>
73    pub fn key(&self) -> ::std::option::Option<&str> {
74        self.key.as_deref()
75    }
76}
77impl ::std::fmt::Debug for AutocompleteInput {
78    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
79        let mut formatter = f.debug_struct("AutocompleteInput");
80        formatter.field("query_text", &"*** Sensitive Data Redacted ***");
81        formatter.field("max_results", &self.max_results);
82        formatter.field("bias_position", &"*** Sensitive Data Redacted ***");
83        formatter.field("filter", &self.filter);
84        formatter.field("postal_code_mode", &self.postal_code_mode);
85        formatter.field("additional_features", &self.additional_features);
86        formatter.field("language", &self.language);
87        formatter.field("political_view", &self.political_view);
88        formatter.field("intended_use", &self.intended_use);
89        formatter.field("key", &"*** Sensitive Data Redacted ***");
90        formatter.finish()
91    }
92}
93impl AutocompleteInput {
94    /// Creates a new builder-style object to manufacture [`AutocompleteInput`](crate::operation::autocomplete::AutocompleteInput).
95    pub fn builder() -> crate::operation::autocomplete::builders::AutocompleteInputBuilder {
96        crate::operation::autocomplete::builders::AutocompleteInputBuilder::default()
97    }
98}
99
100/// A builder for [`AutocompleteInput`](crate::operation::autocomplete::AutocompleteInput).
101#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
102#[non_exhaustive]
103pub struct AutocompleteInputBuilder {
104    pub(crate) query_text: ::std::option::Option<::std::string::String>,
105    pub(crate) max_results: ::std::option::Option<i32>,
106    pub(crate) bias_position: ::std::option::Option<::std::vec::Vec<f64>>,
107    pub(crate) filter: ::std::option::Option<crate::types::AutocompleteFilter>,
108    pub(crate) postal_code_mode: ::std::option::Option<crate::types::PostalCodeMode>,
109    pub(crate) additional_features: ::std::option::Option<::std::vec::Vec<crate::types::AutocompleteAdditionalFeature>>,
110    pub(crate) language: ::std::option::Option<::std::string::String>,
111    pub(crate) political_view: ::std::option::Option<::std::string::String>,
112    pub(crate) intended_use: ::std::option::Option<crate::types::AutocompleteIntendedUse>,
113    pub(crate) key: ::std::option::Option<::std::string::String>,
114}
115impl AutocompleteInputBuilder {
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    /// This field is required.
118    pub fn query_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.query_text = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <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>
123    pub fn set_query_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.query_text = input;
125        self
126    }
127    /// <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>
128    pub fn get_query_text(&self) -> &::std::option::Option<::std::string::String> {
129        &self.query_text
130    }
131    /// <p>An optional limit for the number of results returned in a single call.</p>
132    pub fn max_results(mut self, input: i32) -> Self {
133        self.max_results = ::std::option::Option::Some(input);
134        self
135    }
136    /// <p>An optional limit for the number of results returned in a single call.</p>
137    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
138        self.max_results = input;
139        self
140    }
141    /// <p>An optional limit for the number of results returned in a single call.</p>
142    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
143        &self.max_results
144    }
145    /// Appends an item to `bias_position`.
146    ///
147    /// To override the contents of this collection use [`set_bias_position`](Self::set_bias_position).
148    ///
149    /// <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>
150    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
151    /// </note>
152    pub fn bias_position(mut self, input: f64) -> Self {
153        let mut v = self.bias_position.unwrap_or_default();
154        v.push(input);
155        self.bias_position = ::std::option::Option::Some(v);
156        self
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 set_bias_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
162        self.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 get_bias_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
169        &self.bias_position
170    }
171    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
172    pub fn filter(mut self, input: crate::types::AutocompleteFilter) -> Self {
173        self.filter = ::std::option::Option::Some(input);
174        self
175    }
176    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
177    pub fn set_filter(mut self, input: ::std::option::Option<crate::types::AutocompleteFilter>) -> Self {
178        self.filter = input;
179        self
180    }
181    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
182    pub fn get_filter(&self) -> &::std::option::Option<crate::types::AutocompleteFilter> {
183        &self.filter
184    }
185    /// <p>The <code>PostalCodeMode</code> affects how postal code results are returned. If a postal code spans multiple localities and this value is empty, partial district or locality information may be returned under a single postal code result entry. If it's populated with the value <code>cityLookup</code>, all cities in that postal code are returned.</p>
186    pub fn postal_code_mode(mut self, input: crate::types::PostalCodeMode) -> Self {
187        self.postal_code_mode = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>The <code>PostalCodeMode</code> affects how postal code results are returned. If a postal code spans multiple localities and this value is empty, partial district or locality information may be returned under a single postal code result entry. If it's populated with the value <code>cityLookup</code>, all cities in that postal code are returned.</p>
191    pub fn set_postal_code_mode(mut self, input: ::std::option::Option<crate::types::PostalCodeMode>) -> Self {
192        self.postal_code_mode = input;
193        self
194    }
195    /// <p>The <code>PostalCodeMode</code> affects how postal code results are returned. If a postal code spans multiple localities and this value is empty, partial district or locality information may be returned under a single postal code result entry. If it's populated with the value <code>cityLookup</code>, all cities in that postal code are returned.</p>
196    pub fn get_postal_code_mode(&self) -> &::std::option::Option<crate::types::PostalCodeMode> {
197        &self.postal_code_mode
198    }
199    /// Appends an item to `additional_features`.
200    ///
201    /// To override the contents of this collection use [`set_additional_features`](Self::set_additional_features).
202    ///
203    /// <p>A list of optional additional parameters that can be requested for each result.</p>
204    pub fn additional_features(mut self, input: crate::types::AutocompleteAdditionalFeature) -> Self {
205        let mut v = self.additional_features.unwrap_or_default();
206        v.push(input);
207        self.additional_features = ::std::option::Option::Some(v);
208        self
209    }
210    /// <p>A list of optional additional parameters that can be requested for each result.</p>
211    pub fn set_additional_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AutocompleteAdditionalFeature>>) -> Self {
212        self.additional_features = input;
213        self
214    }
215    /// <p>A list of optional additional parameters that can be requested for each result.</p>
216    pub fn get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AutocompleteAdditionalFeature>> {
217        &self.additional_features
218    }
219    /// <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>
220    pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
221        self.language = ::std::option::Option::Some(input.into());
222        self
223    }
224    /// <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>
225    pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
226        self.language = input;
227        self
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 get_language(&self) -> &::std::option::Option<::std::string::String> {
231        &self.language
232    }
233    /// <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>
234    pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.political_view = ::std::option::Option::Some(input.into());
236        self
237    }
238    /// <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>
239    pub fn set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240        self.political_view = input;
241        self
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 get_political_view(&self) -> &::std::option::Option<::std::string::String> {
245        &self.political_view
246    }
247    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
248    pub fn intended_use(mut self, input: crate::types::AutocompleteIntendedUse) -> Self {
249        self.intended_use = ::std::option::Option::Some(input);
250        self
251    }
252    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
253    pub fn set_intended_use(mut self, input: ::std::option::Option<crate::types::AutocompleteIntendedUse>) -> Self {
254        self.intended_use = input;
255        self
256    }
257    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
258    pub fn get_intended_use(&self) -> &::std::option::Option<crate::types::AutocompleteIntendedUse> {
259        &self.intended_use
260    }
261    /// <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>
262    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
263        self.key = ::std::option::Option::Some(input.into());
264        self
265    }
266    /// <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>
267    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268        self.key = input;
269        self
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 get_key(&self) -> &::std::option::Option<::std::string::String> {
273        &self.key
274    }
275    /// Consumes the builder and constructs a [`AutocompleteInput`](crate::operation::autocomplete::AutocompleteInput).
276    pub fn build(self) -> ::std::result::Result<crate::operation::autocomplete::AutocompleteInput, ::aws_smithy_types::error::operation::BuildError> {
277        ::std::result::Result::Ok(crate::operation::autocomplete::AutocompleteInput {
278            query_text: self.query_text,
279            max_results: self.max_results,
280            bias_position: self.bias_position,
281            filter: self.filter,
282            postal_code_mode: self.postal_code_mode,
283            additional_features: self.additional_features,
284            language: self.language,
285            political_view: self.political_view,
286            intended_use: self.intended_use,
287            key: self.key,
288        })
289    }
290}
291impl ::std::fmt::Debug for AutocompleteInputBuilder {
292    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
293        let mut formatter = f.debug_struct("AutocompleteInputBuilder");
294        formatter.field("query_text", &"*** Sensitive Data Redacted ***");
295        formatter.field("max_results", &self.max_results);
296        formatter.field("bias_position", &"*** Sensitive Data Redacted ***");
297        formatter.field("filter", &self.filter);
298        formatter.field("postal_code_mode", &self.postal_code_mode);
299        formatter.field("additional_features", &self.additional_features);
300        formatter.field("language", &self.language);
301        formatter.field("political_view", &self.political_view);
302        formatter.field("intended_use", &self.intended_use);
303        formatter.field("key", &"*** Sensitive Data Redacted ***");
304        formatter.finish()
305    }
306}