aws_sdk_repostspace/operation/get_channel/
_get_channel_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetChannelOutput {
6 pub space_id: ::std::string::String,
8 pub channel_id: ::std::string::String,
10 pub channel_name: ::std::string::String,
12 pub channel_description: ::std::option::Option<::std::string::String>,
14 pub create_date_time: ::aws_smithy_types::DateTime,
16 pub delete_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
18 pub channel_roles: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ChannelRole>>>,
20 pub channel_status: crate::types::ChannelStatus,
22 _request_id: Option<String>,
23}
24impl GetChannelOutput {
25 pub fn space_id(&self) -> &str {
27 use std::ops::Deref;
28 self.space_id.deref()
29 }
30 pub fn channel_id(&self) -> &str {
32 use std::ops::Deref;
33 self.channel_id.deref()
34 }
35 pub fn channel_name(&self) -> &str {
37 use std::ops::Deref;
38 self.channel_name.deref()
39 }
40 pub fn channel_description(&self) -> ::std::option::Option<&str> {
42 self.channel_description.as_deref()
43 }
44 pub fn create_date_time(&self) -> &::aws_smithy_types::DateTime {
46 &self.create_date_time
47 }
48 pub fn delete_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
50 self.delete_date_time.as_ref()
51 }
52 pub fn channel_roles(
54 &self,
55 ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ChannelRole>>> {
56 self.channel_roles.as_ref()
57 }
58 pub fn channel_status(&self) -> &crate::types::ChannelStatus {
60 &self.channel_status
61 }
62}
63impl ::std::fmt::Debug for GetChannelOutput {
64 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
65 let mut formatter = f.debug_struct("GetChannelOutput");
66 formatter.field("space_id", &self.space_id);
67 formatter.field("channel_id", &self.channel_id);
68 formatter.field("channel_name", &"*** Sensitive Data Redacted ***");
69 formatter.field("channel_description", &"*** Sensitive Data Redacted ***");
70 formatter.field("create_date_time", &self.create_date_time);
71 formatter.field("delete_date_time", &self.delete_date_time);
72 formatter.field("channel_roles", &self.channel_roles);
73 formatter.field("channel_status", &self.channel_status);
74 formatter.field("_request_id", &self._request_id);
75 formatter.finish()
76 }
77}
78impl ::aws_types::request_id::RequestId for GetChannelOutput {
79 fn request_id(&self) -> Option<&str> {
80 self._request_id.as_deref()
81 }
82}
83impl GetChannelOutput {
84 pub fn builder() -> crate::operation::get_channel::builders::GetChannelOutputBuilder {
86 crate::operation::get_channel::builders::GetChannelOutputBuilder::default()
87 }
88}
89
90#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
92#[non_exhaustive]
93pub struct GetChannelOutputBuilder {
94 pub(crate) space_id: ::std::option::Option<::std::string::String>,
95 pub(crate) channel_id: ::std::option::Option<::std::string::String>,
96 pub(crate) channel_name: ::std::option::Option<::std::string::String>,
97 pub(crate) channel_description: ::std::option::Option<::std::string::String>,
98 pub(crate) create_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
99 pub(crate) delete_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
100 pub(crate) channel_roles: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ChannelRole>>>,
101 pub(crate) channel_status: ::std::option::Option<crate::types::ChannelStatus>,
102 _request_id: Option<String>,
103}
104impl GetChannelOutputBuilder {
105 pub fn space_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108 self.space_id = ::std::option::Option::Some(input.into());
109 self
110 }
111 pub fn set_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113 self.space_id = input;
114 self
115 }
116 pub fn get_space_id(&self) -> &::std::option::Option<::std::string::String> {
118 &self.space_id
119 }
120 pub fn channel_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.channel_id = ::std::option::Option::Some(input.into());
124 self
125 }
126 pub fn set_channel_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.channel_id = input;
129 self
130 }
131 pub fn get_channel_id(&self) -> &::std::option::Option<::std::string::String> {
133 &self.channel_id
134 }
135 pub fn channel_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138 self.channel_name = ::std::option::Option::Some(input.into());
139 self
140 }
141 pub fn set_channel_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143 self.channel_name = input;
144 self
145 }
146 pub fn get_channel_name(&self) -> &::std::option::Option<::std::string::String> {
148 &self.channel_name
149 }
150 pub fn channel_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152 self.channel_description = ::std::option::Option::Some(input.into());
153 self
154 }
155 pub fn set_channel_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157 self.channel_description = input;
158 self
159 }
160 pub fn get_channel_description(&self) -> &::std::option::Option<::std::string::String> {
162 &self.channel_description
163 }
164 pub fn create_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
167 self.create_date_time = ::std::option::Option::Some(input);
168 self
169 }
170 pub fn set_create_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
172 self.create_date_time = input;
173 self
174 }
175 pub fn get_create_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
177 &self.create_date_time
178 }
179 pub fn delete_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
181 self.delete_date_time = ::std::option::Option::Some(input);
182 self
183 }
184 pub fn set_delete_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
186 self.delete_date_time = input;
187 self
188 }
189 pub fn get_delete_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
191 &self.delete_date_time
192 }
193 pub fn channel_roles(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<crate::types::ChannelRole>) -> Self {
199 let mut hash_map = self.channel_roles.unwrap_or_default();
200 hash_map.insert(k.into(), v);
201 self.channel_roles = ::std::option::Option::Some(hash_map);
202 self
203 }
204 pub fn set_channel_roles(
206 mut self,
207 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ChannelRole>>>,
208 ) -> Self {
209 self.channel_roles = input;
210 self
211 }
212 pub fn get_channel_roles(
214 &self,
215 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ChannelRole>>> {
216 &self.channel_roles
217 }
218 pub fn channel_status(mut self, input: crate::types::ChannelStatus) -> Self {
221 self.channel_status = ::std::option::Option::Some(input);
222 self
223 }
224 pub fn set_channel_status(mut self, input: ::std::option::Option<crate::types::ChannelStatus>) -> Self {
226 self.channel_status = input;
227 self
228 }
229 pub fn get_channel_status(&self) -> &::std::option::Option<crate::types::ChannelStatus> {
231 &self.channel_status
232 }
233 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
234 self._request_id = Some(request_id.into());
235 self
236 }
237
238 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
239 self._request_id = request_id;
240 self
241 }
242 pub fn build(self) -> ::std::result::Result<crate::operation::get_channel::GetChannelOutput, ::aws_smithy_types::error::operation::BuildError> {
250 ::std::result::Result::Ok(crate::operation::get_channel::GetChannelOutput {
251 space_id: self.space_id.ok_or_else(|| {
252 ::aws_smithy_types::error::operation::BuildError::missing_field(
253 "space_id",
254 "space_id was not specified but it is required when building GetChannelOutput",
255 )
256 })?,
257 channel_id: self.channel_id.ok_or_else(|| {
258 ::aws_smithy_types::error::operation::BuildError::missing_field(
259 "channel_id",
260 "channel_id was not specified but it is required when building GetChannelOutput",
261 )
262 })?,
263 channel_name: self.channel_name.ok_or_else(|| {
264 ::aws_smithy_types::error::operation::BuildError::missing_field(
265 "channel_name",
266 "channel_name was not specified but it is required when building GetChannelOutput",
267 )
268 })?,
269 channel_description: self.channel_description,
270 create_date_time: self.create_date_time.ok_or_else(|| {
271 ::aws_smithy_types::error::operation::BuildError::missing_field(
272 "create_date_time",
273 "create_date_time was not specified but it is required when building GetChannelOutput",
274 )
275 })?,
276 delete_date_time: self.delete_date_time,
277 channel_roles: self.channel_roles,
278 channel_status: self.channel_status.ok_or_else(|| {
279 ::aws_smithy_types::error::operation::BuildError::missing_field(
280 "channel_status",
281 "channel_status was not specified but it is required when building GetChannelOutput",
282 )
283 })?,
284 _request_id: self._request_id,
285 })
286 }
287}
288impl ::std::fmt::Debug for GetChannelOutputBuilder {
289 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
290 let mut formatter = f.debug_struct("GetChannelOutputBuilder");
291 formatter.field("space_id", &self.space_id);
292 formatter.field("channel_id", &self.channel_id);
293 formatter.field("channel_name", &"*** Sensitive Data Redacted ***");
294 formatter.field("channel_description", &"*** Sensitive Data Redacted ***");
295 formatter.field("create_date_time", &self.create_date_time);
296 formatter.field("delete_date_time", &self.delete_date_time);
297 formatter.field("channel_roles", &self.channel_roles);
298 formatter.field("channel_status", &self.channel_status);
299 formatter.field("_request_id", &self._request_id);
300 formatter.finish()
301 }
302}