aws_sdk_geoplaces/operation/search_nearby/
_search_nearby_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 SearchNearbyInput {
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><note>
9    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
10    /// </note>
11    pub query_radius: ::std::option::Option<i64>,
12    /// <p>An optional limit for the number of results returned in a single call.</p>
13    pub max_results: ::std::option::Option<i32>,
14    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
15    pub filter: ::std::option::Option<crate::types::SearchNearbyFilter>,
16    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
17    pub additional_features: ::std::option::Option<::std::vec::Vec<crate::types::SearchNearbyAdditionalFeature>>,
18    /// <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>
19    pub language: ::std::option::Option<::std::string::String>,
20    /// <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>
21    pub political_view: ::std::option::Option<::std::string::String>,
22    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
23    /// <p>Storing the response of an SearchNearby 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>
24    /// </note>
25    pub intended_use: ::std::option::Option<crate::types::SearchNearbyIntendedUse>,
26    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page.</p>
27    pub next_token: ::std::option::Option<::std::string::String>,
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 SearchNearbyInput {
32    /// <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>
33    ///
34    /// 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()`.
35    pub fn query_position(&self) -> &[f64] {
36        self.query_position.as_deref().unwrap_or_default()
37    }
38    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p><note>
39    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
40    /// </note>
41    pub fn query_radius(&self) -> ::std::option::Option<i64> {
42        self.query_radius
43    }
44    /// <p>An optional limit for the number of results returned in a single call.</p>
45    pub fn max_results(&self) -> ::std::option::Option<i32> {
46        self.max_results
47    }
48    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
49    pub fn filter(&self) -> ::std::option::Option<&crate::types::SearchNearbyFilter> {
50        self.filter.as_ref()
51    }
52    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
53    ///
54    /// 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()`.
55    pub fn additional_features(&self) -> &[crate::types::SearchNearbyAdditionalFeature] {
56        self.additional_features.as_deref().unwrap_or_default()
57    }
58    /// <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>
59    pub fn language(&self) -> ::std::option::Option<&str> {
60        self.language.as_deref()
61    }
62    /// <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>
63    pub fn political_view(&self) -> ::std::option::Option<&str> {
64        self.political_view.as_deref()
65    }
66    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
67    /// <p>Storing the response of an SearchNearby 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>
68    /// </note>
69    pub fn intended_use(&self) -> ::std::option::Option<&crate::types::SearchNearbyIntendedUse> {
70        self.intended_use.as_ref()
71    }
72    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page.</p>
73    pub fn next_token(&self) -> ::std::option::Option<&str> {
74        self.next_token.as_deref()
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 SearchNearbyInput {
82    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
83        let mut formatter = f.debug_struct("SearchNearbyInput");
84        formatter.field("query_position", &"*** Sensitive Data Redacted ***");
85        formatter.field("query_radius", &"*** Sensitive Data Redacted ***");
86        formatter.field("max_results", &self.max_results);
87        formatter.field("filter", &self.filter);
88        formatter.field("additional_features", &self.additional_features);
89        formatter.field("language", &self.language);
90        formatter.field("political_view", &"*** Sensitive Data Redacted ***");
91        formatter.field("intended_use", &self.intended_use);
92        formatter.field("next_token", &self.next_token);
93        formatter.field("key", &"*** Sensitive Data Redacted ***");
94        formatter.finish()
95    }
96}
97impl SearchNearbyInput {
98    /// Creates a new builder-style object to manufacture [`SearchNearbyInput`](crate::operation::search_nearby::SearchNearbyInput).
99    pub fn builder() -> crate::operation::search_nearby::builders::SearchNearbyInputBuilder {
100        crate::operation::search_nearby::builders::SearchNearbyInputBuilder::default()
101    }
102}
103
104/// A builder for [`SearchNearbyInput`](crate::operation::search_nearby::SearchNearbyInput).
105#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
106#[non_exhaustive]
107pub struct SearchNearbyInputBuilder {
108    pub(crate) query_position: ::std::option::Option<::std::vec::Vec<f64>>,
109    pub(crate) query_radius: ::std::option::Option<i64>,
110    pub(crate) max_results: ::std::option::Option<i32>,
111    pub(crate) filter: ::std::option::Option<crate::types::SearchNearbyFilter>,
112    pub(crate) additional_features: ::std::option::Option<::std::vec::Vec<crate::types::SearchNearbyAdditionalFeature>>,
113    pub(crate) language: ::std::option::Option<::std::string::String>,
114    pub(crate) political_view: ::std::option::Option<::std::string::String>,
115    pub(crate) intended_use: ::std::option::Option<crate::types::SearchNearbyIntendedUse>,
116    pub(crate) next_token: ::std::option::Option<::std::string::String>,
117    pub(crate) key: ::std::option::Option<::std::string::String>,
118}
119impl SearchNearbyInputBuilder {
120    /// Appends an item to `query_position`.
121    ///
122    /// To override the contents of this collection use [`set_query_position`](Self::set_query_position).
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 query_position(mut self, input: f64) -> Self {
126        let mut v = self.query_position.unwrap_or_default();
127        v.push(input);
128        self.query_position = ::std::option::Option::Some(v);
129        self
130    }
131    /// <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>
132    pub fn set_query_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
133        self.query_position = input;
134        self
135    }
136    /// <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>
137    pub fn get_query_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
138        &self.query_position
139    }
140    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p><note>
141    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
142    /// </note>
143    pub fn query_radius(mut self, input: i64) -> Self {
144        self.query_radius = ::std::option::Option::Some(input);
145        self
146    }
147    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p><note>
148    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
149    /// </note>
150    pub fn set_query_radius(mut self, input: ::std::option::Option<i64>) -> Self {
151        self.query_radius = input;
152        self
153    }
154    /// <p>The maximum distance in meters from the QueryPosition from which a result will be returned.</p><note>
155    /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
156    /// </note>
157    pub fn get_query_radius(&self) -> &::std::option::Option<i64> {
158        &self.query_radius
159    }
160    /// <p>An optional limit for the number of results returned in a single call.</p>
161    pub fn max_results(mut self, input: i32) -> Self {
162        self.max_results = ::std::option::Option::Some(input);
163        self
164    }
165    /// <p>An optional limit for the number of results returned in a single call.</p>
166    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
167        self.max_results = input;
168        self
169    }
170    /// <p>An optional limit for the number of results returned in a single call.</p>
171    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
172        &self.max_results
173    }
174    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
175    pub fn filter(mut self, input: crate::types::SearchNearbyFilter) -> Self {
176        self.filter = ::std::option::Option::Some(input);
177        self
178    }
179    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
180    pub fn set_filter(mut self, input: ::std::option::Option<crate::types::SearchNearbyFilter>) -> Self {
181        self.filter = input;
182        self
183    }
184    /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
185    pub fn get_filter(&self) -> &::std::option::Option<crate::types::SearchNearbyFilter> {
186        &self.filter
187    }
188    /// Appends an item to `additional_features`.
189    ///
190    /// To override the contents of this collection use [`set_additional_features`](Self::set_additional_features).
191    ///
192    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
193    pub fn additional_features(mut self, input: crate::types::SearchNearbyAdditionalFeature) -> Self {
194        let mut v = self.additional_features.unwrap_or_default();
195        v.push(input);
196        self.additional_features = ::std::option::Option::Some(v);
197        self
198    }
199    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
200    pub fn set_additional_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchNearbyAdditionalFeature>>) -> Self {
201        self.additional_features = input;
202        self
203    }
204    /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
205    pub fn get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchNearbyAdditionalFeature>> {
206        &self.additional_features
207    }
208    /// <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>
209    pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210        self.language = ::std::option::Option::Some(input.into());
211        self
212    }
213    /// <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>
214    pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215        self.language = input;
216        self
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 get_language(&self) -> &::std::option::Option<::std::string::String> {
220        &self.language
221    }
222    /// <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>
223    pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
224        self.political_view = ::std::option::Option::Some(input.into());
225        self
226    }
227    /// <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>
228    pub fn set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
229        self.political_view = input;
230        self
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 get_political_view(&self) -> &::std::option::Option<::std::string::String> {
234        &self.political_view
235    }
236    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
237    /// <p>Storing the response of an SearchNearby 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>
238    /// </note>
239    pub fn intended_use(mut self, input: crate::types::SearchNearbyIntendedUse) -> Self {
240        self.intended_use = ::std::option::Option::Some(input);
241        self
242    }
243    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
244    /// <p>Storing the response of an SearchNearby 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>
245    /// </note>
246    pub fn set_intended_use(mut self, input: ::std::option::Option<crate::types::SearchNearbyIntendedUse>) -> Self {
247        self.intended_use = input;
248        self
249    }
250    /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
251    /// <p>Storing the response of an SearchNearby 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>
252    /// </note>
253    pub fn get_intended_use(&self) -> &::std::option::Option<crate::types::SearchNearbyIntendedUse> {
254        &self.intended_use
255    }
256    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page.</p>
257    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
258        self.next_token = ::std::option::Option::Some(input.into());
259        self
260    }
261    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page.</p>
262    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
263        self.next_token = input;
264        self
265    }
266    /// <p>If <code>nextToken</code> is returned, there are more results available. The value of <code>nextToken</code> is a unique pagination token for each page.</p>
267    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
268        &self.next_token
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 key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
272        self.key = ::std::option::Option::Some(input.into());
273        self
274    }
275    /// <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>
276    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
277        self.key = input;
278        self
279    }
280    /// <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>
281    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
282        &self.key
283    }
284    /// Consumes the builder and constructs a [`SearchNearbyInput`](crate::operation::search_nearby::SearchNearbyInput).
285    pub fn build(
286        self,
287    ) -> ::std::result::Result<crate::operation::search_nearby::SearchNearbyInput, ::aws_smithy_types::error::operation::BuildError> {
288        ::std::result::Result::Ok(crate::operation::search_nearby::SearchNearbyInput {
289            query_position: self.query_position,
290            query_radius: self.query_radius,
291            max_results: self.max_results,
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            next_token: self.next_token,
298            key: self.key,
299        })
300    }
301}
302impl ::std::fmt::Debug for SearchNearbyInputBuilder {
303    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
304        let mut formatter = f.debug_struct("SearchNearbyInputBuilder");
305        formatter.field("query_position", &"*** Sensitive Data Redacted ***");
306        formatter.field("query_radius", &"*** Sensitive Data Redacted ***");
307        formatter.field("max_results", &self.max_results);
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("next_token", &self.next_token);
314        formatter.field("key", &"*** Sensitive Data Redacted ***");
315        formatter.finish()
316    }
317}