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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Returns information about a specific comment.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Comment {
/// <p>The system-generated comment ID.</p>
pub comment_id: ::std::option::Option<::std::string::String>,
/// <p>The content of the comment.</p>
pub content: ::std::option::Option<::std::string::String>,
/// <p>The ID of the comment for which this comment is a reply, if any.</p>
pub in_reply_to: ::std::option::Option<::std::string::String>,
/// <p>The date and time the comment was created, in timestamp format.</p>
pub creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The date and time the comment was most recently modified, in timestamp format.</p>
pub last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
/// <p>The Amazon Resource Name (ARN) of the person who posted the comment.</p>
pub author_arn: ::std::option::Option<::std::string::String>,
/// <p>A Boolean value indicating whether the comment has been deleted.</p>
pub deleted: bool,
/// <p>A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.</p>
pub client_request_token: ::std::option::Option<::std::string::String>,
/// <p>The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.</p>
pub caller_reactions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.</p>
pub reaction_counts: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
}
impl Comment {
/// <p>The system-generated comment ID.</p>
pub fn comment_id(&self) -> ::std::option::Option<&str> {
self.comment_id.as_deref()
}
/// <p>The content of the comment.</p>
pub fn content(&self) -> ::std::option::Option<&str> {
self.content.as_deref()
}
/// <p>The ID of the comment for which this comment is a reply, if any.</p>
pub fn in_reply_to(&self) -> ::std::option::Option<&str> {
self.in_reply_to.as_deref()
}
/// <p>The date and time the comment was created, in timestamp format.</p>
pub fn creation_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.creation_date.as_ref()
}
/// <p>The date and time the comment was most recently modified, in timestamp format.</p>
pub fn last_modified_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
self.last_modified_date.as_ref()
}
/// <p>The Amazon Resource Name (ARN) of the person who posted the comment.</p>
pub fn author_arn(&self) -> ::std::option::Option<&str> {
self.author_arn.as_deref()
}
/// <p>A Boolean value indicating whether the comment has been deleted.</p>
pub fn deleted(&self) -> bool {
self.deleted
}
/// <p>A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.</p>
pub fn client_request_token(&self) -> ::std::option::Option<&str> {
self.client_request_token.as_deref()
}
/// <p>The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.caller_reactions.is_none()`.
pub fn caller_reactions(&self) -> &[::std::string::String] {
self.caller_reactions.as_deref().unwrap_or_default()
}
/// <p>A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.</p>
pub fn reaction_counts(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, i32>> {
self.reaction_counts.as_ref()
}
}
impl Comment {
/// Creates a new builder-style object to manufacture [`Comment`](crate::types::Comment).
pub fn builder() -> crate::types::builders::CommentBuilder {
crate::types::builders::CommentBuilder::default()
}
}
/// A builder for [`Comment`](crate::types::Comment).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CommentBuilder {
pub(crate) comment_id: ::std::option::Option<::std::string::String>,
pub(crate) content: ::std::option::Option<::std::string::String>,
pub(crate) in_reply_to: ::std::option::Option<::std::string::String>,
pub(crate) creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_modified_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) author_arn: ::std::option::Option<::std::string::String>,
pub(crate) deleted: ::std::option::Option<bool>,
pub(crate) client_request_token: ::std::option::Option<::std::string::String>,
pub(crate) caller_reactions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) reaction_counts: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>,
}
impl CommentBuilder {
/// <p>The system-generated comment ID.</p>
pub fn comment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.comment_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The system-generated comment ID.</p>
pub fn set_comment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.comment_id = input;
self
}
/// <p>The system-generated comment ID.</p>
pub fn get_comment_id(&self) -> &::std::option::Option<::std::string::String> {
&self.comment_id
}
/// <p>The content of the comment.</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 content of the comment.</p>
pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.content = input;
self
}
/// <p>The content of the comment.</p>
pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
&self.content
}
/// <p>The ID of the comment for which this comment is a reply, if any.</p>
pub fn in_reply_to(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.in_reply_to = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the comment for which this comment is a reply, if any.</p>
pub fn set_in_reply_to(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.in_reply_to = input;
self
}
/// <p>The ID of the comment for which this comment is a reply, if any.</p>
pub fn get_in_reply_to(&self) -> &::std::option::Option<::std::string::String> {
&self.in_reply_to
}
/// <p>The date and time the comment was created, in timestamp format.</p>
pub fn creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.creation_date = ::std::option::Option::Some(input);
self
}
/// <p>The date and time the comment was created, in timestamp format.</p>
pub fn set_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.creation_date = input;
self
}
/// <p>The date and time the comment was created, in timestamp format.</p>
pub fn get_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.creation_date
}
/// <p>The date and time the comment was most recently modified, in timestamp format.</p>
pub fn last_modified_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_modified_date = ::std::option::Option::Some(input);
self
}
/// <p>The date and time the comment was most recently modified, in timestamp format.</p>
pub fn set_last_modified_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_modified_date = input;
self
}
/// <p>The date and time the comment was most recently modified, in timestamp format.</p>
pub fn get_last_modified_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_modified_date
}
/// <p>The Amazon Resource Name (ARN) of the person who posted the comment.</p>
pub fn author_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.author_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Resource Name (ARN) of the person who posted the comment.</p>
pub fn set_author_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.author_arn = input;
self
}
/// <p>The Amazon Resource Name (ARN) of the person who posted the comment.</p>
pub fn get_author_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.author_arn
}
/// <p>A Boolean value indicating whether the comment has been deleted.</p>
pub fn deleted(mut self, input: bool) -> Self {
self.deleted = ::std::option::Option::Some(input);
self
}
/// <p>A Boolean value indicating whether the comment has been deleted.</p>
pub fn set_deleted(mut self, input: ::std::option::Option<bool>) -> Self {
self.deleted = input;
self
}
/// <p>A Boolean value indicating whether the comment has been deleted.</p>
pub fn get_deleted(&self) -> &::std::option::Option<bool> {
&self.deleted
}
/// <p>A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.</p>
pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_request_token = ::std::option::Option::Some(input.into());
self
}
/// <p>A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.</p>
pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_request_token = input;
self
}
/// <p>A unique, client-generated idempotency token that, when provided in a request, ensures the request cannot be repeated with a changed parameter. If a request is received with the same parameters and a token is included, the request returns information about the initial request that used that token.</p>
pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_request_token
}
/// Appends an item to `caller_reactions`.
///
/// To override the contents of this collection use [`set_caller_reactions`](Self::set_caller_reactions).
///
/// <p>The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.</p>
pub fn caller_reactions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.caller_reactions.unwrap_or_default();
v.push(input.into());
self.caller_reactions = ::std::option::Option::Some(v);
self
}
/// <p>The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.</p>
pub fn set_caller_reactions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.caller_reactions = input;
self
}
/// <p>The emoji reactions to a comment, if any, submitted by the user whose credentials are associated with the call to the API.</p>
pub fn get_caller_reactions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.caller_reactions
}
/// Adds a key-value pair to `reaction_counts`.
///
/// To override the contents of this collection use [`set_reaction_counts`](Self::set_reaction_counts).
///
/// <p>A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.</p>
pub fn reaction_counts(mut self, k: impl ::std::convert::Into<::std::string::String>, v: i32) -> Self {
let mut hash_map = self.reaction_counts.unwrap_or_default();
hash_map.insert(k.into(), v);
self.reaction_counts = ::std::option::Option::Some(hash_map);
self
}
/// <p>A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.</p>
pub fn set_reaction_counts(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, i32>>) -> Self {
self.reaction_counts = input;
self
}
/// <p>A string to integer map that represents the number of individual users who have responded to a comment with the specified reactions.</p>
pub fn get_reaction_counts(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, i32>> {
&self.reaction_counts
}
/// Consumes the builder and constructs a [`Comment`](crate::types::Comment).
pub fn build(self) -> crate::types::Comment {
crate::types::Comment {
comment_id: self.comment_id,
content: self.content,
in_reply_to: self.in_reply_to,
creation_date: self.creation_date,
last_modified_date: self.last_modified_date,
author_arn: self.author_arn,
deleted: self.deleted.unwrap_or_default(),
client_request_token: self.client_request_token,
caller_reactions: self.caller_reactions,
reaction_counts: self.reaction_counts,
}
}
}