aws_sdk_geoplaces/operation/search_text/_search_text_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 SearchTextInput {
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><note>
7 /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
8 /// </note>
9 pub query_text: ::std::option::Option<::std::string::String>,
10 /// <p>The query Id returned by the suggest API. If passed in the request, the SearchText API will preform a SearchText query with the improved query terms for the original query made to the suggest API.</p><note>
11 /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
12 /// </note>
13 pub query_id: ::std::option::Option<::std::string::String>,
14 /// <p>An optional limit for the number of results returned in a single call.</p>
15 pub max_results: ::std::option::Option<i32>,
16 /// <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>
17 /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
18 /// </note>
19 pub bias_position: ::std::option::Option<::std::vec::Vec<f64>>,
20 /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
21 pub filter: ::std::option::Option<crate::types::SearchTextFilter>,
22 /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
23 pub additional_features: ::std::option::Option<::std::vec::Vec<crate::types::SearchTextAdditionalFeature>>,
24 /// <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>
25 pub language: ::std::option::Option<::std::string::String>,
26 /// <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>
27 pub political_view: ::std::option::Option<::std::string::String>,
28 /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
29 /// <p>Storing the response of an SearchText 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>
30 /// </note>
31 pub intended_use: ::std::option::Option<crate::types::SearchTextIntendedUse>,
32 /// <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>
33 pub next_token: ::std::option::Option<::std::string::String>,
34 /// <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>
35 pub key: ::std::option::Option<::std::string::String>,
36}
37impl SearchTextInput {
38 /// <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><note>
39 /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
40 /// </note>
41 pub fn query_text(&self) -> ::std::option::Option<&str> {
42 self.query_text.as_deref()
43 }
44 /// <p>The query Id returned by the suggest API. If passed in the request, the SearchText API will preform a SearchText query with the improved query terms for the original query made to the suggest API.</p><note>
45 /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
46 /// </note>
47 pub fn query_id(&self) -> ::std::option::Option<&str> {
48 self.query_id.as_deref()
49 }
50 /// <p>An optional limit for the number of results returned in a single call.</p>
51 pub fn max_results(&self) -> ::std::option::Option<i32> {
52 self.max_results
53 }
54 /// <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>
55 /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
56 /// </note>
57 ///
58 /// 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()`.
59 pub fn bias_position(&self) -> &[f64] {
60 self.bias_position.as_deref().unwrap_or_default()
61 }
62 /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
63 pub fn filter(&self) -> ::std::option::Option<&crate::types::SearchTextFilter> {
64 self.filter.as_ref()
65 }
66 /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
67 ///
68 /// 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()`.
69 pub fn additional_features(&self) -> &[crate::types::SearchTextAdditionalFeature] {
70 self.additional_features.as_deref().unwrap_or_default()
71 }
72 /// <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>
73 pub fn language(&self) -> ::std::option::Option<&str> {
74 self.language.as_deref()
75 }
76 /// <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>
77 pub fn political_view(&self) -> ::std::option::Option<&str> {
78 self.political_view.as_deref()
79 }
80 /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
81 /// <p>Storing the response of an SearchText 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>
82 /// </note>
83 pub fn intended_use(&self) -> ::std::option::Option<&crate::types::SearchTextIntendedUse> {
84 self.intended_use.as_ref()
85 }
86 /// <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>
87 pub fn next_token(&self) -> ::std::option::Option<&str> {
88 self.next_token.as_deref()
89 }
90 /// <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>
91 pub fn key(&self) -> ::std::option::Option<&str> {
92 self.key.as_deref()
93 }
94}
95impl ::std::fmt::Debug for SearchTextInput {
96 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
97 let mut formatter = f.debug_struct("SearchTextInput");
98 formatter.field("query_text", &"*** Sensitive Data Redacted ***");
99 formatter.field("query_id", &"*** Sensitive Data Redacted ***");
100 formatter.field("max_results", &self.max_results);
101 formatter.field("bias_position", &"*** Sensitive Data Redacted ***");
102 formatter.field("filter", &self.filter);
103 formatter.field("additional_features", &self.additional_features);
104 formatter.field("language", &self.language);
105 formatter.field("political_view", &"*** Sensitive Data Redacted ***");
106 formatter.field("intended_use", &self.intended_use);
107 formatter.field("next_token", &self.next_token);
108 formatter.field("key", &"*** Sensitive Data Redacted ***");
109 formatter.finish()
110 }
111}
112impl SearchTextInput {
113 /// Creates a new builder-style object to manufacture [`SearchTextInput`](crate::operation::search_text::SearchTextInput).
114 pub fn builder() -> crate::operation::search_text::builders::SearchTextInputBuilder {
115 crate::operation::search_text::builders::SearchTextInputBuilder::default()
116 }
117}
118
119/// A builder for [`SearchTextInput`](crate::operation::search_text::SearchTextInput).
120#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
121#[non_exhaustive]
122pub struct SearchTextInputBuilder {
123 pub(crate) query_text: ::std::option::Option<::std::string::String>,
124 pub(crate) query_id: ::std::option::Option<::std::string::String>,
125 pub(crate) max_results: ::std::option::Option<i32>,
126 pub(crate) bias_position: ::std::option::Option<::std::vec::Vec<f64>>,
127 pub(crate) filter: ::std::option::Option<crate::types::SearchTextFilter>,
128 pub(crate) additional_features: ::std::option::Option<::std::vec::Vec<crate::types::SearchTextAdditionalFeature>>,
129 pub(crate) language: ::std::option::Option<::std::string::String>,
130 pub(crate) political_view: ::std::option::Option<::std::string::String>,
131 pub(crate) intended_use: ::std::option::Option<crate::types::SearchTextIntendedUse>,
132 pub(crate) next_token: ::std::option::Option<::std::string::String>,
133 pub(crate) key: ::std::option::Option<::std::string::String>,
134}
135impl SearchTextInputBuilder {
136 /// <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><note>
137 /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
138 /// </note>
139 pub fn query_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140 self.query_text = ::std::option::Option::Some(input.into());
141 self
142 }
143 /// <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><note>
144 /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
145 /// </note>
146 pub fn set_query_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147 self.query_text = input;
148 self
149 }
150 /// <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><note>
151 /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
152 /// </note>
153 pub fn get_query_text(&self) -> &::std::option::Option<::std::string::String> {
154 &self.query_text
155 }
156 /// <p>The query Id returned by the suggest API. If passed in the request, the SearchText API will preform a SearchText query with the improved query terms for the original query made to the suggest API.</p><note>
157 /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
158 /// </note>
159 pub fn query_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160 self.query_id = ::std::option::Option::Some(input.into());
161 self
162 }
163 /// <p>The query Id returned by the suggest API. If passed in the request, the SearchText API will preform a SearchText query with the improved query terms for the original query made to the suggest API.</p><note>
164 /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
165 /// </note>
166 pub fn set_query_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167 self.query_id = input;
168 self
169 }
170 /// <p>The query Id returned by the suggest API. If passed in the request, the SearchText API will preform a SearchText query with the improved query terms for the original query made to the suggest API.</p><note>
171 /// <p>The fields <code>QueryText</code>, and <code>QueryID</code> are mutually exclusive.</p>
172 /// </note>
173 pub fn get_query_id(&self) -> &::std::option::Option<::std::string::String> {
174 &self.query_id
175 }
176 /// <p>An optional limit for the number of results returned in a single call.</p>
177 pub fn max_results(mut self, input: i32) -> Self {
178 self.max_results = ::std::option::Option::Some(input);
179 self
180 }
181 /// <p>An optional limit for the number of results returned in a single call.</p>
182 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
183 self.max_results = input;
184 self
185 }
186 /// <p>An optional limit for the number of results returned in a single call.</p>
187 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
188 &self.max_results
189 }
190 /// Appends an item to `bias_position`.
191 ///
192 /// To override the contents of this collection use [`set_bias_position`](Self::set_bias_position).
193 ///
194 /// <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>
195 /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
196 /// </note>
197 pub fn bias_position(mut self, input: f64) -> Self {
198 let mut v = self.bias_position.unwrap_or_default();
199 v.push(input);
200 self.bias_position = ::std::option::Option::Some(v);
201 self
202 }
203 /// <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>
204 /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
205 /// </note>
206 pub fn set_bias_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
207 self.bias_position = input;
208 self
209 }
210 /// <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>
211 /// <p>The fields <code>BiasPosition</code>, <code>FilterBoundingBox</code>, and <code>FilterCircle</code> are mutually exclusive.</p>
212 /// </note>
213 pub fn get_bias_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
214 &self.bias_position
215 }
216 /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
217 pub fn filter(mut self, input: crate::types::SearchTextFilter) -> Self {
218 self.filter = ::std::option::Option::Some(input);
219 self
220 }
221 /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
222 pub fn set_filter(mut self, input: ::std::option::Option<crate::types::SearchTextFilter>) -> Self {
223 self.filter = input;
224 self
225 }
226 /// <p>A structure which contains a set of inclusion/exclusion properties that results must possess in order to be returned as a result.</p>
227 pub fn get_filter(&self) -> &::std::option::Option<crate::types::SearchTextFilter> {
228 &self.filter
229 }
230 /// Appends an item to `additional_features`.
231 ///
232 /// To override the contents of this collection use [`set_additional_features`](Self::set_additional_features).
233 ///
234 /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
235 pub fn additional_features(mut self, input: crate::types::SearchTextAdditionalFeature) -> Self {
236 let mut v = self.additional_features.unwrap_or_default();
237 v.push(input);
238 self.additional_features = ::std::option::Option::Some(v);
239 self
240 }
241 /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
242 pub fn set_additional_features(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchTextAdditionalFeature>>) -> Self {
243 self.additional_features = input;
244 self
245 }
246 /// <p>A list of optional additional parameters, such as time zone, that can be requested for each result.</p>
247 pub fn get_additional_features(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchTextAdditionalFeature>> {
248 &self.additional_features
249 }
250 /// <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>
251 pub fn language(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
252 self.language = ::std::option::Option::Some(input.into());
253 self
254 }
255 /// <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>
256 pub fn set_language(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
257 self.language = input;
258 self
259 }
260 /// <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>
261 pub fn get_language(&self) -> &::std::option::Option<::std::string::String> {
262 &self.language
263 }
264 /// <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>
265 pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
266 self.political_view = ::std::option::Option::Some(input.into());
267 self
268 }
269 /// <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>
270 pub fn set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
271 self.political_view = input;
272 self
273 }
274 /// <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>
275 pub fn get_political_view(&self) -> &::std::option::Option<::std::string::String> {
276 &self.political_view
277 }
278 /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
279 /// <p>Storing the response of an SearchText 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>
280 /// </note>
281 pub fn intended_use(mut self, input: crate::types::SearchTextIntendedUse) -> Self {
282 self.intended_use = ::std::option::Option::Some(input);
283 self
284 }
285 /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
286 /// <p>Storing the response of an SearchText 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>
287 /// </note>
288 pub fn set_intended_use(mut self, input: ::std::option::Option<crate::types::SearchTextIntendedUse>) -> Self {
289 self.intended_use = input;
290 self
291 }
292 /// <p>Indicates if the results will be stored. Defaults to <code>SingleUse</code>, if left empty.</p><note>
293 /// <p>Storing the response of an SearchText 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>
294 /// </note>
295 pub fn get_intended_use(&self) -> &::std::option::Option<crate::types::SearchTextIntendedUse> {
296 &self.intended_use
297 }
298 /// <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>
299 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
300 self.next_token = ::std::option::Option::Some(input.into());
301 self
302 }
303 /// <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>
304 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
305 self.next_token = input;
306 self
307 }
308 /// <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>
309 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
310 &self.next_token
311 }
312 /// <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>
313 pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
314 self.key = ::std::option::Option::Some(input.into());
315 self
316 }
317 /// <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>
318 pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
319 self.key = input;
320 self
321 }
322 /// <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>
323 pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
324 &self.key
325 }
326 /// Consumes the builder and constructs a [`SearchTextInput`](crate::operation::search_text::SearchTextInput).
327 pub fn build(self) -> ::std::result::Result<crate::operation::search_text::SearchTextInput, ::aws_smithy_types::error::operation::BuildError> {
328 ::std::result::Result::Ok(crate::operation::search_text::SearchTextInput {
329 query_text: self.query_text,
330 query_id: self.query_id,
331 max_results: self.max_results,
332 bias_position: self.bias_position,
333 filter: self.filter,
334 additional_features: self.additional_features,
335 language: self.language,
336 political_view: self.political_view,
337 intended_use: self.intended_use,
338 next_token: self.next_token,
339 key: self.key,
340 })
341 }
342}
343impl ::std::fmt::Debug for SearchTextInputBuilder {
344 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
345 let mut formatter = f.debug_struct("SearchTextInputBuilder");
346 formatter.field("query_text", &"*** Sensitive Data Redacted ***");
347 formatter.field("query_id", &"*** Sensitive Data Redacted ***");
348 formatter.field("max_results", &self.max_results);
349 formatter.field("bias_position", &"*** Sensitive Data Redacted ***");
350 formatter.field("filter", &self.filter);
351 formatter.field("additional_features", &self.additional_features);
352 formatter.field("language", &self.language);
353 formatter.field("political_view", &"*** Sensitive Data Redacted ***");
354 formatter.field("intended_use", &self.intended_use);
355 formatter.field("next_token", &self.next_token);
356 formatter.field("key", &"*** Sensitive Data Redacted ***");
357 formatter.finish()
358 }
359}