aws_sdk_geoplaces/operation/get_place/
_get_place_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetPlaceOutput {
6 pub place_id: ::std::string::String,
8 pub place_type: crate::types::PlaceType,
10 pub title: ::std::string::String,
12 pub pricing_bucket: ::std::string::String,
15 pub address: ::std::option::Option<crate::types::Address>,
17 pub address_number_corrected: ::std::option::Option<bool>,
19 pub postal_code_details: ::std::option::Option<::std::vec::Vec<crate::types::PostalCodeDetails>>,
21 pub position: ::std::option::Option<::std::vec::Vec<f64>>,
23 pub map_view: ::std::option::Option<::std::vec::Vec<f64>>,
26 pub categories: ::std::option::Option<::std::vec::Vec<crate::types::Category>>,
28 pub food_types: ::std::option::Option<::std::vec::Vec<crate::types::FoodType>>,
30 pub business_chains: ::std::option::Option<::std::vec::Vec<crate::types::BusinessChain>>,
32 pub contacts: ::std::option::Option<crate::types::Contacts>,
34 pub opening_hours: ::std::option::Option<::std::vec::Vec<crate::types::OpeningHours>>,
36 pub access_points: ::std::option::Option<::std::vec::Vec<crate::types::AccessPoint>>,
38 pub access_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::AccessRestriction>>,
40 pub time_zone: ::std::option::Option<crate::types::TimeZone>,
42 pub political_view: ::std::option::Option<::std::string::String>,
44 pub phonemes: ::std::option::Option<crate::types::PhonemeDetails>,
46 _request_id: Option<String>,
47}
48impl GetPlaceOutput {
49 pub fn place_id(&self) -> &str {
51 use std::ops::Deref;
52 self.place_id.deref()
53 }
54 pub fn place_type(&self) -> &crate::types::PlaceType {
56 &self.place_type
57 }
58 pub fn title(&self) -> &str {
60 use std::ops::Deref;
61 self.title.deref()
62 }
63 pub fn pricing_bucket(&self) -> &str {
66 use std::ops::Deref;
67 self.pricing_bucket.deref()
68 }
69 pub fn address(&self) -> ::std::option::Option<&crate::types::Address> {
71 self.address.as_ref()
72 }
73 pub fn address_number_corrected(&self) -> ::std::option::Option<bool> {
75 self.address_number_corrected
76 }
77 pub fn postal_code_details(&self) -> &[crate::types::PostalCodeDetails] {
81 self.postal_code_details.as_deref().unwrap_or_default()
82 }
83 pub fn position(&self) -> &[f64] {
87 self.position.as_deref().unwrap_or_default()
88 }
89 pub fn map_view(&self) -> &[f64] {
94 self.map_view.as_deref().unwrap_or_default()
95 }
96 pub fn categories(&self) -> &[crate::types::Category] {
100 self.categories.as_deref().unwrap_or_default()
101 }
102 pub fn food_types(&self) -> &[crate::types::FoodType] {
106 self.food_types.as_deref().unwrap_or_default()
107 }
108 pub fn business_chains(&self) -> &[crate::types::BusinessChain] {
112 self.business_chains.as_deref().unwrap_or_default()
113 }
114 pub fn contacts(&self) -> ::std::option::Option<&crate::types::Contacts> {
116 self.contacts.as_ref()
117 }
118 pub fn opening_hours(&self) -> &[crate::types::OpeningHours] {
122 self.opening_hours.as_deref().unwrap_or_default()
123 }
124 pub fn access_points(&self) -> &[crate::types::AccessPoint] {
128 self.access_points.as_deref().unwrap_or_default()
129 }
130 pub fn access_restrictions(&self) -> &[crate::types::AccessRestriction] {
134 self.access_restrictions.as_deref().unwrap_or_default()
135 }
136 pub fn time_zone(&self) -> ::std::option::Option<&crate::types::TimeZone> {
138 self.time_zone.as_ref()
139 }
140 pub fn political_view(&self) -> ::std::option::Option<&str> {
142 self.political_view.as_deref()
143 }
144 pub fn phonemes(&self) -> ::std::option::Option<&crate::types::PhonemeDetails> {
146 self.phonemes.as_ref()
147 }
148}
149impl ::std::fmt::Debug for GetPlaceOutput {
150 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
151 let mut formatter = f.debug_struct("GetPlaceOutput");
152 formatter.field("place_id", &self.place_id);
153 formatter.field("place_type", &self.place_type);
154 formatter.field("title", &self.title);
155 formatter.field("pricing_bucket", &self.pricing_bucket);
156 formatter.field("address", &self.address);
157 formatter.field("address_number_corrected", &self.address_number_corrected);
158 formatter.field("postal_code_details", &self.postal_code_details);
159 formatter.field("position", &"*** Sensitive Data Redacted ***");
160 formatter.field("map_view", &"*** Sensitive Data Redacted ***");
161 formatter.field("categories", &self.categories);
162 formatter.field("food_types", &self.food_types);
163 formatter.field("business_chains", &self.business_chains);
164 formatter.field("contacts", &self.contacts);
165 formatter.field("opening_hours", &self.opening_hours);
166 formatter.field("access_points", &self.access_points);
167 formatter.field("access_restrictions", &self.access_restrictions);
168 formatter.field("time_zone", &self.time_zone);
169 formatter.field("political_view", &self.political_view);
170 formatter.field("phonemes", &self.phonemes);
171 formatter.field("_request_id", &self._request_id);
172 formatter.finish()
173 }
174}
175impl ::aws_types::request_id::RequestId for GetPlaceOutput {
176 fn request_id(&self) -> Option<&str> {
177 self._request_id.as_deref()
178 }
179}
180impl GetPlaceOutput {
181 pub fn builder() -> crate::operation::get_place::builders::GetPlaceOutputBuilder {
183 crate::operation::get_place::builders::GetPlaceOutputBuilder::default()
184 }
185}
186
187#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
189#[non_exhaustive]
190pub struct GetPlaceOutputBuilder {
191 pub(crate) place_id: ::std::option::Option<::std::string::String>,
192 pub(crate) place_type: ::std::option::Option<crate::types::PlaceType>,
193 pub(crate) title: ::std::option::Option<::std::string::String>,
194 pub(crate) pricing_bucket: ::std::option::Option<::std::string::String>,
195 pub(crate) address: ::std::option::Option<crate::types::Address>,
196 pub(crate) address_number_corrected: ::std::option::Option<bool>,
197 pub(crate) postal_code_details: ::std::option::Option<::std::vec::Vec<crate::types::PostalCodeDetails>>,
198 pub(crate) position: ::std::option::Option<::std::vec::Vec<f64>>,
199 pub(crate) map_view: ::std::option::Option<::std::vec::Vec<f64>>,
200 pub(crate) categories: ::std::option::Option<::std::vec::Vec<crate::types::Category>>,
201 pub(crate) food_types: ::std::option::Option<::std::vec::Vec<crate::types::FoodType>>,
202 pub(crate) business_chains: ::std::option::Option<::std::vec::Vec<crate::types::BusinessChain>>,
203 pub(crate) contacts: ::std::option::Option<crate::types::Contacts>,
204 pub(crate) opening_hours: ::std::option::Option<::std::vec::Vec<crate::types::OpeningHours>>,
205 pub(crate) access_points: ::std::option::Option<::std::vec::Vec<crate::types::AccessPoint>>,
206 pub(crate) access_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::AccessRestriction>>,
207 pub(crate) time_zone: ::std::option::Option<crate::types::TimeZone>,
208 pub(crate) political_view: ::std::option::Option<::std::string::String>,
209 pub(crate) phonemes: ::std::option::Option<crate::types::PhonemeDetails>,
210 _request_id: Option<String>,
211}
212impl GetPlaceOutputBuilder {
213 pub fn place_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216 self.place_id = ::std::option::Option::Some(input.into());
217 self
218 }
219 pub fn set_place_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221 self.place_id = input;
222 self
223 }
224 pub fn get_place_id(&self) -> &::std::option::Option<::std::string::String> {
226 &self.place_id
227 }
228 pub fn place_type(mut self, input: crate::types::PlaceType) -> Self {
231 self.place_type = ::std::option::Option::Some(input);
232 self
233 }
234 pub fn set_place_type(mut self, input: ::std::option::Option<crate::types::PlaceType>) -> Self {
236 self.place_type = input;
237 self
238 }
239 pub fn get_place_type(&self) -> &::std::option::Option<crate::types::PlaceType> {
241 &self.place_type
242 }
243 pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
246 self.title = ::std::option::Option::Some(input.into());
247 self
248 }
249 pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
251 self.title = input;
252 self
253 }
254 pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
256 &self.title
257 }
258 pub fn pricing_bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
262 self.pricing_bucket = ::std::option::Option::Some(input.into());
263 self
264 }
265 pub fn set_pricing_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268 self.pricing_bucket = input;
269 self
270 }
271 pub fn get_pricing_bucket(&self) -> &::std::option::Option<::std::string::String> {
274 &self.pricing_bucket
275 }
276 pub fn address(mut self, input: crate::types::Address) -> Self {
278 self.address = ::std::option::Option::Some(input);
279 self
280 }
281 pub fn set_address(mut self, input: ::std::option::Option<crate::types::Address>) -> Self {
283 self.address = input;
284 self
285 }
286 pub fn get_address(&self) -> &::std::option::Option<crate::types::Address> {
288 &self.address
289 }
290 pub fn address_number_corrected(mut self, input: bool) -> Self {
292 self.address_number_corrected = ::std::option::Option::Some(input);
293 self
294 }
295 pub fn set_address_number_corrected(mut self, input: ::std::option::Option<bool>) -> Self {
297 self.address_number_corrected = input;
298 self
299 }
300 pub fn get_address_number_corrected(&self) -> &::std::option::Option<bool> {
302 &self.address_number_corrected
303 }
304 pub fn postal_code_details(mut self, input: crate::types::PostalCodeDetails) -> Self {
310 let mut v = self.postal_code_details.unwrap_or_default();
311 v.push(input);
312 self.postal_code_details = ::std::option::Option::Some(v);
313 self
314 }
315 pub fn set_postal_code_details(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PostalCodeDetails>>) -> Self {
317 self.postal_code_details = input;
318 self
319 }
320 pub fn get_postal_code_details(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PostalCodeDetails>> {
322 &self.postal_code_details
323 }
324 pub fn position(mut self, input: f64) -> Self {
330 let mut v = self.position.unwrap_or_default();
331 v.push(input);
332 self.position = ::std::option::Option::Some(v);
333 self
334 }
335 pub fn set_position(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
337 self.position = input;
338 self
339 }
340 pub fn get_position(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
342 &self.position
343 }
344 pub fn map_view(mut self, input: f64) -> Self {
351 let mut v = self.map_view.unwrap_or_default();
352 v.push(input);
353 self.map_view = ::std::option::Option::Some(v);
354 self
355 }
356 pub fn set_map_view(mut self, input: ::std::option::Option<::std::vec::Vec<f64>>) -> Self {
359 self.map_view = input;
360 self
361 }
362 pub fn get_map_view(&self) -> &::std::option::Option<::std::vec::Vec<f64>> {
365 &self.map_view
366 }
367 pub fn categories(mut self, input: crate::types::Category) -> Self {
373 let mut v = self.categories.unwrap_or_default();
374 v.push(input);
375 self.categories = ::std::option::Option::Some(v);
376 self
377 }
378 pub fn set_categories(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Category>>) -> Self {
380 self.categories = input;
381 self
382 }
383 pub fn get_categories(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Category>> {
385 &self.categories
386 }
387 pub fn food_types(mut self, input: crate::types::FoodType) -> Self {
393 let mut v = self.food_types.unwrap_or_default();
394 v.push(input);
395 self.food_types = ::std::option::Option::Some(v);
396 self
397 }
398 pub fn set_food_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::FoodType>>) -> Self {
400 self.food_types = input;
401 self
402 }
403 pub fn get_food_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::FoodType>> {
405 &self.food_types
406 }
407 pub fn business_chains(mut self, input: crate::types::BusinessChain) -> Self {
413 let mut v = self.business_chains.unwrap_or_default();
414 v.push(input);
415 self.business_chains = ::std::option::Option::Some(v);
416 self
417 }
418 pub fn set_business_chains(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BusinessChain>>) -> Self {
420 self.business_chains = input;
421 self
422 }
423 pub fn get_business_chains(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BusinessChain>> {
425 &self.business_chains
426 }
427 pub fn contacts(mut self, input: crate::types::Contacts) -> Self {
429 self.contacts = ::std::option::Option::Some(input);
430 self
431 }
432 pub fn set_contacts(mut self, input: ::std::option::Option<crate::types::Contacts>) -> Self {
434 self.contacts = input;
435 self
436 }
437 pub fn get_contacts(&self) -> &::std::option::Option<crate::types::Contacts> {
439 &self.contacts
440 }
441 pub fn opening_hours(mut self, input: crate::types::OpeningHours) -> Self {
447 let mut v = self.opening_hours.unwrap_or_default();
448 v.push(input);
449 self.opening_hours = ::std::option::Option::Some(v);
450 self
451 }
452 pub fn set_opening_hours(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OpeningHours>>) -> Self {
454 self.opening_hours = input;
455 self
456 }
457 pub fn get_opening_hours(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OpeningHours>> {
459 &self.opening_hours
460 }
461 pub fn access_points(mut self, input: crate::types::AccessPoint) -> Self {
467 let mut v = self.access_points.unwrap_or_default();
468 v.push(input);
469 self.access_points = ::std::option::Option::Some(v);
470 self
471 }
472 pub fn set_access_points(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AccessPoint>>) -> Self {
474 self.access_points = input;
475 self
476 }
477 pub fn get_access_points(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AccessPoint>> {
479 &self.access_points
480 }
481 pub fn access_restrictions(mut self, input: crate::types::AccessRestriction) -> Self {
487 let mut v = self.access_restrictions.unwrap_or_default();
488 v.push(input);
489 self.access_restrictions = ::std::option::Option::Some(v);
490 self
491 }
492 pub fn set_access_restrictions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AccessRestriction>>) -> Self {
494 self.access_restrictions = input;
495 self
496 }
497 pub fn get_access_restrictions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AccessRestriction>> {
499 &self.access_restrictions
500 }
501 pub fn time_zone(mut self, input: crate::types::TimeZone) -> Self {
503 self.time_zone = ::std::option::Option::Some(input);
504 self
505 }
506 pub fn set_time_zone(mut self, input: ::std::option::Option<crate::types::TimeZone>) -> Self {
508 self.time_zone = input;
509 self
510 }
511 pub fn get_time_zone(&self) -> &::std::option::Option<crate::types::TimeZone> {
513 &self.time_zone
514 }
515 pub fn political_view(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
517 self.political_view = ::std::option::Option::Some(input.into());
518 self
519 }
520 pub fn set_political_view(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
522 self.political_view = input;
523 self
524 }
525 pub fn get_political_view(&self) -> &::std::option::Option<::std::string::String> {
527 &self.political_view
528 }
529 pub fn phonemes(mut self, input: crate::types::PhonemeDetails) -> Self {
531 self.phonemes = ::std::option::Option::Some(input);
532 self
533 }
534 pub fn set_phonemes(mut self, input: ::std::option::Option<crate::types::PhonemeDetails>) -> Self {
536 self.phonemes = input;
537 self
538 }
539 pub fn get_phonemes(&self) -> &::std::option::Option<crate::types::PhonemeDetails> {
541 &self.phonemes
542 }
543 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
544 self._request_id = Some(request_id.into());
545 self
546 }
547
548 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
549 self._request_id = request_id;
550 self
551 }
552 pub fn build(self) -> ::std::result::Result<crate::operation::get_place::GetPlaceOutput, ::aws_smithy_types::error::operation::BuildError> {
559 ::std::result::Result::Ok(crate::operation::get_place::GetPlaceOutput {
560 place_id: self.place_id.ok_or_else(|| {
561 ::aws_smithy_types::error::operation::BuildError::missing_field(
562 "place_id",
563 "place_id was not specified but it is required when building GetPlaceOutput",
564 )
565 })?,
566 place_type: self.place_type.ok_or_else(|| {
567 ::aws_smithy_types::error::operation::BuildError::missing_field(
568 "place_type",
569 "place_type was not specified but it is required when building GetPlaceOutput",
570 )
571 })?,
572 title: self.title.ok_or_else(|| {
573 ::aws_smithy_types::error::operation::BuildError::missing_field(
574 "title",
575 "title was not specified but it is required when building GetPlaceOutput",
576 )
577 })?,
578 pricing_bucket: self.pricing_bucket.ok_or_else(|| {
579 ::aws_smithy_types::error::operation::BuildError::missing_field(
580 "pricing_bucket",
581 "pricing_bucket was not specified but it is required when building GetPlaceOutput",
582 )
583 })?,
584 address: self.address,
585 address_number_corrected: self.address_number_corrected,
586 postal_code_details: self.postal_code_details,
587 position: self.position,
588 map_view: self.map_view,
589 categories: self.categories,
590 food_types: self.food_types,
591 business_chains: self.business_chains,
592 contacts: self.contacts,
593 opening_hours: self.opening_hours,
594 access_points: self.access_points,
595 access_restrictions: self.access_restrictions,
596 time_zone: self.time_zone,
597 political_view: self.political_view,
598 phonemes: self.phonemes,
599 _request_id: self._request_id,
600 })
601 }
602}
603impl ::std::fmt::Debug for GetPlaceOutputBuilder {
604 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
605 let mut formatter = f.debug_struct("GetPlaceOutputBuilder");
606 formatter.field("place_id", &self.place_id);
607 formatter.field("place_type", &self.place_type);
608 formatter.field("title", &self.title);
609 formatter.field("pricing_bucket", &self.pricing_bucket);
610 formatter.field("address", &self.address);
611 formatter.field("address_number_corrected", &self.address_number_corrected);
612 formatter.field("postal_code_details", &self.postal_code_details);
613 formatter.field("position", &"*** Sensitive Data Redacted ***");
614 formatter.field("map_view", &"*** Sensitive Data Redacted ***");
615 formatter.field("categories", &self.categories);
616 formatter.field("food_types", &self.food_types);
617 formatter.field("business_chains", &self.business_chains);
618 formatter.field("contacts", &self.contacts);
619 formatter.field("opening_hours", &self.opening_hours);
620 formatter.field("access_points", &self.access_points);
621 formatter.field("access_restrictions", &self.access_restrictions);
622 formatter.field("time_zone", &self.time_zone);
623 formatter.field("political_view", &self.political_view);
624 formatter.field("phonemes", &self.phonemes);
625 formatter.field("_request_id", &self._request_id);
626 formatter.finish()
627 }
628}