aws_sdk_geoplaces/operation/geocode/
_geocode_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GeocodeOutput {
6 pub pricing_bucket: ::std::string::String,
9 pub result_items: ::std::option::Option<::std::vec::Vec<crate::types::GeocodeResultItem>>,
11 _request_id: Option<String>,
12}
13impl GeocodeOutput {
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::GeocodeResultItem] {
24 self.result_items.as_deref().unwrap_or_default()
25 }
26}
27impl ::aws_types::request_id::RequestId for GeocodeOutput {
28 fn request_id(&self) -> Option<&str> {
29 self._request_id.as_deref()
30 }
31}
32impl GeocodeOutput {
33 pub fn builder() -> crate::operation::geocode::builders::GeocodeOutputBuilder {
35 crate::operation::geocode::builders::GeocodeOutputBuilder::default()
36 }
37}
38
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
41#[non_exhaustive]
42pub struct GeocodeOutputBuilder {
43 pub(crate) pricing_bucket: ::std::option::Option<::std::string::String>,
44 pub(crate) result_items: ::std::option::Option<::std::vec::Vec<crate::types::GeocodeResultItem>>,
45 _request_id: Option<String>,
46}
47impl GeocodeOutputBuilder {
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::GeocodeResultItem) -> 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::GeocodeResultItem>>) -> Self {
79 self.result_items = input;
80 self
81 }
82 pub fn get_result_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GeocodeResultItem>> {
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(self) -> ::std::result::Result<crate::operation::geocode::GeocodeOutput, ::aws_smithy_types::error::operation::BuildError> {
99 ::std::result::Result::Ok(crate::operation::geocode::GeocodeOutput {
100 pricing_bucket: self.pricing_bucket.ok_or_else(|| {
101 ::aws_smithy_types::error::operation::BuildError::missing_field(
102 "pricing_bucket",
103 "pricing_bucket was not specified but it is required when building GeocodeOutput",
104 )
105 })?,
106 result_items: self.result_items,
107 _request_id: self._request_id,
108 })
109 }
110}