rusoto_sqs/
generated.rs

1// =================================================================
2//
3//                           * WARNING *
4//
5//                    This file is generated!
6//
7//  Changes made to this file will be overwritten. If changes are
8//  required to the generated code, the service_crategen project
9//  must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::param::{Params, ServiceParams};
23use rusoto_core::proto::xml::error::*;
24use rusoto_core::proto::xml::util::{
25    self as xml_util, deserialize_elements, find_start_element, skip_tree,
26};
27use rusoto_core::proto::xml::util::{Next, Peek, XmlParseError, XmlResponse};
28use rusoto_core::request::HttpResponse;
29use rusoto_core::signature::SignedRequest;
30#[cfg(feature = "deserialize_structs")]
31use serde::Deserialize;
32#[cfg(feature = "serialize_structs")]
33use serde::Serialize;
34use serde_urlencoded;
35use std::str::FromStr;
36use xml::EventReader;
37
38impl SqsClient {
39    fn new_params(&self, operation_name: &str) -> Params {
40        let mut params = Params::new();
41
42        params.put("Action", operation_name);
43        params.put("Version", "2012-11-05");
44
45        params
46    }
47
48    async fn sign_and_dispatch<E>(
49        &self,
50        request: SignedRequest,
51        from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
52    ) -> Result<HttpResponse, RusotoError<E>> {
53        let mut response = self.client.sign_and_dispatch(request).await?;
54        if !response.status.is_success() {
55            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
56            return Err(from_response(response));
57        }
58
59        Ok(response)
60    }
61}
62
63/// Serialize `AWSAccountIdList` contents to a `SignedRequest`.
64struct AWSAccountIdListSerializer;
65impl AWSAccountIdListSerializer {
66    fn serialize(params: &mut Params, name: &str, obj: &Vec<String>) {
67        for (index, obj) in obj.iter().enumerate() {
68            let key = format!("{}.{}", name, index + 1);
69            params.put(&key, &obj);
70        }
71    }
72}
73
74/// Serialize `ActionNameList` contents to a `SignedRequest`.
75struct ActionNameListSerializer;
76impl ActionNameListSerializer {
77    fn serialize(params: &mut Params, name: &str, obj: &Vec<String>) {
78        for (index, obj) in obj.iter().enumerate() {
79            let key = format!("{}.{}", name, index + 1);
80            params.put(&key, &obj);
81        }
82    }
83}
84
85/// <p><p/></p>
86#[derive(Clone, Debug, Default, PartialEq)]
87#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
88pub struct AddPermissionRequest {
89    /// <p>The AWS account number of the <a href="https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principal</a> who is given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS. For information about locating the AWS account identification, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-making-api-requests.html#sqs-api-request-authentication">Your AWS Identifiers</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p>
90    pub aws_account_ids: Vec<String>,
91    /// <p>The action the client wants to allow for the specified principal. Valid values: the name of any action or <code>*</code>.</p> <p>For more information about these actions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-overview-of-managing-access.html">Overview of Managing Access Permissions to Your Amazon Simple Queue Service Resource</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <p>Specifying <code>SendMessage</code>, <code>DeleteMessage</code>, or <code>ChangeMessageVisibility</code> for <code>ActionName.n</code> also grants permissions for the corresponding batch versions of those actions: <code>SendMessageBatch</code>, <code>DeleteMessageBatch</code>, and <code>ChangeMessageVisibilityBatch</code>.</p>
92    pub actions: Vec<String>,
93    /// <p>The unique identification of the permission you're setting (for example, <code>AliceSendMessage</code>). Maximum 80 characters. Allowed characters include alphanumeric characters, hyphens (<code>-</code>), and underscores (<code>_</code>).</p>
94    pub label: String,
95    /// <p>The URL of the Amazon SQS queue to which permissions are added.</p> <p>Queue URLs and names are case-sensitive.</p>
96    pub queue_url: String,
97}
98
99/// Serialize `AddPermissionRequest` contents to a `SignedRequest`.
100struct AddPermissionRequestSerializer;
101impl AddPermissionRequestSerializer {
102    fn serialize(params: &mut Params, name: &str, obj: &AddPermissionRequest) {
103        let mut prefix = name.to_string();
104        if prefix != "" {
105            prefix.push_str(".");
106        }
107
108        AWSAccountIdListSerializer::serialize(
109            params,
110            &format!("{}{}", prefix, "AWSAccountId"),
111            &obj.aws_account_ids,
112        );
113        ActionNameListSerializer::serialize(
114            params,
115            &format!("{}{}", prefix, "ActionName"),
116            &obj.actions,
117        );
118        params.put(&format!("{}{}", prefix, "Label"), &obj.label);
119        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
120    }
121}
122
123/// Serialize `AttributeNameList` contents to a `SignedRequest`.
124struct AttributeNameListSerializer;
125impl AttributeNameListSerializer {
126    fn serialize(params: &mut Params, name: &str, obj: &Vec<String>) {
127        for (index, obj) in obj.iter().enumerate() {
128            let key = format!("{}.{}", name, index + 1);
129            params.put(&key, &obj);
130        }
131    }
132}
133
134/// <p>Gives a detailed description of the result of an action on each entry in the request.</p>
135#[derive(Clone, Debug, Default, PartialEq)]
136#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
137pub struct BatchResultErrorEntry {
138    /// <p>An error code representing why the action failed on this entry.</p>
139    pub code: String,
140    /// <p>The <code>Id</code> of an entry in a batch request.</p>
141    pub id: String,
142    /// <p>A message explaining why the action failed on this entry.</p>
143    pub message: Option<String>,
144    /// <p>Specifies whether the error happened due to the caller of the batch API action.</p>
145    pub sender_fault: bool,
146}
147
148#[allow(dead_code)]
149struct BatchResultErrorEntryDeserializer;
150impl BatchResultErrorEntryDeserializer {
151    #[allow(dead_code, unused_variables)]
152    fn deserialize<T: Peek + Next>(
153        tag_name: &str,
154        stack: &mut T,
155    ) -> Result<BatchResultErrorEntry, XmlParseError> {
156        deserialize_elements::<_, BatchResultErrorEntry, _>(tag_name, stack, |name, stack, obj| {
157            match name {
158                "Code" => {
159                    obj.code = StringDeserializer::deserialize("Code", stack)?;
160                }
161                "Id" => {
162                    obj.id = StringDeserializer::deserialize("Id", stack)?;
163                }
164                "Message" => {
165                    obj.message = Some(StringDeserializer::deserialize("Message", stack)?);
166                }
167                "SenderFault" => {
168                    obj.sender_fault = BooleanDeserializer::deserialize("SenderFault", stack)?;
169                }
170                _ => skip_tree(stack),
171            }
172            Ok(())
173        })
174    }
175}
176#[allow(dead_code)]
177struct BatchResultErrorEntryListDeserializer;
178impl BatchResultErrorEntryListDeserializer {
179    #[allow(dead_code, unused_variables)]
180    fn deserialize<T: Peek + Next>(
181        tag_name: &str,
182        stack: &mut T,
183    ) -> Result<Vec<BatchResultErrorEntry>, XmlParseError> {
184        let mut obj = vec![];
185
186        loop {
187            let consume_next_tag = match stack.peek() {
188                Some(&Ok(xml::reader::XmlEvent::StartElement { ref name, .. })) => {
189                    name.local_name == tag_name
190                }
191                _ => false,
192            };
193
194            if consume_next_tag {
195                obj.push(BatchResultErrorEntryDeserializer::deserialize(
196                    tag_name, stack,
197                )?);
198            } else {
199                break;
200            }
201        }
202
203        Ok(obj)
204    }
205}
206#[allow(dead_code)]
207struct BinaryDeserializer;
208impl BinaryDeserializer {
209    #[allow(dead_code, unused_variables)]
210    fn deserialize<T: Peek + Next>(
211        tag_name: &str,
212        stack: &mut T,
213    ) -> Result<bytes::Bytes, XmlParseError> {
214        xml_util::deserialize_primitive(tag_name, stack, |s| Ok(s.into()))
215    }
216}
217#[allow(dead_code)]
218struct BinaryListDeserializer;
219impl BinaryListDeserializer {
220    #[allow(dead_code, unused_variables)]
221    fn deserialize<T: Peek + Next>(
222        tag_name: &str,
223        stack: &mut T,
224    ) -> Result<Vec<bytes::Bytes>, XmlParseError> {
225        deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
226            if name == "BinaryListValue" {
227                obj.push(BinaryDeserializer::deserialize("BinaryListValue", stack)?);
228            } else {
229                skip_tree(stack);
230            }
231            Ok(())
232        })
233    }
234}
235
236/// Serialize `BinaryList` contents to a `SignedRequest`.
237struct BinaryListSerializer;
238impl BinaryListSerializer {
239    fn serialize(params: &mut Params, name: &str, obj: &Vec<bytes::Bytes>) {
240        for (index, obj) in obj.iter().enumerate() {
241            let key = format!("{}.member.{}", name, index + 1);
242            params.put(&key, ::std::str::from_utf8(&obj).unwrap());
243        }
244    }
245}
246
247#[allow(dead_code)]
248struct BooleanDeserializer;
249impl BooleanDeserializer {
250    #[allow(dead_code, unused_variables)]
251    fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<bool, XmlParseError> {
252        xml_util::deserialize_primitive(tag_name, stack, |s| Ok(bool::from_str(&s).unwrap()))
253    }
254}
255/// <p><p/></p>
256#[derive(Clone, Debug, Default, PartialEq)]
257#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
258pub struct ChangeMessageVisibilityBatchRequest {
259    /// <p>A list of receipt handles of the messages for which the visibility timeout must be changed.</p>
260    pub entries: Vec<ChangeMessageVisibilityBatchRequestEntry>,
261    /// <p>The URL of the Amazon SQS queue whose messages' visibility is changed.</p> <p>Queue URLs and names are case-sensitive.</p>
262    pub queue_url: String,
263}
264
265/// Serialize `ChangeMessageVisibilityBatchRequest` contents to a `SignedRequest`.
266struct ChangeMessageVisibilityBatchRequestSerializer;
267impl ChangeMessageVisibilityBatchRequestSerializer {
268    fn serialize(params: &mut Params, name: &str, obj: &ChangeMessageVisibilityBatchRequest) {
269        let mut prefix = name.to_string();
270        if prefix != "" {
271            prefix.push_str(".");
272        }
273
274        ChangeMessageVisibilityBatchRequestEntryListSerializer::serialize(
275            params,
276            &format!("{}{}", prefix, "ChangeMessageVisibilityBatchRequestEntry"),
277            &obj.entries,
278        );
279        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
280    }
281}
282
283/// <p>Encloses a receipt handle and an entry id for each message in <code> <a>ChangeMessageVisibilityBatch</a>.</code> </p> <important> <p>All of the following list parameters must be prefixed with <code>ChangeMessageVisibilityBatchRequestEntry.n</code>, where <code>n</code> is an integer value starting with <code>1</code>. For example, a parameter list for this action might look like this:</p> </important> <p> <code>&amp;ChangeMessageVisibilityBatchRequestEntry.1.Id=change_visibility_msg_2</code> </p> <p> <code>&amp;ChangeMessageVisibilityBatchRequestEntry.1.ReceiptHandle=your_receipt_handle</code> </p> <p> <code>&amp;ChangeMessageVisibilityBatchRequestEntry.1.VisibilityTimeout=45</code> </p>
284#[derive(Clone, Debug, Default, PartialEq)]
285#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
286pub struct ChangeMessageVisibilityBatchRequestEntry {
287    /// <p><p>An identifier for this particular receipt handle used to communicate the result.</p> <note> <p>The <code>Id</code>s of a batch request need to be unique within a request.</p> <p>This identifier can have up to 80 characters. The following characters are accepted: alphanumeric characters, hyphens(-), and underscores (_).</p> </note></p>
288    pub id: String,
289    /// <p>A receipt handle.</p>
290    pub receipt_handle: String,
291    /// <p>The new value (in seconds) for the message's visibility timeout.</p>
292    pub visibility_timeout: Option<i64>,
293}
294
295/// Serialize `ChangeMessageVisibilityBatchRequestEntry` contents to a `SignedRequest`.
296struct ChangeMessageVisibilityBatchRequestEntrySerializer;
297impl ChangeMessageVisibilityBatchRequestEntrySerializer {
298    fn serialize(params: &mut Params, name: &str, obj: &ChangeMessageVisibilityBatchRequestEntry) {
299        let mut prefix = name.to_string();
300        if prefix != "" {
301            prefix.push_str(".");
302        }
303
304        params.put(&format!("{}{}", prefix, "Id"), &obj.id);
305        params.put(
306            &format!("{}{}", prefix, "ReceiptHandle"),
307            &obj.receipt_handle,
308        );
309        if let Some(ref field_value) = obj.visibility_timeout {
310            params.put(&format!("{}{}", prefix, "VisibilityTimeout"), &field_value);
311        }
312    }
313}
314
315/// Serialize `ChangeMessageVisibilityBatchRequestEntryList` contents to a `SignedRequest`.
316struct ChangeMessageVisibilityBatchRequestEntryListSerializer;
317impl ChangeMessageVisibilityBatchRequestEntryListSerializer {
318    fn serialize(
319        params: &mut Params,
320        name: &str,
321        obj: &Vec<ChangeMessageVisibilityBatchRequestEntry>,
322    ) {
323        for (index, obj) in obj.iter().enumerate() {
324            let key = format!("{}.{}", name, index + 1);
325            ChangeMessageVisibilityBatchRequestEntrySerializer::serialize(params, &key, obj);
326        }
327    }
328}
329
330/// <p>For each message in the batch, the response contains a <code> <a>ChangeMessageVisibilityBatchResultEntry</a> </code> tag if the message succeeds or a <code> <a>BatchResultErrorEntry</a> </code> tag if the message fails.</p>
331#[derive(Clone, Debug, Default, PartialEq)]
332#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
333pub struct ChangeMessageVisibilityBatchResult {
334    /// <p>A list of <code> <a>BatchResultErrorEntry</a> </code> items.</p>
335    pub failed: Vec<BatchResultErrorEntry>,
336    /// <p>A list of <code> <a>ChangeMessageVisibilityBatchResultEntry</a> </code> items.</p>
337    pub successful: Vec<ChangeMessageVisibilityBatchResultEntry>,
338}
339
340#[allow(dead_code)]
341struct ChangeMessageVisibilityBatchResultDeserializer;
342impl ChangeMessageVisibilityBatchResultDeserializer {
343    #[allow(dead_code, unused_variables)]
344    fn deserialize<T: Peek + Next>(
345        tag_name: &str,
346        stack: &mut T,
347    ) -> Result<ChangeMessageVisibilityBatchResult, XmlParseError> {
348        deserialize_elements::<_, ChangeMessageVisibilityBatchResult, _>(
349            tag_name,
350            stack,
351            |name, stack, obj| {
352                match name {
353                    "BatchResultErrorEntry" => {
354                        obj.failed
355                            .extend(BatchResultErrorEntryListDeserializer::deserialize(
356                                "BatchResultErrorEntry",
357                                stack,
358                            )?);
359                    }
360                    "ChangeMessageVisibilityBatchResultEntry" => {
361                        obj.successful.extend(
362                            ChangeMessageVisibilityBatchResultEntryListDeserializer::deserialize(
363                                "ChangeMessageVisibilityBatchResultEntry",
364                                stack,
365                            )?,
366                        );
367                    }
368                    _ => skip_tree(stack),
369                }
370                Ok(())
371            },
372        )
373    }
374}
375/// <p>Encloses the <code>Id</code> of an entry in <code> <a>ChangeMessageVisibilityBatch</a>.</code> </p>
376#[derive(Clone, Debug, Default, PartialEq)]
377#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
378pub struct ChangeMessageVisibilityBatchResultEntry {
379    /// <p>Represents a message whose visibility timeout has been changed successfully.</p>
380    pub id: String,
381}
382
383#[allow(dead_code)]
384struct ChangeMessageVisibilityBatchResultEntryDeserializer;
385impl ChangeMessageVisibilityBatchResultEntryDeserializer {
386    #[allow(dead_code, unused_variables)]
387    fn deserialize<T: Peek + Next>(
388        tag_name: &str,
389        stack: &mut T,
390    ) -> Result<ChangeMessageVisibilityBatchResultEntry, XmlParseError> {
391        deserialize_elements::<_, ChangeMessageVisibilityBatchResultEntry, _>(
392            tag_name,
393            stack,
394            |name, stack, obj| {
395                match name {
396                    "Id" => {
397                        obj.id = StringDeserializer::deserialize("Id", stack)?;
398                    }
399                    _ => skip_tree(stack),
400                }
401                Ok(())
402            },
403        )
404    }
405}
406#[allow(dead_code)]
407struct ChangeMessageVisibilityBatchResultEntryListDeserializer;
408impl ChangeMessageVisibilityBatchResultEntryListDeserializer {
409    #[allow(dead_code, unused_variables)]
410    fn deserialize<T: Peek + Next>(
411        tag_name: &str,
412        stack: &mut T,
413    ) -> Result<Vec<ChangeMessageVisibilityBatchResultEntry>, XmlParseError> {
414        let mut obj = vec![];
415
416        loop {
417            let consume_next_tag = match stack.peek() {
418                Some(&Ok(xml::reader::XmlEvent::StartElement { ref name, .. })) => {
419                    name.local_name == tag_name
420                }
421                _ => false,
422            };
423
424            if consume_next_tag {
425                obj.push(
426                    ChangeMessageVisibilityBatchResultEntryDeserializer::deserialize(
427                        tag_name, stack,
428                    )?,
429                );
430            } else {
431                break;
432            }
433        }
434
435        Ok(obj)
436    }
437}
438#[derive(Clone, Debug, Default, PartialEq)]
439#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
440pub struct ChangeMessageVisibilityRequest {
441    /// <p>The URL of the Amazon SQS queue whose message's visibility is changed.</p> <p>Queue URLs and names are case-sensitive.</p>
442    pub queue_url: String,
443    /// <p>The receipt handle associated with the message whose visibility timeout is changed. This parameter is returned by the <code> <a>ReceiveMessage</a> </code> action.</p>
444    pub receipt_handle: String,
445    /// <p>The new value for the message's visibility timeout (in seconds). Values values: <code>0</code> to <code>43200</code>. Maximum: 12 hours.</p>
446    pub visibility_timeout: i64,
447}
448
449/// Serialize `ChangeMessageVisibilityRequest` contents to a `SignedRequest`.
450struct ChangeMessageVisibilityRequestSerializer;
451impl ChangeMessageVisibilityRequestSerializer {
452    fn serialize(params: &mut Params, name: &str, obj: &ChangeMessageVisibilityRequest) {
453        let mut prefix = name.to_string();
454        if prefix != "" {
455            prefix.push_str(".");
456        }
457
458        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
459        params.put(
460            &format!("{}{}", prefix, "ReceiptHandle"),
461            &obj.receipt_handle,
462        );
463        params.put(
464            &format!("{}{}", prefix, "VisibilityTimeout"),
465            &obj.visibility_timeout,
466        );
467    }
468}
469
470/// <p><p/></p>
471#[derive(Clone, Debug, Default, PartialEq)]
472#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
473pub struct CreateQueueRequest {
474    /// <p><p>A map of attributes with their corresponding values.</p> <p>The following lists the names, descriptions, and values of the special request parameters that the <code>CreateQueue</code> action uses:</p> <ul> <li> <p> <code>DelaySeconds</code> – The length of time, in seconds, for which the delivery of all messages in the queue is delayed. Valid values: An integer from 0 to 900 seconds (15 minutes). Default: 0. </p> </li> <li> <p> <code>MaximumMessageSize</code> – The limit of how many bytes a message can contain before Amazon SQS rejects it. Valid values: An integer from 1,024 bytes (1 KiB) to 262,144 bytes (256 KiB). Default: 262,144 (256 KiB). </p> </li> <li> <p> <code>MessageRetentionPeriod</code> – The length of time, in seconds, for which Amazon SQS retains a message. Valid values: An integer from 60 seconds (1 minute) to 1,209,600 seconds (14 days). Default: 345,600 (4 days). </p> </li> <li> <p> <code>Policy</code> – The queue&#39;s policy. A valid AWS policy. For more information about policy structure, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html">Overview of AWS IAM Policies</a> in the <i>Amazon IAM User Guide</i>. </p> </li> <li> <p> <code>ReceiveMessageWaitTimeSeconds</code> – The length of time, in seconds, for which a <code> <a>ReceiveMessage</a> </code> action waits for a message to arrive. Valid values: An integer from 0 to 20 (seconds). Default: 0. </p> </li> <li> <p> <code>RedrivePolicy</code> – The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object. For more information about the redrive policy and dead-letter queues, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html">Using Amazon SQS Dead-Letter Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <ul> <li> <p> <code>deadLetterTargetArn</code> – The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon SQS moves messages after the value of <code>maxReceiveCount</code> is exceeded.</p> </li> <li> <p> <code>maxReceiveCount</code> – The number of times a message is delivered to the source queue before being moved to the dead-letter queue. When the <code>ReceiveCount</code> for a message exceeds the <code>maxReceiveCount</code> for a queue, Amazon SQS moves the message to the dead-letter-queue.</p> </li> </ul> <note> <p>The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, the dead-letter queue of a standard queue must also be a standard queue.</p> </note> </li> <li> <p> <code>VisibilityTimeout</code> – The visibility timeout for the queue, in seconds. Valid values: An integer from 0 to 43,200 (12 hours). Default: 30. For more information about the visibility timeout, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </li> </ul> <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html">server-side-encryption</a>:</p> <ul> <li> <p> <code>KmsMasterKeyId</code> – The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms">Key Terms</a>. While the alias of the AWS-managed CMK for Amazon SQS is always <code>alias/aws/sqs</code>, the alias of a custom CMK can, for example, be <code>alias/<i>MyAlias</i> </code>. For more examples, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters">KeyId</a> in the <i>AWS Key Management Service API Reference</i>. </p> </li> <li> <p> <code>KmsDataKeyReusePeriodSeconds</code> – The length of time, in seconds, for which Amazon SQS can reuse a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys">data key</a> to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: 300 (5 minutes). A shorter time period provides better security but results in more calls to KMS which might incur charges after Free Tier. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work">How Does the Data Key Reuse Period Work?</a>. </p> </li> </ul> <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html">FIFO (first-in-first-out) queues</a>:</p> <ul> <li> <p> <code>FifoQueue</code> – Designates a queue as FIFO. Valid values: <code>true</code>, <code>false</code>. If you don&#39;t specify the <code>FifoQueue</code> attribute, Amazon SQS creates a standard queue. You can provide this attribute only during queue creation. You can&#39;t change it for an existing queue. When you set this attribute, you must also provide the <code>MessageGroupId</code> for your messages explicitly.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic">FIFO Queue Logic</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </li> <li> <p> <code>ContentBasedDeduplication</code> – Enables content-based deduplication. Valid values: <code>true</code>, <code>false</code>. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing">Exactly-Once Processing</a> in the <i>Amazon Simple Queue Service Developer Guide</i>. </p> <ul> <li> <p>Every message must have a unique <code>MessageDeduplicationId</code>,</p> <ul> <li> <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p> </li> <li> <p>If you aren&#39;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> <li> <p>If you don&#39;t provide a <code>MessageDeduplicationId</code> and the queue doesn&#39;t have <code>ContentBasedDeduplication</code> set, the action fails with an error.</p> </li> <li> <p>If the queue has <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p> </li> </ul> </li> <li> <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> <li> <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> </ul> </li> </ul></p>
475    pub attributes: Option<::std::collections::HashMap<String, String>>,
476    /// <p>The name of the new queue. The following limits apply to this name:</p> <ul> <li> <p>A queue name can have up to 80 characters.</p> </li> <li> <p>Valid values: alphanumeric characters, hyphens (<code>-</code>), and underscores (<code>_</code>).</p> </li> <li> <p>A FIFO queue name must end with the <code>.fifo</code> suffix.</p> </li> </ul> <p>Queue URLs and names are case-sensitive.</p>
477    pub queue_name: String,
478    /// <p><p>Add cost allocation tags to the specified Amazon SQS queue. For an overview, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html">Tagging Your Amazon SQS Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <p>When you use queue tags, keep the following guidelines in mind:</p> <ul> <li> <p>Adding more than 50 tags to a queue isn&#39;t recommended.</p> </li> <li> <p>Tags don&#39;t have any semantic meaning. Amazon SQS interprets tags as character strings.</p> </li> <li> <p>Tags are case-sensitive.</p> </li> <li> <p>A new tag with a key identical to that of an existing tag overwrites the existing tag.</p> </li> </ul> <p>For a full list of tag restrictions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues">Limits Related to Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <note> <p>To be able to tag a queue on creation, you must have the <code>sqs:CreateQueue</code> and <code>sqs:TagQueue</code> permissions.</p> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
479    pub tags: Option<::std::collections::HashMap<String, String>>,
480}
481
482/// Serialize `CreateQueueRequest` contents to a `SignedRequest`.
483struct CreateQueueRequestSerializer;
484impl CreateQueueRequestSerializer {
485    fn serialize(params: &mut Params, name: &str, obj: &CreateQueueRequest) {
486        let mut prefix = name.to_string();
487        if prefix != "" {
488            prefix.push_str(".");
489        }
490
491        if let Some(ref field_value) = obj.attributes {
492            QueueAttributeMapSerializer::serialize(
493                params,
494                &format!("{}{}", prefix, "Attribute"),
495                field_value,
496            );
497        }
498        params.put(&format!("{}{}", prefix, "QueueName"), &obj.queue_name);
499        if let Some(ref field_value) = obj.tags {
500            TagMapSerializer::serialize(params, &format!("{}{}", prefix, "Tag"), field_value);
501        }
502    }
503}
504
505/// <p>Returns the <code>QueueUrl</code> attribute of the created queue.</p>
506#[derive(Clone, Debug, Default, PartialEq)]
507#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
508pub struct CreateQueueResult {
509    /// <p>The URL of the created Amazon SQS queue.</p>
510    pub queue_url: Option<String>,
511}
512
513#[allow(dead_code)]
514struct CreateQueueResultDeserializer;
515impl CreateQueueResultDeserializer {
516    #[allow(dead_code, unused_variables)]
517    fn deserialize<T: Peek + Next>(
518        tag_name: &str,
519        stack: &mut T,
520    ) -> Result<CreateQueueResult, XmlParseError> {
521        deserialize_elements::<_, CreateQueueResult, _>(tag_name, stack, |name, stack, obj| {
522            match name {
523                "QueueUrl" => {
524                    obj.queue_url = Some(StringDeserializer::deserialize("QueueUrl", stack)?);
525                }
526                _ => skip_tree(stack),
527            }
528            Ok(())
529        })
530    }
531}
532/// <p><p/></p>
533#[derive(Clone, Debug, Default, PartialEq)]
534#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
535pub struct DeleteMessageBatchRequest {
536    /// <p>A list of receipt handles for the messages to be deleted.</p>
537    pub entries: Vec<DeleteMessageBatchRequestEntry>,
538    /// <p>The URL of the Amazon SQS queue from which messages are deleted.</p> <p>Queue URLs and names are case-sensitive.</p>
539    pub queue_url: String,
540}
541
542/// Serialize `DeleteMessageBatchRequest` contents to a `SignedRequest`.
543struct DeleteMessageBatchRequestSerializer;
544impl DeleteMessageBatchRequestSerializer {
545    fn serialize(params: &mut Params, name: &str, obj: &DeleteMessageBatchRequest) {
546        let mut prefix = name.to_string();
547        if prefix != "" {
548            prefix.push_str(".");
549        }
550
551        DeleteMessageBatchRequestEntryListSerializer::serialize(
552            params,
553            &format!("{}{}", prefix, "DeleteMessageBatchRequestEntry"),
554            &obj.entries,
555        );
556        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
557    }
558}
559
560/// <p>Encloses a receipt handle and an identifier for it.</p>
561#[derive(Clone, Debug, Default, PartialEq)]
562#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
563pub struct DeleteMessageBatchRequestEntry {
564    /// <p><p>An identifier for this particular receipt handle. This is used to communicate the result.</p> <note> <p>The <code>Id</code>s of a batch request need to be unique within a request.</p> <p>This identifier can have up to 80 characters. The following characters are accepted: alphanumeric characters, hyphens(-), and underscores (_).</p> </note></p>
565    pub id: String,
566    /// <p>A receipt handle.</p>
567    pub receipt_handle: String,
568}
569
570/// Serialize `DeleteMessageBatchRequestEntry` contents to a `SignedRequest`.
571struct DeleteMessageBatchRequestEntrySerializer;
572impl DeleteMessageBatchRequestEntrySerializer {
573    fn serialize(params: &mut Params, name: &str, obj: &DeleteMessageBatchRequestEntry) {
574        let mut prefix = name.to_string();
575        if prefix != "" {
576            prefix.push_str(".");
577        }
578
579        params.put(&format!("{}{}", prefix, "Id"), &obj.id);
580        params.put(
581            &format!("{}{}", prefix, "ReceiptHandle"),
582            &obj.receipt_handle,
583        );
584    }
585}
586
587/// Serialize `DeleteMessageBatchRequestEntryList` contents to a `SignedRequest`.
588struct DeleteMessageBatchRequestEntryListSerializer;
589impl DeleteMessageBatchRequestEntryListSerializer {
590    fn serialize(params: &mut Params, name: &str, obj: &Vec<DeleteMessageBatchRequestEntry>) {
591        for (index, obj) in obj.iter().enumerate() {
592            let key = format!("{}.{}", name, index + 1);
593            DeleteMessageBatchRequestEntrySerializer::serialize(params, &key, obj);
594        }
595    }
596}
597
598/// <p>For each message in the batch, the response contains a <code> <a>DeleteMessageBatchResultEntry</a> </code> tag if the message is deleted or a <code> <a>BatchResultErrorEntry</a> </code> tag if the message can't be deleted.</p>
599#[derive(Clone, Debug, Default, PartialEq)]
600#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
601pub struct DeleteMessageBatchResult {
602    /// <p>A list of <code> <a>BatchResultErrorEntry</a> </code> items.</p>
603    pub failed: Vec<BatchResultErrorEntry>,
604    /// <p>A list of <code> <a>DeleteMessageBatchResultEntry</a> </code> items.</p>
605    pub successful: Vec<DeleteMessageBatchResultEntry>,
606}
607
608#[allow(dead_code)]
609struct DeleteMessageBatchResultDeserializer;
610impl DeleteMessageBatchResultDeserializer {
611    #[allow(dead_code, unused_variables)]
612    fn deserialize<T: Peek + Next>(
613        tag_name: &str,
614        stack: &mut T,
615    ) -> Result<DeleteMessageBatchResult, XmlParseError> {
616        deserialize_elements::<_, DeleteMessageBatchResult, _>(
617            tag_name,
618            stack,
619            |name, stack, obj| {
620                match name {
621                    "BatchResultErrorEntry" => {
622                        obj.failed
623                            .extend(BatchResultErrorEntryListDeserializer::deserialize(
624                                "BatchResultErrorEntry",
625                                stack,
626                            )?);
627                    }
628                    "DeleteMessageBatchResultEntry" => {
629                        obj.successful.extend(
630                            DeleteMessageBatchResultEntryListDeserializer::deserialize(
631                                "DeleteMessageBatchResultEntry",
632                                stack,
633                            )?,
634                        );
635                    }
636                    _ => skip_tree(stack),
637                }
638                Ok(())
639            },
640        )
641    }
642}
643/// <p>Encloses the <code>Id</code> of an entry in <code> <a>DeleteMessageBatch</a>.</code> </p>
644#[derive(Clone, Debug, Default, PartialEq)]
645#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
646pub struct DeleteMessageBatchResultEntry {
647    /// <p>Represents a successfully deleted message.</p>
648    pub id: String,
649}
650
651#[allow(dead_code)]
652struct DeleteMessageBatchResultEntryDeserializer;
653impl DeleteMessageBatchResultEntryDeserializer {
654    #[allow(dead_code, unused_variables)]
655    fn deserialize<T: Peek + Next>(
656        tag_name: &str,
657        stack: &mut T,
658    ) -> Result<DeleteMessageBatchResultEntry, XmlParseError> {
659        deserialize_elements::<_, DeleteMessageBatchResultEntry, _>(
660            tag_name,
661            stack,
662            |name, stack, obj| {
663                match name {
664                    "Id" => {
665                        obj.id = StringDeserializer::deserialize("Id", stack)?;
666                    }
667                    _ => skip_tree(stack),
668                }
669                Ok(())
670            },
671        )
672    }
673}
674#[allow(dead_code)]
675struct DeleteMessageBatchResultEntryListDeserializer;
676impl DeleteMessageBatchResultEntryListDeserializer {
677    #[allow(dead_code, unused_variables)]
678    fn deserialize<T: Peek + Next>(
679        tag_name: &str,
680        stack: &mut T,
681    ) -> Result<Vec<DeleteMessageBatchResultEntry>, XmlParseError> {
682        let mut obj = vec![];
683
684        loop {
685            let consume_next_tag = match stack.peek() {
686                Some(&Ok(xml::reader::XmlEvent::StartElement { ref name, .. })) => {
687                    name.local_name == tag_name
688                }
689                _ => false,
690            };
691
692            if consume_next_tag {
693                obj.push(DeleteMessageBatchResultEntryDeserializer::deserialize(
694                    tag_name, stack,
695                )?);
696            } else {
697                break;
698            }
699        }
700
701        Ok(obj)
702    }
703}
704/// <p><p/></p>
705#[derive(Clone, Debug, Default, PartialEq)]
706#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
707pub struct DeleteMessageRequest {
708    /// <p>The URL of the Amazon SQS queue from which messages are deleted.</p> <p>Queue URLs and names are case-sensitive.</p>
709    pub queue_url: String,
710    /// <p>The receipt handle associated with the message to delete.</p>
711    pub receipt_handle: String,
712}
713
714/// Serialize `DeleteMessageRequest` contents to a `SignedRequest`.
715struct DeleteMessageRequestSerializer;
716impl DeleteMessageRequestSerializer {
717    fn serialize(params: &mut Params, name: &str, obj: &DeleteMessageRequest) {
718        let mut prefix = name.to_string();
719        if prefix != "" {
720            prefix.push_str(".");
721        }
722
723        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
724        params.put(
725            &format!("{}{}", prefix, "ReceiptHandle"),
726            &obj.receipt_handle,
727        );
728    }
729}
730
731/// <p><p/></p>
732#[derive(Clone, Debug, Default, PartialEq)]
733#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
734pub struct DeleteQueueRequest {
735    /// <p>The URL of the Amazon SQS queue to delete.</p> <p>Queue URLs and names are case-sensitive.</p>
736    pub queue_url: String,
737}
738
739/// Serialize `DeleteQueueRequest` contents to a `SignedRequest`.
740struct DeleteQueueRequestSerializer;
741impl DeleteQueueRequestSerializer {
742    fn serialize(params: &mut Params, name: &str, obj: &DeleteQueueRequest) {
743        let mut prefix = name.to_string();
744        if prefix != "" {
745            prefix.push_str(".");
746        }
747
748        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
749    }
750}
751
752/// <p><p/></p>
753#[derive(Clone, Debug, Default, PartialEq)]
754#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
755pub struct GetQueueAttributesRequest {
756    /// <p><p>A list of attributes for which to retrieve information.</p> <note> <p>In the future, new attributes might be added. If you write code that calls this action, we recommend that you structure your code so that it can handle new attributes gracefully.</p> </note> <p>The following attributes are supported:</p> <important> <p>The <code>ApproximateNumberOfMessagesDelayed</code>, <code>ApproximateNumberOfMessagesNotVisible</code>, and <code>ApproximateNumberOfMessagesVisible</code> metrics may not achieve consistency until at least 1 minute after the producers stop sending messages. This period is required for the queue metadata to reach eventual consistency. </p> </important> <ul> <li> <p> <code>All</code> – Returns all values. </p> </li> <li> <p> <code>ApproximateNumberOfMessages</code> – Returns the approximate number of messages available for retrieval from the queue.</p> </li> <li> <p> <code>ApproximateNumberOfMessagesDelayed</code> – Returns the approximate number of messages in the queue that are delayed and not available for reading immediately. This can happen when the queue is configured as a delay queue or when a message has been sent with a delay parameter.</p> </li> <li> <p> <code>ApproximateNumberOfMessagesNotVisible</code> – Returns the approximate number of messages that are in flight. Messages are considered to be <i>in flight</i> if they have been sent to a client but have not yet been deleted or have not yet reached the end of their visibility window. </p> </li> <li> <p> <code>CreatedTimestamp</code> – Returns the time when the queue was created in seconds (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a>).</p> </li> <li> <p> <code>DelaySeconds</code> – Returns the default delay on the queue in seconds.</p> </li> <li> <p> <code>LastModifiedTimestamp</code> – Returns the time when the queue was last changed in seconds (<a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a>).</p> </li> <li> <p> <code>MaximumMessageSize</code> – Returns the limit of how many bytes a message can contain before Amazon SQS rejects it.</p> </li> <li> <p> <code>MessageRetentionPeriod</code> – Returns the length of time, in seconds, for which Amazon SQS retains a message.</p> </li> <li> <p> <code>Policy</code> – Returns the policy of the queue.</p> </li> <li> <p> <code>QueueArn</code> – Returns the Amazon resource name (ARN) of the queue.</p> </li> <li> <p> <code>ReceiveMessageWaitTimeSeconds</code> – Returns the length of time, in seconds, for which the <code>ReceiveMessage</code> action waits for a message to arrive. </p> </li> <li> <p> <code>RedrivePolicy</code> – The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object. For more information about the redrive policy and dead-letter queues, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html">Using Amazon SQS Dead-Letter Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <ul> <li> <p> <code>deadLetterTargetArn</code> – The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon SQS moves messages after the value of <code>maxReceiveCount</code> is exceeded.</p> </li> <li> <p> <code>maxReceiveCount</code> – The number of times a message is delivered to the source queue before being moved to the dead-letter queue. When the <code>ReceiveCount</code> for a message exceeds the <code>maxReceiveCount</code> for a queue, Amazon SQS moves the message to the dead-letter-queue.</p> </li> </ul> </li> <li> <p> <code>VisibilityTimeout</code> – Returns the visibility timeout for the queue. For more information about the visibility timeout, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon Simple Queue Service Developer Guide</i>. </p> </li> </ul> <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html">server-side-encryption</a>:</p> <ul> <li> <p> <code>KmsMasterKeyId</code> – Returns the ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms">Key Terms</a>. </p> </li> <li> <p> <code>KmsDataKeyReusePeriodSeconds</code> – Returns the length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling AWS KMS again. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work">How Does the Data Key Reuse Period Work?</a>. </p> </li> </ul> <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html">FIFO (first-in-first-out) queues</a>:</p> <ul> <li> <p> <code>FifoQueue</code> – Returns whether the queue is FIFO. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic">FIFO Queue Logic</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <note> <p>To determine whether a queue is <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html">FIFO</a>, you can check whether <code>QueueName</code> ends with the <code>.fifo</code> suffix.</p> </note> </li> <li> <p> <code>ContentBasedDeduplication</code> – Returns whether content-based deduplication is enabled for the queue. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing">Exactly-Once Processing</a> in the <i>Amazon Simple Queue Service Developer Guide</i>. </p> </li> </ul></p>
757    pub attribute_names: Option<Vec<String>>,
758    /// <p>The URL of the Amazon SQS queue whose attribute information is retrieved.</p> <p>Queue URLs and names are case-sensitive.</p>
759    pub queue_url: String,
760}
761
762/// Serialize `GetQueueAttributesRequest` contents to a `SignedRequest`.
763struct GetQueueAttributesRequestSerializer;
764impl GetQueueAttributesRequestSerializer {
765    fn serialize(params: &mut Params, name: &str, obj: &GetQueueAttributesRequest) {
766        let mut prefix = name.to_string();
767        if prefix != "" {
768            prefix.push_str(".");
769        }
770
771        if let Some(ref field_value) = obj.attribute_names {
772            AttributeNameListSerializer::serialize(
773                params,
774                &format!("{}{}", prefix, "AttributeName"),
775                field_value,
776            );
777        }
778        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
779    }
780}
781
782/// <p>A list of returned queue attributes.</p>
783#[derive(Clone, Debug, Default, PartialEq)]
784#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
785pub struct GetQueueAttributesResult {
786    /// <p>A map of attributes to their respective values.</p>
787    pub attributes: Option<::std::collections::HashMap<String, String>>,
788}
789
790#[allow(dead_code)]
791struct GetQueueAttributesResultDeserializer;
792impl GetQueueAttributesResultDeserializer {
793    #[allow(dead_code, unused_variables)]
794    fn deserialize<T: Peek + Next>(
795        tag_name: &str,
796        stack: &mut T,
797    ) -> Result<GetQueueAttributesResult, XmlParseError> {
798        deserialize_elements::<_, GetQueueAttributesResult, _>(
799            tag_name,
800            stack,
801            |name, stack, obj| {
802                match name {
803                    "Attribute" => {
804                        obj.attributes = Some(QueueAttributeMapDeserializer::deserialize(
805                            "Attribute",
806                            stack,
807                        )?);
808                    }
809                    _ => skip_tree(stack),
810                }
811                Ok(())
812            },
813        )
814    }
815}
816/// <p><p/></p>
817#[derive(Clone, Debug, Default, PartialEq)]
818#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
819pub struct GetQueueUrlRequest {
820    /// <p>The name of the queue whose URL must be fetched. Maximum 80 characters. Valid values: alphanumeric characters, hyphens (<code>-</code>), and underscores (<code>_</code>).</p> <p>Queue URLs and names are case-sensitive.</p>
821    pub queue_name: String,
822    /// <p>The AWS account ID of the account that created the queue.</p>
823    pub queue_owner_aws_account_id: Option<String>,
824}
825
826/// Serialize `GetQueueUrlRequest` contents to a `SignedRequest`.
827struct GetQueueUrlRequestSerializer;
828impl GetQueueUrlRequestSerializer {
829    fn serialize(params: &mut Params, name: &str, obj: &GetQueueUrlRequest) {
830        let mut prefix = name.to_string();
831        if prefix != "" {
832            prefix.push_str(".");
833        }
834
835        params.put(&format!("{}{}", prefix, "QueueName"), &obj.queue_name);
836        if let Some(ref field_value) = obj.queue_owner_aws_account_id {
837            params.put(
838                &format!("{}{}", prefix, "QueueOwnerAWSAccountId"),
839                &field_value,
840            );
841        }
842    }
843}
844
845/// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-api-responses.html">Interpreting Responses</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p>
846#[derive(Clone, Debug, Default, PartialEq)]
847#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
848pub struct GetQueueUrlResult {
849    /// <p>The URL of the queue.</p>
850    pub queue_url: Option<String>,
851}
852
853#[allow(dead_code)]
854struct GetQueueUrlResultDeserializer;
855impl GetQueueUrlResultDeserializer {
856    #[allow(dead_code, unused_variables)]
857    fn deserialize<T: Peek + Next>(
858        tag_name: &str,
859        stack: &mut T,
860    ) -> Result<GetQueueUrlResult, XmlParseError> {
861        deserialize_elements::<_, GetQueueUrlResult, _>(tag_name, stack, |name, stack, obj| {
862            match name {
863                "QueueUrl" => {
864                    obj.queue_url = Some(StringDeserializer::deserialize("QueueUrl", stack)?);
865                }
866                _ => skip_tree(stack),
867            }
868            Ok(())
869        })
870    }
871}
872/// <p><p/></p>
873#[derive(Clone, Debug, Default, PartialEq)]
874#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
875pub struct ListDeadLetterSourceQueuesRequest {
876    /// <p>Maximum number of results to include in the response.</p>
877    pub max_results: Option<i64>,
878    /// <p>Pagination token to request the next set of results.</p>
879    pub next_token: Option<String>,
880    /// <p>The URL of a dead-letter queue.</p> <p>Queue URLs and names are case-sensitive.</p>
881    pub queue_url: String,
882}
883
884/// Serialize `ListDeadLetterSourceQueuesRequest` contents to a `SignedRequest`.
885struct ListDeadLetterSourceQueuesRequestSerializer;
886impl ListDeadLetterSourceQueuesRequestSerializer {
887    fn serialize(params: &mut Params, name: &str, obj: &ListDeadLetterSourceQueuesRequest) {
888        let mut prefix = name.to_string();
889        if prefix != "" {
890            prefix.push_str(".");
891        }
892
893        if let Some(ref field_value) = obj.max_results {
894            params.put(&format!("{}{}", prefix, "MaxResults"), &field_value);
895        }
896        if let Some(ref field_value) = obj.next_token {
897            params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
898        }
899        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
900    }
901}
902
903/// <p>A list of your dead letter source queues.</p>
904#[derive(Clone, Debug, Default, PartialEq)]
905#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
906pub struct ListDeadLetterSourceQueuesResult {
907    /// <p>Pagination token to include in the next request.</p>
908    pub next_token: Option<String>,
909    /// <p>A list of source queue URLs that have the <code>RedrivePolicy</code> queue attribute configured with a dead-letter queue.</p>
910    pub queue_urls: Vec<String>,
911}
912
913#[allow(dead_code)]
914struct ListDeadLetterSourceQueuesResultDeserializer;
915impl ListDeadLetterSourceQueuesResultDeserializer {
916    #[allow(dead_code, unused_variables)]
917    fn deserialize<T: Peek + Next>(
918        tag_name: &str,
919        stack: &mut T,
920    ) -> Result<ListDeadLetterSourceQueuesResult, XmlParseError> {
921        deserialize_elements::<_, ListDeadLetterSourceQueuesResult, _>(
922            tag_name,
923            stack,
924            |name, stack, obj| {
925                match name {
926                    "NextToken" => {
927                        obj.next_token = Some(TokenDeserializer::deserialize("NextToken", stack)?);
928                    }
929                    "QueueUrl" => {
930                        obj.queue_urls
931                            .extend(QueueUrlListDeserializer::deserialize("QueueUrl", stack)?);
932                    }
933                    _ => skip_tree(stack),
934                }
935                Ok(())
936            },
937        )
938    }
939}
940#[derive(Clone, Debug, Default, PartialEq)]
941#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
942pub struct ListQueueTagsRequest {
943    /// <p>The URL of the queue.</p>
944    pub queue_url: String,
945}
946
947/// Serialize `ListQueueTagsRequest` contents to a `SignedRequest`.
948struct ListQueueTagsRequestSerializer;
949impl ListQueueTagsRequestSerializer {
950    fn serialize(params: &mut Params, name: &str, obj: &ListQueueTagsRequest) {
951        let mut prefix = name.to_string();
952        if prefix != "" {
953            prefix.push_str(".");
954        }
955
956        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
957    }
958}
959
960#[derive(Clone, Debug, Default, PartialEq)]
961#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
962pub struct ListQueueTagsResult {
963    /// <p>The list of all tags added to the specified queue.</p>
964    pub tags: Option<::std::collections::HashMap<String, String>>,
965}
966
967#[allow(dead_code)]
968struct ListQueueTagsResultDeserializer;
969impl ListQueueTagsResultDeserializer {
970    #[allow(dead_code, unused_variables)]
971    fn deserialize<T: Peek + Next>(
972        tag_name: &str,
973        stack: &mut T,
974    ) -> Result<ListQueueTagsResult, XmlParseError> {
975        deserialize_elements::<_, ListQueueTagsResult, _>(tag_name, stack, |name, stack, obj| {
976            match name {
977                "Tag" => {
978                    obj.tags = Some(TagMapDeserializer::deserialize("Tag", stack)?);
979                }
980                _ => skip_tree(stack),
981            }
982            Ok(())
983        })
984    }
985}
986/// <p><p/></p>
987#[derive(Clone, Debug, Default, PartialEq)]
988#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
989pub struct ListQueuesRequest {
990    /// <p>Maximum number of results to include in the response.</p>
991    pub max_results: Option<i64>,
992    /// <p>Pagination token to request the next set of results.</p>
993    pub next_token: Option<String>,
994    /// <p>A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.</p> <p>Queue URLs and names are case-sensitive.</p>
995    pub queue_name_prefix: Option<String>,
996}
997
998/// Serialize `ListQueuesRequest` contents to a `SignedRequest`.
999struct ListQueuesRequestSerializer;
1000impl ListQueuesRequestSerializer {
1001    fn serialize(params: &mut Params, name: &str, obj: &ListQueuesRequest) {
1002        let mut prefix = name.to_string();
1003        if prefix != "" {
1004            prefix.push_str(".");
1005        }
1006
1007        if let Some(ref field_value) = obj.max_results {
1008            params.put(&format!("{}{}", prefix, "MaxResults"), &field_value);
1009        }
1010        if let Some(ref field_value) = obj.next_token {
1011            params.put(&format!("{}{}", prefix, "NextToken"), &field_value);
1012        }
1013        if let Some(ref field_value) = obj.queue_name_prefix {
1014            params.put(&format!("{}{}", prefix, "QueueNamePrefix"), &field_value);
1015        }
1016    }
1017}
1018
1019/// <p>A list of your queues.</p>
1020#[derive(Clone, Debug, Default, PartialEq)]
1021#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
1022pub struct ListQueuesResult {
1023    /// <p>Pagination token to include in the next request.</p>
1024    pub next_token: Option<String>,
1025    /// <p>A list of queue URLs, up to 1,000 entries, or the value of MaxResults that you sent in the request.</p>
1026    pub queue_urls: Option<Vec<String>>,
1027}
1028
1029#[allow(dead_code)]
1030struct ListQueuesResultDeserializer;
1031impl ListQueuesResultDeserializer {
1032    #[allow(dead_code, unused_variables)]
1033    fn deserialize<T: Peek + Next>(
1034        tag_name: &str,
1035        stack: &mut T,
1036    ) -> Result<ListQueuesResult, XmlParseError> {
1037        deserialize_elements::<_, ListQueuesResult, _>(tag_name, stack, |name, stack, obj| {
1038            match name {
1039                "NextToken" => {
1040                    obj.next_token = Some(TokenDeserializer::deserialize("NextToken", stack)?);
1041                }
1042                "QueueUrl" => {
1043                    obj.queue_urls
1044                        .get_or_insert(vec![])
1045                        .extend(QueueUrlListDeserializer::deserialize("QueueUrl", stack)?);
1046                }
1047                _ => skip_tree(stack),
1048            }
1049            Ok(())
1050        })
1051    }
1052}
1053/// <p>An Amazon SQS message.</p>
1054#[derive(Clone, Debug, Default, PartialEq)]
1055#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
1056pub struct Message {
1057    /// <p>A map of the attributes requested in <code> <a>ReceiveMessage</a> </code> to their respective values. Supported attributes:</p> <ul> <li> <p> <code>ApproximateReceiveCount</code> </p> </li> <li> <p> <code>ApproximateFirstReceiveTimestamp</code> </p> </li> <li> <p> <code>MessageDeduplicationId</code> </p> </li> <li> <p> <code>MessageGroupId</code> </p> </li> <li> <p> <code>SenderId</code> </p> </li> <li> <p> <code>SentTimestamp</code> </p> </li> <li> <p> <code>SequenceNumber</code> </p> </li> </ul> <p> <code>ApproximateFirstReceiveTimestamp</code> and <code>SentTimestamp</code> are each returned as an integer representing the <a href="http://en.wikipedia.org/wiki/Unix_time">epoch time</a> in milliseconds.</p>
1058    pub attributes: Option<::std::collections::HashMap<String, String>>,
1059    /// <p>The message's contents (not URL-encoded).</p>
1060    pub body: Option<String>,
1061    /// <p>An MD5 digest of the non-URL-encoded message body string.</p>
1062    pub md5_of_body: Option<String>,
1063    /// <p>An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p>
1064    pub md5_of_message_attributes: Option<String>,
1065    /// <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-attributes.html">Amazon SQS Message Attributes</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p>
1066    pub message_attributes: Option<::std::collections::HashMap<String, MessageAttributeValue>>,
1067    /// <p>A unique identifier for the message. A <code>MessageId</code>is considered unique across all AWS accounts for an extended period of time.</p>
1068    pub message_id: Option<String>,
1069    /// <p>An identifier associated with the act of receiving the message. A new receipt handle is returned every time you receive a message. When deleting a message, you provide the last received receipt handle to delete the message.</p>
1070    pub receipt_handle: Option<String>,
1071}
1072
1073#[allow(dead_code)]
1074struct MessageDeserializer;
1075impl MessageDeserializer {
1076    #[allow(dead_code, unused_variables)]
1077    fn deserialize<T: Peek + Next>(
1078        tag_name: &str,
1079        stack: &mut T,
1080    ) -> Result<Message, XmlParseError> {
1081        deserialize_elements::<_, Message, _>(tag_name, stack, |name, stack, obj| {
1082            match name {
1083                "Attribute" => {
1084                    obj.attributes = Some(MessageSystemAttributeMapDeserializer::deserialize(
1085                        "Attribute",
1086                        stack,
1087                    )?);
1088                }
1089                "Body" => {
1090                    obj.body = Some(StringDeserializer::deserialize("Body", stack)?);
1091                }
1092                "MD5OfBody" => {
1093                    obj.md5_of_body = Some(StringDeserializer::deserialize("MD5OfBody", stack)?);
1094                }
1095                "MD5OfMessageAttributes" => {
1096                    obj.md5_of_message_attributes = Some(StringDeserializer::deserialize(
1097                        "MD5OfMessageAttributes",
1098                        stack,
1099                    )?);
1100                }
1101                "MessageAttribute" => {
1102                    obj.message_attributes =
1103                        Some(MessageBodyAttributeMapDeserializer::deserialize(
1104                            "MessageAttribute",
1105                            stack,
1106                        )?);
1107                }
1108                "MessageId" => {
1109                    obj.message_id = Some(StringDeserializer::deserialize("MessageId", stack)?);
1110                }
1111                "ReceiptHandle" => {
1112                    obj.receipt_handle =
1113                        Some(StringDeserializer::deserialize("ReceiptHandle", stack)?);
1114                }
1115                _ => skip_tree(stack),
1116            }
1117            Ok(())
1118        })
1119    }
1120}
1121
1122/// Serialize `MessageAttributeNameList` contents to a `SignedRequest`.
1123struct MessageAttributeNameListSerializer;
1124impl MessageAttributeNameListSerializer {
1125    fn serialize(params: &mut Params, name: &str, obj: &Vec<String>) {
1126        for (index, obj) in obj.iter().enumerate() {
1127            let key = format!("{}.{}", name, index + 1);
1128            params.put(&key, &obj);
1129        }
1130    }
1131}
1132
1133/// <p>The user-specified message attribute value. For string data types, the <code>Value</code> attribute has the same restrictions on the content as the message body. For more information, see <code> <a>SendMessage</a>.</code> </p> <p> <code>Name</code>, <code>type</code>, <code>value</code> and the message body must not be empty or null. All parts of the message attribute, including <code>Name</code>, <code>Type</code>, and <code>Value</code>, are part of the message size restriction (256 KB or 262,144 bytes).</p>
1134#[derive(Clone, Debug, Default, PartialEq)]
1135#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
1136#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1137pub struct MessageAttributeValue {
1138    /// <p>Not implemented. Reserved for future use.</p>
1139    pub binary_list_values: Option<Vec<bytes::Bytes>>,
1140    /// <p>Binary type attributes can store any binary data, such as compressed data, encrypted data, or images.</p>
1141    pub binary_value: Option<bytes::Bytes>,
1142    /// <p>Amazon SQS supports the following logical data types: <code>String</code>, <code>Number</code>, and <code>Binary</code>. For the <code>Number</code> data type, you must use <code>StringValue</code>.</p> <p>You can also append custom labels. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html">Amazon SQS Message Attributes</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p>
1143    pub data_type: String,
1144    /// <p>Not implemented. Reserved for future use.</p>
1145    pub string_list_values: Option<Vec<String>>,
1146    /// <p>Strings are Unicode with UTF-8 binary encoding. For a list of code values, see <a href="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters">ASCII Printable Characters</a>.</p>
1147    pub string_value: Option<String>,
1148}
1149
1150#[allow(dead_code)]
1151struct MessageAttributeValueDeserializer;
1152impl MessageAttributeValueDeserializer {
1153    #[allow(dead_code, unused_variables)]
1154    fn deserialize<T: Peek + Next>(
1155        tag_name: &str,
1156        stack: &mut T,
1157    ) -> Result<MessageAttributeValue, XmlParseError> {
1158        deserialize_elements::<_, MessageAttributeValue, _>(tag_name, stack, |name, stack, obj| {
1159            match name {
1160                "BinaryListValue" => {
1161                    obj.binary_list_values.get_or_insert(vec![]).extend(
1162                        BinaryListDeserializer::deserialize("BinaryListValue", stack)?,
1163                    );
1164                }
1165                "BinaryValue" => {
1166                    obj.binary_value = Some(BinaryDeserializer::deserialize("BinaryValue", stack)?);
1167                }
1168                "DataType" => {
1169                    obj.data_type = StringDeserializer::deserialize("DataType", stack)?;
1170                }
1171                "StringListValue" => {
1172                    obj.string_list_values.get_or_insert(vec![]).extend(
1173                        StringListDeserializer::deserialize("StringListValue", stack)?,
1174                    );
1175                }
1176                "StringValue" => {
1177                    obj.string_value = Some(StringDeserializer::deserialize("StringValue", stack)?);
1178                }
1179                _ => skip_tree(stack),
1180            }
1181            Ok(())
1182        })
1183    }
1184}
1185
1186/// Serialize `MessageAttributeValue` contents to a `SignedRequest`.
1187struct MessageAttributeValueSerializer;
1188impl MessageAttributeValueSerializer {
1189    fn serialize(params: &mut Params, name: &str, obj: &MessageAttributeValue) {
1190        let mut prefix = name.to_string();
1191        if prefix != "" {
1192            prefix.push_str(".");
1193        }
1194
1195        if let Some(ref field_value) = obj.binary_list_values {
1196            BinaryListSerializer::serialize(
1197                params,
1198                &format!("{}{}", prefix, "BinaryListValue"),
1199                field_value,
1200            );
1201        }
1202        if let Some(ref field_value) = obj.binary_value {
1203            params.put(
1204                &format!("{}{}", prefix, "BinaryValue"),
1205                ::std::str::from_utf8(&field_value).unwrap(),
1206            );
1207        }
1208        params.put(&format!("{}{}", prefix, "DataType"), &obj.data_type);
1209        if let Some(ref field_value) = obj.string_list_values {
1210            StringListSerializer::serialize(
1211                params,
1212                &format!("{}{}", prefix, "StringListValue"),
1213                field_value,
1214            );
1215        }
1216        if let Some(ref field_value) = obj.string_value {
1217            params.put(&format!("{}{}", prefix, "StringValue"), &field_value);
1218        }
1219    }
1220}
1221
1222#[allow(dead_code)]
1223struct MessageBodyAttributeMapDeserializer;
1224impl MessageBodyAttributeMapDeserializer {
1225    #[allow(dead_code, unused_variables)]
1226    fn deserialize<T: Peek + Next>(
1227        tag_name: &str,
1228        stack: &mut T,
1229    ) -> Result<::std::collections::HashMap<String, MessageAttributeValue>, XmlParseError> {
1230        let mut obj = ::std::collections::HashMap::new();
1231
1232        while xml_util::peek_at_name(stack)? == tag_name {
1233            xml_util::start_element(tag_name, stack)?;
1234            let key = StringDeserializer::deserialize("Name", stack)?;
1235            let value = MessageAttributeValueDeserializer::deserialize("Value", stack)?;
1236            obj.insert(key, value);
1237            xml_util::end_element(tag_name, stack)?;
1238        }
1239
1240        Ok(obj)
1241    }
1242}
1243
1244/// Serialize `MessageBodyAttributeMap` contents to a `SignedRequest`.
1245struct MessageBodyAttributeMapSerializer;
1246impl MessageBodyAttributeMapSerializer {
1247    fn serialize(
1248        params: &mut Params,
1249        name: &str,
1250        obj: &::std::collections::HashMap<String, MessageAttributeValue>,
1251    ) {
1252        for (index, (key, value)) in obj.iter().enumerate() {
1253            let prefix = format!("{}.{}", name, index + 1);
1254            params.put(&format!("{}.{}", prefix, "Name"), &key);
1255            MessageAttributeValueSerializer::serialize(
1256                params,
1257                &format!("{}.{}", prefix, "Value"),
1258                value,
1259            );
1260        }
1261    }
1262}
1263
1264/// Serialize `MessageBodySystemAttributeMap` contents to a `SignedRequest`.
1265struct MessageBodySystemAttributeMapSerializer;
1266impl MessageBodySystemAttributeMapSerializer {
1267    fn serialize(
1268        params: &mut Params,
1269        name: &str,
1270        obj: &::std::collections::HashMap<String, MessageSystemAttributeValue>,
1271    ) {
1272        for (index, (key, value)) in obj.iter().enumerate() {
1273            let prefix = format!("{}.{}", name, index + 1);
1274            params.put(&format!("{}.{}", prefix, "Name"), &key);
1275            MessageSystemAttributeValueSerializer::serialize(
1276                params,
1277                &format!("{}.{}", prefix, "Value"),
1278                value,
1279            );
1280        }
1281    }
1282}
1283
1284#[allow(dead_code)]
1285struct MessageListDeserializer;
1286impl MessageListDeserializer {
1287    #[allow(dead_code, unused_variables)]
1288    fn deserialize<T: Peek + Next>(
1289        tag_name: &str,
1290        stack: &mut T,
1291    ) -> Result<Vec<Message>, XmlParseError> {
1292        let mut obj = vec![];
1293
1294        loop {
1295            let consume_next_tag = match stack.peek() {
1296                Some(&Ok(xml::reader::XmlEvent::StartElement { ref name, .. })) => {
1297                    name.local_name == tag_name
1298                }
1299                _ => false,
1300            };
1301
1302            if consume_next_tag {
1303                obj.push(MessageDeserializer::deserialize(tag_name, stack)?);
1304            } else {
1305                break;
1306            }
1307        }
1308
1309        Ok(obj)
1310    }
1311}
1312#[allow(dead_code)]
1313struct MessageSystemAttributeMapDeserializer;
1314impl MessageSystemAttributeMapDeserializer {
1315    #[allow(dead_code, unused_variables)]
1316    fn deserialize<T: Peek + Next>(
1317        tag_name: &str,
1318        stack: &mut T,
1319    ) -> Result<::std::collections::HashMap<String, String>, XmlParseError> {
1320        let mut obj = ::std::collections::HashMap::new();
1321
1322        while xml_util::peek_at_name(stack)? == "Attribute" {
1323            xml_util::start_element("Attribute", stack)?;
1324            let key = MessageSystemAttributeNameDeserializer::deserialize("Name", stack)?;
1325            let value = StringDeserializer::deserialize("Value", stack)?;
1326            obj.insert(key, value);
1327            xml_util::end_element("Attribute", stack)?;
1328        }
1329
1330        Ok(obj)
1331    }
1332}
1333#[allow(dead_code)]
1334struct MessageSystemAttributeNameDeserializer;
1335impl MessageSystemAttributeNameDeserializer {
1336    #[allow(dead_code, unused_variables)]
1337    fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
1338        xml_util::deserialize_primitive(tag_name, stack, Ok)
1339    }
1340}
1341/// <p>The user-specified message system attribute value. For string data types, the <code>Value</code> attribute has the same restrictions on the content as the message body. For more information, see <code> <a>SendMessage</a>.</code> </p> <p> <code>Name</code>, <code>type</code>, <code>value</code> and the message body must not be empty or null.</p>
1342#[derive(Clone, Debug, Default, PartialEq)]
1343#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1344pub struct MessageSystemAttributeValue {
1345    /// <p>Not implemented. Reserved for future use.</p>
1346    pub binary_list_values: Option<Vec<bytes::Bytes>>,
1347    /// <p>Binary type attributes can store any binary data, such as compressed data, encrypted data, or images.</p>
1348    pub binary_value: Option<bytes::Bytes>,
1349    /// <p>Amazon SQS supports the following logical data types: <code>String</code>, <code>Number</code>, and <code>Binary</code>. For the <code>Number</code> data type, you must use <code>StringValue</code>.</p> <p>You can also append custom labels. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-attributes.html">Amazon SQS Message Attributes</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p>
1350    pub data_type: String,
1351    /// <p>Not implemented. Reserved for future use.</p>
1352    pub string_list_values: Option<Vec<String>>,
1353    /// <p>Strings are Unicode with UTF-8 binary encoding. For a list of code values, see <a href="http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters">ASCII Printable Characters</a>.</p>
1354    pub string_value: Option<String>,
1355}
1356
1357/// Serialize `MessageSystemAttributeValue` contents to a `SignedRequest`.
1358struct MessageSystemAttributeValueSerializer;
1359impl MessageSystemAttributeValueSerializer {
1360    fn serialize(params: &mut Params, name: &str, obj: &MessageSystemAttributeValue) {
1361        let mut prefix = name.to_string();
1362        if prefix != "" {
1363            prefix.push_str(".");
1364        }
1365
1366        if let Some(ref field_value) = obj.binary_list_values {
1367            BinaryListSerializer::serialize(
1368                params,
1369                &format!("{}{}", prefix, "BinaryListValue"),
1370                field_value,
1371            );
1372        }
1373        if let Some(ref field_value) = obj.binary_value {
1374            params.put(
1375                &format!("{}{}", prefix, "BinaryValue"),
1376                ::std::str::from_utf8(&field_value).unwrap(),
1377            );
1378        }
1379        params.put(&format!("{}{}", prefix, "DataType"), &obj.data_type);
1380        if let Some(ref field_value) = obj.string_list_values {
1381            StringListSerializer::serialize(
1382                params,
1383                &format!("{}{}", prefix, "StringListValue"),
1384                field_value,
1385            );
1386        }
1387        if let Some(ref field_value) = obj.string_value {
1388            params.put(&format!("{}{}", prefix, "StringValue"), &field_value);
1389        }
1390    }
1391}
1392
1393/// <p><p/></p>
1394#[derive(Clone, Debug, Default, PartialEq)]
1395#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1396pub struct PurgeQueueRequest {
1397    /// <p>The URL of the queue from which the <code>PurgeQueue</code> action deletes messages.</p> <p>Queue URLs and names are case-sensitive.</p>
1398    pub queue_url: String,
1399}
1400
1401/// Serialize `PurgeQueueRequest` contents to a `SignedRequest`.
1402struct PurgeQueueRequestSerializer;
1403impl PurgeQueueRequestSerializer {
1404    fn serialize(params: &mut Params, name: &str, obj: &PurgeQueueRequest) {
1405        let mut prefix = name.to_string();
1406        if prefix != "" {
1407            prefix.push_str(".");
1408        }
1409
1410        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
1411    }
1412}
1413
1414#[allow(dead_code)]
1415struct QueueAttributeMapDeserializer;
1416impl QueueAttributeMapDeserializer {
1417    #[allow(dead_code, unused_variables)]
1418    fn deserialize<T: Peek + Next>(
1419        tag_name: &str,
1420        stack: &mut T,
1421    ) -> Result<::std::collections::HashMap<String, String>, XmlParseError> {
1422        let mut obj = ::std::collections::HashMap::new();
1423
1424        while xml_util::peek_at_name(stack)? == "Attribute" {
1425            xml_util::start_element("Attribute", stack)?;
1426            let key = QueueAttributeNameDeserializer::deserialize("Name", stack)?;
1427            let value = StringDeserializer::deserialize("Value", stack)?;
1428            obj.insert(key, value);
1429            xml_util::end_element("Attribute", stack)?;
1430        }
1431
1432        Ok(obj)
1433    }
1434}
1435
1436/// Serialize `QueueAttributeMap` contents to a `SignedRequest`.
1437struct QueueAttributeMapSerializer;
1438impl QueueAttributeMapSerializer {
1439    fn serialize(
1440        params: &mut Params,
1441        name: &str,
1442        obj: &::std::collections::HashMap<String, String>,
1443    ) {
1444        for (index, (key, value)) in obj.iter().enumerate() {
1445            let prefix = format!("{}.{}", name, index + 1);
1446            params.put(&format!("{}.{}", prefix, "Name"), &key);
1447            params.put(&format!("{}.{}", prefix, "Value"), &value);
1448        }
1449    }
1450}
1451
1452#[allow(dead_code)]
1453struct QueueAttributeNameDeserializer;
1454impl QueueAttributeNameDeserializer {
1455    #[allow(dead_code, unused_variables)]
1456    fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
1457        xml_util::deserialize_primitive(tag_name, stack, Ok)
1458    }
1459}
1460#[allow(dead_code)]
1461struct QueueUrlListDeserializer;
1462impl QueueUrlListDeserializer {
1463    #[allow(dead_code, unused_variables)]
1464    fn deserialize<T: Peek + Next>(
1465        tag_name: &str,
1466        stack: &mut T,
1467    ) -> Result<Vec<String>, XmlParseError> {
1468        let mut obj = vec![];
1469
1470        loop {
1471            let consume_next_tag = match stack.peek() {
1472                Some(&Ok(xml::reader::XmlEvent::StartElement { ref name, .. })) => {
1473                    name.local_name == tag_name
1474                }
1475                _ => false,
1476            };
1477
1478            if consume_next_tag {
1479                obj.push(StringDeserializer::deserialize(tag_name, stack)?);
1480            } else {
1481                break;
1482            }
1483        }
1484
1485        Ok(obj)
1486    }
1487}
1488/// <p><p/></p>
1489#[derive(Clone, Debug, Default, PartialEq)]
1490#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1491pub struct ReceiveMessageRequest {
1492    /// <p><p>A list of attributes that need to be returned along with each message. These attributes include:</p> <ul> <li> <p> <code>All</code> – Returns all values.</p> </li> <li> <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> <li> <p> <code>ApproximateReceiveCount</code> – Returns the number of times a message has been received across all queues but not deleted.</p> </li> <li> <p> <code>AWSTraceHeader</code> – Returns the AWS X-Ray trace header string. </p> </li> <li> <p> <code>SenderId</code> </p> <ul> <li> <p>For an IAM user, returns the IAM user ID, for example <code>ABCDEFGHI1JKLMNOPQ23R</code>.</p> </li> <li> <p>For an IAM role, returns the IAM role ID, for example <code>ABCDE1F2GH3I4JK5LMNOP:i-a123b456</code>.</p> </li> </ul> </li> <li> <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> <li> <p> <code>MessageDeduplicationId</code> – Returns the value provided by the producer that calls the <code> <a>SendMessage</a> </code> action.</p> </li> <li> <p> <code>MessageGroupId</code> – Returns the value provided by the producer that calls the <code> <a>SendMessage</a> </code> action. Messages with the same <code>MessageGroupId</code> are returned in sequence.</p> </li> <li> <p> <code>SequenceNumber</code> – Returns the value provided by Amazon SQS.</p> </li> </ul></p>
1493    pub attribute_names: Option<Vec<String>>,
1494    /// <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>
1495    pub max_number_of_messages: Option<i64>,
1496    /// <p>The name of the message attribute, where <i>N</i> is the index.</p> <ul> <li> <p>The name can contain alphanumeric characters and the underscore (<code>_</code>), hyphen (<code>-</code>), and period (<code>.</code>).</p> </li> <li> <p>The name is case-sensitive and must be unique among all attribute names for the message.</p> </li> <li> <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> <li> <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> <li> <p>The name can be up to 256 characters long.</p> </li> </ul> <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>
1497    pub message_attribute_names: Option<Vec<String>>,
1498    /// <p>The URL of the Amazon SQS queue from which messages are received.</p> <p>Queue URLs and names are case-sensitive.</p>
1499    pub queue_url: String,
1500    /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p> <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> <ul> <li> <p>You can use <code>ReceiveRequestAttemptId</code> only for 5 minutes after a <code>ReceiveMessage</code> action.</p> </li> <li> <p>When you set <code>FifoQueue</code>, a caller of the <code>ReceiveMessage</code> action can provide a <code>ReceiveRequestAttemptId</code> explicitly.</p> </li> <li> <p>If a caller of the <code>ReceiveMessage</code> action doesn't provide a <code>ReceiveRequestAttemptId</code>, Amazon SQS generates a <code>ReceiveRequestAttemptId</code>.</p> </li> <li> <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> <li> <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 Simple Queue Service Developer Guide</i>.</p> <important> <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> <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> </important> </li> <li> <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> as long as it is also visible.</p> </li> <li> <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> </ul> <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> <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 Simple Queue Service Developer Guide</i>.</p>
1501    pub receive_request_attempt_id: Option<String>,
1502    /// <p>The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a <code>ReceiveMessage</code> request.</p>
1503    pub visibility_timeout: Option<i64>,
1504    /// <p><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 returns successfully with an empty list of messages.</p> <important> <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> </important></p>
1505    pub wait_time_seconds: Option<i64>,
1506}
1507
1508/// Serialize `ReceiveMessageRequest` contents to a `SignedRequest`.
1509struct ReceiveMessageRequestSerializer;
1510impl ReceiveMessageRequestSerializer {
1511    fn serialize(params: &mut Params, name: &str, obj: &ReceiveMessageRequest) {
1512        let mut prefix = name.to_string();
1513        if prefix != "" {
1514            prefix.push_str(".");
1515        }
1516
1517        if let Some(ref field_value) = obj.attribute_names {
1518            AttributeNameListSerializer::serialize(
1519                params,
1520                &format!("{}{}", prefix, "AttributeName"),
1521                field_value,
1522            );
1523        }
1524        if let Some(ref field_value) = obj.max_number_of_messages {
1525            params.put(
1526                &format!("{}{}", prefix, "MaxNumberOfMessages"),
1527                &field_value,
1528            );
1529        }
1530        if let Some(ref field_value) = obj.message_attribute_names {
1531            MessageAttributeNameListSerializer::serialize(
1532                params,
1533                &format!("{}{}", prefix, "MessageAttributeName"),
1534                field_value,
1535            );
1536        }
1537        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
1538        if let Some(ref field_value) = obj.receive_request_attempt_id {
1539            params.put(
1540                &format!("{}{}", prefix, "ReceiveRequestAttemptId"),
1541                &field_value,
1542            );
1543        }
1544        if let Some(ref field_value) = obj.visibility_timeout {
1545            params.put(&format!("{}{}", prefix, "VisibilityTimeout"), &field_value);
1546        }
1547        if let Some(ref field_value) = obj.wait_time_seconds {
1548            params.put(&format!("{}{}", prefix, "WaitTimeSeconds"), &field_value);
1549        }
1550    }
1551}
1552
1553/// <p>A list of received messages.</p>
1554#[derive(Clone, Debug, Default, PartialEq)]
1555#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
1556pub struct ReceiveMessageResult {
1557    /// <p>A list of messages.</p>
1558    pub messages: Option<Vec<Message>>,
1559}
1560
1561#[allow(dead_code)]
1562struct ReceiveMessageResultDeserializer;
1563impl ReceiveMessageResultDeserializer {
1564    #[allow(dead_code, unused_variables)]
1565    fn deserialize<T: Peek + Next>(
1566        tag_name: &str,
1567        stack: &mut T,
1568    ) -> Result<ReceiveMessageResult, XmlParseError> {
1569        deserialize_elements::<_, ReceiveMessageResult, _>(tag_name, stack, |name, stack, obj| {
1570            match name {
1571                "Message" => {
1572                    obj.messages
1573                        .get_or_insert(vec![])
1574                        .extend(MessageListDeserializer::deserialize("Message", stack)?);
1575                }
1576                _ => skip_tree(stack),
1577            }
1578            Ok(())
1579        })
1580    }
1581}
1582/// <p><p/></p>
1583#[derive(Clone, Debug, Default, PartialEq)]
1584#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1585pub struct RemovePermissionRequest {
1586    /// <p>The identification of the permission to remove. This is the label added using the <code> <a>AddPermission</a> </code> action.</p>
1587    pub label: String,
1588    /// <p>The URL of the Amazon SQS queue from which permissions are removed.</p> <p>Queue URLs and names are case-sensitive.</p>
1589    pub queue_url: String,
1590}
1591
1592/// Serialize `RemovePermissionRequest` contents to a `SignedRequest`.
1593struct RemovePermissionRequestSerializer;
1594impl RemovePermissionRequestSerializer {
1595    fn serialize(params: &mut Params, name: &str, obj: &RemovePermissionRequest) {
1596        let mut prefix = name.to_string();
1597        if prefix != "" {
1598            prefix.push_str(".");
1599        }
1600
1601        params.put(&format!("{}{}", prefix, "Label"), &obj.label);
1602        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
1603    }
1604}
1605
1606/// <p><p/></p>
1607#[derive(Clone, Debug, Default, PartialEq)]
1608#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1609pub struct SendMessageBatchRequest {
1610    /// <p>A list of <code> <a>SendMessageBatchRequestEntry</a> </code> items.</p>
1611    pub entries: Vec<SendMessageBatchRequestEntry>,
1612    /// <p>The URL of the Amazon SQS queue to which batched messages are sent.</p> <p>Queue URLs and names are case-sensitive.</p>
1613    pub queue_url: String,
1614}
1615
1616/// Serialize `SendMessageBatchRequest` contents to a `SignedRequest`.
1617struct SendMessageBatchRequestSerializer;
1618impl SendMessageBatchRequestSerializer {
1619    fn serialize(params: &mut Params, name: &str, obj: &SendMessageBatchRequest) {
1620        let mut prefix = name.to_string();
1621        if prefix != "" {
1622            prefix.push_str(".");
1623        }
1624
1625        SendMessageBatchRequestEntryListSerializer::serialize(
1626            params,
1627            &format!("{}{}", prefix, "SendMessageBatchRequestEntry"),
1628            &obj.entries,
1629        );
1630        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
1631    }
1632}
1633
1634/// <p>Contains the details of a single Amazon SQS message along with an <code>Id</code>.</p>
1635#[derive(Clone, Debug, Default, PartialEq)]
1636#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1637pub struct SendMessageBatchRequestEntry {
1638    /// <p><p>The length of time, in seconds, for which a specific message is delayed. 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&#39;t specify a value, the default value for the queue is applied. </p> <note> <p>When you set <code>FifoQueue</code>, you can&#39;t set <code>DelaySeconds</code> per message. You can set this parameter only on a queue level.</p> </note></p>
1639    pub delay_seconds: Option<i64>,
1640    /// <p><p>An identifier for a message in this batch used to communicate the result.</p> <note> <p>The <code>Id</code>s of a batch request need to be unique within a request.</p> <p>This identifier can have up to 80 characters. The following characters are accepted: alphanumeric characters, hyphens(-), and underscores (_).</p> </note></p>
1641    pub id: String,
1642    /// <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-attributes.html">Amazon SQS Message Attributes</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p>
1643    pub message_attributes: Option<::std::collections::HashMap<String, MessageAttributeValue>>,
1644    /// <p>The body of the message.</p>
1645    pub message_body: String,
1646    /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p> <p>The token used for deduplication of messages within a 5-minute minimum deduplication interval. If a message with a particular <code>MessageDeduplicationId</code> is sent successfully, subsequent messages with the same <code>MessageDeduplicationId</code> are accepted successfully but aren't delivered. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing"> Exactly-Once Processing</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <ul> <li> <p>Every message must have a unique <code>MessageDeduplicationId</code>,</p> <ul> <li> <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p> </li> <li> <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> <li> <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> <li> <p>If the queue has <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p> </li> </ul> </li> <li> <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> <li> <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> </ul> <note> <p>The <code>MessageDeduplicationId</code> is available to the consumer of the message (this can be useful for troubleshooting delivery issues).</p> <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> <p>Amazon SQS continues to keep track of the message deduplication ID even after the message is received and deleted.</p> </note> <p>The 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>!"#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~</code>).</p> <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 Simple Queue Service Developer Guide</i>.</p>
1647    pub message_deduplication_id: Option<String>,
1648    /// <p><p>This parameter applies only to FIFO (first-in-first-out) queues.</p> <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> <ul> <li> <p>You must associate a non-empty <code>MessageGroupId</code> with a message. If you don&#39;t provide a <code>MessageGroupId</code>, the action fails.</p> </li> <li> <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&#39;t specify a <code>MessageGroupId</code>.</p> </li> </ul> <p>The length of <code>MessageGroupId</code> is 128 characters. Valid values: alphanumeric characters and punctuation <code>(!&quot;#$%&amp;&#39;()*+,-./:;&lt;=&gt;?@[]^_`{|}~)</code>.</p> <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 Simple Queue Service Developer Guide</i>.</p> <important> <p> <code>MessageGroupId</code> is required for FIFO queues. You can&#39;t use it for Standard queues.</p> </important></p>
1649    pub message_group_id: Option<String>,
1650    /// <p><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> <ul> <li> <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 AWS X-Ray trace header string.</p> </li> <li> <p>The size of a message system attribute doesn&#39;t count towards the total size of a message.</p> </li> </ul> </important></p>
1651    pub message_system_attributes:
1652        Option<::std::collections::HashMap<String, MessageSystemAttributeValue>>,
1653}
1654
1655/// Serialize `SendMessageBatchRequestEntry` contents to a `SignedRequest`.
1656struct SendMessageBatchRequestEntrySerializer;
1657impl SendMessageBatchRequestEntrySerializer {
1658    fn serialize(params: &mut Params, name: &str, obj: &SendMessageBatchRequestEntry) {
1659        let mut prefix = name.to_string();
1660        if prefix != "" {
1661            prefix.push_str(".");
1662        }
1663
1664        if let Some(ref field_value) = obj.delay_seconds {
1665            params.put(&format!("{}{}", prefix, "DelaySeconds"), &field_value);
1666        }
1667        params.put(&format!("{}{}", prefix, "Id"), &obj.id);
1668        if let Some(ref field_value) = obj.message_attributes {
1669            MessageBodyAttributeMapSerializer::serialize(
1670                params,
1671                &format!("{}{}", prefix, "MessageAttribute"),
1672                field_value,
1673            );
1674        }
1675        params.put(&format!("{}{}", prefix, "MessageBody"), &obj.message_body);
1676        if let Some(ref field_value) = obj.message_deduplication_id {
1677            params.put(
1678                &format!("{}{}", prefix, "MessageDeduplicationId"),
1679                &field_value,
1680            );
1681        }
1682        if let Some(ref field_value) = obj.message_group_id {
1683            params.put(&format!("{}{}", prefix, "MessageGroupId"), &field_value);
1684        }
1685        if let Some(ref field_value) = obj.message_system_attributes {
1686            MessageBodySystemAttributeMapSerializer::serialize(
1687                params,
1688                &format!("{}{}", prefix, "MessageSystemAttribute"),
1689                field_value,
1690            );
1691        }
1692    }
1693}
1694
1695/// Serialize `SendMessageBatchRequestEntryList` contents to a `SignedRequest`.
1696struct SendMessageBatchRequestEntryListSerializer;
1697impl SendMessageBatchRequestEntryListSerializer {
1698    fn serialize(params: &mut Params, name: &str, obj: &Vec<SendMessageBatchRequestEntry>) {
1699        for (index, obj) in obj.iter().enumerate() {
1700            let key = format!("{}.{}", name, index + 1);
1701            SendMessageBatchRequestEntrySerializer::serialize(params, &key, obj);
1702        }
1703    }
1704}
1705
1706/// <p>For each message in the batch, the response contains a <code> <a>SendMessageBatchResultEntry</a> </code> tag if the message succeeds or a <code> <a>BatchResultErrorEntry</a> </code> tag if the message fails.</p>
1707#[derive(Clone, Debug, Default, PartialEq)]
1708#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
1709pub struct SendMessageBatchResult {
1710    /// <p>A list of <code> <a>BatchResultErrorEntry</a> </code> items with error details about each message that can't be enqueued.</p>
1711    pub failed: Vec<BatchResultErrorEntry>,
1712    /// <p>A list of <code> <a>SendMessageBatchResultEntry</a> </code> items.</p>
1713    pub successful: Vec<SendMessageBatchResultEntry>,
1714}
1715
1716#[allow(dead_code)]
1717struct SendMessageBatchResultDeserializer;
1718impl SendMessageBatchResultDeserializer {
1719    #[allow(dead_code, unused_variables)]
1720    fn deserialize<T: Peek + Next>(
1721        tag_name: &str,
1722        stack: &mut T,
1723    ) -> Result<SendMessageBatchResult, XmlParseError> {
1724        deserialize_elements::<_, SendMessageBatchResult, _>(tag_name, stack, |name, stack, obj| {
1725            match name {
1726                "BatchResultErrorEntry" => {
1727                    obj.failed
1728                        .extend(BatchResultErrorEntryListDeserializer::deserialize(
1729                            "BatchResultErrorEntry",
1730                            stack,
1731                        )?);
1732                }
1733                "SendMessageBatchResultEntry" => {
1734                    obj.successful.extend(
1735                        SendMessageBatchResultEntryListDeserializer::deserialize(
1736                            "SendMessageBatchResultEntry",
1737                            stack,
1738                        )?,
1739                    );
1740                }
1741                _ => skip_tree(stack),
1742            }
1743            Ok(())
1744        })
1745    }
1746}
1747/// <p>Encloses a <code>MessageId</code> for a successfully-enqueued message in a <code> <a>SendMessageBatch</a>.</code> </p>
1748#[derive(Clone, Debug, Default, PartialEq)]
1749#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
1750pub struct SendMessageBatchResultEntry {
1751    /// <p>An identifier for the message in this batch.</p>
1752    pub id: String,
1753    /// <p>An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p>
1754    pub md5_of_message_attributes: Option<String>,
1755    /// <p>An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p>
1756    pub md5_of_message_body: String,
1757    /// <p>An MD5 digest of the non-URL-encoded message system attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p>
1758    pub md5_of_message_system_attributes: Option<String>,
1759    /// <p>An identifier for the message.</p>
1760    pub message_id: String,
1761    /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p> <p>The large, non-consecutive number that Amazon SQS assigns to each message.</p> <p>The length of <code>SequenceNumber</code> is 128 bits. As <code>SequenceNumber</code> continues to increase for a particular <code>MessageGroupId</code>.</p>
1762    pub sequence_number: Option<String>,
1763}
1764
1765#[allow(dead_code)]
1766struct SendMessageBatchResultEntryDeserializer;
1767impl SendMessageBatchResultEntryDeserializer {
1768    #[allow(dead_code, unused_variables)]
1769    fn deserialize<T: Peek + Next>(
1770        tag_name: &str,
1771        stack: &mut T,
1772    ) -> Result<SendMessageBatchResultEntry, XmlParseError> {
1773        deserialize_elements::<_, SendMessageBatchResultEntry, _>(
1774            tag_name,
1775            stack,
1776            |name, stack, obj| {
1777                match name {
1778                    "Id" => {
1779                        obj.id = StringDeserializer::deserialize("Id", stack)?;
1780                    }
1781                    "MD5OfMessageAttributes" => {
1782                        obj.md5_of_message_attributes = Some(StringDeserializer::deserialize(
1783                            "MD5OfMessageAttributes",
1784                            stack,
1785                        )?);
1786                    }
1787                    "MD5OfMessageBody" => {
1788                        obj.md5_of_message_body =
1789                            StringDeserializer::deserialize("MD5OfMessageBody", stack)?;
1790                    }
1791                    "MD5OfMessageSystemAttributes" => {
1792                        obj.md5_of_message_system_attributes = Some(
1793                            StringDeserializer::deserialize("MD5OfMessageSystemAttributes", stack)?,
1794                        );
1795                    }
1796                    "MessageId" => {
1797                        obj.message_id = StringDeserializer::deserialize("MessageId", stack)?;
1798                    }
1799                    "SequenceNumber" => {
1800                        obj.sequence_number =
1801                            Some(StringDeserializer::deserialize("SequenceNumber", stack)?);
1802                    }
1803                    _ => skip_tree(stack),
1804                }
1805                Ok(())
1806            },
1807        )
1808    }
1809}
1810#[allow(dead_code)]
1811struct SendMessageBatchResultEntryListDeserializer;
1812impl SendMessageBatchResultEntryListDeserializer {
1813    #[allow(dead_code, unused_variables)]
1814    fn deserialize<T: Peek + Next>(
1815        tag_name: &str,
1816        stack: &mut T,
1817    ) -> Result<Vec<SendMessageBatchResultEntry>, XmlParseError> {
1818        let mut obj = vec![];
1819
1820        loop {
1821            let consume_next_tag = match stack.peek() {
1822                Some(&Ok(xml::reader::XmlEvent::StartElement { ref name, .. })) => {
1823                    name.local_name == tag_name
1824                }
1825                _ => false,
1826            };
1827
1828            if consume_next_tag {
1829                obj.push(SendMessageBatchResultEntryDeserializer::deserialize(
1830                    tag_name, stack,
1831                )?);
1832            } else {
1833                break;
1834            }
1835        }
1836
1837        Ok(obj)
1838    }
1839}
1840/// <p><p/></p>
1841#[derive(Clone, Debug, Default, PartialEq)]
1842#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1843pub struct SendMessageRequest {
1844    /// <p><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&#39;t specify a value, the default value for the queue applies. </p> <note> <p>When you set <code>FifoQueue</code>, you can&#39;t set <code>DelaySeconds</code> per message. You can set this parameter only on a queue level.</p> </note></p>
1845    pub delay_seconds: Option<i64>,
1846    /// <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-attributes.html">Amazon SQS Message Attributes</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p>
1847    pub message_attributes: Option<::std::collections::HashMap<String, MessageAttributeValue>>,
1848    /// <p><p>The message to send. The maximum string size is 256 KB.</p> <important> <p>A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed:</p> <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> <p>Any characters not included in this list will be rejected. For more information, see the <a href="http://www.w3.org/TR/REC-xml/#charsets">W3C specification for characters</a>.</p> </important></p>
1849    pub message_body: String,
1850    /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p> <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.html#FIFO-queues-exactly-once-processing"> Exactly-Once Processing</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <ul> <li> <p>Every message must have a unique <code>MessageDeduplicationId</code>,</p> <ul> <li> <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p> </li> <li> <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> <li> <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> <li> <p>If the queue has <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p> </li> </ul> </li> <li> <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> <li> <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> </ul> <note> <p>The <code>MessageDeduplicationId</code> is available to the consumer of the message (this can be useful for troubleshooting delivery issues).</p> <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> <p>Amazon SQS continues to keep track of the message deduplication ID even after the message is received and deleted.</p> </note> <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>!"#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~</code>).</p> <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 Simple Queue Service Developer Guide</i>.</p>
1851    pub message_deduplication_id: Option<String>,
1852    /// <p><p>This parameter applies only to FIFO (first-in-first-out) queues.</p> <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> <ul> <li> <p>You must associate a non-empty <code>MessageGroupId</code> with a message. If you don&#39;t provide a <code>MessageGroupId</code>, the action fails.</p> </li> <li> <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&#39;t specify a <code>MessageGroupId</code>.</p> </li> </ul> <p>The length of <code>MessageGroupId</code> is 128 characters. Valid values: alphanumeric characters and punctuation <code>(!&quot;#$%&amp;&#39;()*+,-./:;&lt;=&gt;?@[]^_`{|}~)</code>.</p> <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 Simple Queue Service Developer Guide</i>.</p> <important> <p> <code>MessageGroupId</code> is required for FIFO queues. You can&#39;t use it for Standard queues.</p> </important></p>
1853    pub message_group_id: Option<String>,
1854    /// <p><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> <ul> <li> <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 AWS X-Ray trace header string.</p> </li> <li> <p>The size of a message system attribute doesn&#39;t count towards the total size of a message.</p> </li> </ul> </important></p>
1855    pub message_system_attributes:
1856        Option<::std::collections::HashMap<String, MessageSystemAttributeValue>>,
1857    /// <p>The URL of the Amazon SQS queue to which a message is sent.</p> <p>Queue URLs and names are case-sensitive.</p>
1858    pub queue_url: String,
1859}
1860
1861/// Serialize `SendMessageRequest` contents to a `SignedRequest`.
1862struct SendMessageRequestSerializer;
1863impl SendMessageRequestSerializer {
1864    fn serialize(params: &mut Params, name: &str, obj: &SendMessageRequest) {
1865        let mut prefix = name.to_string();
1866        if prefix != "" {
1867            prefix.push_str(".");
1868        }
1869
1870        if let Some(ref field_value) = obj.delay_seconds {
1871            params.put(&format!("{}{}", prefix, "DelaySeconds"), &field_value);
1872        }
1873        if let Some(ref field_value) = obj.message_attributes {
1874            MessageBodyAttributeMapSerializer::serialize(
1875                params,
1876                &format!("{}{}", prefix, "MessageAttribute"),
1877                field_value,
1878            );
1879        }
1880        params.put(&format!("{}{}", prefix, "MessageBody"), &obj.message_body);
1881        if let Some(ref field_value) = obj.message_deduplication_id {
1882            params.put(
1883                &format!("{}{}", prefix, "MessageDeduplicationId"),
1884                &field_value,
1885            );
1886        }
1887        if let Some(ref field_value) = obj.message_group_id {
1888            params.put(&format!("{}{}", prefix, "MessageGroupId"), &field_value);
1889        }
1890        if let Some(ref field_value) = obj.message_system_attributes {
1891            MessageBodySystemAttributeMapSerializer::serialize(
1892                params,
1893                &format!("{}{}", prefix, "MessageSystemAttribute"),
1894                field_value,
1895            );
1896        }
1897        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
1898    }
1899}
1900
1901/// <p>The <code>MD5OfMessageBody</code> and <code>MessageId</code> elements.</p>
1902#[derive(Clone, Debug, Default, PartialEq)]
1903#[cfg_attr(feature = "serialize_structs", derive(Serialize))]
1904pub struct SendMessageResult {
1905    /// <p>An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p>
1906    pub md5_of_message_attributes: Option<String>,
1907    /// <p>An MD5 digest of the non-URL-encoded message attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p>
1908    pub md5_of_message_body: Option<String>,
1909    /// <p>An MD5 digest of the non-URL-encoded message system attribute string. You can use this attribute to verify that Amazon SQS received the message correctly. Amazon SQS URL-decodes the message before creating the MD5 digest.</p>
1910    pub md5_of_message_system_attributes: Option<String>,
1911    /// <p>An attribute containing the <code>MessageId</code> of the message sent to the queue. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html">Queue and Message Identifiers</a> in the <i>Amazon Simple Queue Service Developer Guide</i>. </p>
1912    pub message_id: Option<String>,
1913    /// <p>This parameter applies only to FIFO (first-in-first-out) queues.</p> <p>The large, non-consecutive number that Amazon SQS assigns to each message.</p> <p>The length of <code>SequenceNumber</code> is 128 bits. <code>SequenceNumber</code> continues to increase for a particular <code>MessageGroupId</code>.</p>
1914    pub sequence_number: Option<String>,
1915}
1916
1917#[allow(dead_code)]
1918struct SendMessageResultDeserializer;
1919impl SendMessageResultDeserializer {
1920    #[allow(dead_code, unused_variables)]
1921    fn deserialize<T: Peek + Next>(
1922        tag_name: &str,
1923        stack: &mut T,
1924    ) -> Result<SendMessageResult, XmlParseError> {
1925        deserialize_elements::<_, SendMessageResult, _>(tag_name, stack, |name, stack, obj| {
1926            match name {
1927                "MD5OfMessageAttributes" => {
1928                    obj.md5_of_message_attributes = Some(StringDeserializer::deserialize(
1929                        "MD5OfMessageAttributes",
1930                        stack,
1931                    )?);
1932                }
1933                "MD5OfMessageBody" => {
1934                    obj.md5_of_message_body =
1935                        Some(StringDeserializer::deserialize("MD5OfMessageBody", stack)?);
1936                }
1937                "MD5OfMessageSystemAttributes" => {
1938                    obj.md5_of_message_system_attributes = Some(StringDeserializer::deserialize(
1939                        "MD5OfMessageSystemAttributes",
1940                        stack,
1941                    )?);
1942                }
1943                "MessageId" => {
1944                    obj.message_id = Some(StringDeserializer::deserialize("MessageId", stack)?);
1945                }
1946                "SequenceNumber" => {
1947                    obj.sequence_number =
1948                        Some(StringDeserializer::deserialize("SequenceNumber", stack)?);
1949                }
1950                _ => skip_tree(stack),
1951            }
1952            Ok(())
1953        })
1954    }
1955}
1956/// <p><p/></p>
1957#[derive(Clone, Debug, Default, PartialEq)]
1958#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1959pub struct SetQueueAttributesRequest {
1960    /// <p><p>A map of attributes to set.</p> <p>The following lists the names, descriptions, and values of the special request parameters that the <code>SetQueueAttributes</code> action uses:</p> <ul> <li> <p> <code>DelaySeconds</code> – The length of time, in seconds, for which the delivery of all messages in the queue is delayed. Valid values: An integer from 0 to 900 (15 minutes). Default: 0. </p> </li> <li> <p> <code>MaximumMessageSize</code> – The limit of how many bytes a message can contain before Amazon SQS rejects it. Valid values: An integer from 1,024 bytes (1 KiB) up to 262,144 bytes (256 KiB). Default: 262,144 (256 KiB). </p> </li> <li> <p> <code>MessageRetentionPeriod</code> – The length of time, in seconds, for which Amazon SQS retains a message. Valid values: An integer representing seconds, from 60 (1 minute) to 1,209,600 (14 days). Default: 345,600 (4 days). </p> </li> <li> <p> <code>Policy</code> – The queue&#39;s policy. A valid AWS policy. For more information about policy structure, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/PoliciesOverview.html">Overview of AWS IAM Policies</a> in the <i>Amazon IAM User Guide</i>. </p> </li> <li> <p> <code>ReceiveMessageWaitTimeSeconds</code> – The length of time, in seconds, for which a <code> <a>ReceiveMessage</a> </code> action waits for a message to arrive. Valid values: An integer from 0 to 20 (seconds). Default: 0. </p> </li> <li> <p> <code>RedrivePolicy</code> – The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object. For more information about the redrive policy and dead-letter queues, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html">Using Amazon SQS Dead-Letter Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <ul> <li> <p> <code>deadLetterTargetArn</code> – The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon SQS moves messages after the value of <code>maxReceiveCount</code> is exceeded.</p> </li> <li> <p> <code>maxReceiveCount</code> – The number of times a message is delivered to the source queue before being moved to the dead-letter queue. When the <code>ReceiveCount</code> for a message exceeds the <code>maxReceiveCount</code> for a queue, Amazon SQS moves the message to the dead-letter-queue.</p> </li> </ul> <note> <p>The dead-letter queue of a FIFO queue must also be a FIFO queue. Similarly, the dead-letter queue of a standard queue must also be a standard queue.</p> </note> </li> <li> <p> <code>VisibilityTimeout</code> – The visibility timeout for the queue, in seconds. Valid values: An integer from 0 to 43,200 (12 hours). Default: 30. For more information about the visibility timeout, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-visibility-timeout.html">Visibility Timeout</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </li> </ul> <p>The following attributes apply only to <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html">server-side-encryption</a>:</p> <ul> <li> <p> <code>KmsMasterKeyId</code> – The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom CMK. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-sse-key-terms">Key Terms</a>. While the alias of the AWS-managed CMK for Amazon SQS is always <code>alias/aws/sqs</code>, the alias of a custom CMK can, for example, be <code>alias/<i>MyAlias</i> </code>. For more examples, see <a href="https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters">KeyId</a> in the <i>AWS Key Management Service API Reference</i>. </p> </li> <li> <p> <code>KmsDataKeyReusePeriodSeconds</code> – The length of time, in seconds, for which Amazon SQS can reuse a <a href="https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys">data key</a> to encrypt or decrypt messages before calling AWS KMS again. An integer representing seconds, between 60 seconds (1 minute) and 86,400 seconds (24 hours). Default: 300 (5 minutes). A shorter time period provides better security but results in more calls to KMS which might incur charges after Free Tier. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-server-side-encryption.html#sqs-how-does-the-data-key-reuse-period-work">How Does the Data Key Reuse Period Work?</a>. </p> </li> </ul> <p>The following attribute applies only to <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html">FIFO (first-in-first-out) queues</a>:</p> <ul> <li> <p> <code>ContentBasedDeduplication</code> – Enables content-based deduplication. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing">Exactly-Once Processing</a> in the <i>Amazon Simple Queue Service Developer Guide</i>. </p> <ul> <li> <p>Every message must have a unique <code>MessageDeduplicationId</code>,</p> <ul> <li> <p>You may provide a <code>MessageDeduplicationId</code> explicitly.</p> </li> <li> <p>If you aren&#39;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> <li> <p>If you don&#39;t provide a <code>MessageDeduplicationId</code> and the queue doesn&#39;t have <code>ContentBasedDeduplication</code> set, the action fails with an error.</p> </li> <li> <p>If the queue has <code>ContentBasedDeduplication</code> set, your <code>MessageDeduplicationId</code> overrides the generated one.</p> </li> </ul> </li> <li> <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> <li> <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> </ul> </li> </ul></p>
1961    pub attributes: ::std::collections::HashMap<String, String>,
1962    /// <p>The URL of the Amazon SQS queue whose attributes are set.</p> <p>Queue URLs and names are case-sensitive.</p>
1963    pub queue_url: String,
1964}
1965
1966/// Serialize `SetQueueAttributesRequest` contents to a `SignedRequest`.
1967struct SetQueueAttributesRequestSerializer;
1968impl SetQueueAttributesRequestSerializer {
1969    fn serialize(params: &mut Params, name: &str, obj: &SetQueueAttributesRequest) {
1970        let mut prefix = name.to_string();
1971        if prefix != "" {
1972            prefix.push_str(".");
1973        }
1974
1975        QueueAttributeMapSerializer::serialize(
1976            params,
1977            &format!("{}{}", prefix, "Attribute"),
1978            &obj.attributes,
1979        );
1980        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
1981    }
1982}
1983
1984#[allow(dead_code)]
1985struct StringDeserializer;
1986impl StringDeserializer {
1987    #[allow(dead_code, unused_variables)]
1988    fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
1989        xml_util::deserialize_primitive(tag_name, stack, Ok)
1990    }
1991}
1992#[allow(dead_code)]
1993struct StringListDeserializer;
1994impl StringListDeserializer {
1995    #[allow(dead_code, unused_variables)]
1996    fn deserialize<T: Peek + Next>(
1997        tag_name: &str,
1998        stack: &mut T,
1999    ) -> Result<Vec<String>, XmlParseError> {
2000        deserialize_elements::<_, Vec<_>, _>(tag_name, stack, |name, stack, obj| {
2001            if name == "StringListValue" {
2002                obj.push(StringDeserializer::deserialize("StringListValue", stack)?);
2003            } else {
2004                skip_tree(stack);
2005            }
2006            Ok(())
2007        })
2008    }
2009}
2010
2011/// Serialize `StringList` contents to a `SignedRequest`.
2012struct StringListSerializer;
2013impl StringListSerializer {
2014    fn serialize(params: &mut Params, name: &str, obj: &Vec<String>) {
2015        for (index, obj) in obj.iter().enumerate() {
2016            let key = format!("{}.member.{}", name, index + 1);
2017            params.put(&key, &obj);
2018        }
2019    }
2020}
2021
2022#[allow(dead_code)]
2023struct TagKeyDeserializer;
2024impl TagKeyDeserializer {
2025    #[allow(dead_code, unused_variables)]
2026    fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
2027        xml_util::deserialize_primitive(tag_name, stack, Ok)
2028    }
2029}
2030
2031/// Serialize `TagKeyList` contents to a `SignedRequest`.
2032struct TagKeyListSerializer;
2033impl TagKeyListSerializer {
2034    fn serialize(params: &mut Params, name: &str, obj: &Vec<String>) {
2035        for (index, obj) in obj.iter().enumerate() {
2036            let key = format!("{}.{}", name, index + 1);
2037            params.put(&key, &obj);
2038        }
2039    }
2040}
2041
2042#[allow(dead_code)]
2043struct TagMapDeserializer;
2044impl TagMapDeserializer {
2045    #[allow(dead_code, unused_variables)]
2046    fn deserialize<T: Peek + Next>(
2047        tag_name: &str,
2048        stack: &mut T,
2049    ) -> Result<::std::collections::HashMap<String, String>, XmlParseError> {
2050        let mut obj = ::std::collections::HashMap::new();
2051
2052        while xml_util::peek_at_name(stack)? == "Tag" {
2053            xml_util::start_element("Tag", stack)?;
2054            let key = TagKeyDeserializer::deserialize("Key", stack)?;
2055            let value = TagValueDeserializer::deserialize("Value", stack)?;
2056            obj.insert(key, value);
2057            xml_util::end_element("Tag", stack)?;
2058        }
2059
2060        Ok(obj)
2061    }
2062}
2063
2064/// Serialize `TagMap` contents to a `SignedRequest`.
2065struct TagMapSerializer;
2066impl TagMapSerializer {
2067    fn serialize(
2068        params: &mut Params,
2069        name: &str,
2070        obj: &::std::collections::HashMap<String, String>,
2071    ) {
2072        for (index, (key, value)) in obj.iter().enumerate() {
2073            let prefix = format!("{}.{}", name, index + 1);
2074            params.put(&format!("{}.{}", prefix, "Key"), &key);
2075            params.put(&format!("{}.{}", prefix, "Value"), &value);
2076        }
2077    }
2078}
2079
2080#[derive(Clone, Debug, Default, PartialEq)]
2081#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
2082pub struct TagQueueRequest {
2083    /// <p>The URL of the queue.</p>
2084    pub queue_url: String,
2085    /// <p>The list of tags to be added to the specified queue.</p>
2086    pub tags: ::std::collections::HashMap<String, String>,
2087}
2088
2089/// Serialize `TagQueueRequest` contents to a `SignedRequest`.
2090struct TagQueueRequestSerializer;
2091impl TagQueueRequestSerializer {
2092    fn serialize(params: &mut Params, name: &str, obj: &TagQueueRequest) {
2093        let mut prefix = name.to_string();
2094        if prefix != "" {
2095            prefix.push_str(".");
2096        }
2097
2098        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
2099        TagMapSerializer::serialize(params, &format!("{}{}", prefix, "Tags"), &obj.tags);
2100    }
2101}
2102
2103#[allow(dead_code)]
2104struct TagValueDeserializer;
2105impl TagValueDeserializer {
2106    #[allow(dead_code, unused_variables)]
2107    fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
2108        xml_util::deserialize_primitive(tag_name, stack, Ok)
2109    }
2110}
2111#[allow(dead_code)]
2112struct TokenDeserializer;
2113impl TokenDeserializer {
2114    #[allow(dead_code, unused_variables)]
2115    fn deserialize<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<String, XmlParseError> {
2116        xml_util::deserialize_primitive(tag_name, stack, Ok)
2117    }
2118}
2119#[derive(Clone, Debug, Default, PartialEq)]
2120#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
2121pub struct UntagQueueRequest {
2122    /// <p>The URL of the queue.</p>
2123    pub queue_url: String,
2124    /// <p>The list of tags to be removed from the specified queue.</p>
2125    pub tag_keys: Vec<String>,
2126}
2127
2128/// Serialize `UntagQueueRequest` contents to a `SignedRequest`.
2129struct UntagQueueRequestSerializer;
2130impl UntagQueueRequestSerializer {
2131    fn serialize(params: &mut Params, name: &str, obj: &UntagQueueRequest) {
2132        let mut prefix = name.to_string();
2133        if prefix != "" {
2134            prefix.push_str(".");
2135        }
2136
2137        params.put(&format!("{}{}", prefix, "QueueUrl"), &obj.queue_url);
2138        TagKeyListSerializer::serialize(params, &format!("{}{}", prefix, "TagKey"), &obj.tag_keys);
2139    }
2140}
2141
2142/// Errors returned by AddPermission
2143#[derive(Debug, PartialEq)]
2144pub enum AddPermissionError {
2145    /// <p>The specified action violates a limit. For example, <code>ReceiveMessage</code> returns this error if the maximum number of inflight messages is reached and <code>AddPermission</code> returns this error if the maximum number of permissions for the queue is reached.</p>
2146    OverLimit(String),
2147}
2148
2149impl AddPermissionError {
2150    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AddPermissionError> {
2151        {
2152            let reader = EventReader::new(res.body.as_ref());
2153            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2154            find_start_element(&mut stack);
2155            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2156                match &parsed_error.code[..] {
2157                    "OverLimit" => {
2158                        return RusotoError::Service(AddPermissionError::OverLimit(
2159                            parsed_error.message,
2160                        ))
2161                    }
2162                    _ => {}
2163                }
2164            }
2165        }
2166        RusotoError::Unknown(res)
2167    }
2168
2169    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2170    where
2171        T: Peek + Next,
2172    {
2173        xml_util::start_element("ErrorResponse", stack)?;
2174        XmlErrorDeserializer::deserialize("Error", stack)
2175    }
2176}
2177impl fmt::Display for AddPermissionError {
2178    #[allow(unused_variables)]
2179    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2180        match *self {
2181            AddPermissionError::OverLimit(ref cause) => write!(f, "{}", cause),
2182        }
2183    }
2184}
2185impl Error for AddPermissionError {}
2186/// Errors returned by ChangeMessageVisibility
2187#[derive(Debug, PartialEq)]
2188pub enum ChangeMessageVisibilityError {
2189    /// <p>The specified message isn't in flight.</p>
2190    MessageNotInflight(String),
2191    /// <p>The specified receipt handle isn't valid.</p>
2192    ReceiptHandleIsInvalid(String),
2193}
2194
2195impl ChangeMessageVisibilityError {
2196    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ChangeMessageVisibilityError> {
2197        {
2198            let reader = EventReader::new(res.body.as_ref());
2199            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2200            find_start_element(&mut stack);
2201            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2202                match &parsed_error.code[..] {
2203                    "AWS.SimpleQueueService.MessageNotInflight" => {
2204                        return RusotoError::Service(
2205                            ChangeMessageVisibilityError::MessageNotInflight(parsed_error.message),
2206                        )
2207                    }
2208                    "ReceiptHandleIsInvalid" => {
2209                        return RusotoError::Service(
2210                            ChangeMessageVisibilityError::ReceiptHandleIsInvalid(
2211                                parsed_error.message,
2212                            ),
2213                        )
2214                    }
2215                    _ => {}
2216                }
2217            }
2218        }
2219        RusotoError::Unknown(res)
2220    }
2221
2222    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2223    where
2224        T: Peek + Next,
2225    {
2226        xml_util::start_element("ErrorResponse", stack)?;
2227        XmlErrorDeserializer::deserialize("Error", stack)
2228    }
2229}
2230impl fmt::Display for ChangeMessageVisibilityError {
2231    #[allow(unused_variables)]
2232    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2233        match *self {
2234            ChangeMessageVisibilityError::MessageNotInflight(ref cause) => write!(f, "{}", cause),
2235            ChangeMessageVisibilityError::ReceiptHandleIsInvalid(ref cause) => {
2236                write!(f, "{}", cause)
2237            }
2238        }
2239    }
2240}
2241impl Error for ChangeMessageVisibilityError {}
2242/// Errors returned by ChangeMessageVisibilityBatch
2243#[derive(Debug, PartialEq)]
2244pub enum ChangeMessageVisibilityBatchError {
2245    /// <p>Two or more batch entries in the request have the same <code>Id</code>.</p>
2246    BatchEntryIdsNotDistinct(String),
2247    /// <p>The batch request doesn't contain any entries.</p>
2248    EmptyBatchRequest(String),
2249    /// <p>The <code>Id</code> of a batch entry in a batch request doesn't abide by the specification.</p>
2250    InvalidBatchEntryId(String),
2251    /// <p>The batch request contains more entries than permissible.</p>
2252    TooManyEntriesInBatchRequest(String),
2253}
2254
2255impl ChangeMessageVisibilityBatchError {
2256    pub fn from_response(
2257        res: BufferedHttpResponse,
2258    ) -> RusotoError<ChangeMessageVisibilityBatchError> {
2259        {
2260            let reader = EventReader::new(res.body.as_ref());
2261            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2262            find_start_element(&mut stack);
2263            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2264                match &parsed_error.code[..] {
2265                    "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" => {
2266                        return RusotoError::Service(
2267                            ChangeMessageVisibilityBatchError::BatchEntryIdsNotDistinct(
2268                                parsed_error.message,
2269                            ),
2270                        )
2271                    }
2272                    "AWS.SimpleQueueService.EmptyBatchRequest" => {
2273                        return RusotoError::Service(
2274                            ChangeMessageVisibilityBatchError::EmptyBatchRequest(
2275                                parsed_error.message,
2276                            ),
2277                        )
2278                    }
2279                    "AWS.SimpleQueueService.InvalidBatchEntryId" => {
2280                        return RusotoError::Service(
2281                            ChangeMessageVisibilityBatchError::InvalidBatchEntryId(
2282                                parsed_error.message,
2283                            ),
2284                        )
2285                    }
2286                    "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" => {
2287                        return RusotoError::Service(
2288                            ChangeMessageVisibilityBatchError::TooManyEntriesInBatchRequest(
2289                                parsed_error.message,
2290                            ),
2291                        )
2292                    }
2293                    _ => {}
2294                }
2295            }
2296        }
2297        RusotoError::Unknown(res)
2298    }
2299
2300    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2301    where
2302        T: Peek + Next,
2303    {
2304        xml_util::start_element("ErrorResponse", stack)?;
2305        XmlErrorDeserializer::deserialize("Error", stack)
2306    }
2307}
2308impl fmt::Display for ChangeMessageVisibilityBatchError {
2309    #[allow(unused_variables)]
2310    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2311        match *self {
2312            ChangeMessageVisibilityBatchError::BatchEntryIdsNotDistinct(ref cause) => {
2313                write!(f, "{}", cause)
2314            }
2315            ChangeMessageVisibilityBatchError::EmptyBatchRequest(ref cause) => {
2316                write!(f, "{}", cause)
2317            }
2318            ChangeMessageVisibilityBatchError::InvalidBatchEntryId(ref cause) => {
2319                write!(f, "{}", cause)
2320            }
2321            ChangeMessageVisibilityBatchError::TooManyEntriesInBatchRequest(ref cause) => {
2322                write!(f, "{}", cause)
2323            }
2324        }
2325    }
2326}
2327impl Error for ChangeMessageVisibilityBatchError {}
2328/// Errors returned by CreateQueue
2329#[derive(Debug, PartialEq)]
2330pub enum CreateQueueError {
2331    /// <p>You must wait 60 seconds after deleting a queue before you can create another queue with the same name.</p>
2332    QueueDeletedRecently(String),
2333    /// <p>A queue with this name already exists. Amazon SQS returns this error only if the request includes attributes whose values differ from those of the existing queue.</p>
2334    QueueNameExists(String),
2335}
2336
2337impl CreateQueueError {
2338    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateQueueError> {
2339        {
2340            let reader = EventReader::new(res.body.as_ref());
2341            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2342            find_start_element(&mut stack);
2343            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2344                match &parsed_error.code[..] {
2345                    "AWS.SimpleQueueService.QueueDeletedRecently" => {
2346                        return RusotoError::Service(CreateQueueError::QueueDeletedRecently(
2347                            parsed_error.message,
2348                        ))
2349                    }
2350                    "QueueAlreadyExists" => {
2351                        return RusotoError::Service(CreateQueueError::QueueNameExists(
2352                            parsed_error.message,
2353                        ))
2354                    }
2355                    _ => {}
2356                }
2357            }
2358        }
2359        RusotoError::Unknown(res)
2360    }
2361
2362    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2363    where
2364        T: Peek + Next,
2365    {
2366        xml_util::start_element("ErrorResponse", stack)?;
2367        XmlErrorDeserializer::deserialize("Error", stack)
2368    }
2369}
2370impl fmt::Display for CreateQueueError {
2371    #[allow(unused_variables)]
2372    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2373        match *self {
2374            CreateQueueError::QueueDeletedRecently(ref cause) => write!(f, "{}", cause),
2375            CreateQueueError::QueueNameExists(ref cause) => write!(f, "{}", cause),
2376        }
2377    }
2378}
2379impl Error for CreateQueueError {}
2380/// Errors returned by DeleteMessage
2381#[derive(Debug, PartialEq)]
2382pub enum DeleteMessageError {
2383    /// <p>The specified receipt handle isn't valid for the current version.</p>
2384    InvalidIdFormat(String),
2385    /// <p>The specified receipt handle isn't valid.</p>
2386    ReceiptHandleIsInvalid(String),
2387}
2388
2389impl DeleteMessageError {
2390    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteMessageError> {
2391        {
2392            let reader = EventReader::new(res.body.as_ref());
2393            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2394            find_start_element(&mut stack);
2395            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2396                match &parsed_error.code[..] {
2397                    "InvalidIdFormat" => {
2398                        return RusotoError::Service(DeleteMessageError::InvalidIdFormat(
2399                            parsed_error.message,
2400                        ))
2401                    }
2402                    "ReceiptHandleIsInvalid" => {
2403                        return RusotoError::Service(DeleteMessageError::ReceiptHandleIsInvalid(
2404                            parsed_error.message,
2405                        ))
2406                    }
2407                    _ => {}
2408                }
2409            }
2410        }
2411        RusotoError::Unknown(res)
2412    }
2413
2414    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2415    where
2416        T: Peek + Next,
2417    {
2418        xml_util::start_element("ErrorResponse", stack)?;
2419        XmlErrorDeserializer::deserialize("Error", stack)
2420    }
2421}
2422impl fmt::Display for DeleteMessageError {
2423    #[allow(unused_variables)]
2424    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2425        match *self {
2426            DeleteMessageError::InvalidIdFormat(ref cause) => write!(f, "{}", cause),
2427            DeleteMessageError::ReceiptHandleIsInvalid(ref cause) => write!(f, "{}", cause),
2428        }
2429    }
2430}
2431impl Error for DeleteMessageError {}
2432/// Errors returned by DeleteMessageBatch
2433#[derive(Debug, PartialEq)]
2434pub enum DeleteMessageBatchError {
2435    /// <p>Two or more batch entries in the request have the same <code>Id</code>.</p>
2436    BatchEntryIdsNotDistinct(String),
2437    /// <p>The batch request doesn't contain any entries.</p>
2438    EmptyBatchRequest(String),
2439    /// <p>The <code>Id</code> of a batch entry in a batch request doesn't abide by the specification.</p>
2440    InvalidBatchEntryId(String),
2441    /// <p>The batch request contains more entries than permissible.</p>
2442    TooManyEntriesInBatchRequest(String),
2443}
2444
2445impl DeleteMessageBatchError {
2446    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteMessageBatchError> {
2447        {
2448            let reader = EventReader::new(res.body.as_ref());
2449            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2450            find_start_element(&mut stack);
2451            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2452                match &parsed_error.code[..] {
2453                    "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" => {
2454                        return RusotoError::Service(
2455                            DeleteMessageBatchError::BatchEntryIdsNotDistinct(parsed_error.message),
2456                        )
2457                    }
2458                    "AWS.SimpleQueueService.EmptyBatchRequest" => {
2459                        return RusotoError::Service(DeleteMessageBatchError::EmptyBatchRequest(
2460                            parsed_error.message,
2461                        ))
2462                    }
2463                    "AWS.SimpleQueueService.InvalidBatchEntryId" => {
2464                        return RusotoError::Service(DeleteMessageBatchError::InvalidBatchEntryId(
2465                            parsed_error.message,
2466                        ))
2467                    }
2468                    "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" => {
2469                        return RusotoError::Service(
2470                            DeleteMessageBatchError::TooManyEntriesInBatchRequest(
2471                                parsed_error.message,
2472                            ),
2473                        )
2474                    }
2475                    _ => {}
2476                }
2477            }
2478        }
2479        RusotoError::Unknown(res)
2480    }
2481
2482    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2483    where
2484        T: Peek + Next,
2485    {
2486        xml_util::start_element("ErrorResponse", stack)?;
2487        XmlErrorDeserializer::deserialize("Error", stack)
2488    }
2489}
2490impl fmt::Display for DeleteMessageBatchError {
2491    #[allow(unused_variables)]
2492    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2493        match *self {
2494            DeleteMessageBatchError::BatchEntryIdsNotDistinct(ref cause) => write!(f, "{}", cause),
2495            DeleteMessageBatchError::EmptyBatchRequest(ref cause) => write!(f, "{}", cause),
2496            DeleteMessageBatchError::InvalidBatchEntryId(ref cause) => write!(f, "{}", cause),
2497            DeleteMessageBatchError::TooManyEntriesInBatchRequest(ref cause) => {
2498                write!(f, "{}", cause)
2499            }
2500        }
2501    }
2502}
2503impl Error for DeleteMessageBatchError {}
2504/// Errors returned by DeleteQueue
2505#[derive(Debug, PartialEq)]
2506pub enum DeleteQueueError {}
2507
2508impl DeleteQueueError {
2509    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteQueueError> {
2510        {
2511            let reader = EventReader::new(res.body.as_ref());
2512            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2513            find_start_element(&mut stack);
2514            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2515                match &parsed_error.code[..] {
2516                    _ => {}
2517                }
2518            }
2519        }
2520        RusotoError::Unknown(res)
2521    }
2522
2523    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2524    where
2525        T: Peek + Next,
2526    {
2527        xml_util::start_element("ErrorResponse", stack)?;
2528        XmlErrorDeserializer::deserialize("Error", stack)
2529    }
2530}
2531impl fmt::Display for DeleteQueueError {
2532    #[allow(unused_variables)]
2533    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2534        match *self {}
2535    }
2536}
2537impl Error for DeleteQueueError {}
2538/// Errors returned by GetQueueAttributes
2539#[derive(Debug, PartialEq)]
2540pub enum GetQueueAttributesError {
2541    /// <p>The specified attribute doesn't exist.</p>
2542    InvalidAttributeName(String),
2543}
2544
2545impl GetQueueAttributesError {
2546    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetQueueAttributesError> {
2547        {
2548            let reader = EventReader::new(res.body.as_ref());
2549            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2550            find_start_element(&mut stack);
2551            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2552                match &parsed_error.code[..] {
2553                    "InvalidAttributeName" => {
2554                        return RusotoError::Service(GetQueueAttributesError::InvalidAttributeName(
2555                            parsed_error.message,
2556                        ))
2557                    }
2558                    _ => {}
2559                }
2560            }
2561        }
2562        RusotoError::Unknown(res)
2563    }
2564
2565    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2566    where
2567        T: Peek + Next,
2568    {
2569        xml_util::start_element("ErrorResponse", stack)?;
2570        XmlErrorDeserializer::deserialize("Error", stack)
2571    }
2572}
2573impl fmt::Display for GetQueueAttributesError {
2574    #[allow(unused_variables)]
2575    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2576        match *self {
2577            GetQueueAttributesError::InvalidAttributeName(ref cause) => write!(f, "{}", cause),
2578        }
2579    }
2580}
2581impl Error for GetQueueAttributesError {}
2582/// Errors returned by GetQueueUrl
2583#[derive(Debug, PartialEq)]
2584pub enum GetQueueUrlError {
2585    /// <p>The specified queue doesn't exist.</p>
2586    QueueDoesNotExist(String),
2587}
2588
2589impl GetQueueUrlError {
2590    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetQueueUrlError> {
2591        {
2592            let reader = EventReader::new(res.body.as_ref());
2593            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2594            find_start_element(&mut stack);
2595            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2596                match &parsed_error.code[..] {
2597                    "AWS.SimpleQueueService.NonExistentQueue" => {
2598                        return RusotoError::Service(GetQueueUrlError::QueueDoesNotExist(
2599                            parsed_error.message,
2600                        ))
2601                    }
2602                    _ => {}
2603                }
2604            }
2605        }
2606        RusotoError::Unknown(res)
2607    }
2608
2609    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2610    where
2611        T: Peek + Next,
2612    {
2613        xml_util::start_element("ErrorResponse", stack)?;
2614        XmlErrorDeserializer::deserialize("Error", stack)
2615    }
2616}
2617impl fmt::Display for GetQueueUrlError {
2618    #[allow(unused_variables)]
2619    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2620        match *self {
2621            GetQueueUrlError::QueueDoesNotExist(ref cause) => write!(f, "{}", cause),
2622        }
2623    }
2624}
2625impl Error for GetQueueUrlError {}
2626/// Errors returned by ListDeadLetterSourceQueues
2627#[derive(Debug, PartialEq)]
2628pub enum ListDeadLetterSourceQueuesError {
2629    /// <p>The specified queue doesn't exist.</p>
2630    QueueDoesNotExist(String),
2631}
2632
2633impl ListDeadLetterSourceQueuesError {
2634    pub fn from_response(
2635        res: BufferedHttpResponse,
2636    ) -> RusotoError<ListDeadLetterSourceQueuesError> {
2637        {
2638            let reader = EventReader::new(res.body.as_ref());
2639            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2640            find_start_element(&mut stack);
2641            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2642                match &parsed_error.code[..] {
2643                    "AWS.SimpleQueueService.NonExistentQueue" => {
2644                        return RusotoError::Service(
2645                            ListDeadLetterSourceQueuesError::QueueDoesNotExist(
2646                                parsed_error.message,
2647                            ),
2648                        )
2649                    }
2650                    _ => {}
2651                }
2652            }
2653        }
2654        RusotoError::Unknown(res)
2655    }
2656
2657    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2658    where
2659        T: Peek + Next,
2660    {
2661        xml_util::start_element("ErrorResponse", stack)?;
2662        XmlErrorDeserializer::deserialize("Error", stack)
2663    }
2664}
2665impl fmt::Display for ListDeadLetterSourceQueuesError {
2666    #[allow(unused_variables)]
2667    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2668        match *self {
2669            ListDeadLetterSourceQueuesError::QueueDoesNotExist(ref cause) => write!(f, "{}", cause),
2670        }
2671    }
2672}
2673impl Error for ListDeadLetterSourceQueuesError {}
2674/// Errors returned by ListQueueTags
2675#[derive(Debug, PartialEq)]
2676pub enum ListQueueTagsError {}
2677
2678impl ListQueueTagsError {
2679    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListQueueTagsError> {
2680        {
2681            let reader = EventReader::new(res.body.as_ref());
2682            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2683            find_start_element(&mut stack);
2684            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2685                match &parsed_error.code[..] {
2686                    _ => {}
2687                }
2688            }
2689        }
2690        RusotoError::Unknown(res)
2691    }
2692
2693    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2694    where
2695        T: Peek + Next,
2696    {
2697        xml_util::start_element("ErrorResponse", stack)?;
2698        XmlErrorDeserializer::deserialize("Error", stack)
2699    }
2700}
2701impl fmt::Display for ListQueueTagsError {
2702    #[allow(unused_variables)]
2703    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2704        match *self {}
2705    }
2706}
2707impl Error for ListQueueTagsError {}
2708/// Errors returned by ListQueues
2709#[derive(Debug, PartialEq)]
2710pub enum ListQueuesError {}
2711
2712impl ListQueuesError {
2713    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListQueuesError> {
2714        {
2715            let reader = EventReader::new(res.body.as_ref());
2716            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2717            find_start_element(&mut stack);
2718            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2719                match &parsed_error.code[..] {
2720                    _ => {}
2721                }
2722            }
2723        }
2724        RusotoError::Unknown(res)
2725    }
2726
2727    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2728    where
2729        T: Peek + Next,
2730    {
2731        xml_util::start_element("ErrorResponse", stack)?;
2732        XmlErrorDeserializer::deserialize("Error", stack)
2733    }
2734}
2735impl fmt::Display for ListQueuesError {
2736    #[allow(unused_variables)]
2737    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2738        match *self {}
2739    }
2740}
2741impl Error for ListQueuesError {}
2742/// Errors returned by PurgeQueue
2743#[derive(Debug, PartialEq)]
2744pub enum PurgeQueueError {
2745    /// <p>Indicates that the specified queue previously received a <code>PurgeQueue</code> request within the last 60 seconds (the time it can take to delete the messages in the queue).</p>
2746    PurgeQueueInProgress(String),
2747    /// <p>The specified queue doesn't exist.</p>
2748    QueueDoesNotExist(String),
2749}
2750
2751impl PurgeQueueError {
2752    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PurgeQueueError> {
2753        {
2754            let reader = EventReader::new(res.body.as_ref());
2755            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2756            find_start_element(&mut stack);
2757            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2758                match &parsed_error.code[..] {
2759                    "AWS.SimpleQueueService.PurgeQueueInProgress" => {
2760                        return RusotoError::Service(PurgeQueueError::PurgeQueueInProgress(
2761                            parsed_error.message,
2762                        ))
2763                    }
2764                    "AWS.SimpleQueueService.NonExistentQueue" => {
2765                        return RusotoError::Service(PurgeQueueError::QueueDoesNotExist(
2766                            parsed_error.message,
2767                        ))
2768                    }
2769                    _ => {}
2770                }
2771            }
2772        }
2773        RusotoError::Unknown(res)
2774    }
2775
2776    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2777    where
2778        T: Peek + Next,
2779    {
2780        xml_util::start_element("ErrorResponse", stack)?;
2781        XmlErrorDeserializer::deserialize("Error", stack)
2782    }
2783}
2784impl fmt::Display for PurgeQueueError {
2785    #[allow(unused_variables)]
2786    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2787        match *self {
2788            PurgeQueueError::PurgeQueueInProgress(ref cause) => write!(f, "{}", cause),
2789            PurgeQueueError::QueueDoesNotExist(ref cause) => write!(f, "{}", cause),
2790        }
2791    }
2792}
2793impl Error for PurgeQueueError {}
2794/// Errors returned by ReceiveMessage
2795#[derive(Debug, PartialEq)]
2796pub enum ReceiveMessageError {
2797    /// <p>The specified action violates a limit. For example, <code>ReceiveMessage</code> returns this error if the maximum number of inflight messages is reached and <code>AddPermission</code> returns this error if the maximum number of permissions for the queue is reached.</p>
2798    OverLimit(String),
2799}
2800
2801impl ReceiveMessageError {
2802    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ReceiveMessageError> {
2803        {
2804            let reader = EventReader::new(res.body.as_ref());
2805            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2806            find_start_element(&mut stack);
2807            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2808                match &parsed_error.code[..] {
2809                    "OverLimit" => {
2810                        return RusotoError::Service(ReceiveMessageError::OverLimit(
2811                            parsed_error.message,
2812                        ))
2813                    }
2814                    _ => {}
2815                }
2816            }
2817        }
2818        RusotoError::Unknown(res)
2819    }
2820
2821    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2822    where
2823        T: Peek + Next,
2824    {
2825        xml_util::start_element("ErrorResponse", stack)?;
2826        XmlErrorDeserializer::deserialize("Error", stack)
2827    }
2828}
2829impl fmt::Display for ReceiveMessageError {
2830    #[allow(unused_variables)]
2831    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2832        match *self {
2833            ReceiveMessageError::OverLimit(ref cause) => write!(f, "{}", cause),
2834        }
2835    }
2836}
2837impl Error for ReceiveMessageError {}
2838/// Errors returned by RemovePermission
2839#[derive(Debug, PartialEq)]
2840pub enum RemovePermissionError {}
2841
2842impl RemovePermissionError {
2843    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RemovePermissionError> {
2844        {
2845            let reader = EventReader::new(res.body.as_ref());
2846            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2847            find_start_element(&mut stack);
2848            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2849                match &parsed_error.code[..] {
2850                    _ => {}
2851                }
2852            }
2853        }
2854        RusotoError::Unknown(res)
2855    }
2856
2857    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2858    where
2859        T: Peek + Next,
2860    {
2861        xml_util::start_element("ErrorResponse", stack)?;
2862        XmlErrorDeserializer::deserialize("Error", stack)
2863    }
2864}
2865impl fmt::Display for RemovePermissionError {
2866    #[allow(unused_variables)]
2867    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2868        match *self {}
2869    }
2870}
2871impl Error for RemovePermissionError {}
2872/// Errors returned by SendMessage
2873#[derive(Debug, PartialEq)]
2874pub enum SendMessageError {
2875    /// <p>The message contains characters outside the allowed set.</p>
2876    InvalidMessageContents(String),
2877    /// <p>Error code 400. Unsupported operation.</p>
2878    UnsupportedOperation(String),
2879}
2880
2881impl SendMessageError {
2882    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SendMessageError> {
2883        {
2884            let reader = EventReader::new(res.body.as_ref());
2885            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2886            find_start_element(&mut stack);
2887            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2888                match &parsed_error.code[..] {
2889                    "InvalidMessageContents" => {
2890                        return RusotoError::Service(SendMessageError::InvalidMessageContents(
2891                            parsed_error.message,
2892                        ))
2893                    }
2894                    "AWS.SimpleQueueService.UnsupportedOperation" => {
2895                        return RusotoError::Service(SendMessageError::UnsupportedOperation(
2896                            parsed_error.message,
2897                        ))
2898                    }
2899                    _ => {}
2900                }
2901            }
2902        }
2903        RusotoError::Unknown(res)
2904    }
2905
2906    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2907    where
2908        T: Peek + Next,
2909    {
2910        xml_util::start_element("ErrorResponse", stack)?;
2911        XmlErrorDeserializer::deserialize("Error", stack)
2912    }
2913}
2914impl fmt::Display for SendMessageError {
2915    #[allow(unused_variables)]
2916    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2917        match *self {
2918            SendMessageError::InvalidMessageContents(ref cause) => write!(f, "{}", cause),
2919            SendMessageError::UnsupportedOperation(ref cause) => write!(f, "{}", cause),
2920        }
2921    }
2922}
2923impl Error for SendMessageError {}
2924/// Errors returned by SendMessageBatch
2925#[derive(Debug, PartialEq)]
2926pub enum SendMessageBatchError {
2927    /// <p>Two or more batch entries in the request have the same <code>Id</code>.</p>
2928    BatchEntryIdsNotDistinct(String),
2929    /// <p>The length of all the messages put together is more than the limit.</p>
2930    BatchRequestTooLong(String),
2931    /// <p>The batch request doesn't contain any entries.</p>
2932    EmptyBatchRequest(String),
2933    /// <p>The <code>Id</code> of a batch entry in a batch request doesn't abide by the specification.</p>
2934    InvalidBatchEntryId(String),
2935    /// <p>The batch request contains more entries than permissible.</p>
2936    TooManyEntriesInBatchRequest(String),
2937    /// <p>Error code 400. Unsupported operation.</p>
2938    UnsupportedOperation(String),
2939}
2940
2941impl SendMessageBatchError {
2942    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SendMessageBatchError> {
2943        {
2944            let reader = EventReader::new(res.body.as_ref());
2945            let mut stack = XmlResponse::new(reader.into_iter().peekable());
2946            find_start_element(&mut stack);
2947            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
2948                match &parsed_error.code[..] {
2949                    "AWS.SimpleQueueService.BatchEntryIdsNotDistinct" => {
2950                        return RusotoError::Service(
2951                            SendMessageBatchError::BatchEntryIdsNotDistinct(parsed_error.message),
2952                        )
2953                    }
2954                    "AWS.SimpleQueueService.BatchRequestTooLong" => {
2955                        return RusotoError::Service(SendMessageBatchError::BatchRequestTooLong(
2956                            parsed_error.message,
2957                        ))
2958                    }
2959                    "AWS.SimpleQueueService.EmptyBatchRequest" => {
2960                        return RusotoError::Service(SendMessageBatchError::EmptyBatchRequest(
2961                            parsed_error.message,
2962                        ))
2963                    }
2964                    "AWS.SimpleQueueService.InvalidBatchEntryId" => {
2965                        return RusotoError::Service(SendMessageBatchError::InvalidBatchEntryId(
2966                            parsed_error.message,
2967                        ))
2968                    }
2969                    "AWS.SimpleQueueService.TooManyEntriesInBatchRequest" => {
2970                        return RusotoError::Service(
2971                            SendMessageBatchError::TooManyEntriesInBatchRequest(
2972                                parsed_error.message,
2973                            ),
2974                        )
2975                    }
2976                    "AWS.SimpleQueueService.UnsupportedOperation" => {
2977                        return RusotoError::Service(SendMessageBatchError::UnsupportedOperation(
2978                            parsed_error.message,
2979                        ))
2980                    }
2981                    _ => {}
2982                }
2983            }
2984        }
2985        RusotoError::Unknown(res)
2986    }
2987
2988    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
2989    where
2990        T: Peek + Next,
2991    {
2992        xml_util::start_element("ErrorResponse", stack)?;
2993        XmlErrorDeserializer::deserialize("Error", stack)
2994    }
2995}
2996impl fmt::Display for SendMessageBatchError {
2997    #[allow(unused_variables)]
2998    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2999        match *self {
3000            SendMessageBatchError::BatchEntryIdsNotDistinct(ref cause) => write!(f, "{}", cause),
3001            SendMessageBatchError::BatchRequestTooLong(ref cause) => write!(f, "{}", cause),
3002            SendMessageBatchError::EmptyBatchRequest(ref cause) => write!(f, "{}", cause),
3003            SendMessageBatchError::InvalidBatchEntryId(ref cause) => write!(f, "{}", cause),
3004            SendMessageBatchError::TooManyEntriesInBatchRequest(ref cause) => {
3005                write!(f, "{}", cause)
3006            }
3007            SendMessageBatchError::UnsupportedOperation(ref cause) => write!(f, "{}", cause),
3008        }
3009    }
3010}
3011impl Error for SendMessageBatchError {}
3012/// Errors returned by SetQueueAttributes
3013#[derive(Debug, PartialEq)]
3014pub enum SetQueueAttributesError {
3015    /// <p>The specified attribute doesn't exist.</p>
3016    InvalidAttributeName(String),
3017}
3018
3019impl SetQueueAttributesError {
3020    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SetQueueAttributesError> {
3021        {
3022            let reader = EventReader::new(res.body.as_ref());
3023            let mut stack = XmlResponse::new(reader.into_iter().peekable());
3024            find_start_element(&mut stack);
3025            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
3026                match &parsed_error.code[..] {
3027                    "InvalidAttributeName" => {
3028                        return RusotoError::Service(SetQueueAttributesError::InvalidAttributeName(
3029                            parsed_error.message,
3030                        ))
3031                    }
3032                    _ => {}
3033                }
3034            }
3035        }
3036        RusotoError::Unknown(res)
3037    }
3038
3039    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
3040    where
3041        T: Peek + Next,
3042    {
3043        xml_util::start_element("ErrorResponse", stack)?;
3044        XmlErrorDeserializer::deserialize("Error", stack)
3045    }
3046}
3047impl fmt::Display for SetQueueAttributesError {
3048    #[allow(unused_variables)]
3049    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3050        match *self {
3051            SetQueueAttributesError::InvalidAttributeName(ref cause) => write!(f, "{}", cause),
3052        }
3053    }
3054}
3055impl Error for SetQueueAttributesError {}
3056/// Errors returned by TagQueue
3057#[derive(Debug, PartialEq)]
3058pub enum TagQueueError {}
3059
3060impl TagQueueError {
3061    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagQueueError> {
3062        {
3063            let reader = EventReader::new(res.body.as_ref());
3064            let mut stack = XmlResponse::new(reader.into_iter().peekable());
3065            find_start_element(&mut stack);
3066            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
3067                match &parsed_error.code[..] {
3068                    _ => {}
3069                }
3070            }
3071        }
3072        RusotoError::Unknown(res)
3073    }
3074
3075    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
3076    where
3077        T: Peek + Next,
3078    {
3079        xml_util::start_element("ErrorResponse", stack)?;
3080        XmlErrorDeserializer::deserialize("Error", stack)
3081    }
3082}
3083impl fmt::Display for TagQueueError {
3084    #[allow(unused_variables)]
3085    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3086        match *self {}
3087    }
3088}
3089impl Error for TagQueueError {}
3090/// Errors returned by UntagQueue
3091#[derive(Debug, PartialEq)]
3092pub enum UntagQueueError {}
3093
3094impl UntagQueueError {
3095    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagQueueError> {
3096        {
3097            let reader = EventReader::new(res.body.as_ref());
3098            let mut stack = XmlResponse::new(reader.into_iter().peekable());
3099            find_start_element(&mut stack);
3100            if let Ok(parsed_error) = Self::deserialize(&mut stack) {
3101                match &parsed_error.code[..] {
3102                    _ => {}
3103                }
3104            }
3105        }
3106        RusotoError::Unknown(res)
3107    }
3108
3109    fn deserialize<T>(stack: &mut T) -> Result<XmlError, XmlParseError>
3110    where
3111        T: Peek + Next,
3112    {
3113        xml_util::start_element("ErrorResponse", stack)?;
3114        XmlErrorDeserializer::deserialize("Error", stack)
3115    }
3116}
3117impl fmt::Display for UntagQueueError {
3118    #[allow(unused_variables)]
3119    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3120        match *self {}
3121    }
3122}
3123impl Error for UntagQueueError {}
3124/// Trait representing the capabilities of the Amazon SQS API. Amazon SQS clients implement this trait.
3125#[async_trait]
3126pub trait Sqs {
3127    /// <p><p>Adds a permission to a queue for a specific <a href="https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principal</a>. This allows sharing access to the queue.</p> <p>When you create a queue, you have full control access rights for the queue. Only you, the owner of the queue, can grant or deny permissions to the queue. For more information about these permissions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue">Allow Developers to Write Messages to a Shared Queue</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <note> <ul> <li> <p> <code>AddPermission</code> generates a policy for you. You can use <code> <a>SetQueueAttributes</a> </code> to upload your policy. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-creating-custom-policies.html">Using Custom Policies with the Amazon SQS Access Policy Language</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </li> <li> <p>An Amazon SQS policy can have a maximum of 7 actions.</p> </li> <li> <p>To remove the ability to change queue permissions, you must deny permission to the <code>AddPermission</code>, <code>RemovePermission</code>, and <code>SetQueueAttributes</code> actions in your IAM policy.</p> </li> </ul> </note> <p>Some actions take lists of parameters. These lists are specified using the <code>param.n</code> notation. Values of <code>n</code> are integers starting from 1. For example, a parameter list with two elements looks like this:</p> <p> <code>&amp;AttributeName.1=first</code> </p> <p> <code>&amp;AttributeName.2=second</code> </p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3128    async fn add_permission(
3129        &self,
3130        input: AddPermissionRequest,
3131    ) -> Result<(), RusotoError<AddPermissionError>>;
3132
3133    /// <p><p>Changes the visibility timeout of a specified message in a queue to a new value. The default visibility timeout for a message is 30 seconds. The minimum is 0 seconds. The maximum is 12 hours. 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 Simple Queue Service Developer Guide</i>.</p> <p>For example, you have a message with a visibility timeout of 5 minutes. After 3 minutes, you call <code>ChangeMessageVisibility</code> with a timeout of 10 minutes. You can continue to call <code>ChangeMessageVisibility</code> to extend the visibility timeout to the maximum allowed time. If you try to extend the visibility timeout beyond the maximum, your request is rejected.</p> <p>An Amazon SQS message has three basic states:</p> <ol> <li> <p>Sent to a queue by a producer.</p> </li> <li> <p>Received from the queue by a consumer.</p> </li> <li> <p>Deleted from the queue.</p> </li> </ol> <p>A message is considered to be <i>stored</i> after it is sent to a queue by a producer, but not yet received from the queue by a consumer (that is, between states 1 and 2). There is no limit to the number of stored messages. A message is considered to be <i>in flight</i> after it is received from a queue by a consumer, but not yet deleted from the queue (that is, between states 2 and 3). There is a limit to the number of inflight messages.</p> <p>Limits that apply to inflight messages are unrelated to the <i>unlimited</i> number of stored messages.</p> <p>For most standard queues (depending on queue traffic and message backlog), there can be a maximum of approximately 120,000 inflight messages (received from a queue by a consumer, but not yet deleted from the queue). If you reach this limit, Amazon SQS returns the <code>OverLimit</code> error message. To avoid reaching the limit, you should delete messages from the queue after they&#39;re processed. You can also increase the number of queues you use to process your messages. To request a limit increase, <a href="https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&amp;limitType=service-code-sqs">file a support request</a>.</p> <p>For FIFO queues, there can be a maximum of 20,000 inflight messages (received from a queue by a consumer, but not yet deleted from the queue). If you reach this limit, Amazon SQS returns no error messages.</p> <important> <p>If you attempt to set the <code>VisibilityTimeout</code> to a value greater than the maximum time left, Amazon SQS returns an error. Amazon SQS doesn&#39;t automatically recalculate and increase the timeout to the maximum remaining time.</p> <p>Unlike with a queue, when you change the visibility timeout for a specific message the timeout value is applied immediately but isn&#39;t saved in memory for that message. If you don&#39;t delete a message after it is received, the visibility timeout for the message reverts to the original timeout value (not to the value you set using the <code>ChangeMessageVisibility</code> action) the next time the message is received.</p> </important></p>
3134    async fn change_message_visibility(
3135        &self,
3136        input: ChangeMessageVisibilityRequest,
3137    ) -> Result<(), RusotoError<ChangeMessageVisibilityError>>;
3138
3139    /// <p>Changes the visibility timeout of multiple messages. This is a batch version of <code> <a>ChangeMessageVisibility</a>.</code> The result of the action on each message is reported individually in the response. You can send up to 10 <code> <a>ChangeMessageVisibility</a> </code> requests with each <code>ChangeMessageVisibilityBatch</code> action.</p> <important> <p>Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of <code>200</code>.</p> </important> <p>Some actions take lists of parameters. These lists are specified using the <code>param.n</code> notation. Values of <code>n</code> are integers starting from 1. For example, a parameter list with two elements looks like this:</p> <p> <code>&amp;AttributeName.1=first</code> </p> <p> <code>&amp;AttributeName.2=second</code> </p>
3140    async fn change_message_visibility_batch(
3141        &self,
3142        input: ChangeMessageVisibilityBatchRequest,
3143    ) -> Result<ChangeMessageVisibilityBatchResult, RusotoError<ChangeMessageVisibilityBatchError>>;
3144
3145    /// <p><p>Creates a new standard or FIFO queue. You can pass one or more attributes in the request. Keep the following in mind:</p> <ul> <li> <p>If you don&#39;t specify the <code>FifoQueue</code> attribute, Amazon SQS creates a standard queue.</p> <note> <p>You can&#39;t change the queue type after you create it and you can&#39;t convert an existing standard queue into a FIFO queue. You must either create a new FIFO queue for your application or delete your existing standard queue and recreate it as a FIFO queue. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-moving">Moving From a Standard Queue to a FIFO Queue</a> in the <i>Amazon Simple Queue Service Developer Guide</i>. </p> </note> </li> <li> <p>If you don&#39;t provide a value for an attribute, the queue is created with the default value for the attribute.</p> </li> <li> <p>If you delete a queue, you must wait at least 60 seconds before creating a queue with the same name.</p> </li> </ul> <p>To successfully create a new queue, you must provide a queue name that adheres to the <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/limits-queues.html">limits related to queues</a> and is unique within the scope of your queues.</p> <note> <p>After you create a queue, you must wait at least one second after the queue is created to be able to use the queue.</p> </note> <p>To get the queue URL, use the <code> <a>GetQueueUrl</a> </code> action. <code> <a>GetQueueUrl</a> </code> requires only the <code>QueueName</code> parameter. be aware of existing queue names:</p> <ul> <li> <p>If you provide the name of an existing queue along with the exact names and values of all the queue&#39;s attributes, <code>CreateQueue</code> returns the queue URL for the existing queue.</p> </li> <li> <p>If the queue name, attribute names, or attribute values don&#39;t match an existing queue, <code>CreateQueue</code> returns an error.</p> </li> </ul> <p>Some actions take lists of parameters. These lists are specified using the <code>param.n</code> notation. Values of <code>n</code> are integers starting from 1. For example, a parameter list with two elements looks like this:</p> <p> <code>&amp;AttributeName.1=first</code> </p> <p> <code>&amp;AttributeName.2=second</code> </p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3146    async fn create_queue(
3147        &self,
3148        input: CreateQueueRequest,
3149    ) -> Result<CreateQueueResult, RusotoError<CreateQueueError>>;
3150
3151    /// <p><p>Deletes the specified message from the specified queue. To select the message to delete, use the <code>ReceiptHandle</code> of the message (<i>not</i> the <code>MessageId</code> which you receive when you send the message). Amazon SQS can delete a message from a queue even if a visibility timeout setting causes the message to be locked by another consumer. Amazon SQS automatically deletes messages left in a queue longer than the retention period configured for the queue. </p> <note> <p>The <code>ReceiptHandle</code> is associated with a <i>specific instance</i> of receiving a message. If you receive a message more than once, the <code>ReceiptHandle</code> is different each time you receive a message. When you use the <code>DeleteMessage</code> action, you must provide the most recently received <code>ReceiptHandle</code> for the message (otherwise, the request succeeds, but the message might not be deleted).</p> <p>For standard queues, it is possible to receive a message even after you delete it. This might happen on rare occasions if one of the servers which stores a copy of the message is unavailable when you send the request to delete the message. The copy remains on the server and might be returned to you during a subsequent receive request. You should ensure that your application is idempotent, so that receiving a message more than once does not cause issues.</p> </note></p>
3152    async fn delete_message(
3153        &self,
3154        input: DeleteMessageRequest,
3155    ) -> Result<(), RusotoError<DeleteMessageError>>;
3156
3157    /// <p>Deletes up to ten messages from the specified queue. This is a batch version of <code> <a>DeleteMessage</a>.</code> The result of the action on each message is reported individually in the response.</p> <important> <p>Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of <code>200</code>.</p> </important> <p>Some actions take lists of parameters. These lists are specified using the <code>param.n</code> notation. Values of <code>n</code> are integers starting from 1. For example, a parameter list with two elements looks like this:</p> <p> <code>&amp;AttributeName.1=first</code> </p> <p> <code>&amp;AttributeName.2=second</code> </p>
3158    async fn delete_message_batch(
3159        &self,
3160        input: DeleteMessageBatchRequest,
3161    ) -> Result<DeleteMessageBatchResult, RusotoError<DeleteMessageBatchError>>;
3162
3163    /// <p><p>Deletes the queue specified by the <code>QueueUrl</code>, regardless of the queue&#39;s contents.</p> <important> <p>Be careful with the <code>DeleteQueue</code> action: When you delete a queue, any messages in the queue are no longer available. </p> </important> <p>When you delete a queue, the deletion process takes up to 60 seconds. Requests you send involving that queue during the 60 seconds might succeed. For example, a <code> <a>SendMessage</a> </code> request might succeed, but after 60 seconds the queue and the message you sent no longer exist.</p> <p>When you delete a queue, you must wait at least 60 seconds before creating a queue with the same name.</p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3164    async fn delete_queue(
3165        &self,
3166        input: DeleteQueueRequest,
3167    ) -> Result<(), RusotoError<DeleteQueueError>>;
3168
3169    /// <p><p>Gets attributes for the specified queue.</p> <note> <p>To determine whether a queue is <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html">FIFO</a>, you can check whether <code>QueueName</code> ends with the <code>.fifo</code> suffix.</p> </note></p>
3170    async fn get_queue_attributes(
3171        &self,
3172        input: GetQueueAttributesRequest,
3173    ) -> Result<GetQueueAttributesResult, RusotoError<GetQueueAttributesError>>;
3174
3175    /// <p>Returns the URL of an existing Amazon SQS queue.</p> <p>To access a queue that belongs to another AWS account, use the <code>QueueOwnerAWSAccountId</code> parameter to specify the account ID of the queue's owner. The queue's owner must grant you permission to access the queue. For more information about shared queue access, see <code> <a>AddPermission</a> </code> or see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue">Allow Developers to Write Messages to a Shared Queue</a> in the <i>Amazon Simple Queue Service Developer Guide</i>. </p>
3176    async fn get_queue_url(
3177        &self,
3178        input: GetQueueUrlRequest,
3179    ) -> Result<GetQueueUrlResult, RusotoError<GetQueueUrlError>>;
3180
3181    /// <p>Returns a list of your queues that have the <code>RedrivePolicy</code> queue attribute configured with a dead-letter queue.</p> <p>For more information about using dead-letter queues, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html">Using Amazon SQS Dead-Letter Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p>
3182    async fn list_dead_letter_source_queues(
3183        &self,
3184        input: ListDeadLetterSourceQueuesRequest,
3185    ) -> Result<ListDeadLetterSourceQueuesResult, RusotoError<ListDeadLetterSourceQueuesError>>;
3186
3187    /// <p><p>List all cost allocation tags added to the specified Amazon SQS queue. For an overview, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html">Tagging Your Amazon SQS Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3188    async fn list_queue_tags(
3189        &self,
3190        input: ListQueueTagsRequest,
3191    ) -> Result<ListQueueTagsResult, RusotoError<ListQueueTagsError>>;
3192
3193    /// <p><p>Returns a list of your queues. The maximum number of queues that can be returned is 1,000. If you specify a value for the optional <code>QueueNamePrefix</code> parameter, only queues with a name that begins with the specified value are returned.</p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3194    async fn list_queues(
3195        &self,
3196        input: ListQueuesRequest,
3197    ) -> Result<ListQueuesResult, RusotoError<ListQueuesError>>;
3198
3199    /// <p>Deletes the messages in a queue specified by the <code>QueueURL</code> parameter.</p> <important> <p>When you use the <code>PurgeQueue</code> action, you can't retrieve any messages deleted from a queue.</p> <p>The message deletion process takes up to 60 seconds. We recommend waiting for 60 seconds regardless of your queue's size. </p> </important> <p>Messages sent to the queue <i>before</i> you call <code>PurgeQueue</code> might be received but are deleted within the next minute.</p> <p>Messages sent to the queue <i>after</i> you call <code>PurgeQueue</code> might be deleted while the queue is being purged.</p>
3200    async fn purge_queue(
3201        &self,
3202        input: PurgeQueueRequest,
3203    ) -> Result<(), RusotoError<PurgeQueueError>>;
3204
3205    /// <p><p>Retrieves one or more messages (up to 10), from the specified queue. Using the <code>WaitTimeSeconds</code> parameter enables long-poll support. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html">Amazon SQS Long Polling</a> in the <i>Amazon Simple Queue Service Developer Guide</i>. </p> <p>Short poll is the default behavior where a weighted random set of machines is sampled on a <code>ReceiveMessage</code> call. Thus, only the messages on the sampled machines are returned. If the number of messages in the queue is small (fewer than 1,000), you most likely get fewer messages than you requested per <code>ReceiveMessage</code> call. If the number of messages in the queue is extremely small, you might not receive any messages in a particular <code>ReceiveMessage</code> response. If this happens, repeat the request. </p> <p>For each message returned, the response includes the following:</p> <ul> <li> <p>The message body.</p> </li> <li> <p>An MD5 digest of the message body. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p> </li> <li> <p>The <code>MessageId</code> you received when you sent the message to the queue.</p> </li> <li> <p>The receipt handle.</p> </li> <li> <p>The message attributes.</p> </li> <li> <p>An MD5 digest of the message attributes.</p> </li> </ul> <p>The receipt handle is the identifier you must provide when deleting the message. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html">Queue and Message Identifiers</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <p>You can provide the <code>VisibilityTimeout</code> parameter in your request. The parameter is applied to the messages that Amazon SQS returns in the response. If you don&#39;t include the parameter, the overall visibility timeout for the queue is used for the returned messages. 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 Simple Queue Service Developer Guide</i>.</p> <p>A message that isn&#39;t deleted or a message whose visibility isn&#39;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> <note> <p>In the future, new attributes might be added. If you write code that calls this action, we recommend that you structure your code so that it can handle new attributes gracefully.</p> </note></p>
3206    async fn receive_message(
3207        &self,
3208        input: ReceiveMessageRequest,
3209    ) -> Result<ReceiveMessageResult, RusotoError<ReceiveMessageError>>;
3210
3211    /// <p><p>Revokes any permissions in the queue policy that matches the specified <code>Label</code> parameter.</p> <note> <ul> <li> <p>Only the owner of a queue can remove permissions from it.</p> </li> <li> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </li> <li> <p>To remove the ability to change queue permissions, you must deny permission to the <code>AddPermission</code>, <code>RemovePermission</code>, and <code>SetQueueAttributes</code> actions in your IAM policy.</p> </li> </ul> </note></p>
3212    async fn remove_permission(
3213        &self,
3214        input: RemovePermissionRequest,
3215    ) -> Result<(), RusotoError<RemovePermissionError>>;
3216
3217    /// <p><p>Delivers a message to the specified queue.</p> <important> <p>A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed:</p> <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> <p>Any characters not included in this list will be rejected. For more information, see the <a href="http://www.w3.org/TR/REC-xml/#charsets">W3C specification for characters</a>.</p> </important></p>
3218    async fn send_message(
3219        &self,
3220        input: SendMessageRequest,
3221    ) -> Result<SendMessageResult, RusotoError<SendMessageError>>;
3222
3223    /// <p>Delivers up to ten messages to the specified queue. This is a batch version of <code> <a>SendMessage</a>.</code> For a FIFO queue, multiple messages within a single batch are enqueued in the order they are sent.</p> <p>The result of sending each message is reported individually in the response. Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of <code>200</code>.</p> <p>The maximum allowed individual message size and the maximum total payload size (the sum of the individual lengths of all of the batched messages) are both 256 KB (262,144 bytes).</p> <important> <p>A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed:</p> <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> <p>Any characters not included in this list will be rejected. For more information, see the <a href="http://www.w3.org/TR/REC-xml/#charsets">W3C specification for characters</a>.</p> </important> <p>If you don't specify the <code>DelaySeconds</code> parameter for an entry, Amazon SQS uses the default value for the queue.</p> <p>Some actions take lists of parameters. These lists are specified using the <code>param.n</code> notation. Values of <code>n</code> are integers starting from 1. For example, a parameter list with two elements looks like this:</p> <p> <code>&amp;AttributeName.1=first</code> </p> <p> <code>&amp;AttributeName.2=second</code> </p>
3224    async fn send_message_batch(
3225        &self,
3226        input: SendMessageBatchRequest,
3227    ) -> Result<SendMessageBatchResult, RusotoError<SendMessageBatchError>>;
3228
3229    /// <p><p>Sets the value of one or more queue attributes. When you change a queue&#39;s attributes, the change can take up to 60 seconds for most of the attributes to propagate throughout the Amazon SQS system. Changes made to the <code>MessageRetentionPeriod</code> attribute can take up to 15 minutes.</p> <note> <ul> <li> <p>In the future, new attributes might be added. If you write code that calls this action, we recommend that you structure your code so that it can handle new attributes gracefully.</p> </li> <li> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </li> <li> <p>To remove the ability to change queue permissions, you must deny permission to the <code>AddPermission</code>, <code>RemovePermission</code>, and <code>SetQueueAttributes</code> actions in your IAM policy.</p> </li> </ul> </note></p>
3230    async fn set_queue_attributes(
3231        &self,
3232        input: SetQueueAttributesRequest,
3233    ) -> Result<(), RusotoError<SetQueueAttributesError>>;
3234
3235    /// <p><p>Add cost allocation tags to the specified Amazon SQS queue. For an overview, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html">Tagging Your Amazon SQS Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <p>When you use queue tags, keep the following guidelines in mind:</p> <ul> <li> <p>Adding more than 50 tags to a queue isn&#39;t recommended.</p> </li> <li> <p>Tags don&#39;t have any semantic meaning. Amazon SQS interprets tags as character strings.</p> </li> <li> <p>Tags are case-sensitive.</p> </li> <li> <p>A new tag with a key identical to that of an existing tag overwrites the existing tag.</p> </li> </ul> <p>For a full list of tag restrictions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues">Limits Related to Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3236    async fn tag_queue(&self, input: TagQueueRequest) -> Result<(), RusotoError<TagQueueError>>;
3237
3238    /// <p><p>Remove cost allocation tags from the specified Amazon SQS queue. For an overview, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html">Tagging Your Amazon SQS Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3239    async fn untag_queue(
3240        &self,
3241        input: UntagQueueRequest,
3242    ) -> Result<(), RusotoError<UntagQueueError>>;
3243}
3244/// A client for the Amazon SQS API.
3245#[derive(Clone)]
3246pub struct SqsClient {
3247    client: Client,
3248    region: region::Region,
3249}
3250
3251impl SqsClient {
3252    /// Creates a client backed by the default tokio event loop.
3253    ///
3254    /// The client will use the default credentials provider and tls client.
3255    pub fn new(region: region::Region) -> SqsClient {
3256        SqsClient {
3257            client: Client::shared(),
3258            region,
3259        }
3260    }
3261
3262    pub fn new_with<P, D>(
3263        request_dispatcher: D,
3264        credentials_provider: P,
3265        region: region::Region,
3266    ) -> SqsClient
3267    where
3268        P: ProvideAwsCredentials + Send + Sync + 'static,
3269        D: DispatchSignedRequest + Send + Sync + 'static,
3270    {
3271        SqsClient {
3272            client: Client::new_with(credentials_provider, request_dispatcher),
3273            region,
3274        }
3275    }
3276
3277    pub fn new_with_client(client: Client, region: region::Region) -> SqsClient {
3278        SqsClient { client, region }
3279    }
3280}
3281
3282#[async_trait]
3283impl Sqs for SqsClient {
3284    /// <p><p>Adds a permission to a queue for a specific <a href="https://docs.aws.amazon.com/general/latest/gr/glos-chap.html#P">principal</a>. This allows sharing access to the queue.</p> <p>When you create a queue, you have full control access rights for the queue. Only you, the owner of the queue, can grant or deny permissions to the queue. For more information about these permissions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue">Allow Developers to Write Messages to a Shared Queue</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <note> <ul> <li> <p> <code>AddPermission</code> generates a policy for you. You can use <code> <a>SetQueueAttributes</a> </code> to upload your policy. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-creating-custom-policies.html">Using Custom Policies with the Amazon SQS Access Policy Language</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </li> <li> <p>An Amazon SQS policy can have a maximum of 7 actions.</p> </li> <li> <p>To remove the ability to change queue permissions, you must deny permission to the <code>AddPermission</code>, <code>RemovePermission</code>, and <code>SetQueueAttributes</code> actions in your IAM policy.</p> </li> </ul> </note> <p>Some actions take lists of parameters. These lists are specified using the <code>param.n</code> notation. Values of <code>n</code> are integers starting from 1. For example, a parameter list with two elements looks like this:</p> <p> <code>&amp;AttributeName.1=first</code> </p> <p> <code>&amp;AttributeName.2=second</code> </p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3285    async fn add_permission(
3286        &self,
3287        input: AddPermissionRequest,
3288    ) -> Result<(), RusotoError<AddPermissionError>> {
3289        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3290        let params = self.new_params("AddPermission");
3291        let mut params = params;
3292        AddPermissionRequestSerializer::serialize(&mut params, "", &input);
3293        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3294        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3295
3296        let response = self
3297            .sign_and_dispatch(request, AddPermissionError::from_response)
3298            .await?;
3299
3300        std::mem::drop(response);
3301        Ok(())
3302    }
3303
3304    /// <p><p>Changes the visibility timeout of a specified message in a queue to a new value. The default visibility timeout for a message is 30 seconds. The minimum is 0 seconds. The maximum is 12 hours. 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 Simple Queue Service Developer Guide</i>.</p> <p>For example, you have a message with a visibility timeout of 5 minutes. After 3 minutes, you call <code>ChangeMessageVisibility</code> with a timeout of 10 minutes. You can continue to call <code>ChangeMessageVisibility</code> to extend the visibility timeout to the maximum allowed time. If you try to extend the visibility timeout beyond the maximum, your request is rejected.</p> <p>An Amazon SQS message has three basic states:</p> <ol> <li> <p>Sent to a queue by a producer.</p> </li> <li> <p>Received from the queue by a consumer.</p> </li> <li> <p>Deleted from the queue.</p> </li> </ol> <p>A message is considered to be <i>stored</i> after it is sent to a queue by a producer, but not yet received from the queue by a consumer (that is, between states 1 and 2). There is no limit to the number of stored messages. A message is considered to be <i>in flight</i> after it is received from a queue by a consumer, but not yet deleted from the queue (that is, between states 2 and 3). There is a limit to the number of inflight messages.</p> <p>Limits that apply to inflight messages are unrelated to the <i>unlimited</i> number of stored messages.</p> <p>For most standard queues (depending on queue traffic and message backlog), there can be a maximum of approximately 120,000 inflight messages (received from a queue by a consumer, but not yet deleted from the queue). If you reach this limit, Amazon SQS returns the <code>OverLimit</code> error message. To avoid reaching the limit, you should delete messages from the queue after they&#39;re processed. You can also increase the number of queues you use to process your messages. To request a limit increase, <a href="https://console.aws.amazon.com/support/home#/case/create?issueType=service-limit-increase&amp;limitType=service-code-sqs">file a support request</a>.</p> <p>For FIFO queues, there can be a maximum of 20,000 inflight messages (received from a queue by a consumer, but not yet deleted from the queue). If you reach this limit, Amazon SQS returns no error messages.</p> <important> <p>If you attempt to set the <code>VisibilityTimeout</code> to a value greater than the maximum time left, Amazon SQS returns an error. Amazon SQS doesn&#39;t automatically recalculate and increase the timeout to the maximum remaining time.</p> <p>Unlike with a queue, when you change the visibility timeout for a specific message the timeout value is applied immediately but isn&#39;t saved in memory for that message. If you don&#39;t delete a message after it is received, the visibility timeout for the message reverts to the original timeout value (not to the value you set using the <code>ChangeMessageVisibility</code> action) the next time the message is received.</p> </important></p>
3305    async fn change_message_visibility(
3306        &self,
3307        input: ChangeMessageVisibilityRequest,
3308    ) -> Result<(), RusotoError<ChangeMessageVisibilityError>> {
3309        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3310        let params = self.new_params("ChangeMessageVisibility");
3311        let mut params = params;
3312        ChangeMessageVisibilityRequestSerializer::serialize(&mut params, "", &input);
3313        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3314        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3315
3316        let response = self
3317            .sign_and_dispatch(request, ChangeMessageVisibilityError::from_response)
3318            .await?;
3319
3320        std::mem::drop(response);
3321        Ok(())
3322    }
3323
3324    /// <p>Changes the visibility timeout of multiple messages. This is a batch version of <code> <a>ChangeMessageVisibility</a>.</code> The result of the action on each message is reported individually in the response. You can send up to 10 <code> <a>ChangeMessageVisibility</a> </code> requests with each <code>ChangeMessageVisibilityBatch</code> action.</p> <important> <p>Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of <code>200</code>.</p> </important> <p>Some actions take lists of parameters. These lists are specified using the <code>param.n</code> notation. Values of <code>n</code> are integers starting from 1. For example, a parameter list with two elements looks like this:</p> <p> <code>&amp;AttributeName.1=first</code> </p> <p> <code>&amp;AttributeName.2=second</code> </p>
3325    async fn change_message_visibility_batch(
3326        &self,
3327        input: ChangeMessageVisibilityBatchRequest,
3328    ) -> Result<ChangeMessageVisibilityBatchResult, RusotoError<ChangeMessageVisibilityBatchError>>
3329    {
3330        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3331        let params = self.new_params("ChangeMessageVisibilityBatch");
3332        let mut params = params;
3333        ChangeMessageVisibilityBatchRequestSerializer::serialize(&mut params, "", &input);
3334        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3335        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3336
3337        let response = self
3338            .sign_and_dispatch(request, ChangeMessageVisibilityBatchError::from_response)
3339            .await?;
3340
3341        let mut response = response;
3342        let result = xml_util::parse_response(&mut response, |actual_tag_name, stack| {
3343            xml_util::start_element(actual_tag_name, stack)?;
3344            let result = ChangeMessageVisibilityBatchResultDeserializer::deserialize(
3345                "ChangeMessageVisibilityBatchResult",
3346                stack,
3347            )?;
3348            skip_tree(stack);
3349            xml_util::end_element(actual_tag_name, stack)?;
3350            Ok(result)
3351        })
3352        .await?;
3353
3354        drop(response); // parse non-payload
3355        Ok(result)
3356    }
3357
3358    /// <p><p>Creates a new standard or FIFO queue. You can pass one or more attributes in the request. Keep the following in mind:</p> <ul> <li> <p>If you don&#39;t specify the <code>FifoQueue</code> attribute, Amazon SQS creates a standard queue.</p> <note> <p>You can&#39;t change the queue type after you create it and you can&#39;t convert an existing standard queue into a FIFO queue. You must either create a new FIFO queue for your application or delete your existing standard queue and recreate it as a FIFO queue. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-moving">Moving From a Standard Queue to a FIFO Queue</a> in the <i>Amazon Simple Queue Service Developer Guide</i>. </p> </note> </li> <li> <p>If you don&#39;t provide a value for an attribute, the queue is created with the default value for the attribute.</p> </li> <li> <p>If you delete a queue, you must wait at least 60 seconds before creating a queue with the same name.</p> </li> </ul> <p>To successfully create a new queue, you must provide a queue name that adheres to the <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/limits-queues.html">limits related to queues</a> and is unique within the scope of your queues.</p> <note> <p>After you create a queue, you must wait at least one second after the queue is created to be able to use the queue.</p> </note> <p>To get the queue URL, use the <code> <a>GetQueueUrl</a> </code> action. <code> <a>GetQueueUrl</a> </code> requires only the <code>QueueName</code> parameter. be aware of existing queue names:</p> <ul> <li> <p>If you provide the name of an existing queue along with the exact names and values of all the queue&#39;s attributes, <code>CreateQueue</code> returns the queue URL for the existing queue.</p> </li> <li> <p>If the queue name, attribute names, or attribute values don&#39;t match an existing queue, <code>CreateQueue</code> returns an error.</p> </li> </ul> <p>Some actions take lists of parameters. These lists are specified using the <code>param.n</code> notation. Values of <code>n</code> are integers starting from 1. For example, a parameter list with two elements looks like this:</p> <p> <code>&amp;AttributeName.1=first</code> </p> <p> <code>&amp;AttributeName.2=second</code> </p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3359    async fn create_queue(
3360        &self,
3361        input: CreateQueueRequest,
3362    ) -> Result<CreateQueueResult, RusotoError<CreateQueueError>> {
3363        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3364        let params = self.new_params("CreateQueue");
3365        let mut params = params;
3366        CreateQueueRequestSerializer::serialize(&mut params, "", &input);
3367        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3368        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3369
3370        let response = self
3371            .sign_and_dispatch(request, CreateQueueError::from_response)
3372            .await?;
3373
3374        let mut response = response;
3375        let result = xml_util::parse_response(&mut response, |actual_tag_name, stack| {
3376            xml_util::start_element(actual_tag_name, stack)?;
3377            let result = CreateQueueResultDeserializer::deserialize("CreateQueueResult", stack)?;
3378            skip_tree(stack);
3379            xml_util::end_element(actual_tag_name, stack)?;
3380            Ok(result)
3381        })
3382        .await?;
3383
3384        drop(response); // parse non-payload
3385        Ok(result)
3386    }
3387
3388    /// <p><p>Deletes the specified message from the specified queue. To select the message to delete, use the <code>ReceiptHandle</code> of the message (<i>not</i> the <code>MessageId</code> which you receive when you send the message). Amazon SQS can delete a message from a queue even if a visibility timeout setting causes the message to be locked by another consumer. Amazon SQS automatically deletes messages left in a queue longer than the retention period configured for the queue. </p> <note> <p>The <code>ReceiptHandle</code> is associated with a <i>specific instance</i> of receiving a message. If you receive a message more than once, the <code>ReceiptHandle</code> is different each time you receive a message. When you use the <code>DeleteMessage</code> action, you must provide the most recently received <code>ReceiptHandle</code> for the message (otherwise, the request succeeds, but the message might not be deleted).</p> <p>For standard queues, it is possible to receive a message even after you delete it. This might happen on rare occasions if one of the servers which stores a copy of the message is unavailable when you send the request to delete the message. The copy remains on the server and might be returned to you during a subsequent receive request. You should ensure that your application is idempotent, so that receiving a message more than once does not cause issues.</p> </note></p>
3389    async fn delete_message(
3390        &self,
3391        input: DeleteMessageRequest,
3392    ) -> Result<(), RusotoError<DeleteMessageError>> {
3393        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3394        let params = self.new_params("DeleteMessage");
3395        let mut params = params;
3396        DeleteMessageRequestSerializer::serialize(&mut params, "", &input);
3397        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3398        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3399
3400        let response = self
3401            .sign_and_dispatch(request, DeleteMessageError::from_response)
3402            .await?;
3403
3404        std::mem::drop(response);
3405        Ok(())
3406    }
3407
3408    /// <p>Deletes up to ten messages from the specified queue. This is a batch version of <code> <a>DeleteMessage</a>.</code> The result of the action on each message is reported individually in the response.</p> <important> <p>Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of <code>200</code>.</p> </important> <p>Some actions take lists of parameters. These lists are specified using the <code>param.n</code> notation. Values of <code>n</code> are integers starting from 1. For example, a parameter list with two elements looks like this:</p> <p> <code>&amp;AttributeName.1=first</code> </p> <p> <code>&amp;AttributeName.2=second</code> </p>
3409    async fn delete_message_batch(
3410        &self,
3411        input: DeleteMessageBatchRequest,
3412    ) -> Result<DeleteMessageBatchResult, RusotoError<DeleteMessageBatchError>> {
3413        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3414        let params = self.new_params("DeleteMessageBatch");
3415        let mut params = params;
3416        DeleteMessageBatchRequestSerializer::serialize(&mut params, "", &input);
3417        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3418        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3419
3420        let response = self
3421            .sign_and_dispatch(request, DeleteMessageBatchError::from_response)
3422            .await?;
3423
3424        let mut response = response;
3425        let result = xml_util::parse_response(&mut response, |actual_tag_name, stack| {
3426            xml_util::start_element(actual_tag_name, stack)?;
3427            let result = DeleteMessageBatchResultDeserializer::deserialize(
3428                "DeleteMessageBatchResult",
3429                stack,
3430            )?;
3431            skip_tree(stack);
3432            xml_util::end_element(actual_tag_name, stack)?;
3433            Ok(result)
3434        })
3435        .await?;
3436
3437        drop(response); // parse non-payload
3438        Ok(result)
3439    }
3440
3441    /// <p><p>Deletes the queue specified by the <code>QueueUrl</code>, regardless of the queue&#39;s contents.</p> <important> <p>Be careful with the <code>DeleteQueue</code> action: When you delete a queue, any messages in the queue are no longer available. </p> </important> <p>When you delete a queue, the deletion process takes up to 60 seconds. Requests you send involving that queue during the 60 seconds might succeed. For example, a <code> <a>SendMessage</a> </code> request might succeed, but after 60 seconds the queue and the message you sent no longer exist.</p> <p>When you delete a queue, you must wait at least 60 seconds before creating a queue with the same name.</p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3442    async fn delete_queue(
3443        &self,
3444        input: DeleteQueueRequest,
3445    ) -> Result<(), RusotoError<DeleteQueueError>> {
3446        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3447        let params = self.new_params("DeleteQueue");
3448        let mut params = params;
3449        DeleteQueueRequestSerializer::serialize(&mut params, "", &input);
3450        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3451        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3452
3453        let response = self
3454            .sign_and_dispatch(request, DeleteQueueError::from_response)
3455            .await?;
3456
3457        std::mem::drop(response);
3458        Ok(())
3459    }
3460
3461    /// <p><p>Gets attributes for the specified queue.</p> <note> <p>To determine whether a queue is <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html">FIFO</a>, you can check whether <code>QueueName</code> ends with the <code>.fifo</code> suffix.</p> </note></p>
3462    async fn get_queue_attributes(
3463        &self,
3464        input: GetQueueAttributesRequest,
3465    ) -> Result<GetQueueAttributesResult, RusotoError<GetQueueAttributesError>> {
3466        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3467        let params = self.new_params("GetQueueAttributes");
3468        let mut params = params;
3469        GetQueueAttributesRequestSerializer::serialize(&mut params, "", &input);
3470        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3471        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3472
3473        let response = self
3474            .sign_and_dispatch(request, GetQueueAttributesError::from_response)
3475            .await?;
3476
3477        let mut response = response;
3478        let result = xml_util::parse_response(&mut response, |actual_tag_name, stack| {
3479            xml_util::start_element(actual_tag_name, stack)?;
3480            let result = GetQueueAttributesResultDeserializer::deserialize(
3481                "GetQueueAttributesResult",
3482                stack,
3483            )?;
3484            skip_tree(stack);
3485            xml_util::end_element(actual_tag_name, stack)?;
3486            Ok(result)
3487        })
3488        .await?;
3489
3490        drop(response); // parse non-payload
3491        Ok(result)
3492    }
3493
3494    /// <p>Returns the URL of an existing Amazon SQS queue.</p> <p>To access a queue that belongs to another AWS account, use the <code>QueueOwnerAWSAccountId</code> parameter to specify the account ID of the queue's owner. The queue's owner must grant you permission to access the queue. For more information about shared queue access, see <code> <a>AddPermission</a> </code> or see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-writing-an-sqs-policy.html#write-messages-to-shared-queue">Allow Developers to Write Messages to a Shared Queue</a> in the <i>Amazon Simple Queue Service Developer Guide</i>. </p>
3495    async fn get_queue_url(
3496        &self,
3497        input: GetQueueUrlRequest,
3498    ) -> Result<GetQueueUrlResult, RusotoError<GetQueueUrlError>> {
3499        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3500        let params = self.new_params("GetQueueUrl");
3501        let mut params = params;
3502        GetQueueUrlRequestSerializer::serialize(&mut params, "", &input);
3503        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3504        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3505
3506        let response = self
3507            .sign_and_dispatch(request, GetQueueUrlError::from_response)
3508            .await?;
3509
3510        let mut response = response;
3511        let result = xml_util::parse_response(&mut response, |actual_tag_name, stack| {
3512            xml_util::start_element(actual_tag_name, stack)?;
3513            let result = GetQueueUrlResultDeserializer::deserialize("GetQueueUrlResult", stack)?;
3514            skip_tree(stack);
3515            xml_util::end_element(actual_tag_name, stack)?;
3516            Ok(result)
3517        })
3518        .await?;
3519
3520        drop(response); // parse non-payload
3521        Ok(result)
3522    }
3523
3524    /// <p>Returns a list of your queues that have the <code>RedrivePolicy</code> queue attribute configured with a dead-letter queue.</p> <p>For more information about using dead-letter queues, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-dead-letter-queues.html">Using Amazon SQS Dead-Letter Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p>
3525    async fn list_dead_letter_source_queues(
3526        &self,
3527        input: ListDeadLetterSourceQueuesRequest,
3528    ) -> Result<ListDeadLetterSourceQueuesResult, RusotoError<ListDeadLetterSourceQueuesError>>
3529    {
3530        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3531        let params = self.new_params("ListDeadLetterSourceQueues");
3532        let mut params = params;
3533        ListDeadLetterSourceQueuesRequestSerializer::serialize(&mut params, "", &input);
3534        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3535        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3536
3537        let response = self
3538            .sign_and_dispatch(request, ListDeadLetterSourceQueuesError::from_response)
3539            .await?;
3540
3541        let mut response = response;
3542        let result = xml_util::parse_response(&mut response, |actual_tag_name, stack| {
3543            xml_util::start_element(actual_tag_name, stack)?;
3544            let result = ListDeadLetterSourceQueuesResultDeserializer::deserialize(
3545                "ListDeadLetterSourceQueuesResult",
3546                stack,
3547            )?;
3548            skip_tree(stack);
3549            xml_util::end_element(actual_tag_name, stack)?;
3550            Ok(result)
3551        })
3552        .await?;
3553
3554        drop(response); // parse non-payload
3555        Ok(result)
3556    }
3557
3558    /// <p><p>List all cost allocation tags added to the specified Amazon SQS queue. For an overview, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html">Tagging Your Amazon SQS Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3559    async fn list_queue_tags(
3560        &self,
3561        input: ListQueueTagsRequest,
3562    ) -> Result<ListQueueTagsResult, RusotoError<ListQueueTagsError>> {
3563        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3564        let params = self.new_params("ListQueueTags");
3565        let mut params = params;
3566        ListQueueTagsRequestSerializer::serialize(&mut params, "", &input);
3567        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3568        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3569
3570        let response = self
3571            .sign_and_dispatch(request, ListQueueTagsError::from_response)
3572            .await?;
3573
3574        let mut response = response;
3575        let result = xml_util::parse_response(&mut response, |actual_tag_name, stack| {
3576            xml_util::start_element(actual_tag_name, stack)?;
3577            let result =
3578                ListQueueTagsResultDeserializer::deserialize("ListQueueTagsResult", stack)?;
3579            skip_tree(stack);
3580            xml_util::end_element(actual_tag_name, stack)?;
3581            Ok(result)
3582        })
3583        .await?;
3584
3585        drop(response); // parse non-payload
3586        Ok(result)
3587    }
3588
3589    /// <p><p>Returns a list of your queues. The maximum number of queues that can be returned is 1,000. If you specify a value for the optional <code>QueueNamePrefix</code> parameter, only queues with a name that begins with the specified value are returned.</p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3590    async fn list_queues(
3591        &self,
3592        input: ListQueuesRequest,
3593    ) -> Result<ListQueuesResult, RusotoError<ListQueuesError>> {
3594        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3595        let params = self.new_params("ListQueues");
3596        let mut params = params;
3597        ListQueuesRequestSerializer::serialize(&mut params, "", &input);
3598        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3599        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3600
3601        let response = self
3602            .sign_and_dispatch(request, ListQueuesError::from_response)
3603            .await?;
3604
3605        let mut response = response;
3606        let result = xml_util::parse_response(&mut response, |actual_tag_name, stack| {
3607            xml_util::start_element(actual_tag_name, stack)?;
3608            let result = ListQueuesResultDeserializer::deserialize("ListQueuesResult", stack)?;
3609            skip_tree(stack);
3610            xml_util::end_element(actual_tag_name, stack)?;
3611            Ok(result)
3612        })
3613        .await?;
3614
3615        drop(response); // parse non-payload
3616        Ok(result)
3617    }
3618
3619    /// <p>Deletes the messages in a queue specified by the <code>QueueURL</code> parameter.</p> <important> <p>When you use the <code>PurgeQueue</code> action, you can't retrieve any messages deleted from a queue.</p> <p>The message deletion process takes up to 60 seconds. We recommend waiting for 60 seconds regardless of your queue's size. </p> </important> <p>Messages sent to the queue <i>before</i> you call <code>PurgeQueue</code> might be received but are deleted within the next minute.</p> <p>Messages sent to the queue <i>after</i> you call <code>PurgeQueue</code> might be deleted while the queue is being purged.</p>
3620    async fn purge_queue(
3621        &self,
3622        input: PurgeQueueRequest,
3623    ) -> Result<(), RusotoError<PurgeQueueError>> {
3624        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3625        let params = self.new_params("PurgeQueue");
3626        let mut params = params;
3627        PurgeQueueRequestSerializer::serialize(&mut params, "", &input);
3628        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3629        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3630
3631        let response = self
3632            .sign_and_dispatch(request, PurgeQueueError::from_response)
3633            .await?;
3634
3635        std::mem::drop(response);
3636        Ok(())
3637    }
3638
3639    /// <p><p>Retrieves one or more messages (up to 10), from the specified queue. Using the <code>WaitTimeSeconds</code> parameter enables long-poll support. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html">Amazon SQS Long Polling</a> in the <i>Amazon Simple Queue Service Developer Guide</i>. </p> <p>Short poll is the default behavior where a weighted random set of machines is sampled on a <code>ReceiveMessage</code> call. Thus, only the messages on the sampled machines are returned. If the number of messages in the queue is small (fewer than 1,000), you most likely get fewer messages than you requested per <code>ReceiveMessage</code> call. If the number of messages in the queue is extremely small, you might not receive any messages in a particular <code>ReceiveMessage</code> response. If this happens, repeat the request. </p> <p>For each message returned, the response includes the following:</p> <ul> <li> <p>The message body.</p> </li> <li> <p>An MD5 digest of the message body. For information about MD5, see <a href="https://www.ietf.org/rfc/rfc1321.txt">RFC1321</a>.</p> </li> <li> <p>The <code>MessageId</code> you received when you sent the message to the queue.</p> </li> <li> <p>The receipt handle.</p> </li> <li> <p>The message attributes.</p> </li> <li> <p>An MD5 digest of the message attributes.</p> </li> </ul> <p>The receipt handle is the identifier you must provide when deleting the message. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-message-identifiers.html">Queue and Message Identifiers</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <p>You can provide the <code>VisibilityTimeout</code> parameter in your request. The parameter is applied to the messages that Amazon SQS returns in the response. If you don&#39;t include the parameter, the overall visibility timeout for the queue is used for the returned messages. 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 Simple Queue Service Developer Guide</i>.</p> <p>A message that isn&#39;t deleted or a message whose visibility isn&#39;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> <note> <p>In the future, new attributes might be added. If you write code that calls this action, we recommend that you structure your code so that it can handle new attributes gracefully.</p> </note></p>
3640    async fn receive_message(
3641        &self,
3642        input: ReceiveMessageRequest,
3643    ) -> Result<ReceiveMessageResult, RusotoError<ReceiveMessageError>> {
3644        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3645        let params = self.new_params("ReceiveMessage");
3646        let mut params = params;
3647        ReceiveMessageRequestSerializer::serialize(&mut params, "", &input);
3648        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3649        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3650
3651        let response = self
3652            .sign_and_dispatch(request, ReceiveMessageError::from_response)
3653            .await?;
3654
3655        let mut response = response;
3656        let result = xml_util::parse_response(&mut response, |actual_tag_name, stack| {
3657            xml_util::start_element(actual_tag_name, stack)?;
3658            let result =
3659                ReceiveMessageResultDeserializer::deserialize("ReceiveMessageResult", stack)?;
3660            skip_tree(stack);
3661            xml_util::end_element(actual_tag_name, stack)?;
3662            Ok(result)
3663        })
3664        .await?;
3665
3666        drop(response); // parse non-payload
3667        Ok(result)
3668    }
3669
3670    /// <p><p>Revokes any permissions in the queue policy that matches the specified <code>Label</code> parameter.</p> <note> <ul> <li> <p>Only the owner of a queue can remove permissions from it.</p> </li> <li> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </li> <li> <p>To remove the ability to change queue permissions, you must deny permission to the <code>AddPermission</code>, <code>RemovePermission</code>, and <code>SetQueueAttributes</code> actions in your IAM policy.</p> </li> </ul> </note></p>
3671    async fn remove_permission(
3672        &self,
3673        input: RemovePermissionRequest,
3674    ) -> Result<(), RusotoError<RemovePermissionError>> {
3675        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3676        let params = self.new_params("RemovePermission");
3677        let mut params = params;
3678        RemovePermissionRequestSerializer::serialize(&mut params, "", &input);
3679        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3680        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3681
3682        let response = self
3683            .sign_and_dispatch(request, RemovePermissionError::from_response)
3684            .await?;
3685
3686        std::mem::drop(response);
3687        Ok(())
3688    }
3689
3690    /// <p><p>Delivers a message to the specified queue.</p> <important> <p>A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed:</p> <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> <p>Any characters not included in this list will be rejected. For more information, see the <a href="http://www.w3.org/TR/REC-xml/#charsets">W3C specification for characters</a>.</p> </important></p>
3691    async fn send_message(
3692        &self,
3693        input: SendMessageRequest,
3694    ) -> Result<SendMessageResult, RusotoError<SendMessageError>> {
3695        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3696        let params = self.new_params("SendMessage");
3697        let mut params = params;
3698        SendMessageRequestSerializer::serialize(&mut params, "", &input);
3699        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3700        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3701
3702        let response = self
3703            .sign_and_dispatch(request, SendMessageError::from_response)
3704            .await?;
3705
3706        let mut response = response;
3707        let result = xml_util::parse_response(&mut response, |actual_tag_name, stack| {
3708            xml_util::start_element(actual_tag_name, stack)?;
3709            let result = SendMessageResultDeserializer::deserialize("SendMessageResult", stack)?;
3710            skip_tree(stack);
3711            xml_util::end_element(actual_tag_name, stack)?;
3712            Ok(result)
3713        })
3714        .await?;
3715
3716        drop(response); // parse non-payload
3717        Ok(result)
3718    }
3719
3720    /// <p>Delivers up to ten messages to the specified queue. This is a batch version of <code> <a>SendMessage</a>.</code> For a FIFO queue, multiple messages within a single batch are enqueued in the order they are sent.</p> <p>The result of sending each message is reported individually in the response. Because the batch request can result in a combination of successful and unsuccessful actions, you should check for batch errors even when the call returns an HTTP status code of <code>200</code>.</p> <p>The maximum allowed individual message size and the maximum total payload size (the sum of the individual lengths of all of the batched messages) are both 256 KB (262,144 bytes).</p> <important> <p>A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed:</p> <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> <p>Any characters not included in this list will be rejected. For more information, see the <a href="http://www.w3.org/TR/REC-xml/#charsets">W3C specification for characters</a>.</p> </important> <p>If you don't specify the <code>DelaySeconds</code> parameter for an entry, Amazon SQS uses the default value for the queue.</p> <p>Some actions take lists of parameters. These lists are specified using the <code>param.n</code> notation. Values of <code>n</code> are integers starting from 1. For example, a parameter list with two elements looks like this:</p> <p> <code>&amp;AttributeName.1=first</code> </p> <p> <code>&amp;AttributeName.2=second</code> </p>
3721    async fn send_message_batch(
3722        &self,
3723        input: SendMessageBatchRequest,
3724    ) -> Result<SendMessageBatchResult, RusotoError<SendMessageBatchError>> {
3725        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3726        let params = self.new_params("SendMessageBatch");
3727        let mut params = params;
3728        SendMessageBatchRequestSerializer::serialize(&mut params, "", &input);
3729        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3730        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3731
3732        let response = self
3733            .sign_and_dispatch(request, SendMessageBatchError::from_response)
3734            .await?;
3735
3736        let mut response = response;
3737        let result = xml_util::parse_response(&mut response, |actual_tag_name, stack| {
3738            xml_util::start_element(actual_tag_name, stack)?;
3739            let result =
3740                SendMessageBatchResultDeserializer::deserialize("SendMessageBatchResult", stack)?;
3741            skip_tree(stack);
3742            xml_util::end_element(actual_tag_name, stack)?;
3743            Ok(result)
3744        })
3745        .await?;
3746
3747        drop(response); // parse non-payload
3748        Ok(result)
3749    }
3750
3751    /// <p><p>Sets the value of one or more queue attributes. When you change a queue&#39;s attributes, the change can take up to 60 seconds for most of the attributes to propagate throughout the Amazon SQS system. Changes made to the <code>MessageRetentionPeriod</code> attribute can take up to 15 minutes.</p> <note> <ul> <li> <p>In the future, new attributes might be added. If you write code that calls this action, we recommend that you structure your code so that it can handle new attributes gracefully.</p> </li> <li> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </li> <li> <p>To remove the ability to change queue permissions, you must deny permission to the <code>AddPermission</code>, <code>RemovePermission</code>, and <code>SetQueueAttributes</code> actions in your IAM policy.</p> </li> </ul> </note></p>
3752    async fn set_queue_attributes(
3753        &self,
3754        input: SetQueueAttributesRequest,
3755    ) -> Result<(), RusotoError<SetQueueAttributesError>> {
3756        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3757        let params = self.new_params("SetQueueAttributes");
3758        let mut params = params;
3759        SetQueueAttributesRequestSerializer::serialize(&mut params, "", &input);
3760        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3761        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3762
3763        let response = self
3764            .sign_and_dispatch(request, SetQueueAttributesError::from_response)
3765            .await?;
3766
3767        std::mem::drop(response);
3768        Ok(())
3769    }
3770
3771    /// <p><p>Add cost allocation tags to the specified Amazon SQS queue. For an overview, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html">Tagging Your Amazon SQS Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <p>When you use queue tags, keep the following guidelines in mind:</p> <ul> <li> <p>Adding more than 50 tags to a queue isn&#39;t recommended.</p> </li> <li> <p>Tags don&#39;t have any semantic meaning. Amazon SQS interprets tags as character strings.</p> </li> <li> <p>Tags are case-sensitive.</p> </li> <li> <p>A new tag with a key identical to that of an existing tag overwrites the existing tag.</p> </li> </ul> <p>For a full list of tag restrictions, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues">Limits Related to Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3772    async fn tag_queue(&self, input: TagQueueRequest) -> Result<(), RusotoError<TagQueueError>> {
3773        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3774        let params = self.new_params("TagQueue");
3775        let mut params = params;
3776        TagQueueRequestSerializer::serialize(&mut params, "", &input);
3777        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3778        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3779
3780        let response = self
3781            .sign_and_dispatch(request, TagQueueError::from_response)
3782            .await?;
3783
3784        std::mem::drop(response);
3785        Ok(())
3786    }
3787
3788    /// <p><p>Remove cost allocation tags from the specified Amazon SQS queue. For an overview, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html">Tagging Your Amazon SQS Queues</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> <note> <p>Cross-account permissions don&#39;t apply to this action. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name">Grant Cross-Account Permissions to a Role and a User Name</a> in the <i>Amazon Simple Queue Service Developer Guide</i>.</p> </note></p>
3789    async fn untag_queue(
3790        &self,
3791        input: UntagQueueRequest,
3792    ) -> Result<(), RusotoError<UntagQueueError>> {
3793        let mut request = SignedRequest::new("POST", "sqs", &self.region, "/");
3794        let params = self.new_params("UntagQueue");
3795        let mut params = params;
3796        UntagQueueRequestSerializer::serialize(&mut params, "", &input);
3797        request.set_payload(Some(serde_urlencoded::to_string(&params).unwrap()));
3798        request.set_content_type("application/x-www-form-urlencoded".to_owned());
3799
3800        let response = self
3801            .sign_and_dispatch(request, UntagQueueError::from_response)
3802            .await?;
3803
3804        std::mem::drop(response);
3805        Ok(())
3806    }
3807}
3808
3809#[cfg(test)]
3810mod protocol_tests {
3811
3812    extern crate rusoto_mock;
3813
3814    use self::rusoto_mock::*;
3815    use super::*;
3816    use rusoto_core::Region as rusoto_region;
3817
3818    #[tokio::test]
3819    async fn test_parse_error_sqs_delete_queue() {
3820        let mock_response = MockResponseReader::read_response(
3821            "test_resources/generated/error",
3822            "sqs-delete-queue.xml",
3823        );
3824        let mock = MockRequestDispatcher::with_status(400).with_body(&mock_response);
3825        let client = SqsClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
3826        let request = DeleteQueueRequest::default();
3827        let result = client.delete_queue(request).await;
3828        assert!(!result.is_ok(), "parse error: {:?}", result);
3829    }
3830
3831    #[tokio::test]
3832    async fn test_parse_valid_sqs_add_permission() {
3833        let mock_response = MockResponseReader::read_response(
3834            "test_resources/generated/valid",
3835            "sqs-add-permission.xml",
3836        );
3837        let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
3838        let client = SqsClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
3839        let request = AddPermissionRequest::default();
3840        let result = client.add_permission(request).await;
3841        assert!(result.is_ok(), "parse error: {:?}", result);
3842    }
3843
3844    #[tokio::test]
3845    async fn test_parse_valid_sqs_change_message_visibility_batch() {
3846        let mock_response = MockResponseReader::read_response(
3847            "test_resources/generated/valid",
3848            "sqs-change-message-visibility-batch.xml",
3849        );
3850        let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
3851        let client = SqsClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
3852        let request = ChangeMessageVisibilityBatchRequest::default();
3853        let result = client.change_message_visibility_batch(request).await;
3854        assert!(result.is_ok(), "parse error: {:?}", result);
3855    }
3856
3857    #[tokio::test]
3858    async fn test_parse_valid_sqs_create_queue() {
3859        let mock_response = MockResponseReader::read_response(
3860            "test_resources/generated/valid",
3861            "sqs-create-queue.xml",
3862        );
3863        let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
3864        let client = SqsClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
3865        let request = CreateQueueRequest::default();
3866        let result = client.create_queue(request).await;
3867        assert!(result.is_ok(), "parse error: {:?}", result);
3868    }
3869
3870    #[tokio::test]
3871    async fn test_parse_valid_sqs_delete_message_batch() {
3872        let mock_response = MockResponseReader::read_response(
3873            "test_resources/generated/valid",
3874            "sqs-delete-message-batch.xml",
3875        );
3876        let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
3877        let client = SqsClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
3878        let request = DeleteMessageBatchRequest::default();
3879        let result = client.delete_message_batch(request).await;
3880        assert!(result.is_ok(), "parse error: {:?}", result);
3881    }
3882
3883    #[tokio::test]
3884    async fn test_parse_valid_sqs_get_queue_attributes() {
3885        let mock_response = MockResponseReader::read_response(
3886            "test_resources/generated/valid",
3887            "sqs-get-queue-attributes.xml",
3888        );
3889        let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
3890        let client = SqsClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
3891        let request = GetQueueAttributesRequest::default();
3892        let result = client.get_queue_attributes(request).await;
3893        assert!(result.is_ok(), "parse error: {:?}", result);
3894    }
3895
3896    #[tokio::test]
3897    async fn test_parse_valid_sqs_get_queue_url() {
3898        let mock_response = MockResponseReader::read_response(
3899            "test_resources/generated/valid",
3900            "sqs-get-queue-url.xml",
3901        );
3902        let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
3903        let client = SqsClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
3904        let request = GetQueueUrlRequest::default();
3905        let result = client.get_queue_url(request).await;
3906        assert!(result.is_ok(), "parse error: {:?}", result);
3907    }
3908
3909    #[tokio::test]
3910    async fn test_parse_valid_sqs_list_queues() {
3911        let mock_response = MockResponseReader::read_response(
3912            "test_resources/generated/valid",
3913            "sqs-list-queues.xml",
3914        );
3915        let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
3916        let client = SqsClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
3917        let request = ListQueuesRequest::default();
3918        let result = client.list_queues(request).await;
3919        assert!(result.is_ok(), "parse error: {:?}", result);
3920    }
3921
3922    #[tokio::test]
3923    async fn test_parse_valid_sqs_receive_message() {
3924        let mock_response = MockResponseReader::read_response(
3925            "test_resources/generated/valid",
3926            "sqs-receive-message.xml",
3927        );
3928        let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
3929        let client = SqsClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
3930        let request = ReceiveMessageRequest::default();
3931        let result = client.receive_message(request).await;
3932        assert!(result.is_ok(), "parse error: {:?}", result);
3933    }
3934
3935    #[tokio::test]
3936    async fn test_parse_valid_sqs_send_message_batch() {
3937        let mock_response = MockResponseReader::read_response(
3938            "test_resources/generated/valid",
3939            "sqs-send-message-batch.xml",
3940        );
3941        let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
3942        let client = SqsClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
3943        let request = SendMessageBatchRequest::default();
3944        let result = client.send_message_batch(request).await;
3945        assert!(result.is_ok(), "parse error: {:?}", result);
3946    }
3947
3948    #[tokio::test]
3949    async fn test_parse_valid_sqs_send_message() {
3950        let mock_response = MockResponseReader::read_response(
3951            "test_resources/generated/valid",
3952            "sqs-send-message.xml",
3953        );
3954        let mock = MockRequestDispatcher::with_status(200).with_body(&mock_response);
3955        let client = SqsClient::new_with(mock, MockCredentialsProvider, rusoto_region::UsEast1);
3956        let request = SendMessageRequest::default();
3957        let result = client.send_message(request).await;
3958        assert!(result.is_ok(), "parse error: {:?}", result);
3959    }
3960}