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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An Amazon SQS message.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Message {
/// <p>A unique identifier for the message. A <code>MessageId</code>is considered unique across all Amazon Web Services accounts for an extended period of time.</p>
pub message_id: ::std::option::Option<::std::string::String>,
/// <p>An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.</p>
pub receipt_handle: ::std::option::Option<::std::string::String>,
/// <p>An MD5 digest of the non-URL-encoded message body string.</p>
pub md5_of_body: ::std::option::Option<::std::string::String>,
/// <p>The message's contents (not URL-encoded).</p>
pub body: ::std::option::Option<::std::string::String>,
/// <p>A map of the attributes requested in <code> <code>ReceiveMessage</code> </code> to their respective values. Supported attributes:</p>
/// <ul>
/// <li>
/// <p><code>ApproximateReceiveCount</code></p></li>
/// <li>
/// <p><code>ApproximateFirstReceiveTimestamp</code></p></li>
/// <li>
/// <p><code>MessageDeduplicationId</code></p></li>
/// <li>
/// <p><code>MessageGroupId</code></p></li>
/// <li>
/// <p><code>SenderId</code></p></li>
/// <li>
/// <p><code>SentTimestamp</code></p></li>
/// <li>
/// <p><code>SequenceNumber</code></p></li>
/// </ul>
/// <p><code>ApproximateFirstReceiveTimestamp</code> and <code>SentTimestamp</code> are each returned as an integer representing the <a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds.</p>
pub attributes: ::std::option::Option<::std::collections::HashMap<crate::types::MessageSystemAttributeName, ::std::string::String>>,
/// <p>An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p>
pub md5_of_message_attributes: ::std::option::Option<::std::string::String>,
/// <p>Each message attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes">Amazon SQS message attributes</a> in the <i>Amazon SQS Developer Guide</i>.</p>
pub message_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>>,
}
impl Message {
/// <p>A unique identifier for the message. A <code>MessageId</code>is considered unique across all Amazon Web Services accounts for an extended period of time.</p>
pub fn message_id(&self) -> ::std::option::Option<&str> {
self.message_id.as_deref()
}
/// <p>An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.</p>
pub fn receipt_handle(&self) -> ::std::option::Option<&str> {
self.receipt_handle.as_deref()
}
/// <p>An MD5 digest of the non-URL-encoded message body string.</p>
pub fn md5_of_body(&self) -> ::std::option::Option<&str> {
self.md5_of_body.as_deref()
}
/// <p>The message's contents (not URL-encoded).</p>
pub fn body(&self) -> ::std::option::Option<&str> {
self.body.as_deref()
}
/// <p>A map of the attributes requested in <code> <code>ReceiveMessage</code> </code> to their respective values. Supported attributes:</p>
/// <ul>
/// <li>
/// <p><code>ApproximateReceiveCount</code></p></li>
/// <li>
/// <p><code>ApproximateFirstReceiveTimestamp</code></p></li>
/// <li>
/// <p><code>MessageDeduplicationId</code></p></li>
/// <li>
/// <p><code>MessageGroupId</code></p></li>
/// <li>
/// <p><code>SenderId</code></p></li>
/// <li>
/// <p><code>SentTimestamp</code></p></li>
/// <li>
/// <p><code>SequenceNumber</code></p></li>
/// </ul>
/// <p><code>ApproximateFirstReceiveTimestamp</code> and <code>SentTimestamp</code> are each returned as an integer representing the <a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds.</p>
pub fn attributes(&self) -> ::std::option::Option<&::std::collections::HashMap<crate::types::MessageSystemAttributeName, ::std::string::String>> {
self.attributes.as_ref()
}
/// <p>An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p>
pub fn md5_of_message_attributes(&self) -> ::std::option::Option<&str> {
self.md5_of_message_attributes.as_deref()
}
/// <p>Each message attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes">Amazon SQS message attributes</a> in the <i>Amazon SQS Developer Guide</i>.</p>
pub fn message_attributes(
&self,
) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>> {
self.message_attributes.as_ref()
}
}
impl Message {
/// Creates a new builder-style object to manufacture [`Message`](crate::types::Message).
pub fn builder() -> crate::types::builders::MessageBuilder {
crate::types::builders::MessageBuilder::default()
}
}
/// A builder for [`Message`](crate::types::Message).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct MessageBuilder {
pub(crate) message_id: ::std::option::Option<::std::string::String>,
pub(crate) receipt_handle: ::std::option::Option<::std::string::String>,
pub(crate) md5_of_body: ::std::option::Option<::std::string::String>,
pub(crate) body: ::std::option::Option<::std::string::String>,
pub(crate) attributes: ::std::option::Option<::std::collections::HashMap<crate::types::MessageSystemAttributeName, ::std::string::String>>,
pub(crate) md5_of_message_attributes: ::std::option::Option<::std::string::String>,
pub(crate) message_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>>,
}
impl MessageBuilder {
/// <p>A unique identifier for the message. A <code>MessageId</code>is considered unique across all Amazon Web Services accounts for an extended period of time.</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>A unique identifier for the message. A <code>MessageId</code>is considered unique across all Amazon Web Services accounts for an extended period of time.</p>
pub fn set_message_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.message_id = input;
self
}
/// <p>A unique identifier for the message. A <code>MessageId</code>is considered unique across all Amazon Web Services accounts for an extended period of time.</p>
pub fn get_message_id(&self) -> &::std::option::Option<::std::string::String> {
&self.message_id
}
/// <p>An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.</p>
pub fn receipt_handle(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.receipt_handle = ::std::option::Option::Some(input.into());
self
}
/// <p>An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.</p>
pub fn set_receipt_handle(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.receipt_handle = input;
self
}
/// <p>An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.</p>
pub fn get_receipt_handle(&self) -> &::std::option::Option<::std::string::String> {
&self.receipt_handle
}
/// <p>An MD5 digest of the non-URL-encoded message body string.</p>
pub fn md5_of_body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.md5_of_body = ::std::option::Option::Some(input.into());
self
}
/// <p>An MD5 digest of the non-URL-encoded message body string.</p>
pub fn set_md5_of_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.md5_of_body = input;
self
}
/// <p>An MD5 digest of the non-URL-encoded message body string.</p>
pub fn get_md5_of_body(&self) -> &::std::option::Option<::std::string::String> {
&self.md5_of_body
}
/// <p>The message's contents (not URL-encoded).</p>
pub fn body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.body = ::std::option::Option::Some(input.into());
self
}
/// <p>The message's contents (not URL-encoded).</p>
pub fn set_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.body = input;
self
}
/// <p>The message's contents (not URL-encoded).</p>
pub fn get_body(&self) -> &::std::option::Option<::std::string::String> {
&self.body
}
/// Adds a key-value pair to `attributes`.
///
/// To override the contents of this collection use [`set_attributes`](Self::set_attributes).
///
/// <p>A map of the attributes requested in <code> <code>ReceiveMessage</code> </code> to their respective values. Supported attributes:</p>
/// <ul>
/// <li>
/// <p><code>ApproximateReceiveCount</code></p></li>
/// <li>
/// <p><code>ApproximateFirstReceiveTimestamp</code></p></li>
/// <li>
/// <p><code>MessageDeduplicationId</code></p></li>
/// <li>
/// <p><code>MessageGroupId</code></p></li>
/// <li>
/// <p><code>SenderId</code></p></li>
/// <li>
/// <p><code>SentTimestamp</code></p></li>
/// <li>
/// <p><code>SequenceNumber</code></p></li>
/// </ul>
/// <p><code>ApproximateFirstReceiveTimestamp</code> and <code>SentTimestamp</code> are each returned as an integer representing the <a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds.</p>
pub fn attributes(mut self, k: crate::types::MessageSystemAttributeName, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.attributes.unwrap_or_default();
hash_map.insert(k, v.into());
self.attributes = ::std::option::Option::Some(hash_map);
self
}
/// <p>A map of the attributes requested in <code> <code>ReceiveMessage</code> </code> to their respective values. Supported attributes:</p>
/// <ul>
/// <li>
/// <p><code>ApproximateReceiveCount</code></p></li>
/// <li>
/// <p><code>ApproximateFirstReceiveTimestamp</code></p></li>
/// <li>
/// <p><code>MessageDeduplicationId</code></p></li>
/// <li>
/// <p><code>MessageGroupId</code></p></li>
/// <li>
/// <p><code>SenderId</code></p></li>
/// <li>
/// <p><code>SentTimestamp</code></p></li>
/// <li>
/// <p><code>SequenceNumber</code></p></li>
/// </ul>
/// <p><code>ApproximateFirstReceiveTimestamp</code> and <code>SentTimestamp</code> are each returned as an integer representing the <a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds.</p>
pub fn set_attributes(
mut self,
input: ::std::option::Option<::std::collections::HashMap<crate::types::MessageSystemAttributeName, ::std::string::String>>,
) -> Self {
self.attributes = input;
self
}
/// <p>A map of the attributes requested in <code> <code>ReceiveMessage</code> </code> to their respective values. Supported attributes:</p>
/// <ul>
/// <li>
/// <p><code>ApproximateReceiveCount</code></p></li>
/// <li>
/// <p><code>ApproximateFirstReceiveTimestamp</code></p></li>
/// <li>
/// <p><code>MessageDeduplicationId</code></p></li>
/// <li>
/// <p><code>MessageGroupId</code></p></li>
/// <li>
/// <p><code>SenderId</code></p></li>
/// <li>
/// <p><code>SentTimestamp</code></p></li>
/// <li>
/// <p><code>SequenceNumber</code></p></li>
/// </ul>
/// <p><code>ApproximateFirstReceiveTimestamp</code> and <code>SentTimestamp</code> are each returned as an integer representing the <a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds.</p>
pub fn get_attributes(
&self,
) -> &::std::option::Option<::std::collections::HashMap<crate::types::MessageSystemAttributeName, ::std::string::String>> {
&self.attributes
}
/// <p>An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p>
pub fn md5_of_message_attributes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.md5_of_message_attributes = ::std::option::Option::Some(input.into());
self
}
/// <p>An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p>
pub fn set_md5_of_message_attributes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.md5_of_message_attributes = input;
self
}
/// <p>An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p>
pub fn get_md5_of_message_attributes(&self) -> &::std::option::Option<::std::string::String> {
&self.md5_of_message_attributes
}
/// Adds a key-value pair to `message_attributes`.
///
/// To override the contents of this collection use [`set_message_attributes`](Self::set_message_attributes).
///
/// <p>Each message attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes">Amazon SQS message attributes</a> in the <i>Amazon SQS Developer Guide</i>.</p>
pub fn message_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::MessageAttributeValue) -> Self {
let mut hash_map = self.message_attributes.unwrap_or_default();
hash_map.insert(k.into(), v);
self.message_attributes = ::std::option::Option::Some(hash_map);
self
}
/// <p>Each message attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes">Amazon SQS message attributes</a> in the <i>Amazon SQS Developer Guide</i>.</p>
pub fn set_message_attributes(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>>,
) -> Self {
self.message_attributes = input;
self
}
/// <p>Each message attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-metadata.html#sqs-message-attributes">Amazon SQS message attributes</a> in the <i>Amazon SQS Developer Guide</i>.</p>
pub fn get_message_attributes(
&self,
) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>> {
&self.message_attributes
}
/// Consumes the builder and constructs a [`Message`](crate::types::Message).
pub fn build(self) -> crate::types::Message {
crate::types::Message {
message_id: self.message_id,
receipt_handle: self.receipt_handle,
md5_of_body: self.md5_of_body,
body: self.body,
attributes: self.attributes,
md5_of_message_attributes: self.md5_of_message_attributes,
message_attributes: self.message_attributes,
}
}
}