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