aws_sdk_repostspace/operation/get_channel/
_get_channel_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetChannelOutput {
6    /// <p>The unique ID of the private re:Post.</p>
7    pub space_id: ::std::string::String,
8    /// <p>The unique ID of the private re:Post channel.</p>
9    pub channel_id: ::std::string::String,
10    /// <p>The name for the channel. This must be unique per private re:Post.</p>
11    pub channel_name: ::std::string::String,
12    /// <p>A description for the channel. This is used only to help you identify this channel.</p>
13    pub channel_description: ::std::option::Option<::std::string::String>,
14    /// <p>The date when the channel was created.</p>
15    pub create_date_time: ::aws_smithy_types::DateTime,
16    /// <p>The date when the channel was deleted.</p>
17    pub delete_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
18    /// <p>The channel roles associated to the users and groups of the channel.</p>
19    pub channel_roles: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<crate::types::ChannelRole>>>,
20    /// <p>The status pf the channel.</p>
21    pub channel_status: crate::types::ChannelStatus,
22    _request_id: Option<String>,
23}
24impl GetChannelOutput {
25    /// <p>The unique ID of the private re:Post.</p>
26    pub fn space_id(&self) -> &str {
27        use std::ops::Deref;
28        self.space_id.deref()
29    }
30    /// <p>The unique ID of the private re:Post channel.</p>
31    pub fn channel_id(&self) -> &str {
32        use std::ops::Deref;
33        self.channel_id.deref()
34    }
35    /// <p>The name for the channel. This must be unique per private re:Post.</p>
36    pub fn channel_name(&self) -> &str {
37        use std::ops::Deref;
38        self.channel_name.deref()
39    }
40    /// <p>A description for the channel. This is used only to help you identify this channel.</p>
41    pub fn channel_description(&self) -> ::std::option::Option<&str> {
42        self.channel_description.as_deref()
43    }
44    /// <p>The date when the channel was created.</p>
45    pub fn create_date_time(&self) -> &::aws_smithy_types::DateTime {
46        &self.create_date_time
47    }
48    /// <p>The date when the channel was deleted.</p>
49    pub fn delete_date_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
50        self.delete_date_time.as_ref()
51    }
52    /// <p>The channel roles associated to the users and groups of the channel.</p>
53    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    /// <p>The status pf the channel.</p>
59    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    /// Creates a new builder-style object to manufacture [`GetChannelOutput`](crate::operation::get_channel::GetChannelOutput).
85    pub fn builder() -> crate::operation::get_channel::builders::GetChannelOutputBuilder {
86        crate::operation::get_channel::builders::GetChannelOutputBuilder::default()
87    }
88}
89
90/// A builder for [`GetChannelOutput`](crate::operation::get_channel::GetChannelOutput).
91#[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    /// <p>The unique ID of the private re:Post.</p>
106    /// This field is required.
107    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    /// <p>The unique ID of the private re:Post.</p>
112    pub fn set_space_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.space_id = input;
114        self
115    }
116    /// <p>The unique ID of the private re:Post.</p>
117    pub fn get_space_id(&self) -> &::std::option::Option<::std::string::String> {
118        &self.space_id
119    }
120    /// <p>The unique ID of the private re:Post channel.</p>
121    /// This field is required.
122    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    /// <p>The unique ID of the private re:Post channel.</p>
127    pub fn set_channel_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.channel_id = input;
129        self
130    }
131    /// <p>The unique ID of the private re:Post channel.</p>
132    pub fn get_channel_id(&self) -> &::std::option::Option<::std::string::String> {
133        &self.channel_id
134    }
135    /// <p>The name for the channel. This must be unique per private re:Post.</p>
136    /// This field is required.
137    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    /// <p>The name for the channel. This must be unique per private re:Post.</p>
142    pub fn set_channel_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.channel_name = input;
144        self
145    }
146    /// <p>The name for the channel. This must be unique per private re:Post.</p>
147    pub fn get_channel_name(&self) -> &::std::option::Option<::std::string::String> {
148        &self.channel_name
149    }
150    /// <p>A description for the channel. This is used only to help you identify this channel.</p>
151    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    /// <p>A description for the channel. This is used only to help you identify this channel.</p>
156    pub fn set_channel_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157        self.channel_description = input;
158        self
159    }
160    /// <p>A description for the channel. This is used only to help you identify this channel.</p>
161    pub fn get_channel_description(&self) -> &::std::option::Option<::std::string::String> {
162        &self.channel_description
163    }
164    /// <p>The date when the channel was created.</p>
165    /// This field is required.
166    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    /// <p>The date when the channel was created.</p>
171    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    /// <p>The date when the channel was created.</p>
176    pub fn get_create_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
177        &self.create_date_time
178    }
179    /// <p>The date when the channel was deleted.</p>
180    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    /// <p>The date when the channel was deleted.</p>
185    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    /// <p>The date when the channel was deleted.</p>
190    pub fn get_delete_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
191        &self.delete_date_time
192    }
193    /// Adds a key-value pair to `channel_roles`.
194    ///
195    /// To override the contents of this collection use [`set_channel_roles`](Self::set_channel_roles).
196    ///
197    /// <p>The channel roles associated to the users and groups of the channel.</p>
198    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    /// <p>The channel roles associated to the users and groups of the channel.</p>
205    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    /// <p>The channel roles associated to the users and groups of the channel.</p>
213    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    /// <p>The status pf the channel.</p>
219    /// This field is required.
220    pub fn channel_status(mut self, input: crate::types::ChannelStatus) -> Self {
221        self.channel_status = ::std::option::Option::Some(input);
222        self
223    }
224    /// <p>The status pf the channel.</p>
225    pub fn set_channel_status(mut self, input: ::std::option::Option<crate::types::ChannelStatus>) -> Self {
226        self.channel_status = input;
227        self
228    }
229    /// <p>The status pf the channel.</p>
230    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    /// Consumes the builder and constructs a [`GetChannelOutput`](crate::operation::get_channel::GetChannelOutput).
243    /// This method will fail if any of the following fields are not set:
244    /// - [`space_id`](crate::operation::get_channel::builders::GetChannelOutputBuilder::space_id)
245    /// - [`channel_id`](crate::operation::get_channel::builders::GetChannelOutputBuilder::channel_id)
246    /// - [`channel_name`](crate::operation::get_channel::builders::GetChannelOutputBuilder::channel_name)
247    /// - [`create_date_time`](crate::operation::get_channel::builders::GetChannelOutputBuilder::create_date_time)
248    /// - [`channel_status`](crate::operation::get_channel::builders::GetChannelOutputBuilder::channel_status)
249    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}