aws_sdk_geoplaces/operation/search_nearby/
_search_nearby_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct SearchNearbyOutput {
6 pub pricing_bucket: ::std::string::String,
9 pub result_items: ::std::option::Option<::std::vec::Vec<crate::types::SearchNearbyResultItem>>,
11 pub next_token: ::std::option::Option<::std::string::String>,
13 _request_id: Option<String>,
14}
15impl SearchNearbyOutput {
16 pub fn pricing_bucket(&self) -> &str {
19 use std::ops::Deref;
20 self.pricing_bucket.deref()
21 }
22 pub fn result_items(&self) -> &[crate::types::SearchNearbyResultItem] {
26 self.result_items.as_deref().unwrap_or_default()
27 }
28 pub fn next_token(&self) -> ::std::option::Option<&str> {
30 self.next_token.as_deref()
31 }
32}
33impl ::aws_types::request_id::RequestId for SearchNearbyOutput {
34 fn request_id(&self) -> Option<&str> {
35 self._request_id.as_deref()
36 }
37}
38impl SearchNearbyOutput {
39 pub fn builder() -> crate::operation::search_nearby::builders::SearchNearbyOutputBuilder {
41 crate::operation::search_nearby::builders::SearchNearbyOutputBuilder::default()
42 }
43}
44
45#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
47#[non_exhaustive]
48pub struct SearchNearbyOutputBuilder {
49 pub(crate) pricing_bucket: ::std::option::Option<::std::string::String>,
50 pub(crate) result_items: ::std::option::Option<::std::vec::Vec<crate::types::SearchNearbyResultItem>>,
51 pub(crate) next_token: ::std::option::Option<::std::string::String>,
52 _request_id: Option<String>,
53}
54impl SearchNearbyOutputBuilder {
55 pub fn pricing_bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59 self.pricing_bucket = ::std::option::Option::Some(input.into());
60 self
61 }
62 pub fn set_pricing_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65 self.pricing_bucket = input;
66 self
67 }
68 pub fn get_pricing_bucket(&self) -> &::std::option::Option<::std::string::String> {
71 &self.pricing_bucket
72 }
73 pub fn result_items(mut self, input: crate::types::SearchNearbyResultItem) -> Self {
79 let mut v = self.result_items.unwrap_or_default();
80 v.push(input);
81 self.result_items = ::std::option::Option::Some(v);
82 self
83 }
84 pub fn set_result_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchNearbyResultItem>>) -> Self {
86 self.result_items = input;
87 self
88 }
89 pub fn get_result_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchNearbyResultItem>> {
91 &self.result_items
92 }
93 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95 self.next_token = ::std::option::Option::Some(input.into());
96 self
97 }
98 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100 self.next_token = input;
101 self
102 }
103 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
105 &self.next_token
106 }
107 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
108 self._request_id = Some(request_id.into());
109 self
110 }
111
112 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
113 self._request_id = request_id;
114 self
115 }
116 pub fn build(
120 self,
121 ) -> ::std::result::Result<crate::operation::search_nearby::SearchNearbyOutput, ::aws_smithy_types::error::operation::BuildError> {
122 ::std::result::Result::Ok(crate::operation::search_nearby::SearchNearbyOutput {
123 pricing_bucket: self.pricing_bucket.ok_or_else(|| {
124 ::aws_smithy_types::error::operation::BuildError::missing_field(
125 "pricing_bucket",
126 "pricing_bucket was not specified but it is required when building SearchNearbyOutput",
127 )
128 })?,
129 result_items: self.result_items,
130 next_token: self.next_token,
131 _request_id: self._request_id,
132 })
133 }
134}