1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The details of a message in a channel.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct ChannelMessage {
    /// <p>The ARN of the channel.</p>
    pub channel_arn: ::std::option::Option<::std::string::String>,
    /// <p>The ID of a message.</p>
    pub message_id: ::std::option::Option<::std::string::String>,
    /// <p>The message content.</p>
    pub content: ::std::option::Option<::std::string::String>,
    /// <p>The message metadata.</p>
    pub metadata: ::std::option::Option<::std::string::String>,
    /// <p>The message type.</p>
    pub r#type: ::std::option::Option<crate::types::ChannelMessageType>,
    /// <p>The time at which the message was created.</p>
    pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time at which a message was edited.</p>
    pub last_edited_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The time at which a message was updated.</p>
    pub last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The message sender.</p>
    pub sender: ::std::option::Option<crate::types::Identity>,
    /// <p>Hides the content of a message.</p>
    pub redacted: bool,
    /// <p>The persistence setting for a channel message.</p>
    pub persistence: ::std::option::Option<crate::types::ChannelMessagePersistenceType>,
}
impl ChannelMessage {
    /// <p>The ARN of the channel.</p>
    pub fn channel_arn(&self) -> ::std::option::Option<&str> {
        self.channel_arn.as_deref()
    }
    /// <p>The ID of a message.</p>
    pub fn message_id(&self) -> ::std::option::Option<&str> {
        self.message_id.as_deref()
    }
    /// <p>The message content.</p>
    pub fn content(&self) -> ::std::option::Option<&str> {
        self.content.as_deref()
    }
    /// <p>The message metadata.</p>
    pub fn metadata(&self) -> ::std::option::Option<&str> {
        self.metadata.as_deref()
    }
    /// <p>The message type.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::ChannelMessageType> {
        self.r#type.as_ref()
    }
    /// <p>The time at which the message was created.</p>
    pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_timestamp.as_ref()
    }
    /// <p>The time at which a message was edited.</p>
    pub fn last_edited_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_edited_timestamp.as_ref()
    }
    /// <p>The time at which a message was updated.</p>
    pub fn last_updated_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_updated_timestamp.as_ref()
    }
    /// <p>The message sender.</p>
    pub fn sender(&self) -> ::std::option::Option<&crate::types::Identity> {
        self.sender.as_ref()
    }
    /// <p>Hides the content of a message.</p>
    pub fn redacted(&self) -> bool {
        self.redacted
    }
    /// <p>The persistence setting for a channel message.</p>
    pub fn persistence(&self) -> ::std::option::Option<&crate::types::ChannelMessagePersistenceType> {
        self.persistence.as_ref()
    }
}
impl ::std::fmt::Debug for ChannelMessage {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ChannelMessage");
        formatter.field("channel_arn", &self.channel_arn);
        formatter.field("message_id", &self.message_id);
        formatter.field("content", &"*** Sensitive Data Redacted ***");
        formatter.field("metadata", &"*** Sensitive Data Redacted ***");
        formatter.field("r#type", &self.r#type);
        formatter.field("created_timestamp", &self.created_timestamp);
        formatter.field("last_edited_timestamp", &self.last_edited_timestamp);
        formatter.field("last_updated_timestamp", &self.last_updated_timestamp);
        formatter.field("sender", &self.sender);
        formatter.field("redacted", &self.redacted);
        formatter.field("persistence", &self.persistence);
        formatter.finish()
    }
}
impl ChannelMessage {
    /// Creates a new builder-style object to manufacture [`ChannelMessage`](crate::types::ChannelMessage).
    pub fn builder() -> crate::types::builders::ChannelMessageBuilder {
        crate::types::builders::ChannelMessageBuilder::default()
    }
}

/// A builder for [`ChannelMessage`](crate::types::ChannelMessage).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct ChannelMessageBuilder {
    pub(crate) channel_arn: ::std::option::Option<::std::string::String>,
    pub(crate) message_id: ::std::option::Option<::std::string::String>,
    pub(crate) content: ::std::option::Option<::std::string::String>,
    pub(crate) metadata: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::ChannelMessageType>,
    pub(crate) created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_edited_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) last_updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) sender: ::std::option::Option<crate::types::Identity>,
    pub(crate) redacted: ::std::option::Option<bool>,
    pub(crate) persistence: ::std::option::Option<crate::types::ChannelMessagePersistenceType>,
}
impl ChannelMessageBuilder {
    /// <p>The ARN of the channel.</p>
    pub fn channel_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.channel_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the channel.</p>
    pub fn set_channel_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.channel_arn = input;
        self
    }
    /// <p>The ARN of the channel.</p>
    pub fn get_channel_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.channel_arn
    }
    /// <p>The ID of a message.</p>
    pub fn message_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.message_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of a message.</p>
    pub fn set_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.message_id = input;
        self
    }
    /// <p>The ID of a message.</p>
    pub fn get_message_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.message_id
    }
    /// <p>The message content.</p>
    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.content = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The message content.</p>
    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.content = input;
        self
    }
    /// <p>The message content.</p>
    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
        &self.content
    }
    /// <p>The message metadata.</p>
    pub fn metadata(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.metadata = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The message metadata.</p>
    pub fn set_metadata(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.metadata = input;
        self
    }
    /// <p>The message metadata.</p>
    pub fn get_metadata(&self) -> &::std::option::Option<::std::string::String> {
        &self.metadata
    }
    /// <p>The message type.</p>
    pub fn r#type(mut self, input: crate::types::ChannelMessageType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The message type.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ChannelMessageType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The message type.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::ChannelMessageType> {
        &self.r#type
    }
    /// <p>The time at which the message was created.</p>
    pub fn created_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which the message was created.</p>
    pub fn set_created_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_timestamp = input;
        self
    }
    /// <p>The time at which the message was created.</p>
    pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_timestamp
    }
    /// <p>The time at which a message was edited.</p>
    pub fn last_edited_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_edited_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which a message was edited.</p>
    pub fn set_last_edited_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_edited_timestamp = input;
        self
    }
    /// <p>The time at which a message was edited.</p>
    pub fn get_last_edited_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_edited_timestamp
    }
    /// <p>The time at which a message was updated.</p>
    pub fn last_updated_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_updated_timestamp = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time at which a message was updated.</p>
    pub fn set_last_updated_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_updated_timestamp = input;
        self
    }
    /// <p>The time at which a message was updated.</p>
    pub fn get_last_updated_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_updated_timestamp
    }
    /// <p>The message sender.</p>
    pub fn sender(mut self, input: crate::types::Identity) -> Self {
        self.sender = ::std::option::Option::Some(input);
        self
    }
    /// <p>The message sender.</p>
    pub fn set_sender(mut self, input: ::std::option::Option<crate::types::Identity>) -> Self {
        self.sender = input;
        self
    }
    /// <p>The message sender.</p>
    pub fn get_sender(&self) -> &::std::option::Option<crate::types::Identity> {
        &self.sender
    }
    /// <p>Hides the content of a message.</p>
    pub fn redacted(mut self, input: bool) -> Self {
        self.redacted = ::std::option::Option::Some(input);
        self
    }
    /// <p>Hides the content of a message.</p>
    pub fn set_redacted(mut self, input: ::std::option::Option<bool>) -> Self {
        self.redacted = input;
        self
    }
    /// <p>Hides the content of a message.</p>
    pub fn get_redacted(&self) -> &::std::option::Option<bool> {
        &self.redacted
    }
    /// <p>The persistence setting for a channel message.</p>
    pub fn persistence(mut self, input: crate::types::ChannelMessagePersistenceType) -> Self {
        self.persistence = ::std::option::Option::Some(input);
        self
    }
    /// <p>The persistence setting for a channel message.</p>
    pub fn set_persistence(mut self, input: ::std::option::Option<crate::types::ChannelMessagePersistenceType>) -> Self {
        self.persistence = input;
        self
    }
    /// <p>The persistence setting for a channel message.</p>
    pub fn get_persistence(&self) -> &::std::option::Option<crate::types::ChannelMessagePersistenceType> {
        &self.persistence
    }
    /// Consumes the builder and constructs a [`ChannelMessage`](crate::types::ChannelMessage).
    pub fn build(self) -> crate::types::ChannelMessage {
        crate::types::ChannelMessage {
            channel_arn: self.channel_arn,
            message_id: self.message_id,
            content: self.content,
            metadata: self.metadata,
            r#type: self.r#type,
            created_timestamp: self.created_timestamp,
            last_edited_timestamp: self.last_edited_timestamp,
            last_updated_timestamp: self.last_updated_timestamp,
            sender: self.sender,
            redacted: self.redacted.unwrap_or_default(),
            persistence: self.persistence,
        }
    }
}
impl ::std::fmt::Debug for ChannelMessageBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("ChannelMessageBuilder");
        formatter.field("channel_arn", &self.channel_arn);
        formatter.field("message_id", &self.message_id);
        formatter.field("content", &"*** Sensitive Data Redacted ***");
        formatter.field("metadata", &"*** Sensitive Data Redacted ***");
        formatter.field("r#type", &self.r#type);
        formatter.field("created_timestamp", &self.created_timestamp);
        formatter.field("last_edited_timestamp", &self.last_edited_timestamp);
        formatter.field("last_updated_timestamp", &self.last_updated_timestamp);
        formatter.field("sender", &self.sender);
        formatter.field("redacted", &self.redacted);
        formatter.field("persistence", &self.persistence);
        formatter.finish()
    }
}