aws_sdk_connect/operation/search_contacts/
_search_contacts_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct SearchContactsOutput {
6 pub contacts: ::std::vec::Vec<crate::types::ContactSearchSummary>,
8 pub next_token: ::std::option::Option<::std::string::String>,
10 pub total_count: ::std::option::Option<i64>,
12 _request_id: Option<String>,
13}
14impl SearchContactsOutput {
15 pub fn contacts(&self) -> &[crate::types::ContactSearchSummary] {
17 use std::ops::Deref;
18 self.contacts.deref()
19 }
20 pub fn next_token(&self) -> ::std::option::Option<&str> {
22 self.next_token.as_deref()
23 }
24 pub fn total_count(&self) -> ::std::option::Option<i64> {
26 self.total_count
27 }
28}
29impl ::aws_types::request_id::RequestId for SearchContactsOutput {
30 fn request_id(&self) -> Option<&str> {
31 self._request_id.as_deref()
32 }
33}
34impl SearchContactsOutput {
35 pub fn builder() -> crate::operation::search_contacts::builders::SearchContactsOutputBuilder {
37 crate::operation::search_contacts::builders::SearchContactsOutputBuilder::default()
38 }
39}
40
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct SearchContactsOutputBuilder {
45 pub(crate) contacts: ::std::option::Option<::std::vec::Vec<crate::types::ContactSearchSummary>>,
46 pub(crate) next_token: ::std::option::Option<::std::string::String>,
47 pub(crate) total_count: ::std::option::Option<i64>,
48 _request_id: Option<String>,
49}
50impl SearchContactsOutputBuilder {
51 pub fn contacts(mut self, input: crate::types::ContactSearchSummary) -> Self {
57 let mut v = self.contacts.unwrap_or_default();
58 v.push(input);
59 self.contacts = ::std::option::Option::Some(v);
60 self
61 }
62 pub fn set_contacts(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ContactSearchSummary>>) -> Self {
64 self.contacts = input;
65 self
66 }
67 pub fn get_contacts(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ContactSearchSummary>> {
69 &self.contacts
70 }
71 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73 self.next_token = ::std::option::Option::Some(input.into());
74 self
75 }
76 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78 self.next_token = input;
79 self
80 }
81 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
83 &self.next_token
84 }
85 pub fn total_count(mut self, input: i64) -> Self {
87 self.total_count = ::std::option::Option::Some(input);
88 self
89 }
90 pub fn set_total_count(mut self, input: ::std::option::Option<i64>) -> Self {
92 self.total_count = input;
93 self
94 }
95 pub fn get_total_count(&self) -> &::std::option::Option<i64> {
97 &self.total_count
98 }
99 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
100 self._request_id = Some(request_id.into());
101 self
102 }
103
104 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
105 self._request_id = request_id;
106 self
107 }
108 pub fn build(
112 self,
113 ) -> ::std::result::Result<crate::operation::search_contacts::SearchContactsOutput, ::aws_smithy_types::error::operation::BuildError> {
114 ::std::result::Result::Ok(crate::operation::search_contacts::SearchContactsOutput {
115 contacts: self.contacts.ok_or_else(|| {
116 ::aws_smithy_types::error::operation::BuildError::missing_field(
117 "contacts",
118 "contacts was not specified but it is required when building SearchContactsOutput",
119 )
120 })?,
121 next_token: self.next_token,
122 total_count: self.total_count,
123 _request_id: self._request_id,
124 })
125 }
126}