aws_sdk_geoplaces/operation/suggest/_suggest_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 SuggestInput {
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>Maximum number of query terms to be returned for use with a search text query.</p>
11 pub max_query_refinements: ::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::SuggestFilter>,
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::SuggestAdditionalFeature>>,
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::SuggestIntendedUse>,
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 SuggestInput {
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>Maximum number of query terms to be returned for use with a search text query.</p>
39 pub fn max_query_refinements(&self) -> ::std::option::Option<i32> {
40 self.max_query_refinements
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::SuggestFilter> {
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::SuggestAdditionalFeature] {
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::SuggestIntendedUse> {
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 SuggestInput {
78 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
79 let mut formatter = f.debug_struct("SuggestInput");
80 formatter.field("query_text", &"*** Sensitive Data Redacted ***");
81 formatter.field("max_results", &self.max_results);
82 formatter.field("max_query_refinements", &self.max_query_refinements);
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 SuggestInput {
94 /// Creates a new builder-style object to manufacture [`SuggestInput`](crate::operation::suggest::SuggestInput).
95 pub fn builder() -> crate::operation::suggest::builders::SuggestInputBuilder {
96 crate::operation::suggest::builders::SuggestInputBuilder::default()
97 }
98}
99
100/// A builder for [`SuggestInput`](crate::operation::suggest::SuggestInput).
101#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
102#[non_exhaustive]
103pub struct SuggestInputBuilder {
104 pub(crate) query_text: ::std::option::Option<::std::string::String>,
105 pub(crate) max_results: ::std::option::Option<i32>,
106 pub(crate) max_query_refinements: ::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::SuggestFilter>,
109 pub(crate) additional_features: ::std::option::Option<::std::vec::Vec<crate::types::SuggestAdditionalFeature>>,
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::SuggestIntendedUse>,
113 pub(crate) key: ::std::option::Option<::std::string::String>,
114}
115impl SuggestInputBuilder {
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 /// <p>Maximum number of query terms to be returned for use with a search text query.</p>
146 pub fn max_query_refinements(mut self, input: i32) -> Self {
147 self.max_query_refinements = ::std::option::Option::Some(input);
148 self
149 }
150 /// <p>Maximum number of query terms to be returned for use with a search text query.</p>
151 pub fn set_max_query_refinements(mut self, input: ::std::option::Option<i32>) -> Self {
152 self.max_query_refinements = input;
153 self
154 }
155 /// <p>Maximum number of query terms to be returned for use with a search text query.</p>
156 pub fn get_max_query_refinements(&self) -> &::std::option::Option<i32> {
157 &self.max_query_refinements
158 }
159 /// Appends an item to `bias_position`.
160 ///
161 /// To override the contents of this collection use [`set_bias_position`](Self::set_bias_position).
162 ///
163 /// <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>
164 /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
165 /// </note>
166 pub fn bias_position(mut self, input: f64) -> Self {
167 let mut v = self.bias_position.unwrap_or_default();
168 v.push(input);
169 self.bias_position = ::std::option::Option::Some(v);
170 self
171 }
172 /// <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>
173 /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
174 /// </note>
175 pub fn set_bias_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
176 self.bias_position = input;
177 self
178 }
179 /// <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>
180 /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
181 /// </note>
182 pub fn get_bias_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
183 &self.bias_position
184 }
185 /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
186 pub fn filter(mut self, input: crate::types::SuggestFilter) -> Self {
187 self.filter = ::std::option::Option::Some(input);
188 self
189 }
190 /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
191 pub fn set_filter(mut self, input: ::std::option::Option<crate::types::SuggestFilter>) -> Self {
192 self.filter = input;
193 self
194 }
195 /// <p>A structure which contains a set of inclusion/exclusion properties that results must posses in order to be returned as a result.</p>
196 pub fn get_filter(&self) -> &::std::option::Option<crate::types::SuggestFilter> {
197 &self.filter
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, such as time zone, that can be requested for each result.</p>
204 pub fn additional_features(mut self, input: crate::types::SuggestAdditionalFeature) -> 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, such as time zone, 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::SuggestAdditionalFeature>>) -> Self {
212 self.additional_features = input;
213 self
214 }
215 /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
216 pub fn get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SuggestAdditionalFeature>> {
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::SuggestIntendedUse) -> 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::SuggestIntendedUse>) -> 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::SuggestIntendedUse> {
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 [`SuggestInput`](crate::operation::suggest::SuggestInput).
276 pub fn build(self) -> ::std::result::Result<crate::operation::suggest::SuggestInput, ::aws_smithy_types::error::operation::BuildError> {
277 ::std::result::Result::Ok(crate::operation::suggest::SuggestInput {
278 query_text: self.query_text,
279 max_results: self.max_results,
280 max_query_refinements: self.max_query_refinements,
281 bias_position: self.bias_position,
282 filter: self.filter,
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 SuggestInputBuilder {
292 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
293 let mut formatter = f.debug_struct("SuggestInputBuilder");
294 formatter.field("query_text", &"*** Sensitive Data Redacted ***");
295 formatter.field("max_results", &self.max_results);
296 formatter.field("max_query_refinements", &self.max_query_refinements);
297 formatter.field("bias_position", &"*** Sensitive Data Redacted ***");
298 formatter.field("filter", &self.filter);
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}