aws_sdk_geoplaces/operation/reverse_geocode/
_reverse_geocode_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct ReverseGeocodeOutput {
6 pub pricing_bucket: ::std::string::String,
9 pub result_items: ::std::option::Option<::std::vec::Vec<crate::types::ReverseGeocodeResultItem>>,
11 _request_id: Option<String>,
12}
13impl ReverseGeocodeOutput {
14 pub fn pricing_bucket(&self) -> &str {
17 use std::ops::Deref;
18 self.pricing_bucket.deref()
19 }
20 pub fn result_items(&self) -> &[crate::types::ReverseGeocodeResultItem] {
24 self.result_items.as_deref().unwrap_or_default()
25 }
26}
27impl ::aws_types::request_id::RequestId for ReverseGeocodeOutput {
28 fn request_id(&self) -> Option<&str> {
29 self._request_id.as_deref()
30 }
31}
32impl ReverseGeocodeOutput {
33 pub fn builder() -> crate::operation::reverse_geocode::builders::ReverseGeocodeOutputBuilder {
35 crate::operation::reverse_geocode::builders::ReverseGeocodeOutputBuilder::default()
36 }
37}
38
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
41#[non_exhaustive]
42pub struct ReverseGeocodeOutputBuilder {
43 pub(crate) pricing_bucket: ::std::option::Option<::std::string::String>,
44 pub(crate) result_items: ::std::option::Option<::std::vec::Vec<crate::types::ReverseGeocodeResultItem>>,
45 _request_id: Option<String>,
46}
47impl ReverseGeocodeOutputBuilder {
48 pub fn pricing_bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52 self.pricing_bucket = ::std::option::Option::Some(input.into());
53 self
54 }
55 pub fn set_pricing_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58 self.pricing_bucket = input;
59 self
60 }
61 pub fn get_pricing_bucket(&self) -> &::std::option::Option<::std::string::String> {
64 &self.pricing_bucket
65 }
66 pub fn result_items(mut self, input: crate::types::ReverseGeocodeResultItem) -> Self {
72 let mut v = self.result_items.unwrap_or_default();
73 v.push(input);
74 self.result_items = ::std::option::Option::Some(v);
75 self
76 }
77 pub fn set_result_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReverseGeocodeResultItem>>) -> Self {
79 self.result_items = input;
80 self
81 }
82 pub fn get_result_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReverseGeocodeResultItem>> {
84 &self.result_items
85 }
86 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
87 self._request_id = Some(request_id.into());
88 self
89 }
90
91 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
92 self._request_id = request_id;
93 self
94 }
95 pub fn build(
99 self,
100 ) -> ::std::result::Result<crate::operation::reverse_geocode::ReverseGeocodeOutput, ::aws_smithy_types::error::operation::BuildError> {
101 ::std::result::Result::Ok(crate::operation::reverse_geocode::ReverseGeocodeOutput {
102 pricing_bucket: self.pricing_bucket.ok_or_else(|| {
103 ::aws_smithy_types::error::operation::BuildError::missing_field(
104 "pricing_bucket",
105 "pricing_bucket was not specified but it is required when building ReverseGeocodeOutput",
106 )
107 })?,
108 result_items: self.result_items,
109 _request_id: self._request_id,
110 })
111 }
112}