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