aws_sdk_sqs/operation/receive_message/
_receive_message_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Retrieves one or more messages from a specified queue.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ReceiveMessageInput {
7    /// <p>The URL of the Amazon SQS queue from which messages are received.</p>
8    /// <p>Queue URLs and names are case-sensitive.</p>
9    pub queue_url: ::std::option::Option<::std::string::String>,
10    /// <important>
11    /// <p>This parameter has been discontinued but will be supported for backward compatibility. To provide attribute names, you are encouraged to use <code>MessageSystemAttributeNames</code>.</p>
12    /// </important>
13    /// <p>A list of attributes that need to be returned along with each message. These attributes include:</p>
14    /// <ul>
15    /// <li>
16    /// <p><code>All</code> – Returns all values.</p></li>
17    /// <li>
18    /// <p><code>ApproximateFirstReceiveTimestamp</code> – Returns the time the message was first received from the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
19    /// <li>
20    /// <p><code>ApproximateReceiveCount</code> – Returns the number of times a message has been received across all queues but not deleted.</p></li>
21    /// <li>
22    /// <p><code>AWSTraceHeader</code> – Returns the X-Ray trace header string.</p></li>
23    /// <li>
24    /// <p><code>SenderId</code></p>
25    /// <ul>
26    /// <li>
27    /// <p>For a user, returns the user ID, for example <code>ABCDEFGHI1JKLMNOPQ23R</code>.</p></li>
28    /// <li>
29    /// <p>For an IAM role, returns the IAM role ID, for example <code>ABCDE1F2GH3I4JK5LMNOP:i-a123b456</code>.</p></li>
30    /// </ul></li>
31    /// <li>
32    /// <p><code>SentTimestamp</code> – Returns the time the message was sent to the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
33    /// <li>
34    /// <p><code>SqsManagedSseEnabled</code> – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html">SSE-KMS</a> or <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html">SSE-SQS</a>).</p></li>
35    /// <li>
36    /// <p><code>MessageDeduplicationId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
37    /// <li>
38    /// <p><code>MessageGroupId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
39    /// <li>
40    /// <p><code>SequenceNumber</code> – Returns the value provided by Amazon SQS.</p></li>
41    /// </ul>
42    #[deprecated(note = "AttributeNames has been replaced by MessageSystemAttributeNames")]
43    pub attribute_names: ::std::option::Option<::std::vec::Vec<crate::types::QueueAttributeName>>,
44    /// <p>A list of attributes that need to be returned along with each message. These attributes include:</p>
45    /// <ul>
46    /// <li>
47    /// <p><code>All</code> – Returns all values.</p></li>
48    /// <li>
49    /// <p><code>ApproximateFirstReceiveTimestamp</code> – Returns the time the message was first received from the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
50    /// <li>
51    /// <p><code>ApproximateReceiveCount</code> – Returns the number of times a message has been received across all queues but not deleted.</p></li>
52    /// <li>
53    /// <p><code>AWSTraceHeader</code> – Returns the X-Ray trace header string.</p></li>
54    /// <li>
55    /// <p><code>SenderId</code></p>
56    /// <ul>
57    /// <li>
58    /// <p>For a user, returns the user ID, for example <code>ABCDEFGHI1JKLMNOPQ23R</code>.</p></li>
59    /// <li>
60    /// <p>For an IAM role, returns the IAM role ID, for example <code>ABCDE1F2GH3I4JK5LMNOP:i-a123b456</code>.</p></li>
61    /// </ul></li>
62    /// <li>
63    /// <p><code>SentTimestamp</code> – Returns the time the message was sent to the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
64    /// <li>
65    /// <p><code>SqsManagedSseEnabled</code> – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html">SSE-KMS</a> or <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html">SSE-SQS</a>).</p></li>
66    /// <li>
67    /// <p><code>MessageDeduplicationId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
68    /// <li>
69    /// <p><code>MessageGroupId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
70    /// <li>
71    /// <p><code>SequenceNumber</code> – Returns the value provided by Amazon SQS.</p></li>
72    /// </ul>
73    pub message_system_attribute_names: ::std::option::Option<::std::vec::Vec<crate::types::MessageSystemAttributeName>>,
74    /// <p>The name of the message attribute, where <i>N</i> is the index.</p>
75    /// <ul>
76    /// <li>
77    /// <p>The name can contain alphanumeric characters and the underscore (<code>_</code>), hyphen (<code>-</code>), and period (<code>.</code>).</p></li>
78    /// <li>
79    /// <p>The name is case-sensitive and must be unique among all attribute names for the message.</p></li>
80    /// <li>
81    /// <p>The name must not start with AWS-reserved prefixes such as <code>AWS.</code> or <code>Amazon.</code> (or any casing variants).</p></li>
82    /// <li>
83    /// <p>The name must not start or end with a period (<code>.</code>), and it should not have periods in succession (<code>..</code>).</p></li>
84    /// <li>
85    /// <p>The name can be up to 256 characters long.</p></li>
86    /// </ul>
87    /// <p>When using <code>ReceiveMessage</code>, you can send a list of attribute names to receive, or you can return all of the attributes by specifying <code>All</code> or <code>.*</code> in your request. You can also use all message attributes starting with a prefix, for example <code>bar.*</code>.</p>
88    pub message_attribute_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
89    /// <p>The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1.</p>
90    pub max_number_of_messages: ::std::option::Option<i32>,
91    /// <p>The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a <code>ReceiveMessage</code> request. If not specified, the default visibility timeout for the queue is used, which is 30 seconds.</p>
92    /// <p>Understanding <code>VisibilityTimeout</code>:</p>
93    /// <ul>
94    /// <li>
95    /// <p>When a message is received from a queue, it becomes temporarily invisible to other consumers for the duration of the visibility timeout. This prevents multiple consumers from processing the same message simultaneously. If the message is not deleted or its visibility timeout is not extended before the timeout expires, it becomes visible again and can be retrieved by other consumers.</p></li>
96    /// <li>
97    /// <p>Setting an appropriate visibility timeout is crucial. If it's too short, the message might become visible again before processing is complete, leading to duplicate processing. If it's too long, it delays the reprocessing of messages if the initial processing fails.</p></li>
98    /// <li>
99    /// <p>You can adjust the visibility timeout using the <code>--visibility-timeout</code> parameter in the <code>receive-message</code> command to match the processing time required by your application.</p></li>
100    /// <li>
101    /// <p>A message that isn't deleted or a message whose visibility isn't extended before the visibility timeout expires counts as a failed receive. Depending on the configuration of the queue, the message might be sent to the dead-letter queue.</p></li>
102    /// </ul>
103    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon SQS Developer Guide</i>.</p>
104    pub visibility_timeout: ::std::option::Option<i32>,
105    /// <p>The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than <code>WaitTimeSeconds</code>. If no messages are available and the wait time expires, the call does not return a message list. If you are using the Java SDK, it returns a <code>ReceiveMessageResponse</code> object, which has a empty list instead of a Null object.</p><important>
106    /// <p>To avoid HTTP errors, ensure that the HTTP response timeout for <code>ReceiveMessage</code> requests is longer than the <code>WaitTimeSeconds</code> parameter. For example, with the Java SDK, you can set HTTP transport settings using the <a href="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html"> NettyNioAsyncHttpClient</a> for asynchronous clients, or the <a href="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.html"> ApacheHttpClient</a> for synchronous clients.</p>
107    /// </important>
108    pub wait_time_seconds: ::std::option::Option<i32>,
109    /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
110    /// <p>The token used for deduplication of <code>ReceiveMessage</code> calls. If a networking issue occurs after a <code>ReceiveMessage</code> action, and instead of a response you receive a generic error, it is possible to retry the same action with an identical <code>ReceiveRequestAttemptId</code> to retrieve the same set of messages, even if their visibility timeout has not yet expired.</p>
111    /// <ul>
112    /// <li>
113    /// <p>You can use <code>ReceiveRequestAttemptId</code> only for 5 minutes after a <code>ReceiveMessage</code> action.</p></li>
114    /// <li>
115    /// <p>When you set <code>FifoQueue</code>, a caller of the <code>ReceiveMessage</code> action can provide a <code>ReceiveRequestAttemptId</code> explicitly.</p></li>
116    /// <li>
117    /// <p>It is possible to retry the <code>ReceiveMessage</code> action with the same <code>ReceiveRequestAttemptId</code> if none of the messages have been modified (deleted or had their visibility changes).</p></li>
118    /// <li>
119    /// <p>During a visibility timeout, subsequent calls with the same <code>ReceiveRequestAttemptId</code> return the same messages and receipt handles. If a retry occurs within the deduplication interval, it resets the visibility timeout. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon SQS Developer Guide</i>.</p><important>
120    /// <p>If a caller of the <code>ReceiveMessage</code> action still processes messages when the visibility timeout expires and messages become visible, another worker consuming from the same queue can receive the same messages and therefore process duplicates. Also, if a consumer whose message processing time is longer than the visibility timeout tries to delete the processed messages, the action fails with an error.</p>
121    /// <p>To mitigate this effect, ensure that your application observes a safe threshold before the visibility timeout expires and extend the visibility timeout as necessary.</p>
122    /// </important></li>
123    /// <li>
124    /// <p>While messages with a particular <code>MessageGroupId</code> are invisible, no more messages belonging to the same <code>MessageGroupId</code> are returned until the visibility timeout expires. You can still receive messages with another <code>MessageGroupId</code> from your FIFO queue as long as they are visible.</p></li>
125    /// <li>
126    /// <p>If a caller of <code>ReceiveMessage</code> can't track the <code>ReceiveRequestAttemptId</code>, no retries work until the original visibility timeout expires. As a result, delays might occur but the messages in the queue remain in a strict order.</p></li>
127    /// </ul>
128    /// <p>The maximum length of <code>ReceiveRequestAttemptId</code> is 128 characters. <code>ReceiveRequestAttemptId</code> can contain alphanumeric characters (<code>a-z</code>, <code>A-Z</code>, <code>0-9</code>) and punctuation (<code>!"#$%&amp;'()*+,-./:;&lt;=&gt;?@\[\\]^_`{|}~</code>).</p>
129    /// <p>For best practices of using <code>ReceiveRequestAttemptId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html">Using the ReceiveRequestAttemptId Request Parameter</a> in the <i>Amazon SQS Developer Guide</i>.</p>
130    pub receive_request_attempt_id: ::std::option::Option<::std::string::String>,
131}
132impl ReceiveMessageInput {
133    /// <p>The URL of the Amazon SQS queue from which messages are received.</p>
134    /// <p>Queue URLs and names are case-sensitive.</p>
135    pub fn queue_url(&self) -> ::std::option::Option<&str> {
136        self.queue_url.as_deref()
137    }
138    /// <important>
139    /// <p>This parameter has been discontinued but will be supported for backward compatibility. To provide attribute names, you are encouraged to use <code>MessageSystemAttributeNames</code>.</p>
140    /// </important>
141    /// <p>A list of attributes that need to be returned along with each message. These attributes include:</p>
142    /// <ul>
143    /// <li>
144    /// <p><code>All</code> – Returns all values.</p></li>
145    /// <li>
146    /// <p><code>ApproximateFirstReceiveTimestamp</code> – Returns the time the message was first received from the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
147    /// <li>
148    /// <p><code>ApproximateReceiveCount</code> – Returns the number of times a message has been received across all queues but not deleted.</p></li>
149    /// <li>
150    /// <p><code>AWSTraceHeader</code> – Returns the X-Ray trace header string.</p></li>
151    /// <li>
152    /// <p><code>SenderId</code></p>
153    /// <ul>
154    /// <li>
155    /// <p>For a user, returns the user ID, for example <code>ABCDEFGHI1JKLMNOPQ23R</code>.</p></li>
156    /// <li>
157    /// <p>For an IAM role, returns the IAM role ID, for example <code>ABCDE1F2GH3I4JK5LMNOP:i-a123b456</code>.</p></li>
158    /// </ul></li>
159    /// <li>
160    /// <p><code>SentTimestamp</code> – Returns the time the message was sent to the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
161    /// <li>
162    /// <p><code>SqsManagedSseEnabled</code> – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html">SSE-KMS</a> or <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html">SSE-SQS</a>).</p></li>
163    /// <li>
164    /// <p><code>MessageDeduplicationId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
165    /// <li>
166    /// <p><code>MessageGroupId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
167    /// <li>
168    /// <p><code>SequenceNumber</code> – Returns the value provided by Amazon SQS.</p></li>
169    /// </ul>
170    ///
171    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attribute_names.is_none()`.
172    #[deprecated(note = "AttributeNames has been replaced by MessageSystemAttributeNames")]
173    pub fn attribute_names(&self) -> &[crate::types::QueueAttributeName] {
174        self.attribute_names.as_deref().unwrap_or_default()
175    }
176    /// <p>A list of attributes that need to be returned along with each message. These attributes include:</p>
177    /// <ul>
178    /// <li>
179    /// <p><code>All</code> – Returns all values.</p></li>
180    /// <li>
181    /// <p><code>ApproximateFirstReceiveTimestamp</code> – Returns the time the message was first received from the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
182    /// <li>
183    /// <p><code>ApproximateReceiveCount</code> – Returns the number of times a message has been received across all queues but not deleted.</p></li>
184    /// <li>
185    /// <p><code>AWSTraceHeader</code> – Returns the X-Ray trace header string.</p></li>
186    /// <li>
187    /// <p><code>SenderId</code></p>
188    /// <ul>
189    /// <li>
190    /// <p>For a user, returns the user ID, for example <code>ABCDEFGHI1JKLMNOPQ23R</code>.</p></li>
191    /// <li>
192    /// <p>For an IAM role, returns the IAM role ID, for example <code>ABCDE1F2GH3I4JK5LMNOP:i-a123b456</code>.</p></li>
193    /// </ul></li>
194    /// <li>
195    /// <p><code>SentTimestamp</code> – Returns the time the message was sent to the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
196    /// <li>
197    /// <p><code>SqsManagedSseEnabled</code> – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html">SSE-KMS</a> or <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html">SSE-SQS</a>).</p></li>
198    /// <li>
199    /// <p><code>MessageDeduplicationId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
200    /// <li>
201    /// <p><code>MessageGroupId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
202    /// <li>
203    /// <p><code>SequenceNumber</code> – Returns the value provided by Amazon SQS.</p></li>
204    /// </ul>
205    ///
206    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.message_system_attribute_names.is_none()`.
207    pub fn message_system_attribute_names(&self) -> &[crate::types::MessageSystemAttributeName] {
208        self.message_system_attribute_names.as_deref().unwrap_or_default()
209    }
210    /// <p>The name of the message attribute, where <i>N</i> is the index.</p>
211    /// <ul>
212    /// <li>
213    /// <p>The name can contain alphanumeric characters and the underscore (<code>_</code>), hyphen (<code>-</code>), and period (<code>.</code>).</p></li>
214    /// <li>
215    /// <p>The name is case-sensitive and must be unique among all attribute names for the message.</p></li>
216    /// <li>
217    /// <p>The name must not start with AWS-reserved prefixes such as <code>AWS.</code> or <code>Amazon.</code> (or any casing variants).</p></li>
218    /// <li>
219    /// <p>The name must not start or end with a period (<code>.</code>), and it should not have periods in succession (<code>..</code>).</p></li>
220    /// <li>
221    /// <p>The name can be up to 256 characters long.</p></li>
222    /// </ul>
223    /// <p>When using <code>ReceiveMessage</code>, you can send a list of attribute names to receive, or you can return all of the attributes by specifying <code>All</code> or <code>.*</code> in your request. You can also use all message attributes starting with a prefix, for example <code>bar.*</code>.</p>
224    ///
225    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.message_attribute_names.is_none()`.
226    pub fn message_attribute_names(&self) -> &[::std::string::String] {
227        self.message_attribute_names.as_deref().unwrap_or_default()
228    }
229    /// <p>The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1.</p>
230    pub fn max_number_of_messages(&self) -> ::std::option::Option<i32> {
231        self.max_number_of_messages
232    }
233    /// <p>The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a <code>ReceiveMessage</code> request. If not specified, the default visibility timeout for the queue is used, which is 30 seconds.</p>
234    /// <p>Understanding <code>VisibilityTimeout</code>:</p>
235    /// <ul>
236    /// <li>
237    /// <p>When a message is received from a queue, it becomes temporarily invisible to other consumers for the duration of the visibility timeout. This prevents multiple consumers from processing the same message simultaneously. If the message is not deleted or its visibility timeout is not extended before the timeout expires, it becomes visible again and can be retrieved by other consumers.</p></li>
238    /// <li>
239    /// <p>Setting an appropriate visibility timeout is crucial. If it's too short, the message might become visible again before processing is complete, leading to duplicate processing. If it's too long, it delays the reprocessing of messages if the initial processing fails.</p></li>
240    /// <li>
241    /// <p>You can adjust the visibility timeout using the <code>--visibility-timeout</code> parameter in the <code>receive-message</code> command to match the processing time required by your application.</p></li>
242    /// <li>
243    /// <p>A message that isn't deleted or a message whose visibility isn't extended before the visibility timeout expires counts as a failed receive. Depending on the configuration of the queue, the message might be sent to the dead-letter queue.</p></li>
244    /// </ul>
245    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon SQS Developer Guide</i>.</p>
246    pub fn visibility_timeout(&self) -> ::std::option::Option<i32> {
247        self.visibility_timeout
248    }
249    /// <p>The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than <code>WaitTimeSeconds</code>. If no messages are available and the wait time expires, the call does not return a message list. If you are using the Java SDK, it returns a <code>ReceiveMessageResponse</code> object, which has a empty list instead of a Null object.</p><important>
250    /// <p>To avoid HTTP errors, ensure that the HTTP response timeout for <code>ReceiveMessage</code> requests is longer than the <code>WaitTimeSeconds</code> parameter. For example, with the Java SDK, you can set HTTP transport settings using the <a href="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html"> NettyNioAsyncHttpClient</a> for asynchronous clients, or the <a href="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.html"> ApacheHttpClient</a> for synchronous clients.</p>
251    /// </important>
252    pub fn wait_time_seconds(&self) -> ::std::option::Option<i32> {
253        self.wait_time_seconds
254    }
255    /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
256    /// <p>The token used for deduplication of <code>ReceiveMessage</code> calls. If a networking issue occurs after a <code>ReceiveMessage</code> action, and instead of a response you receive a generic error, it is possible to retry the same action with an identical <code>ReceiveRequestAttemptId</code> to retrieve the same set of messages, even if their visibility timeout has not yet expired.</p>
257    /// <ul>
258    /// <li>
259    /// <p>You can use <code>ReceiveRequestAttemptId</code> only for 5 minutes after a <code>ReceiveMessage</code> action.</p></li>
260    /// <li>
261    /// <p>When you set <code>FifoQueue</code>, a caller of the <code>ReceiveMessage</code> action can provide a <code>ReceiveRequestAttemptId</code> explicitly.</p></li>
262    /// <li>
263    /// <p>It is possible to retry the <code>ReceiveMessage</code> action with the same <code>ReceiveRequestAttemptId</code> if none of the messages have been modified (deleted or had their visibility changes).</p></li>
264    /// <li>
265    /// <p>During a visibility timeout, subsequent calls with the same <code>ReceiveRequestAttemptId</code> return the same messages and receipt handles. If a retry occurs within the deduplication interval, it resets the visibility timeout. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon SQS Developer Guide</i>.</p><important>
266    /// <p>If a caller of the <code>ReceiveMessage</code> action still processes messages when the visibility timeout expires and messages become visible, another worker consuming from the same queue can receive the same messages and therefore process duplicates. Also, if a consumer whose message processing time is longer than the visibility timeout tries to delete the processed messages, the action fails with an error.</p>
267    /// <p>To mitigate this effect, ensure that your application observes a safe threshold before the visibility timeout expires and extend the visibility timeout as necessary.</p>
268    /// </important></li>
269    /// <li>
270    /// <p>While messages with a particular <code>MessageGroupId</code> are invisible, no more messages belonging to the same <code>MessageGroupId</code> are returned until the visibility timeout expires. You can still receive messages with another <code>MessageGroupId</code> from your FIFO queue as long as they are visible.</p></li>
271    /// <li>
272    /// <p>If a caller of <code>ReceiveMessage</code> can't track the <code>ReceiveRequestAttemptId</code>, no retries work until the original visibility timeout expires. As a result, delays might occur but the messages in the queue remain in a strict order.</p></li>
273    /// </ul>
274    /// <p>The maximum length of <code>ReceiveRequestAttemptId</code> is 128 characters. <code>ReceiveRequestAttemptId</code> can contain alphanumeric characters (<code>a-z</code>, <code>A-Z</code>, <code>0-9</code>) and punctuation (<code>!"#$%&amp;'()*+,-./:;&lt;=&gt;?@\[\\]^_`{|}~</code>).</p>
275    /// <p>For best practices of using <code>ReceiveRequestAttemptId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html">Using the ReceiveRequestAttemptId Request Parameter</a> in the <i>Amazon SQS Developer Guide</i>.</p>
276    pub fn receive_request_attempt_id(&self) -> ::std::option::Option<&str> {
277        self.receive_request_attempt_id.as_deref()
278    }
279}
280impl ReceiveMessageInput {
281    /// Creates a new builder-style object to manufacture [`ReceiveMessageInput`](crate::operation::receive_message::ReceiveMessageInput).
282    pub fn builder() -> crate::operation::receive_message::builders::ReceiveMessageInputBuilder {
283        crate::operation::receive_message::builders::ReceiveMessageInputBuilder::default()
284    }
285}
286
287/// A builder for [`ReceiveMessageInput`](crate::operation::receive_message::ReceiveMessageInput).
288#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
289#[non_exhaustive]
290pub struct ReceiveMessageInputBuilder {
291    pub(crate) queue_url: ::std::option::Option<::std::string::String>,
292    pub(crate) attribute_names: ::std::option::Option<::std::vec::Vec<crate::types::QueueAttributeName>>,
293    pub(crate) message_system_attribute_names: ::std::option::Option<::std::vec::Vec<crate::types::MessageSystemAttributeName>>,
294    pub(crate) message_attribute_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
295    pub(crate) max_number_of_messages: ::std::option::Option<i32>,
296    pub(crate) visibility_timeout: ::std::option::Option<i32>,
297    pub(crate) wait_time_seconds: ::std::option::Option<i32>,
298    pub(crate) receive_request_attempt_id: ::std::option::Option<::std::string::String>,
299}
300impl ReceiveMessageInputBuilder {
301    /// <p>The URL of the Amazon SQS queue from which messages are received.</p>
302    /// <p>Queue URLs and names are case-sensitive.</p>
303    /// This field is required.
304    pub fn queue_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
305        self.queue_url = ::std::option::Option::Some(input.into());
306        self
307    }
308    /// <p>The URL of the Amazon SQS queue from which messages are received.</p>
309    /// <p>Queue URLs and names are case-sensitive.</p>
310    pub fn set_queue_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
311        self.queue_url = input;
312        self
313    }
314    /// <p>The URL of the Amazon SQS queue from which messages are received.</p>
315    /// <p>Queue URLs and names are case-sensitive.</p>
316    pub fn get_queue_url(&self) -> &::std::option::Option<::std::string::String> {
317        &self.queue_url
318    }
319    /// Appends an item to `attribute_names`.
320    ///
321    /// To override the contents of this collection use [`set_attribute_names`](Self::set_attribute_names).
322    ///
323    /// <important>
324    /// <p>This parameter has been discontinued but will be supported for backward compatibility. To provide attribute names, you are encouraged to use <code>MessageSystemAttributeNames</code>.</p>
325    /// </important>
326    /// <p>A list of attributes that need to be returned along with each message. These attributes include:</p>
327    /// <ul>
328    /// <li>
329    /// <p><code>All</code> – Returns all values.</p></li>
330    /// <li>
331    /// <p><code>ApproximateFirstReceiveTimestamp</code> – Returns the time the message was first received from the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
332    /// <li>
333    /// <p><code>ApproximateReceiveCount</code> – Returns the number of times a message has been received across all queues but not deleted.</p></li>
334    /// <li>
335    /// <p><code>AWSTraceHeader</code> – Returns the X-Ray trace header string.</p></li>
336    /// <li>
337    /// <p><code>SenderId</code></p>
338    /// <ul>
339    /// <li>
340    /// <p>For a user, returns the user ID, for example <code>ABCDEFGHI1JKLMNOPQ23R</code>.</p></li>
341    /// <li>
342    /// <p>For an IAM role, returns the IAM role ID, for example <code>ABCDE1F2GH3I4JK5LMNOP:i-a123b456</code>.</p></li>
343    /// </ul></li>
344    /// <li>
345    /// <p><code>SentTimestamp</code> – Returns the time the message was sent to the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
346    /// <li>
347    /// <p><code>SqsManagedSseEnabled</code> – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html">SSE-KMS</a> or <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html">SSE-SQS</a>).</p></li>
348    /// <li>
349    /// <p><code>MessageDeduplicationId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
350    /// <li>
351    /// <p><code>MessageGroupId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
352    /// <li>
353    /// <p><code>SequenceNumber</code> – Returns the value provided by Amazon SQS.</p></li>
354    /// </ul>
355    #[deprecated(note = "AttributeNames has been replaced by MessageSystemAttributeNames")]
356    pub fn attribute_names(mut self, input: crate::types::QueueAttributeName) -> Self {
357        let mut v = self.attribute_names.unwrap_or_default();
358        v.push(input);
359        self.attribute_names = ::std::option::Option::Some(v);
360        self
361    }
362    /// <important>
363    /// <p>This parameter has been discontinued but will be supported for backward compatibility. To provide attribute names, you are encouraged to use <code>MessageSystemAttributeNames</code>.</p>
364    /// </important>
365    /// <p>A list of attributes that need to be returned along with each message. These attributes include:</p>
366    /// <ul>
367    /// <li>
368    /// <p><code>All</code> – Returns all values.</p></li>
369    /// <li>
370    /// <p><code>ApproximateFirstReceiveTimestamp</code> – Returns the time the message was first received from the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
371    /// <li>
372    /// <p><code>ApproximateReceiveCount</code> – Returns the number of times a message has been received across all queues but not deleted.</p></li>
373    /// <li>
374    /// <p><code>AWSTraceHeader</code> – Returns the X-Ray trace header string.</p></li>
375    /// <li>
376    /// <p><code>SenderId</code></p>
377    /// <ul>
378    /// <li>
379    /// <p>For a user, returns the user ID, for example <code>ABCDEFGHI1JKLMNOPQ23R</code>.</p></li>
380    /// <li>
381    /// <p>For an IAM role, returns the IAM role ID, for example <code>ABCDE1F2GH3I4JK5LMNOP:i-a123b456</code>.</p></li>
382    /// </ul></li>
383    /// <li>
384    /// <p><code>SentTimestamp</code> – Returns the time the message was sent to the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
385    /// <li>
386    /// <p><code>SqsManagedSseEnabled</code> – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html">SSE-KMS</a> or <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html">SSE-SQS</a>).</p></li>
387    /// <li>
388    /// <p><code>MessageDeduplicationId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
389    /// <li>
390    /// <p><code>MessageGroupId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
391    /// <li>
392    /// <p><code>SequenceNumber</code> – Returns the value provided by Amazon SQS.</p></li>
393    /// </ul>
394    #[deprecated(note = "AttributeNames has been replaced by MessageSystemAttributeNames")]
395    pub fn set_attribute_names(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::QueueAttributeName>>) -> Self {
396        self.attribute_names = input;
397        self
398    }
399    /// <important>
400    /// <p>This parameter has been discontinued but will be supported for backward compatibility. To provide attribute names, you are encouraged to use <code>MessageSystemAttributeNames</code>.</p>
401    /// </important>
402    /// <p>A list of attributes that need to be returned along with each message. These attributes include:</p>
403    /// <ul>
404    /// <li>
405    /// <p><code>All</code> – Returns all values.</p></li>
406    /// <li>
407    /// <p><code>ApproximateFirstReceiveTimestamp</code> – Returns the time the message was first received from the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
408    /// <li>
409    /// <p><code>ApproximateReceiveCount</code> – Returns the number of times a message has been received across all queues but not deleted.</p></li>
410    /// <li>
411    /// <p><code>AWSTraceHeader</code> – Returns the X-Ray trace header string.</p></li>
412    /// <li>
413    /// <p><code>SenderId</code></p>
414    /// <ul>
415    /// <li>
416    /// <p>For a user, returns the user ID, for example <code>ABCDEFGHI1JKLMNOPQ23R</code>.</p></li>
417    /// <li>
418    /// <p>For an IAM role, returns the IAM role ID, for example <code>ABCDE1F2GH3I4JK5LMNOP:i-a123b456</code>.</p></li>
419    /// </ul></li>
420    /// <li>
421    /// <p><code>SentTimestamp</code> – Returns the time the message was sent to the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
422    /// <li>
423    /// <p><code>SqsManagedSseEnabled</code> – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html">SSE-KMS</a> or <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html">SSE-SQS</a>).</p></li>
424    /// <li>
425    /// <p><code>MessageDeduplicationId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
426    /// <li>
427    /// <p><code>MessageGroupId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
428    /// <li>
429    /// <p><code>SequenceNumber</code> – Returns the value provided by Amazon SQS.</p></li>
430    /// </ul>
431    #[deprecated(note = "AttributeNames has been replaced by MessageSystemAttributeNames")]
432    pub fn get_attribute_names(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::QueueAttributeName>> {
433        &self.attribute_names
434    }
435    /// Appends an item to `message_system_attribute_names`.
436    ///
437    /// To override the contents of this collection use [`set_message_system_attribute_names`](Self::set_message_system_attribute_names).
438    ///
439    /// <p>A list of attributes that need to be returned along with each message. These attributes include:</p>
440    /// <ul>
441    /// <li>
442    /// <p><code>All</code> – Returns all values.</p></li>
443    /// <li>
444    /// <p><code>ApproximateFirstReceiveTimestamp</code> – Returns the time the message was first received from the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
445    /// <li>
446    /// <p><code>ApproximateReceiveCount</code> – Returns the number of times a message has been received across all queues but not deleted.</p></li>
447    /// <li>
448    /// <p><code>AWSTraceHeader</code> – Returns the X-Ray trace header string.</p></li>
449    /// <li>
450    /// <p><code>SenderId</code></p>
451    /// <ul>
452    /// <li>
453    /// <p>For a user, returns the user ID, for example <code>ABCDEFGHI1JKLMNOPQ23R</code>.</p></li>
454    /// <li>
455    /// <p>For an IAM role, returns the IAM role ID, for example <code>ABCDE1F2GH3I4JK5LMNOP:i-a123b456</code>.</p></li>
456    /// </ul></li>
457    /// <li>
458    /// <p><code>SentTimestamp</code> – Returns the time the message was sent to the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
459    /// <li>
460    /// <p><code>SqsManagedSseEnabled</code> – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html">SSE-KMS</a> or <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html">SSE-SQS</a>).</p></li>
461    /// <li>
462    /// <p><code>MessageDeduplicationId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
463    /// <li>
464    /// <p><code>MessageGroupId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
465    /// <li>
466    /// <p><code>SequenceNumber</code> – Returns the value provided by Amazon SQS.</p></li>
467    /// </ul>
468    pub fn message_system_attribute_names(mut self, input: crate::types::MessageSystemAttributeName) -> Self {
469        let mut v = self.message_system_attribute_names.unwrap_or_default();
470        v.push(input);
471        self.message_system_attribute_names = ::std::option::Option::Some(v);
472        self
473    }
474    /// <p>A list of attributes that need to be returned along with each message. These attributes include:</p>
475    /// <ul>
476    /// <li>
477    /// <p><code>All</code> – Returns all values.</p></li>
478    /// <li>
479    /// <p><code>ApproximateFirstReceiveTimestamp</code> – Returns the time the message was first received from the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
480    /// <li>
481    /// <p><code>ApproximateReceiveCount</code> – Returns the number of times a message has been received across all queues but not deleted.</p></li>
482    /// <li>
483    /// <p><code>AWSTraceHeader</code> – Returns the X-Ray trace header string.</p></li>
484    /// <li>
485    /// <p><code>SenderId</code></p>
486    /// <ul>
487    /// <li>
488    /// <p>For a user, returns the user ID, for example <code>ABCDEFGHI1JKLMNOPQ23R</code>.</p></li>
489    /// <li>
490    /// <p>For an IAM role, returns the IAM role ID, for example <code>ABCDE1F2GH3I4JK5LMNOP:i-a123b456</code>.</p></li>
491    /// </ul></li>
492    /// <li>
493    /// <p><code>SentTimestamp</code> – Returns the time the message was sent to the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
494    /// <li>
495    /// <p><code>SqsManagedSseEnabled</code> – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html">SSE-KMS</a> or <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html">SSE-SQS</a>).</p></li>
496    /// <li>
497    /// <p><code>MessageDeduplicationId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
498    /// <li>
499    /// <p><code>MessageGroupId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
500    /// <li>
501    /// <p><code>SequenceNumber</code> – Returns the value provided by Amazon SQS.</p></li>
502    /// </ul>
503    pub fn set_message_system_attribute_names(
504        mut self,
505        input: ::std::option::Option<::std::vec::Vec<crate::types::MessageSystemAttributeName>>,
506    ) -> Self {
507        self.message_system_attribute_names = input;
508        self
509    }
510    /// <p>A list of attributes that need to be returned along with each message. These attributes include:</p>
511    /// <ul>
512    /// <li>
513    /// <p><code>All</code> – Returns all values.</p></li>
514    /// <li>
515    /// <p><code>ApproximateFirstReceiveTimestamp</code> – Returns the time the message was first received from the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
516    /// <li>
517    /// <p><code>ApproximateReceiveCount</code> – Returns the number of times a message has been received across all queues but not deleted.</p></li>
518    /// <li>
519    /// <p><code>AWSTraceHeader</code> – Returns the X-Ray trace header string.</p></li>
520    /// <li>
521    /// <p><code>SenderId</code></p>
522    /// <ul>
523    /// <li>
524    /// <p>For a user, returns the user ID, for example <code>ABCDEFGHI1JKLMNOPQ23R</code>.</p></li>
525    /// <li>
526    /// <p>For an IAM role, returns the IAM role ID, for example <code>ABCDE1F2GH3I4JK5LMNOP:i-a123b456</code>.</p></li>
527    /// </ul></li>
528    /// <li>
529    /// <p><code>SentTimestamp</code> – Returns the time the message was sent to the queue (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds).</p></li>
530    /// <li>
531    /// <p><code>SqsManagedSseEnabled</code> – Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sse-existing-queue.html">SSE-KMS</a> or <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-configure-sqs-sse-queue.html">SSE-SQS</a>).</p></li>
532    /// <li>
533    /// <p><code>MessageDeduplicationId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
534    /// <li>
535    /// <p><code>MessageGroupId</code> – Returns the value provided by the producer that calls the <code> <code>SendMessage</code> </code> action.</p></li>
536    /// <li>
537    /// <p><code>SequenceNumber</code> – Returns the value provided by Amazon SQS.</p></li>
538    /// </ul>
539    pub fn get_message_system_attribute_names(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MessageSystemAttributeName>> {
540        &self.message_system_attribute_names
541    }
542    /// Appends an item to `message_attribute_names`.
543    ///
544    /// To override the contents of this collection use [`set_message_attribute_names`](Self::set_message_attribute_names).
545    ///
546    /// <p>The name of the message attribute, where <i>N</i> is the index.</p>
547    /// <ul>
548    /// <li>
549    /// <p>The name can contain alphanumeric characters and the underscore (<code>_</code>), hyphen (<code>-</code>), and period (<code>.</code>).</p></li>
550    /// <li>
551    /// <p>The name is case-sensitive and must be unique among all attribute names for the message.</p></li>
552    /// <li>
553    /// <p>The name must not start with AWS-reserved prefixes such as <code>AWS.</code> or <code>Amazon.</code> (or any casing variants).</p></li>
554    /// <li>
555    /// <p>The name must not start or end with a period (<code>.</code>), and it should not have periods in succession (<code>..</code>).</p></li>
556    /// <li>
557    /// <p>The name can be up to 256 characters long.</p></li>
558    /// </ul>
559    /// <p>When using <code>ReceiveMessage</code>, you can send a list of attribute names to receive, or you can return all of the attributes by specifying <code>All</code> or <code>.*</code> in your request. You can also use all message attributes starting with a prefix, for example <code>bar.*</code>.</p>
560    pub fn message_attribute_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
561        let mut v = self.message_attribute_names.unwrap_or_default();
562        v.push(input.into());
563        self.message_attribute_names = ::std::option::Option::Some(v);
564        self
565    }
566    /// <p>The name of the message attribute, where <i>N</i> is the index.</p>
567    /// <ul>
568    /// <li>
569    /// <p>The name can contain alphanumeric characters and the underscore (<code>_</code>), hyphen (<code>-</code>), and period (<code>.</code>).</p></li>
570    /// <li>
571    /// <p>The name is case-sensitive and must be unique among all attribute names for the message.</p></li>
572    /// <li>
573    /// <p>The name must not start with AWS-reserved prefixes such as <code>AWS.</code> or <code>Amazon.</code> (or any casing variants).</p></li>
574    /// <li>
575    /// <p>The name must not start or end with a period (<code>.</code>), and it should not have periods in succession (<code>..</code>).</p></li>
576    /// <li>
577    /// <p>The name can be up to 256 characters long.</p></li>
578    /// </ul>
579    /// <p>When using <code>ReceiveMessage</code>, you can send a list of attribute names to receive, or you can return all of the attributes by specifying <code>All</code> or <code>.*</code> in your request. You can also use all message attributes starting with a prefix, for example <code>bar.*</code>.</p>
580    pub fn set_message_attribute_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
581        self.message_attribute_names = input;
582        self
583    }
584    /// <p>The name of the message attribute, where <i>N</i> is the index.</p>
585    /// <ul>
586    /// <li>
587    /// <p>The name can contain alphanumeric characters and the underscore (<code>_</code>), hyphen (<code>-</code>), and period (<code>.</code>).</p></li>
588    /// <li>
589    /// <p>The name is case-sensitive and must be unique among all attribute names for the message.</p></li>
590    /// <li>
591    /// <p>The name must not start with AWS-reserved prefixes such as <code>AWS.</code> or <code>Amazon.</code> (or any casing variants).</p></li>
592    /// <li>
593    /// <p>The name must not start or end with a period (<code>.</code>), and it should not have periods in succession (<code>..</code>).</p></li>
594    /// <li>
595    /// <p>The name can be up to 256 characters long.</p></li>
596    /// </ul>
597    /// <p>When using <code>ReceiveMessage</code>, you can send a list of attribute names to receive, or you can return all of the attributes by specifying <code>All</code> or <code>.*</code> in your request. You can also use all message attributes starting with a prefix, for example <code>bar.*</code>.</p>
598    pub fn get_message_attribute_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
599        &self.message_attribute_names
600    }
601    /// <p>The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1.</p>
602    pub fn max_number_of_messages(mut self, input: i32) -> Self {
603        self.max_number_of_messages = ::std::option::Option::Some(input);
604        self
605    }
606    /// <p>The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1.</p>
607    pub fn set_max_number_of_messages(mut self, input: ::std::option::Option<i32>) -> Self {
608        self.max_number_of_messages = input;
609        self
610    }
611    /// <p>The maximum number of messages to return. Amazon SQS never returns more messages than this value (however, fewer messages might be returned). Valid values: 1 to 10. Default: 1.</p>
612    pub fn get_max_number_of_messages(&self) -> &::std::option::Option<i32> {
613        &self.max_number_of_messages
614    }
615    /// <p>The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a <code>ReceiveMessage</code> request. If not specified, the default visibility timeout for the queue is used, which is 30 seconds.</p>
616    /// <p>Understanding <code>VisibilityTimeout</code>:</p>
617    /// <ul>
618    /// <li>
619    /// <p>When a message is received from a queue, it becomes temporarily invisible to other consumers for the duration of the visibility timeout. This prevents multiple consumers from processing the same message simultaneously. If the message is not deleted or its visibility timeout is not extended before the timeout expires, it becomes visible again and can be retrieved by other consumers.</p></li>
620    /// <li>
621    /// <p>Setting an appropriate visibility timeout is crucial. If it's too short, the message might become visible again before processing is complete, leading to duplicate processing. If it's too long, it delays the reprocessing of messages if the initial processing fails.</p></li>
622    /// <li>
623    /// <p>You can adjust the visibility timeout using the <code>--visibility-timeout</code> parameter in the <code>receive-message</code> command to match the processing time required by your application.</p></li>
624    /// <li>
625    /// <p>A message that isn't deleted or a message whose visibility isn't extended before the visibility timeout expires counts as a failed receive. Depending on the configuration of the queue, the message might be sent to the dead-letter queue.</p></li>
626    /// </ul>
627    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon SQS Developer Guide</i>.</p>
628    pub fn visibility_timeout(mut self, input: i32) -> Self {
629        self.visibility_timeout = ::std::option::Option::Some(input);
630        self
631    }
632    /// <p>The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a <code>ReceiveMessage</code> request. If not specified, the default visibility timeout for the queue is used, which is 30 seconds.</p>
633    /// <p>Understanding <code>VisibilityTimeout</code>:</p>
634    /// <ul>
635    /// <li>
636    /// <p>When a message is received from a queue, it becomes temporarily invisible to other consumers for the duration of the visibility timeout. This prevents multiple consumers from processing the same message simultaneously. If the message is not deleted or its visibility timeout is not extended before the timeout expires, it becomes visible again and can be retrieved by other consumers.</p></li>
637    /// <li>
638    /// <p>Setting an appropriate visibility timeout is crucial. If it's too short, the message might become visible again before processing is complete, leading to duplicate processing. If it's too long, it delays the reprocessing of messages if the initial processing fails.</p></li>
639    /// <li>
640    /// <p>You can adjust the visibility timeout using the <code>--visibility-timeout</code> parameter in the <code>receive-message</code> command to match the processing time required by your application.</p></li>
641    /// <li>
642    /// <p>A message that isn't deleted or a message whose visibility isn't extended before the visibility timeout expires counts as a failed receive. Depending on the configuration of the queue, the message might be sent to the dead-letter queue.</p></li>
643    /// </ul>
644    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon SQS Developer Guide</i>.</p>
645    pub fn set_visibility_timeout(mut self, input: ::std::option::Option<i32>) -> Self {
646        self.visibility_timeout = input;
647        self
648    }
649    /// <p>The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a <code>ReceiveMessage</code> request. If not specified, the default visibility timeout for the queue is used, which is 30 seconds.</p>
650    /// <p>Understanding <code>VisibilityTimeout</code>:</p>
651    /// <ul>
652    /// <li>
653    /// <p>When a message is received from a queue, it becomes temporarily invisible to other consumers for the duration of the visibility timeout. This prevents multiple consumers from processing the same message simultaneously. If the message is not deleted or its visibility timeout is not extended before the timeout expires, it becomes visible again and can be retrieved by other consumers.</p></li>
654    /// <li>
655    /// <p>Setting an appropriate visibility timeout is crucial. If it's too short, the message might become visible again before processing is complete, leading to duplicate processing. If it's too long, it delays the reprocessing of messages if the initial processing fails.</p></li>
656    /// <li>
657    /// <p>You can adjust the visibility timeout using the <code>--visibility-timeout</code> parameter in the <code>receive-message</code> command to match the processing time required by your application.</p></li>
658    /// <li>
659    /// <p>A message that isn't deleted or a message whose visibility isn't extended before the visibility timeout expires counts as a failed receive. Depending on the configuration of the queue, the message might be sent to the dead-letter queue.</p></li>
660    /// </ul>
661    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon SQS Developer Guide</i>.</p>
662    pub fn get_visibility_timeout(&self) -> &::std::option::Option<i32> {
663        &self.visibility_timeout
664    }
665    /// <p>The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than <code>WaitTimeSeconds</code>. If no messages are available and the wait time expires, the call does not return a message list. If you are using the Java SDK, it returns a <code>ReceiveMessageResponse</code> object, which has a empty list instead of a Null object.</p><important>
666    /// <p>To avoid HTTP errors, ensure that the HTTP response timeout for <code>ReceiveMessage</code> requests is longer than the <code>WaitTimeSeconds</code> parameter. For example, with the Java SDK, you can set HTTP transport settings using the <a href="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html"> NettyNioAsyncHttpClient</a> for asynchronous clients, or the <a href="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.html"> ApacheHttpClient</a> for synchronous clients.</p>
667    /// </important>
668    pub fn wait_time_seconds(mut self, input: i32) -> Self {
669        self.wait_time_seconds = ::std::option::Option::Some(input);
670        self
671    }
672    /// <p>The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than <code>WaitTimeSeconds</code>. If no messages are available and the wait time expires, the call does not return a message list. If you are using the Java SDK, it returns a <code>ReceiveMessageResponse</code> object, which has a empty list instead of a Null object.</p><important>
673    /// <p>To avoid HTTP errors, ensure that the HTTP response timeout for <code>ReceiveMessage</code> requests is longer than the <code>WaitTimeSeconds</code> parameter. For example, with the Java SDK, you can set HTTP transport settings using the <a href="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html"> NettyNioAsyncHttpClient</a> for asynchronous clients, or the <a href="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.html"> ApacheHttpClient</a> for synchronous clients.</p>
674    /// </important>
675    pub fn set_wait_time_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
676        self.wait_time_seconds = input;
677        self
678    }
679    /// <p>The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. If a message is available, the call returns sooner than <code>WaitTimeSeconds</code>. If no messages are available and the wait time expires, the call does not return a message list. If you are using the Java SDK, it returns a <code>ReceiveMessageResponse</code> object, which has a empty list instead of a Null object.</p><important>
680    /// <p>To avoid HTTP errors, ensure that the HTTP response timeout for <code>ReceiveMessage</code> requests is longer than the <code>WaitTimeSeconds</code> parameter. For example, with the Java SDK, you can set HTTP transport settings using the <a href="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/nio/netty/NettyNioAsyncHttpClient.html"> NettyNioAsyncHttpClient</a> for asynchronous clients, or the <a href="https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/http/apache/ApacheHttpClient.html"> ApacheHttpClient</a> for synchronous clients.</p>
681    /// </important>
682    pub fn get_wait_time_seconds(&self) -> &::std::option::Option<i32> {
683        &self.wait_time_seconds
684    }
685    /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
686    /// <p>The token used for deduplication of <code>ReceiveMessage</code> calls. If a networking issue occurs after a <code>ReceiveMessage</code> action, and instead of a response you receive a generic error, it is possible to retry the same action with an identical <code>ReceiveRequestAttemptId</code> to retrieve the same set of messages, even if their visibility timeout has not yet expired.</p>
687    /// <ul>
688    /// <li>
689    /// <p>You can use <code>ReceiveRequestAttemptId</code> only for 5 minutes after a <code>ReceiveMessage</code> action.</p></li>
690    /// <li>
691    /// <p>When you set <code>FifoQueue</code>, a caller of the <code>ReceiveMessage</code> action can provide a <code>ReceiveRequestAttemptId</code> explicitly.</p></li>
692    /// <li>
693    /// <p>It is possible to retry the <code>ReceiveMessage</code> action with the same <code>ReceiveRequestAttemptId</code> if none of the messages have been modified (deleted or had their visibility changes).</p></li>
694    /// <li>
695    /// <p>During a visibility timeout, subsequent calls with the same <code>ReceiveRequestAttemptId</code> return the same messages and receipt handles. If a retry occurs within the deduplication interval, it resets the visibility timeout. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon SQS Developer Guide</i>.</p><important>
696    /// <p>If a caller of the <code>ReceiveMessage</code> action still processes messages when the visibility timeout expires and messages become visible, another worker consuming from the same queue can receive the same messages and therefore process duplicates. Also, if a consumer whose message processing time is longer than the visibility timeout tries to delete the processed messages, the action fails with an error.</p>
697    /// <p>To mitigate this effect, ensure that your application observes a safe threshold before the visibility timeout expires and extend the visibility timeout as necessary.</p>
698    /// </important></li>
699    /// <li>
700    /// <p>While messages with a particular <code>MessageGroupId</code> are invisible, no more messages belonging to the same <code>MessageGroupId</code> are returned until the visibility timeout expires. You can still receive messages with another <code>MessageGroupId</code> from your FIFO queue as long as they are visible.</p></li>
701    /// <li>
702    /// <p>If a caller of <code>ReceiveMessage</code> can't track the <code>ReceiveRequestAttemptId</code>, no retries work until the original visibility timeout expires. As a result, delays might occur but the messages in the queue remain in a strict order.</p></li>
703    /// </ul>
704    /// <p>The maximum length of <code>ReceiveRequestAttemptId</code> is 128 characters. <code>ReceiveRequestAttemptId</code> can contain alphanumeric characters (<code>a-z</code>, <code>A-Z</code>, <code>0-9</code>) and punctuation (<code>!"#$%&amp;'()*+,-./:;&lt;=&gt;?@\[\\]^_`{|}~</code>).</p>
705    /// <p>For best practices of using <code>ReceiveRequestAttemptId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html">Using the ReceiveRequestAttemptId Request Parameter</a> in the <i>Amazon SQS Developer Guide</i>.</p>
706    pub fn receive_request_attempt_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
707        self.receive_request_attempt_id = ::std::option::Option::Some(input.into());
708        self
709    }
710    /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
711    /// <p>The token used for deduplication of <code>ReceiveMessage</code> calls. If a networking issue occurs after a <code>ReceiveMessage</code> action, and instead of a response you receive a generic error, it is possible to retry the same action with an identical <code>ReceiveRequestAttemptId</code> to retrieve the same set of messages, even if their visibility timeout has not yet expired.</p>
712    /// <ul>
713    /// <li>
714    /// <p>You can use <code>ReceiveRequestAttemptId</code> only for 5 minutes after a <code>ReceiveMessage</code> action.</p></li>
715    /// <li>
716    /// <p>When you set <code>FifoQueue</code>, a caller of the <code>ReceiveMessage</code> action can provide a <code>ReceiveRequestAttemptId</code> explicitly.</p></li>
717    /// <li>
718    /// <p>It is possible to retry the <code>ReceiveMessage</code> action with the same <code>ReceiveRequestAttemptId</code> if none of the messages have been modified (deleted or had their visibility changes).</p></li>
719    /// <li>
720    /// <p>During a visibility timeout, subsequent calls with the same <code>ReceiveRequestAttemptId</code> return the same messages and receipt handles. If a retry occurs within the deduplication interval, it resets the visibility timeout. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon SQS Developer Guide</i>.</p><important>
721    /// <p>If a caller of the <code>ReceiveMessage</code> action still processes messages when the visibility timeout expires and messages become visible, another worker consuming from the same queue can receive the same messages and therefore process duplicates. Also, if a consumer whose message processing time is longer than the visibility timeout tries to delete the processed messages, the action fails with an error.</p>
722    /// <p>To mitigate this effect, ensure that your application observes a safe threshold before the visibility timeout expires and extend the visibility timeout as necessary.</p>
723    /// </important></li>
724    /// <li>
725    /// <p>While messages with a particular <code>MessageGroupId</code> are invisible, no more messages belonging to the same <code>MessageGroupId</code> are returned until the visibility timeout expires. You can still receive messages with another <code>MessageGroupId</code> from your FIFO queue as long as they are visible.</p></li>
726    /// <li>
727    /// <p>If a caller of <code>ReceiveMessage</code> can't track the <code>ReceiveRequestAttemptId</code>, no retries work until the original visibility timeout expires. As a result, delays might occur but the messages in the queue remain in a strict order.</p></li>
728    /// </ul>
729    /// <p>The maximum length of <code>ReceiveRequestAttemptId</code> is 128 characters. <code>ReceiveRequestAttemptId</code> can contain alphanumeric characters (<code>a-z</code>, <code>A-Z</code>, <code>0-9</code>) and punctuation (<code>!"#$%&amp;'()*+,-./:;&lt;=&gt;?@\[\\]^_`{|}~</code>).</p>
730    /// <p>For best practices of using <code>ReceiveRequestAttemptId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html">Using the ReceiveRequestAttemptId Request Parameter</a> in the <i>Amazon SQS Developer Guide</i>.</p>
731    pub fn set_receive_request_attempt_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
732        self.receive_request_attempt_id = input;
733        self
734    }
735    /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p>
736    /// <p>The token used for deduplication of <code>ReceiveMessage</code> calls. If a networking issue occurs after a <code>ReceiveMessage</code> action, and instead of a response you receive a generic error, it is possible to retry the same action with an identical <code>ReceiveRequestAttemptId</code> to retrieve the same set of messages, even if their visibility timeout has not yet expired.</p>
737    /// <ul>
738    /// <li>
739    /// <p>You can use <code>ReceiveRequestAttemptId</code> only for 5 minutes after a <code>ReceiveMessage</code> action.</p></li>
740    /// <li>
741    /// <p>When you set <code>FifoQueue</code>, a caller of the <code>ReceiveMessage</code> action can provide a <code>ReceiveRequestAttemptId</code> explicitly.</p></li>
742    /// <li>
743    /// <p>It is possible to retry the <code>ReceiveMessage</code> action with the same <code>ReceiveRequestAttemptId</code> if none of the messages have been modified (deleted or had their visibility changes).</p></li>
744    /// <li>
745    /// <p>During a visibility timeout, subsequent calls with the same <code>ReceiveRequestAttemptId</code> return the same messages and receipt handles. If a retry occurs within the deduplication interval, it resets the visibility timeout. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon SQS Developer Guide</i>.</p><important>
746    /// <p>If a caller of the <code>ReceiveMessage</code> action still processes messages when the visibility timeout expires and messages become visible, another worker consuming from the same queue can receive the same messages and therefore process duplicates. Also, if a consumer whose message processing time is longer than the visibility timeout tries to delete the processed messages, the action fails with an error.</p>
747    /// <p>To mitigate this effect, ensure that your application observes a safe threshold before the visibility timeout expires and extend the visibility timeout as necessary.</p>
748    /// </important></li>
749    /// <li>
750    /// <p>While messages with a particular <code>MessageGroupId</code> are invisible, no more messages belonging to the same <code>MessageGroupId</code> are returned until the visibility timeout expires. You can still receive messages with another <code>MessageGroupId</code> from your FIFO queue as long as they are visible.</p></li>
751    /// <li>
752    /// <p>If a caller of <code>ReceiveMessage</code> can't track the <code>ReceiveRequestAttemptId</code>, no retries work until the original visibility timeout expires. As a result, delays might occur but the messages in the queue remain in a strict order.</p></li>
753    /// </ul>
754    /// <p>The maximum length of <code>ReceiveRequestAttemptId</code> is 128 characters. <code>ReceiveRequestAttemptId</code> can contain alphanumeric characters (<code>a-z</code>, <code>A-Z</code>, <code>0-9</code>) and punctuation (<code>!"#$%&amp;'()*+,-./:;&lt;=&gt;?@\[\\]^_`{|}~</code>).</p>
755    /// <p>For best practices of using <code>ReceiveRequestAttemptId</code>, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/using-receiverequestattemptid-request-parameter.html">Using the ReceiveRequestAttemptId Request Parameter</a> in the <i>Amazon SQS Developer Guide</i>.</p>
756    pub fn get_receive_request_attempt_id(&self) -> &::std::option::Option<::std::string::String> {
757        &self.receive_request_attempt_id
758    }
759    /// Consumes the builder and constructs a [`ReceiveMessageInput`](crate::operation::receive_message::ReceiveMessageInput).
760    pub fn build(
761        self,
762    ) -> ::std::result::Result<crate::operation::receive_message::ReceiveMessageInput, ::aws_smithy_types::error::operation::BuildError> {
763        ::std::result::Result::Ok(crate::operation::receive_message::ReceiveMessageInput {
764            queue_url: self.queue_url,
765            attribute_names: self.attribute_names,
766            message_system_attribute_names: self.message_system_attribute_names,
767            message_attribute_names: self.message_attribute_names,
768            max_number_of_messages: self.max_number_of_messages,
769            visibility_timeout: self.visibility_timeout,
770            wait_time_seconds: self.wait_time_seconds,
771            receive_request_attempt_id: self.receive_request_attempt_id,
772        })
773    }
774}