aws_sdk_sqs/operation/send_message/_send_message_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p></p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SendMessageInput {
7 /// <p>The URL of the Amazon SQS queue to which a message is sent.</p>
8 /// <p>Queue URLs and names are case-sensitive.</p>
9 pub queue_url: ::std::option::Option<::std::string::String>,
10 /// <p>The message to send. The minimum size is one character. The maximum size is 256 KiB.</p><important>
11 /// <p>A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed. For more information, see the <a href="http://www.w3.org/TR/REC-xml/#charsets">W3C specification for characters</a>.</p>
12 /// <p><code>#x9</code> | <code>#xA</code> | <code>#xD</code> | <code>#x20</code> to <code>#xD7FF</code> | <code>#xE000</code> to <code>#xFFFD</code> | <code>#x10000</code> to <code>#x10FFFF</code></p>
13 /// <p>Amazon SQS does not throw an exception or completely reject the message if it contains invalid characters. Instead, it replaces those invalid characters with <code>U+FFFD</code> before storing the message in the queue, as long as the message body contains at least one valid character.</p>
14 /// </important>
15 pub message_body: ::std::option::Option<::std::string::String>,
16 /// <p>The length of time, in seconds, for which to delay a specific message. Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive <code>DelaySeconds</code> value become available for processing after the delay period is finished. If you don't specify a value, the default value for the queue applies.</p><note>
17 /// <p>When you set <code>FifoQueue</code>, you can't set <code>DelaySeconds</code> per message. You can set this parameter only on a queue level.</p>
18 /// </note>
19 pub delay_seconds: ::std::option::Option<i32>,
20 /// <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>
21 pub message_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>>,
22 /// <p>The message system attribute to send. Each message system attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>.</p><important>
23 /// <ul>
24 /// <li>
25 /// <p>Currently, the only supported message system attribute is <code>AWSTraceHeader</code>. Its type must be <code>String</code> and its value must be a correctly formatted X-Ray trace header string.</p></li>
26 /// <li>
27 /// <p>The size of a message system attribute doesn't count towards the total size of a message.</p></li>
28 /// </ul>
29 /// </important>
30 pub message_system_attributes: ::std::option::Option<
31 ::std::collections::HashMap<crate::types::MessageSystemAttributeNameForSends, crate::types::MessageSystemAttributeValue>,
32 >,
33 /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
34 /// <p>The token used for deduplication of sent messages. If a message with a particular <code>MessageDeduplicationId</code> is sent successfully, any messages sent with the same <code>MessageDeduplicationId</code> are accepted successfully but aren't delivered during the 5-minute deduplication interval. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html"> Exactly-once processing</a> in the <i>Amazon SQS Developer Guide</i>.</p>
35 /// <ul>
36 /// <li>
37 /// <p>Every message must have a unique <code>MessageDeduplicationId</code>,</p>
38 /// <ul>
39 /// <li>
40 /// <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p></li>
41 /// <li>
42 /// <p>If you aren't able to provide a <code>MessageDeduplicationId</code> and you enable <code>ContentBasedDeduplication</code> for your queue, Amazon SQS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p></li>
43 /// <li>
44 /// <p>If you don't provide a <code>MessageDeduplicationId</code> and the queue doesn't have <code>ContentBasedDeduplication</code> set, the action fails with an error.</p></li>
45 /// <li>
46 /// <p>If the queue has <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p></li>
47 /// </ul></li>
48 /// <li>
49 /// <p>When <code>ContentBasedDeduplication</code> is in effect, messages with identical content sent within the deduplication interval are treated as duplicates and only one copy of the message is delivered.</p></li>
50 /// <li>
51 /// <p>If you send one message with <code>ContentBasedDeduplication</code> enabled and then another message with a <code>MessageDeduplicationId</code> that is the same as the one generated for the first <code>MessageDeduplicationId</code>, the two messages are treated as duplicates and only one copy of the message is delivered.</p></li>
52 /// </ul><note>
53 /// <p>The <code>MessageDeduplicationId</code> is available to the consumer of the message (this can be useful for troubleshooting delivery issues).</p>
54 /// <p>If a message is sent successfully but the acknowledgement is lost and the message is resent with the same <code>MessageDeduplicationId</code> after the deduplication interval, Amazon SQS can't detect duplicate messages.</p>
55 /// <p>Amazon SQS continues to keep track of the message deduplication ID even after the message is received and deleted.</p>
56 /// </note>
57 /// <p>The maximum length of <code>MessageDeduplicationId</code> is 128 characters. <code>MessageDeduplicationId</code> can contain alphanumeric characters (<code>a-z</code>, <code>A-Z</code>, <code>0-9</code>) and punctuation (<code>!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~</code>).</p>
58 /// <p>For best practices of using <code>MessageDeduplicationId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html">Using the MessageDeduplicationId Property</a> in the <i>Amazon SQS Developer Guide</i>.</p>
59 pub message_deduplication_id: ::std::option::Option<::std::string::String>,
60 /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
61 /// <p>The tag that specifies that a message belongs to a specific message group. Messages that belong to the same message group are processed in a FIFO manner (however, messages in different message groups might be processed out of order). To interleave multiple ordered streams within a single queue, use <code>MessageGroupId</code> values (for example, session data for multiple users). In this scenario, multiple consumers can process the queue, but the session data of each user is processed in a FIFO fashion.</p>
62 /// <ul>
63 /// <li>
64 /// <p>You must associate a non-empty <code>MessageGroupId</code> with a message. If you don't provide a <code>MessageGroupId</code>, the action fails.</p></li>
65 /// <li>
66 /// <p><code>ReceiveMessage</code> might return messages with multiple <code>MessageGroupId</code> values. For each <code>MessageGroupId</code>, the messages are sorted by time sent. The caller can't specify a <code>MessageGroupId</code>.</p></li>
67 /// </ul>
68 /// <p>The maximum length of <code>MessageGroupId</code> is 128 characters. Valid values: alphanumeric characters and punctuation <code>(!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~)</code>.</p>
69 /// <p>For best practices of using <code>MessageGroupId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html">Using the MessageGroupId Property</a> in the <i>Amazon SQS Developer Guide</i>.</p><important>
70 /// <p><code>MessageGroupId</code> is required for FIFO queues. You can't use it for Standard queues.</p>
71 /// </important>
72 pub message_group_id: ::std::option::Option<::std::string::String>,
73}
74impl SendMessageInput {
75 /// <p>The URL of the Amazon SQS queue to which a message is sent.</p>
76 /// <p>Queue URLs and names are case-sensitive.</p>
77 pub fn queue_url(&self) -> ::std::option::Option<&str> {
78 self.queue_url.as_deref()
79 }
80 /// <p>The message to send. The minimum size is one character. The maximum size is 256 KiB.</p><important>
81 /// <p>A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed. For more information, see the <a href="http://www.w3.org/TR/REC-xml/#charsets">W3C specification for characters</a>.</p>
82 /// <p><code>#x9</code> | <code>#xA</code> | <code>#xD</code> | <code>#x20</code> to <code>#xD7FF</code> | <code>#xE000</code> to <code>#xFFFD</code> | <code>#x10000</code> to <code>#x10FFFF</code></p>
83 /// <p>Amazon SQS does not throw an exception or completely reject the message if it contains invalid characters. Instead, it replaces those invalid characters with <code>U+FFFD</code> before storing the message in the queue, as long as the message body contains at least one valid character.</p>
84 /// </important>
85 pub fn message_body(&self) -> ::std::option::Option<&str> {
86 self.message_body.as_deref()
87 }
88 /// <p>The length of time, in seconds, for which to delay a specific message. Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive <code>DelaySeconds</code> value become available for processing after the delay period is finished. If you don't specify a value, the default value for the queue applies.</p><note>
89 /// <p>When you set <code>FifoQueue</code>, you can't set <code>DelaySeconds</code> per message. You can set this parameter only on a queue level.</p>
90 /// </note>
91 pub fn delay_seconds(&self) -> ::std::option::Option<i32> {
92 self.delay_seconds
93 }
94 /// <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>
95 pub fn message_attributes(
96 &self,
97 ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>> {
98 self.message_attributes.as_ref()
99 }
100 /// <p>The message system attribute to send. Each message system attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>.</p><important>
101 /// <ul>
102 /// <li>
103 /// <p>Currently, the only supported message system attribute is <code>AWSTraceHeader</code>. Its type must be <code>String</code> and its value must be a correctly formatted X-Ray trace header string.</p></li>
104 /// <li>
105 /// <p>The size of a message system attribute doesn't count towards the total size of a message.</p></li>
106 /// </ul>
107 /// </important>
108 pub fn message_system_attributes(
109 &self,
110 ) -> ::std::option::Option<
111 &::std::collections::HashMap<crate::types::MessageSystemAttributeNameForSends, crate::types::MessageSystemAttributeValue>,
112 > {
113 self.message_system_attributes.as_ref()
114 }
115 /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
116 /// <p>The token used for deduplication of sent messages. If a message with a particular <code>MessageDeduplicationId</code> is sent successfully, any messages sent with the same <code>MessageDeduplicationId</code> are accepted successfully but aren't delivered during the 5-minute deduplication interval. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html"> Exactly-once processing</a> in the <i>Amazon SQS Developer Guide</i>.</p>
117 /// <ul>
118 /// <li>
119 /// <p>Every message must have a unique <code>MessageDeduplicationId</code>,</p>
120 /// <ul>
121 /// <li>
122 /// <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p></li>
123 /// <li>
124 /// <p>If you aren't able to provide a <code>MessageDeduplicationId</code> and you enable <code>ContentBasedDeduplication</code> for your queue, Amazon SQS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p></li>
125 /// <li>
126 /// <p>If you don't provide a <code>MessageDeduplicationId</code> and the queue doesn't have <code>ContentBasedDeduplication</code> set, the action fails with an error.</p></li>
127 /// <li>
128 /// <p>If the queue has <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p></li>
129 /// </ul></li>
130 /// <li>
131 /// <p>When <code>ContentBasedDeduplication</code> is in effect, messages with identical content sent within the deduplication interval are treated as duplicates and only one copy of the message is delivered.</p></li>
132 /// <li>
133 /// <p>If you send one message with <code>ContentBasedDeduplication</code> enabled and then another message with a <code>MessageDeduplicationId</code> that is the same as the one generated for the first <code>MessageDeduplicationId</code>, the two messages are treated as duplicates and only one copy of the message is delivered.</p></li>
134 /// </ul><note>
135 /// <p>The <code>MessageDeduplicationId</code> is available to the consumer of the message (this can be useful for troubleshooting delivery issues).</p>
136 /// <p>If a message is sent successfully but the acknowledgement is lost and the message is resent with the same <code>MessageDeduplicationId</code> after the deduplication interval, Amazon SQS can't detect duplicate messages.</p>
137 /// <p>Amazon SQS continues to keep track of the message deduplication ID even after the message is received and deleted.</p>
138 /// </note>
139 /// <p>The maximum length of <code>MessageDeduplicationId</code> is 128 characters. <code>MessageDeduplicationId</code> can contain alphanumeric characters (<code>a-z</code>, <code>A-Z</code>, <code>0-9</code>) and punctuation (<code>!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~</code>).</p>
140 /// <p>For best practices of using <code>MessageDeduplicationId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html">Using the MessageDeduplicationId Property</a> in the <i>Amazon SQS Developer Guide</i>.</p>
141 pub fn message_deduplication_id(&self) -> ::std::option::Option<&str> {
142 self.message_deduplication_id.as_deref()
143 }
144 /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
145 /// <p>The tag that specifies that a message belongs to a specific message group. Messages that belong to the same message group are processed in a FIFO manner (however, messages in different message groups might be processed out of order). To interleave multiple ordered streams within a single queue, use <code>MessageGroupId</code> values (for example, session data for multiple users). In this scenario, multiple consumers can process the queue, but the session data of each user is processed in a FIFO fashion.</p>
146 /// <ul>
147 /// <li>
148 /// <p>You must associate a non-empty <code>MessageGroupId</code> with a message. If you don't provide a <code>MessageGroupId</code>, the action fails.</p></li>
149 /// <li>
150 /// <p><code>ReceiveMessage</code> might return messages with multiple <code>MessageGroupId</code> values. For each <code>MessageGroupId</code>, the messages are sorted by time sent. The caller can't specify a <code>MessageGroupId</code>.</p></li>
151 /// </ul>
152 /// <p>The maximum length of <code>MessageGroupId</code> is 128 characters. Valid values: alphanumeric characters and punctuation <code>(!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~)</code>.</p>
153 /// <p>For best practices of using <code>MessageGroupId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html">Using the MessageGroupId Property</a> in the <i>Amazon SQS Developer Guide</i>.</p><important>
154 /// <p><code>MessageGroupId</code> is required for FIFO queues. You can't use it for Standard queues.</p>
155 /// </important>
156 pub fn message_group_id(&self) -> ::std::option::Option<&str> {
157 self.message_group_id.as_deref()
158 }
159}
160impl SendMessageInput {
161 /// Creates a new builder-style object to manufacture [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
162 pub fn builder() -> crate::operation::send_message::builders::SendMessageInputBuilder {
163 crate::operation::send_message::builders::SendMessageInputBuilder::default()
164 }
165}
166
167/// A builder for [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
168#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
169#[non_exhaustive]
170pub struct SendMessageInputBuilder {
171 pub(crate) queue_url: ::std::option::Option<::std::string::String>,
172 pub(crate) message_body: ::std::option::Option<::std::string::String>,
173 pub(crate) delay_seconds: ::std::option::Option<i32>,
174 pub(crate) message_attributes: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>>,
175 pub(crate) message_system_attributes: ::std::option::Option<
176 ::std::collections::HashMap<crate::types::MessageSystemAttributeNameForSends, crate::types::MessageSystemAttributeValue>,
177 >,
178 pub(crate) message_deduplication_id: ::std::option::Option<::std::string::String>,
179 pub(crate) message_group_id: ::std::option::Option<::std::string::String>,
180}
181impl SendMessageInputBuilder {
182 /// <p>The URL of the Amazon SQS queue to which a message is sent.</p>
183 /// <p>Queue URLs and names are case-sensitive.</p>
184 /// This field is required.
185 pub fn queue_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
186 self.queue_url = ::std::option::Option::Some(input.into());
187 self
188 }
189 /// <p>The URL of the Amazon SQS queue to which a message is sent.</p>
190 /// <p>Queue URLs and names are case-sensitive.</p>
191 pub fn set_queue_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.queue_url = input;
193 self
194 }
195 /// <p>The URL of the Amazon SQS queue to which a message is sent.</p>
196 /// <p>Queue URLs and names are case-sensitive.</p>
197 pub fn get_queue_url(&self) -> &::std::option::Option<::std::string::String> {
198 &self.queue_url
199 }
200 /// <p>The message to send. The minimum size is one character. The maximum size is 256 KiB.</p><important>
201 /// <p>A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed. For more information, see the <a href="http://www.w3.org/TR/REC-xml/#charsets">W3C specification for characters</a>.</p>
202 /// <p><code>#x9</code> | <code>#xA</code> | <code>#xD</code> | <code>#x20</code> to <code>#xD7FF</code> | <code>#xE000</code> to <code>#xFFFD</code> | <code>#x10000</code> to <code>#x10FFFF</code></p>
203 /// <p>Amazon SQS does not throw an exception or completely reject the message if it contains invalid characters. Instead, it replaces those invalid characters with <code>U+FFFD</code> before storing the message in the queue, as long as the message body contains at least one valid character.</p>
204 /// </important>
205 /// This field is required.
206 pub fn message_body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207 self.message_body = ::std::option::Option::Some(input.into());
208 self
209 }
210 /// <p>The message to send. The minimum size is one character. The maximum size is 256 KiB.</p><important>
211 /// <p>A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed. For more information, see the <a href="http://www.w3.org/TR/REC-xml/#charsets">W3C specification for characters</a>.</p>
212 /// <p><code>#x9</code> | <code>#xA</code> | <code>#xD</code> | <code>#x20</code> to <code>#xD7FF</code> | <code>#xE000</code> to <code>#xFFFD</code> | <code>#x10000</code> to <code>#x10FFFF</code></p>
213 /// <p>Amazon SQS does not throw an exception or completely reject the message if it contains invalid characters. Instead, it replaces those invalid characters with <code>U+FFFD</code> before storing the message in the queue, as long as the message body contains at least one valid character.</p>
214 /// </important>
215 pub fn set_message_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216 self.message_body = input;
217 self
218 }
219 /// <p>The message to send. The minimum size is one character. The maximum size is 256 KiB.</p><important>
220 /// <p>A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed. For more information, see the <a href="http://www.w3.org/TR/REC-xml/#charsets">W3C specification for characters</a>.</p>
221 /// <p><code>#x9</code> | <code>#xA</code> | <code>#xD</code> | <code>#x20</code> to <code>#xD7FF</code> | <code>#xE000</code> to <code>#xFFFD</code> | <code>#x10000</code> to <code>#x10FFFF</code></p>
222 /// <p>Amazon SQS does not throw an exception or completely reject the message if it contains invalid characters. Instead, it replaces those invalid characters with <code>U+FFFD</code> before storing the message in the queue, as long as the message body contains at least one valid character.</p>
223 /// </important>
224 pub fn get_message_body(&self) -> &::std::option::Option<::std::string::String> {
225 &self.message_body
226 }
227 /// <p>The length of time, in seconds, for which to delay a specific message. Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive <code>DelaySeconds</code> value become available for processing after the delay period is finished. If you don't specify a value, the default value for the queue applies.</p><note>
228 /// <p>When you set <code>FifoQueue</code>, you can't set <code>DelaySeconds</code> per message. You can set this parameter only on a queue level.</p>
229 /// </note>
230 pub fn delay_seconds(mut self, input: i32) -> Self {
231 self.delay_seconds = ::std::option::Option::Some(input);
232 self
233 }
234 /// <p>The length of time, in seconds, for which to delay a specific message. Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive <code>DelaySeconds</code> value become available for processing after the delay period is finished. If you don't specify a value, the default value for the queue applies.</p><note>
235 /// <p>When you set <code>FifoQueue</code>, you can't set <code>DelaySeconds</code> per message. You can set this parameter only on a queue level.</p>
236 /// </note>
237 pub fn set_delay_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
238 self.delay_seconds = input;
239 self
240 }
241 /// <p>The length of time, in seconds, for which to delay a specific message. Valid values: 0 to 900. Maximum: 15 minutes. Messages with a positive <code>DelaySeconds</code> value become available for processing after the delay period is finished. If you don't specify a value, the default value for the queue applies.</p><note>
242 /// <p>When you set <code>FifoQueue</code>, you can't set <code>DelaySeconds</code> per message. You can set this parameter only on a queue level.</p>
243 /// </note>
244 pub fn get_delay_seconds(&self) -> &::std::option::Option<i32> {
245 &self.delay_seconds
246 }
247 /// Adds a key-value pair to `message_attributes`.
248 ///
249 /// To override the contents of this collection use [`set_message_attributes`](Self::set_message_attributes).
250 ///
251 /// <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>
252 pub fn message_attributes(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::MessageAttributeValue) -> Self {
253 let mut hash_map = self.message_attributes.unwrap_or_default();
254 hash_map.insert(k.into(), v);
255 self.message_attributes = ::std::option::Option::Some(hash_map);
256 self
257 }
258 /// <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>
259 pub fn set_message_attributes(
260 mut self,
261 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>>,
262 ) -> Self {
263 self.message_attributes = input;
264 self
265 }
266 /// <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>
267 pub fn get_message_attributes(
268 &self,
269 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MessageAttributeValue>> {
270 &self.message_attributes
271 }
272 /// Adds a key-value pair to `message_system_attributes`.
273 ///
274 /// To override the contents of this collection use [`set_message_system_attributes`](Self::set_message_system_attributes).
275 ///
276 /// <p>The message system attribute to send. Each message system attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>.</p><important>
277 /// <ul>
278 /// <li>
279 /// <p>Currently, the only supported message system attribute is <code>AWSTraceHeader</code>. Its type must be <code>String</code> and its value must be a correctly formatted X-Ray trace header string.</p></li>
280 /// <li>
281 /// <p>The size of a message system attribute doesn't count towards the total size of a message.</p></li>
282 /// </ul>
283 /// </important>
284 pub fn message_system_attributes(
285 mut self,
286 k: crate::types::MessageSystemAttributeNameForSends,
287 v: crate::types::MessageSystemAttributeValue,
288 ) -> Self {
289 let mut hash_map = self.message_system_attributes.unwrap_or_default();
290 hash_map.insert(k, v);
291 self.message_system_attributes = ::std::option::Option::Some(hash_map);
292 self
293 }
294 /// <p>The message system attribute to send. Each message system attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>.</p><important>
295 /// <ul>
296 /// <li>
297 /// <p>Currently, the only supported message system attribute is <code>AWSTraceHeader</code>. Its type must be <code>String</code> and its value must be a correctly formatted X-Ray trace header string.</p></li>
298 /// <li>
299 /// <p>The size of a message system attribute doesn't count towards the total size of a message.</p></li>
300 /// </ul>
301 /// </important>
302 pub fn set_message_system_attributes(
303 mut self,
304 input: ::std::option::Option<
305 ::std::collections::HashMap<crate::types::MessageSystemAttributeNameForSends, crate::types::MessageSystemAttributeValue>,
306 >,
307 ) -> Self {
308 self.message_system_attributes = input;
309 self
310 }
311 /// <p>The message system attribute to send. Each message system attribute consists of a <code>Name</code>, <code>Type</code>, and <code>Value</code>.</p><important>
312 /// <ul>
313 /// <li>
314 /// <p>Currently, the only supported message system attribute is <code>AWSTraceHeader</code>. Its type must be <code>String</code> and its value must be a correctly formatted X-Ray trace header string.</p></li>
315 /// <li>
316 /// <p>The size of a message system attribute doesn't count towards the total size of a message.</p></li>
317 /// </ul>
318 /// </important>
319 pub fn get_message_system_attributes(
320 &self,
321 ) -> &::std::option::Option<
322 ::std::collections::HashMap<crate::types::MessageSystemAttributeNameForSends, crate::types::MessageSystemAttributeValue>,
323 > {
324 &self.message_system_attributes
325 }
326 /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
327 /// <p>The token used for deduplication of sent messages. If a message with a particular <code>MessageDeduplicationId</code> is sent successfully, any messages sent with the same <code>MessageDeduplicationId</code> are accepted successfully but aren't delivered during the 5-minute deduplication interval. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html"> Exactly-once processing</a> in the <i>Amazon SQS Developer Guide</i>.</p>
328 /// <ul>
329 /// <li>
330 /// <p>Every message must have a unique <code>MessageDeduplicationId</code>,</p>
331 /// <ul>
332 /// <li>
333 /// <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p></li>
334 /// <li>
335 /// <p>If you aren't able to provide a <code>MessageDeduplicationId</code> and you enable <code>ContentBasedDeduplication</code> for your queue, Amazon SQS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p></li>
336 /// <li>
337 /// <p>If you don't provide a <code>MessageDeduplicationId</code> and the queue doesn't have <code>ContentBasedDeduplication</code> set, the action fails with an error.</p></li>
338 /// <li>
339 /// <p>If the queue has <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p></li>
340 /// </ul></li>
341 /// <li>
342 /// <p>When <code>ContentBasedDeduplication</code> is in effect, messages with identical content sent within the deduplication interval are treated as duplicates and only one copy of the message is delivered.</p></li>
343 /// <li>
344 /// <p>If you send one message with <code>ContentBasedDeduplication</code> enabled and then another message with a <code>MessageDeduplicationId</code> that is the same as the one generated for the first <code>MessageDeduplicationId</code>, the two messages are treated as duplicates and only one copy of the message is delivered.</p></li>
345 /// </ul><note>
346 /// <p>The <code>MessageDeduplicationId</code> is available to the consumer of the message (this can be useful for troubleshooting delivery issues).</p>
347 /// <p>If a message is sent successfully but the acknowledgement is lost and the message is resent with the same <code>MessageDeduplicationId</code> after the deduplication interval, Amazon SQS can't detect duplicate messages.</p>
348 /// <p>Amazon SQS continues to keep track of the message deduplication ID even after the message is received and deleted.</p>
349 /// </note>
350 /// <p>The maximum length of <code>MessageDeduplicationId</code> is 128 characters. <code>MessageDeduplicationId</code> can contain alphanumeric characters (<code>a-z</code>, <code>A-Z</code>, <code>0-9</code>) and punctuation (<code>!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~</code>).</p>
351 /// <p>For best practices of using <code>MessageDeduplicationId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html">Using the MessageDeduplicationId Property</a> in the <i>Amazon SQS Developer Guide</i>.</p>
352 pub fn message_deduplication_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
353 self.message_deduplication_id = ::std::option::Option::Some(input.into());
354 self
355 }
356 /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
357 /// <p>The token used for deduplication of sent messages. If a message with a particular <code>MessageDeduplicationId</code> is sent successfully, any messages sent with the same <code>MessageDeduplicationId</code> are accepted successfully but aren't delivered during the 5-minute deduplication interval. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html"> Exactly-once processing</a> in the <i>Amazon SQS Developer Guide</i>.</p>
358 /// <ul>
359 /// <li>
360 /// <p>Every message must have a unique <code>MessageDeduplicationId</code>,</p>
361 /// <ul>
362 /// <li>
363 /// <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p></li>
364 /// <li>
365 /// <p>If you aren't able to provide a <code>MessageDeduplicationId</code> and you enable <code>ContentBasedDeduplication</code> for your queue, Amazon SQS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p></li>
366 /// <li>
367 /// <p>If you don't provide a <code>MessageDeduplicationId</code> and the queue doesn't have <code>ContentBasedDeduplication</code> set, the action fails with an error.</p></li>
368 /// <li>
369 /// <p>If the queue has <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p></li>
370 /// </ul></li>
371 /// <li>
372 /// <p>When <code>ContentBasedDeduplication</code> is in effect, messages with identical content sent within the deduplication interval are treated as duplicates and only one copy of the message is delivered.</p></li>
373 /// <li>
374 /// <p>If you send one message with <code>ContentBasedDeduplication</code> enabled and then another message with a <code>MessageDeduplicationId</code> that is the same as the one generated for the first <code>MessageDeduplicationId</code>, the two messages are treated as duplicates and only one copy of the message is delivered.</p></li>
375 /// </ul><note>
376 /// <p>The <code>MessageDeduplicationId</code> is available to the consumer of the message (this can be useful for troubleshooting delivery issues).</p>
377 /// <p>If a message is sent successfully but the acknowledgement is lost and the message is resent with the same <code>MessageDeduplicationId</code> after the deduplication interval, Amazon SQS can't detect duplicate messages.</p>
378 /// <p>Amazon SQS continues to keep track of the message deduplication ID even after the message is received and deleted.</p>
379 /// </note>
380 /// <p>The maximum length of <code>MessageDeduplicationId</code> is 128 characters. <code>MessageDeduplicationId</code> can contain alphanumeric characters (<code>a-z</code>, <code>A-Z</code>, <code>0-9</code>) and punctuation (<code>!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~</code>).</p>
381 /// <p>For best practices of using <code>MessageDeduplicationId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html">Using the MessageDeduplicationId Property</a> in the <i>Amazon SQS Developer Guide</i>.</p>
382 pub fn set_message_deduplication_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
383 self.message_deduplication_id = input;
384 self
385 }
386 /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
387 /// <p>The token used for deduplication of sent messages. If a message with a particular <code>MessageDeduplicationId</code> is sent successfully, any messages sent with the same <code>MessageDeduplicationId</code> are accepted successfully but aren't delivered during the 5-minute deduplication interval. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-exactly-once-processing.html"> Exactly-once processing</a> in the <i>Amazon SQS Developer Guide</i>.</p>
388 /// <ul>
389 /// <li>
390 /// <p>Every message must have a unique <code>MessageDeduplicationId</code>,</p>
391 /// <ul>
392 /// <li>
393 /// <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p></li>
394 /// <li>
395 /// <p>If you aren't able to provide a <code>MessageDeduplicationId</code> and you enable <code>ContentBasedDeduplication</code> for your queue, Amazon SQS uses a SHA-256 hash to generate the <code>MessageDeduplicationId</code> using the body of the message (but not the attributes of the message).</p></li>
396 /// <li>
397 /// <p>If you don't provide a <code>MessageDeduplicationId</code> and the queue doesn't have <code>ContentBasedDeduplication</code> set, the action fails with an error.</p></li>
398 /// <li>
399 /// <p>If the queue has <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p></li>
400 /// </ul></li>
401 /// <li>
402 /// <p>When <code>ContentBasedDeduplication</code> is in effect, messages with identical content sent within the deduplication interval are treated as duplicates and only one copy of the message is delivered.</p></li>
403 /// <li>
404 /// <p>If you send one message with <code>ContentBasedDeduplication</code> enabled and then another message with a <code>MessageDeduplicationId</code> that is the same as the one generated for the first <code>MessageDeduplicationId</code>, the two messages are treated as duplicates and only one copy of the message is delivered.</p></li>
405 /// </ul><note>
406 /// <p>The <code>MessageDeduplicationId</code> is available to the consumer of the message (this can be useful for troubleshooting delivery issues).</p>
407 /// <p>If a message is sent successfully but the acknowledgement is lost and the message is resent with the same <code>MessageDeduplicationId</code> after the deduplication interval, Amazon SQS can't detect duplicate messages.</p>
408 /// <p>Amazon SQS continues to keep track of the message deduplication ID even after the message is received and deleted.</p>
409 /// </note>
410 /// <p>The maximum length of <code>MessageDeduplicationId</code> is 128 characters. <code>MessageDeduplicationId</code> can contain alphanumeric characters (<code>a-z</code>, <code>A-Z</code>, <code>0-9</code>) and punctuation (<code>!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~</code>).</p>
411 /// <p>For best practices of using <code>MessageDeduplicationId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagededuplicationid-property.html">Using the MessageDeduplicationId Property</a> in the <i>Amazon SQS Developer Guide</i>.</p>
412 pub fn get_message_deduplication_id(&self) -> &::std::option::Option<::std::string::String> {
413 &self.message_deduplication_id
414 }
415 /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
416 /// <p>The tag that specifies that a message belongs to a specific message group. Messages that belong to the same message group are processed in a FIFO manner (however, messages in different message groups might be processed out of order). To interleave multiple ordered streams within a single queue, use <code>MessageGroupId</code> values (for example, session data for multiple users). In this scenario, multiple consumers can process the queue, but the session data of each user is processed in a FIFO fashion.</p>
417 /// <ul>
418 /// <li>
419 /// <p>You must associate a non-empty <code>MessageGroupId</code> with a message. If you don't provide a <code>MessageGroupId</code>, the action fails.</p></li>
420 /// <li>
421 /// <p><code>ReceiveMessage</code> might return messages with multiple <code>MessageGroupId</code> values. For each <code>MessageGroupId</code>, the messages are sorted by time sent. The caller can't specify a <code>MessageGroupId</code>.</p></li>
422 /// </ul>
423 /// <p>The maximum length of <code>MessageGroupId</code> is 128 characters. Valid values: alphanumeric characters and punctuation <code>(!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~)</code>.</p>
424 /// <p>For best practices of using <code>MessageGroupId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html">Using the MessageGroupId Property</a> in the <i>Amazon SQS Developer Guide</i>.</p><important>
425 /// <p><code>MessageGroupId</code> is required for FIFO queues. You can't use it for Standard queues.</p>
426 /// </important>
427 pub fn message_group_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
428 self.message_group_id = ::std::option::Option::Some(input.into());
429 self
430 }
431 /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
432 /// <p>The tag that specifies that a message belongs to a specific message group. Messages that belong to the same message group are processed in a FIFO manner (however, messages in different message groups might be processed out of order). To interleave multiple ordered streams within a single queue, use <code>MessageGroupId</code> values (for example, session data for multiple users). In this scenario, multiple consumers can process the queue, but the session data of each user is processed in a FIFO fashion.</p>
433 /// <ul>
434 /// <li>
435 /// <p>You must associate a non-empty <code>MessageGroupId</code> with a message. If you don't provide a <code>MessageGroupId</code>, the action fails.</p></li>
436 /// <li>
437 /// <p><code>ReceiveMessage</code> might return messages with multiple <code>MessageGroupId</code> values. For each <code>MessageGroupId</code>, the messages are sorted by time sent. The caller can't specify a <code>MessageGroupId</code>.</p></li>
438 /// </ul>
439 /// <p>The maximum length of <code>MessageGroupId</code> is 128 characters. Valid values: alphanumeric characters and punctuation <code>(!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~)</code>.</p>
440 /// <p>For best practices of using <code>MessageGroupId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html">Using the MessageGroupId Property</a> in the <i>Amazon SQS Developer Guide</i>.</p><important>
441 /// <p><code>MessageGroupId</code> is required for FIFO queues. You can't use it for Standard queues.</p>
442 /// </important>
443 pub fn set_message_group_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
444 self.message_group_id = input;
445 self
446 }
447 /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
448 /// <p>The tag that specifies that a message belongs to a specific message group. Messages that belong to the same message group are processed in a FIFO manner (however, messages in different message groups might be processed out of order). To interleave multiple ordered streams within a single queue, use <code>MessageGroupId</code> values (for example, session data for multiple users). In this scenario, multiple consumers can process the queue, but the session data of each user is processed in a FIFO fashion.</p>
449 /// <ul>
450 /// <li>
451 /// <p>You must associate a non-empty <code>MessageGroupId</code> with a message. If you don't provide a <code>MessageGroupId</code>, the action fails.</p></li>
452 /// <li>
453 /// <p><code>ReceiveMessage</code> might return messages with multiple <code>MessageGroupId</code> values. For each <code>MessageGroupId</code>, the messages are sorted by time sent. The caller can't specify a <code>MessageGroupId</code>.</p></li>
454 /// </ul>
455 /// <p>The maximum length of <code>MessageGroupId</code> is 128 characters. Valid values: alphanumeric characters and punctuation <code>(!"#$%&'()*+,-./:;<=>?@\[\\]^_`{|}~)</code>.</p>
456 /// <p>For best practices of using <code>MessageGroupId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-messagegroupid-property.html">Using the MessageGroupId Property</a> in the <i>Amazon SQS Developer Guide</i>.</p><important>
457 /// <p><code>MessageGroupId</code> is required for FIFO queues. You can't use it for Standard queues.</p>
458 /// </important>
459 pub fn get_message_group_id(&self) -> &::std::option::Option<::std::string::String> {
460 &self.message_group_id
461 }
462 /// Consumes the builder and constructs a [`SendMessageInput`](crate::operation::send_message::SendMessageInput).
463 pub fn build(self) -> ::std::result::Result<crate::operation::send_message::SendMessageInput, ::aws_smithy_types::error::operation::BuildError> {
464 ::std::result::Result::Ok(crate::operation::send_message::SendMessageInput {
465 queue_url: self.queue_url,
466 message_body: self.message_body,
467 delay_seconds: self.delay_seconds,
468 message_attributes: self.message_attributes,
469 message_system_attributes: self.message_system_attributes,
470 message_deduplication_id: self.message_deduplication_id,
471 message_group_id: self.message_group_id,
472 })
473 }
474}