aws_sdk_geoplaces/operation/geocode/
_geocode_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 GeocodeInput {
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>A structured free text query allows you to search for places by the name or text representation of specific properties of the place.</p>
9    pub query_components: ::std::option::Option<crate::types::GeocodeQueryComponents>,
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>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>
13    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
14    /// </note>
15    pub bias_position: ::std::option::Option<::std::vec::Vec<f64>>,
16    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
17    pub filter: ::std::option::Option<crate::types::GeocodeFilter>,
18    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
19    pub additional_features: ::std::option::Option<::std::vec::Vec<crate::types::GeocodeAdditionalFeature>>,
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::GeocodeIntendedUse>,
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 GeocodeInput {
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>A structured free text query allows you to search for places by the name or text representation of specific properties of the place.</p>
35    pub fn query_components(&self) -> ::std::option::Option<&crate::types::GeocodeQueryComponents> {
36        self.query_components.as_ref()
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>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>
43    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
44    /// </note>
45    ///
46    /// 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()`.
47    pub fn bias_position(&self) -> &[f64] {
48        self.bias_position.as_deref().unwrap_or_default()
49    }
50    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
51    pub fn filter(&self) -> ::std::option::Option<&crate::types::GeocodeFilter> {
52        self.filter.as_ref()
53    }
54    /// <p>A list of optional additional parameters, such as time zone, 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::GeocodeAdditionalFeature] {
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::GeocodeIntendedUse> {
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 GeocodeInput {
78    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
79        let mut formatter = f.debug_struct("GeocodeInput");
80        formatter.field("query_text", &"*** Sensitive Data Redacted ***");
81        formatter.field("query_components", &self.query_components);
82        formatter.field("max_results", &self.max_results);
83        formatter.field("bias_position", &"*** Sensitive Data Redacted ***");
84        formatter.field("filter", &self.filter);
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 GeocodeInput {
94    /// Creates a new builder-style object to manufacture [`GeocodeInput`](crate::operation::geocode::GeocodeInput).
95    pub fn builder() -> crate::operation::geocode::builders::GeocodeInputBuilder {
96        crate::operation::geocode::builders::GeocodeInputBuilder::default()
97    }
98}
99
100/// A builder for [`GeocodeInput`](crate::operation::geocode::GeocodeInput).
101#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
102#[non_exhaustive]
103pub struct GeocodeInputBuilder {
104    pub(crate) query_text: ::std::option::Option<::std::string::String>,
105    pub(crate) query_components: ::std::option::Option<crate::types::GeocodeQueryComponents>,
106    pub(crate) max_results: ::std::option::Option<i32>,
107    pub(crate) bias_position: ::std::option::Option<::std::vec::Vec<f64>>,
108    pub(crate) filter: ::std::option::Option<crate::types::GeocodeFilter>,
109    pub(crate) additional_features: ::std::option::Option<::std::vec::Vec<crate::types::GeocodeAdditionalFeature>>,
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::GeocodeIntendedUse>,
113    pub(crate) key: ::std::option::Option<::std::string::String>,
114}
115impl GeocodeInputBuilder {
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 query_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.query_text = ::std::option::Option::Some(input.into());
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 set_query_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.query_text = input;
124        self
125    }
126    /// <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>
127    pub fn get_query_text(&self) -> &::std::option::Option<::std::string::String> {
128        &self.query_text
129    }
130    /// <p>A structured free text query allows you to search for places by the name or text representation of specific properties of the place.</p>
131    pub fn query_components(mut self, input: crate::types::GeocodeQueryComponents) -> Self {
132        self.query_components = ::std::option::Option::Some(input);
133        self
134    }
135    /// <p>A structured free text query allows you to search for places by the name or text representation of specific properties of the place.</p>
136    pub fn set_query_components(mut self, input: ::std::option::Option<crate::types::GeocodeQueryComponents>) -> Self {
137        self.query_components = input;
138        self
139    }
140    /// <p>A structured free text query allows you to search for places by the name or text representation of specific properties of the place.</p>
141    pub fn get_query_components(&self) -> &::std::option::Option<crate::types::GeocodeQueryComponents> {
142        &self.query_components
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.max_results = ::std::option::Option::Some(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.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.max_results
157    }
158    /// Appends an item to `bias_position`.
159    ///
160    /// To override the contents of this collection use [`set_bias_position`](Self::set_bias_position).
161    ///
162    /// <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>
163    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
164    /// </note>
165    pub fn bias_position(mut self, input: f64) -> Self {
166        let mut v = self.bias_position.unwrap_or_default();
167        v.push(input);
168        self.bias_position = ::std::option::Option::Some(v);
169        self
170    }
171    /// <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>
172    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
173    /// </note>
174    pub fn set_bias_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
175        self.bias_position = input;
176        self
177    }
178    /// <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>
179    /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
180    /// </note>
181    pub fn get_bias_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
182        &self.bias_position
183    }
184    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
185    pub fn filter(mut self, input: crate::types::GeocodeFilter) -> Self {
186        self.filter = ::std::option::Option::Some(input);
187        self
188    }
189    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
190    pub fn set_filter(mut self, input: ::std::option::Option<crate::types::GeocodeFilter>) -> Self {
191        self.filter = input;
192        self
193    }
194    /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
195    pub fn get_filter(&self) -> &::std::option::Option<crate::types::GeocodeFilter> {
196        &self.filter
197    }
198    /// Appends an item to `additional_features`.
199    ///
200    /// To override the contents of this collection use [`set_additional_features`](Self::set_additional_features).
201    ///
202    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
203    pub fn additional_features(mut self, input: crate::types::GeocodeAdditionalFeature) -> Self {
204        let mut v = self.additional_features.unwrap_or_default();
205        v.push(input);
206        self.additional_features = ::std::option::Option::Some(v);
207        self
208    }
209    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
210    pub fn set_additional_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GeocodeAdditionalFeature>>) -> Self {
211        self.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 get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GeocodeAdditionalFeature>> {
216        &self.additional_features
217    }
218    /// <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>
219    pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
220        self.language = ::std::option::Option::Some(input.into());
221        self
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 set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
225        self.language = input;
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 get_language(&self) -> &::std::option::Option<::std::string::String> {
230        &self.language
231    }
232    /// <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>
233    pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
234        self.political_view = ::std::option::Option::Some(input.into());
235        self
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 set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
239        self.political_view = input;
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 get_political_view(&self) -> &::std::option::Option<::std::string::String> {
244        &self.political_view
245    }
246    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
247    pub fn intended_use(mut self, input: crate::types::GeocodeIntendedUse) -> Self {
248        self.intended_use = ::std::option::Option::Some(input);
249        self
250    }
251    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
252    pub fn set_intended_use(mut self, input: ::std::option::Option<crate::types::GeocodeIntendedUse>) -> Self {
253        self.intended_use = input;
254        self
255    }
256    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p>
257    pub fn get_intended_use(&self) -> &::std::option::Option<crate::types::GeocodeIntendedUse> {
258        &self.intended_use
259    }
260    /// <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>
261    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
262        self.key = ::std::option::Option::Some(input.into());
263        self
264    }
265    /// <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>
266    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
267        self.key = input;
268        self
269    }
270    /// <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>
271    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
272        &self.key
273    }
274    /// Consumes the builder and constructs a [`GeocodeInput`](crate::operation::geocode::GeocodeInput).
275    pub fn build(self) -> ::std::result::Result<crate::operation::geocode::GeocodeInput, ::aws_smithy_types::error::operation::BuildError> {
276        ::std::result::Result::Ok(crate::operation::geocode::GeocodeInput {
277            query_text: self.query_text,
278            query_components: self.query_components,
279            max_results: self.max_results,
280            bias_position: self.bias_position,
281            filter: self.filter,
282            additional_features: self.additional_features,
283            language: self.language,
284            political_view: self.political_view,
285            intended_use: self.intended_use,
286            key: self.key,
287        })
288    }
289}
290impl ::std::fmt::Debug for GeocodeInputBuilder {
291    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
292        let mut formatter = f.debug_struct("GeocodeInputBuilder");
293        formatter.field("query_text", &"*** Sensitive Data Redacted ***");
294        formatter.field("query_components", &self.query_components);
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("additional_features", &self.additional_features);
299        formatter.field("language", &self.language);
300        formatter.field("political_view", &self.political_view);
301        formatter.field("intended_use", &self.intended_use);
302        formatter.field("key", &"*** Sensitive Data Redacted ***");
303        formatter.finish()
304    }
305}