aws_sdk_geoplaces/operation/reverse_geocode/
_reverse_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 ReverseGeocodeInput {
6    /// <p>The position, in <code>\[lng, lat\]</code> for which you are querying nearby results for. Results closer to the position will be ranked higher then results further away from the position</p>
7    pub query_position: ::std::option::Option<::std::vec::Vec<f64>>,
8    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p>
9    pub query_radius: ::std::option::Option<i64>,
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>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
13    pub filter: ::std::option::Option<crate::types::ReverseGeocodeFilter>,
14    /// <p>A list of optional additional parameters, such as time zone that can be requested for each result.</p>
15    pub additional_features: ::std::option::Option<::std::vec::Vec<crate::types::ReverseGeocodeAdditionalFeature>>,
16    /// <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>
17    pub language: ::std::option::Option<::std::string::String>,
18    /// <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>
19    pub political_view: ::std::option::Option<::std::string::String>,
20    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
21    /// <p>Storing the response of an ReverseGeocode 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>
22    /// </note>
23    pub intended_use: ::std::option::Option<crate::types::ReverseGeocodeIntendedUse>,
24    /// <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>
25    pub key: ::std::option::Option<::std::string::String>,
26}
27impl ReverseGeocodeInput {
28    /// <p>The position, in <code>\[lng, lat\]</code> for which you are querying nearby results for. Results closer to the position will be ranked higher then results further away from the position</p>
29    ///
30    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.query_position.is_none()`.
31    pub fn query_position(&self) -> &[f64] {
32        self.query_position.as_deref().unwrap_or_default()
33    }
34    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p>
35    pub fn query_radius(&self) -> ::std::option::Option<i64> {
36        self.query_radius
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>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
43    pub fn filter(&self) -> ::std::option::Option<&crate::types::ReverseGeocodeFilter> {
44        self.filter.as_ref()
45    }
46    /// <p>A list of optional additional parameters, such as time zone that can be requested for each result.</p>
47    ///
48    /// 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()`.
49    pub fn additional_features(&self) -> &[crate::types::ReverseGeocodeAdditionalFeature] {
50        self.additional_features.as_deref().unwrap_or_default()
51    }
52    /// <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>
53    pub fn language(&self) -> ::std::option::Option<&str> {
54        self.language.as_deref()
55    }
56    /// <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>
57    pub fn political_view(&self) -> ::std::option::Option<&str> {
58        self.political_view.as_deref()
59    }
60    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
61    /// <p>Storing the response of an ReverseGeocode 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>
62    /// </note>
63    pub fn intended_use(&self) -> ::std::option::Option<&crate::types::ReverseGeocodeIntendedUse> {
64        self.intended_use.as_ref()
65    }
66    /// <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>
67    pub fn key(&self) -> ::std::option::Option<&str> {
68        self.key.as_deref()
69    }
70}
71impl ::std::fmt::Debug for ReverseGeocodeInput {
72    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
73        let mut formatter = f.debug_struct("ReverseGeocodeInput");
74        formatter.field("query_position", &"*** Sensitive Data Redacted ***");
75        formatter.field("query_radius", &"*** Sensitive Data Redacted ***");
76        formatter.field("max_results", &self.max_results);
77        formatter.field("filter", &self.filter);
78        formatter.field("additional_features", &self.additional_features);
79        formatter.field("language", &self.language);
80        formatter.field("political_view", &"*** Sensitive Data Redacted ***");
81        formatter.field("intended_use", &self.intended_use);
82        formatter.field("key", &"*** Sensitive Data Redacted ***");
83        formatter.finish()
84    }
85}
86impl ReverseGeocodeInput {
87    /// Creates a new builder-style object to manufacture [`ReverseGeocodeInput`](crate::operation::reverse_geocode::ReverseGeocodeInput).
88    pub fn builder() -> crate::operation::reverse_geocode::builders::ReverseGeocodeInputBuilder {
89        crate::operation::reverse_geocode::builders::ReverseGeocodeInputBuilder::default()
90    }
91}
92
93/// A builder for [`ReverseGeocodeInput`](crate::operation::reverse_geocode::ReverseGeocodeInput).
94#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
95#[non_exhaustive]
96pub struct ReverseGeocodeInputBuilder {
97    pub(crate) query_position: ::std::option::Option<::std::vec::Vec<f64>>,
98    pub(crate) query_radius: ::std::option::Option<i64>,
99    pub(crate) max_results: ::std::option::Option<i32>,
100    pub(crate) filter: ::std::option::Option<crate::types::ReverseGeocodeFilter>,
101    pub(crate) additional_features: ::std::option::Option<::std::vec::Vec<crate::types::ReverseGeocodeAdditionalFeature>>,
102    pub(crate) language: ::std::option::Option<::std::string::String>,
103    pub(crate) political_view: ::std::option::Option<::std::string::String>,
104    pub(crate) intended_use: ::std::option::Option<crate::types::ReverseGeocodeIntendedUse>,
105    pub(crate) key: ::std::option::Option<::std::string::String>,
106}
107impl ReverseGeocodeInputBuilder {
108    /// Appends an item to `query_position`.
109    ///
110    /// To override the contents of this collection use [`set_query_position`](Self::set_query_position).
111    ///
112    /// <p>The position, in <code>\[lng, lat\]</code> for which you are querying nearby results for. Results closer to the position will be ranked higher then results further away from the position</p>
113    pub fn query_position(mut self, input: f64) -> Self {
114        let mut v = self.query_position.unwrap_or_default();
115        v.push(input);
116        self.query_position = ::std::option::Option::Some(v);
117        self
118    }
119    /// <p>The position, in <code>\[lng, lat\]</code> for which you are querying nearby results for. Results closer to the position will be ranked higher then results further away from the position</p>
120    pub fn set_query_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
121        self.query_position = input;
122        self
123    }
124    /// <p>The position, in <code>\[lng, lat\]</code> for which you are querying nearby results for. Results closer to the position will be ranked higher then results further away from the position</p>
125    pub fn get_query_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
126        &self.query_position
127    }
128    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p>
129    pub fn query_radius(mut self, input: i64) -> Self {
130        self.query_radius = ::std::option::Option::Some(input);
131        self
132    }
133    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p>
134    pub fn set_query_radius(mut self, input: ::std::option::Option<i64>) -> Self {
135        self.query_radius = input;
136        self
137    }
138    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p>
139    pub fn get_query_radius(&self) -> &::std::option::Option<i64> {
140        &self.query_radius
141    }
142    /// <p>An optional limit for the number of results returned in a single call.</p>
143    pub fn max_results(mut self, input: i32) -> Self {
144        self.max_results = ::std::option::Option::Some(input);
145        self
146    }
147    /// <p>An optional limit for the number of results returned in a single call.</p>
148    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
149        self.max_results = input;
150        self
151    }
152    /// <p>An optional limit for the number of results returned in a single call.</p>
153    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
154        &self.max_results
155    }
156    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
157    pub fn filter(mut self, input: crate::types::ReverseGeocodeFilter) -> Self {
158        self.filter = ::std::option::Option::Some(input);
159        self
160    }
161    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
162    pub fn set_filter(mut self, input: ::std::option::Option<crate::types::ReverseGeocodeFilter>) -> Self {
163        self.filter = input;
164        self
165    }
166    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
167    pub fn get_filter(&self) -> &::std::option::Option<crate::types::ReverseGeocodeFilter> {
168        &self.filter
169    }
170    /// Appends an item to `additional_features`.
171    ///
172    /// To override the contents of this collection use [`set_additional_features`](Self::set_additional_features).
173    ///
174    /// <p>A list of optional additional parameters, such as time zone that can be requested for each result.</p>
175    pub fn additional_features(mut self, input: crate::types::ReverseGeocodeAdditionalFeature) -> Self {
176        let mut v = self.additional_features.unwrap_or_default();
177        v.push(input);
178        self.additional_features = ::std::option::Option::Some(v);
179        self
180    }
181    /// <p>A list of optional additional parameters, such as time zone that can be requested for each result.</p>
182    pub fn set_additional_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReverseGeocodeAdditionalFeature>>) -> Self {
183        self.additional_features = input;
184        self
185    }
186    /// <p>A list of optional additional parameters, such as time zone that can be requested for each result.</p>
187    pub fn get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReverseGeocodeAdditionalFeature>> {
188        &self.additional_features
189    }
190    /// <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>
191    pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.language = ::std::option::Option::Some(input.into());
193        self
194    }
195    /// <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>
196    pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.language = input;
198        self
199    }
200    /// <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>
201    pub fn get_language(&self) -> &::std::option::Option<::std::string::String> {
202        &self.language
203    }
204    /// <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>
205    pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
206        self.political_view = ::std::option::Option::Some(input.into());
207        self
208    }
209    /// <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>
210    pub fn set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
211        self.political_view = input;
212        self
213    }
214    /// <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>
215    pub fn get_political_view(&self) -> &::std::option::Option<::std::string::String> {
216        &self.political_view
217    }
218    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
219    /// <p>Storing the response of an ReverseGeocode 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>
220    /// </note>
221    pub fn intended_use(mut self, input: crate::types::ReverseGeocodeIntendedUse) -> Self {
222        self.intended_use = ::std::option::Option::Some(input);
223        self
224    }
225    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
226    /// <p>Storing the response of an ReverseGeocode 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>
227    /// </note>
228    pub fn set_intended_use(mut self, input: ::std::option::Option<crate::types::ReverseGeocodeIntendedUse>) -> Self {
229        self.intended_use = input;
230        self
231    }
232    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
233    /// <p>Storing the response of an ReverseGeocode 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>
234    /// </note>
235    pub fn get_intended_use(&self) -> &::std::option::Option<crate::types::ReverseGeocodeIntendedUse> {
236        &self.intended_use
237    }
238    /// <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>
239    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
240        self.key = ::std::option::Option::Some(input.into());
241        self
242    }
243    /// <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>
244    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
245        self.key = input;
246        self
247    }
248    /// <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>
249    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
250        &self.key
251    }
252    /// Consumes the builder and constructs a [`ReverseGeocodeInput`](crate::operation::reverse_geocode::ReverseGeocodeInput).
253    pub fn build(
254        self,
255    ) -> ::std::result::Result<crate::operation::reverse_geocode::ReverseGeocodeInput, ::aws_smithy_types::error::operation::BuildError> {
256        ::std::result::Result::Ok(crate::operation::reverse_geocode::ReverseGeocodeInput {
257            query_position: self.query_position,
258            query_radius: self.query_radius,
259            max_results: self.max_results,
260            filter: self.filter,
261            additional_features: self.additional_features,
262            language: self.language,
263            political_view: self.political_view,
264            intended_use: self.intended_use,
265            key: self.key,
266        })
267    }
268}
269impl ::std::fmt::Debug for ReverseGeocodeInputBuilder {
270    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
271        let mut formatter = f.debug_struct("ReverseGeocodeInputBuilder");
272        formatter.field("query_position", &"*** Sensitive Data Redacted ***");
273        formatter.field("query_radius", &"*** Sensitive Data Redacted ***");
274        formatter.field("max_results", &self.max_results);
275        formatter.field("filter", &self.filter);
276        formatter.field("additional_features", &self.additional_features);
277        formatter.field("language", &self.language);
278        formatter.field("political_view", &"*** Sensitive Data Redacted ***");
279        formatter.field("intended_use", &self.intended_use);
280        formatter.field("key", &"*** Sensitive Data Redacted ***");
281        formatter.finish()
282    }
283}