/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
* permissions and limitations under the License.
*/
/*
* Do not modify this file. This file is generated from the sqs-2012-11-05.normal.json service model.
*/
using System;
using System.Runtime.ExceptionServices;
using System.Threading;
using System.Threading.Tasks;
using System.Collections.Generic;
using System.Net;
using Amazon.SQS.Model;
using Amazon.SQS.Model.Internal.MarshallTransformations;
using Amazon.SQS.Internal;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Auth;
using Amazon.Runtime.Internal.Transform;
namespace Amazon.SQS
{
///
/// Implementation for accessing SQS
///
/// Welcome to the Amazon SQS API Reference.
///
///
///
/// Amazon SQS is a reliable, highly-scalable hosted queue for storing messages as they
/// travel between applications or microservices. Amazon SQS moves data between distributed
/// application components and helps you decouple these components.
///
///
///
/// For information on the permissions you need to use this API, see Identity
/// and access management in the Amazon SQS Developer Guide.
///
///
///
/// You can use Amazon Web Services SDKs
/// to access Amazon SQS using your favorite programming language. The SDKs perform tasks
/// such as the following automatically:
///
/// -
///
/// Cryptographically sign your service requests
///
///
-
///
/// Retry requests
///
///
-
///
/// Handle error responses
///
///
///
/// Additional information
///
///
///
public partial class AmazonSQSClient : AmazonServiceClient, IAmazonSQS
{
private static IServiceMetadata serviceMetadata = new AmazonSQSMetadata();
#region Constructors
///
/// Constructs AmazonSQSClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
///
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
///
///
///
public AmazonSQSClient()
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonSQSConfig()) { }
///
/// Constructs AmazonSQSClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
///
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
///
///
///
/// The region to connect.
public AmazonSQSClient(RegionEndpoint region)
: base(FallbackCredentialsFactory.GetCredentials(), new AmazonSQSConfig{RegionEndpoint = region}) { }
///
/// Constructs AmazonSQSClient with the credentials loaded from the application's
/// default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
///
/// Example App.config with credentials set.
///
/// <?xml version="1.0" encoding="utf-8" ?>
/// <configuration>
/// <appSettings>
/// <add key="AWSProfileName" value="AWS Default"/>
/// </appSettings>
/// </configuration>
///
///
///
/// The AmazonSQSClient Configuration Object
public AmazonSQSClient(AmazonSQSConfig config)
: base(FallbackCredentialsFactory.GetCredentials(config), config){}
///
/// Constructs AmazonSQSClient with AWS Credentials
///
/// AWS Credentials
public AmazonSQSClient(AWSCredentials credentials)
: this(credentials, new AmazonSQSConfig())
{
}
///
/// Constructs AmazonSQSClient with AWS Credentials
///
/// AWS Credentials
/// The region to connect.
public AmazonSQSClient(AWSCredentials credentials, RegionEndpoint region)
: this(credentials, new AmazonSQSConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonSQSClient with AWS Credentials and an
/// AmazonSQSClient Configuration object.
///
/// AWS Credentials
/// The AmazonSQSClient Configuration Object
public AmazonSQSClient(AWSCredentials credentials, AmazonSQSConfig clientConfig)
: base(credentials, clientConfig)
{
}
///
/// Constructs AmazonSQSClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
public AmazonSQSClient(string awsAccessKeyId, string awsSecretAccessKey)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonSQSConfig())
{
}
///
/// Constructs AmazonSQSClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The region to connect.
public AmazonSQSClient(string awsAccessKeyId, string awsSecretAccessKey, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, new AmazonSQSConfig() {RegionEndpoint=region})
{
}
///
/// Constructs AmazonSQSClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonSQSClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// The AmazonSQSClient Configuration Object
public AmazonSQSClient(string awsAccessKeyId, string awsSecretAccessKey, AmazonSQSConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, clientConfig)
{
}
///
/// Constructs AmazonSQSClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
public AmazonSQSClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonSQSConfig())
{
}
///
/// Constructs AmazonSQSClient with AWS Access Key ID and AWS Secret Key
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The region to connect.
public AmazonSQSClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, RegionEndpoint region)
: this(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, new AmazonSQSConfig{RegionEndpoint = region})
{
}
///
/// Constructs AmazonSQSClient with AWS Access Key ID, AWS Secret Key and an
/// AmazonSQSClient Configuration object.
///
/// AWS Access Key ID
/// AWS Secret Access Key
/// AWS Session Token
/// The AmazonSQSClient Configuration Object
public AmazonSQSClient(string awsAccessKeyId, string awsSecretAccessKey, string awsSessionToken, AmazonSQSConfig clientConfig)
: base(awsAccessKeyId, awsSecretAccessKey, awsSessionToken, clientConfig)
{
}
#endregion
#if AWS_ASYNC_ENUMERABLES_API
private ISQSPaginatorFactory _paginators;
///
/// Paginators for the service
///
public ISQSPaginatorFactory Paginators
{
get
{
if (this._paginators == null)
{
this._paginators = new SQSPaginatorFactory(this);
}
return this._paginators;
}
}
#endif
#region Overrides
///
/// Creates the signer for the service.
///
protected override AbstractAWSSigner CreateSigner()
{
return new AWS4Signer();
}
///
/// Customizes the runtime pipeline.
///
/// Runtime pipeline for the current client.
protected override void CustomizeRuntimePipeline(RuntimePipeline pipeline)
{
pipeline.AddHandlerAfter(new Amazon.SQS.Internal.ProcessRequestHandler());
pipeline.AddHandlerBefore(new Amazon.SQS.Internal.ValidationResponseHandler());
pipeline.RemoveHandler();
pipeline.AddHandlerAfter(new AmazonSQSEndpointResolver());
}
///
/// Capture metadata for the service.
///
protected override IServiceMetadata ServiceMetadata
{
get
{
return serviceMetadata;
}
}
#endregion
#region Dispose
///
/// Disposes the service client.
///
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
#endregion
#region AddPermission
internal virtual AddPermissionResponse AddPermission(AddPermissionRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = AddPermissionRequestMarshaller.Instance;
options.ResponseUnmarshaller = AddPermissionResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Adds a permission to a queue for a specific principal.
/// This allows sharing access to the queue.
///
///
///
/// 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 Allow
/// Developers to Write Messages to a Shared Queue in the Amazon SQS Developer
/// Guide.
///
/// -
///
///
AddPermission
generates a policy for you. You can use SetQueueAttributes
///
to upload your policy. For more information, see Using
/// Custom Policies with the Amazon SQS Access Policy Language in the Amazon SQS
/// Developer Guide.
///
/// -
///
/// An Amazon SQS policy can have a maximum of seven actions per statement.
///
///
-
///
/// To remove the ability to change queue permissions, you must deny permission to the
///
AddPermission
, RemovePermission
, and SetQueueAttributes
/// actions in your IAM policy.
///
/// -
///
/// Amazon SQS
AddPermission
does not support adding a non-account principal.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
/// The URL of the Amazon SQS queue to which permissions are added. Queue URLs and names are case-sensitive.
/// The unique identification of the permission you're setting (for example, AliceSendMessage
). Maximum 80 characters. Allowed characters include alphanumeric characters, hyphens (-
), and underscores (_
).
/// The Amazon Web Services account numbers of the principals who are to receive permission. For information about locating the Amazon Web Services account identification, see Your Amazon Web Services Identifiers in the Amazon SQS Developer Guide.
/// The action the client wants to allow for the specified principal. Valid values: the name of any action or *
. For more information about these actions, see Overview of Managing Access Permissions to Your Amazon Simple Queue Service Resource in the Amazon SQS Developer Guide. Specifying SendMessage
, DeleteMessage
, or ChangeMessageVisibility
for ActionName.n
also grants permissions for the corresponding batch versions of those actions: SendMessageBatch
, DeleteMessageBatch
, and ChangeMessageVisibilityBatch
.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the AddPermission service method, as returned by SQS.
///
/// The specified action violates a limit. For example, ReceiveMessage
returns
/// this error if the maximum number of in flight messages is reached and AddPermission
/// returns this error if the maximum number of permissions for the queue is reached.
///
/// REST API Reference for AddPermission Operation
public virtual Task AddPermissionAsync(string queueUrl, string label, List awsAccountIds, List actions, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new AddPermissionRequest();
request.QueueUrl = queueUrl;
request.Label = label;
request.AWSAccountIds = awsAccountIds;
request.Actions = actions;
return AddPermissionAsync(request, cancellationToken);
}
///
/// Adds a permission to a queue for a specific principal.
/// This allows sharing access to the queue.
///
///
///
/// 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 Allow
/// Developers to Write Messages to a Shared Queue in the Amazon SQS Developer
/// Guide.
///
/// -
///
///
AddPermission
generates a policy for you. You can use SetQueueAttributes
///
to upload your policy. For more information, see Using
/// Custom Policies with the Amazon SQS Access Policy Language in the Amazon SQS
/// Developer Guide.
///
/// -
///
/// An Amazon SQS policy can have a maximum of seven actions per statement.
///
///
-
///
/// To remove the ability to change queue permissions, you must deny permission to the
///
AddPermission
, RemovePermission
, and SetQueueAttributes
/// actions in your IAM policy.
///
/// -
///
/// Amazon SQS
AddPermission
does not support adding a non-account principal.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
/// Container for the necessary parameters to execute the AddPermission service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the AddPermission service method, as returned by SQS.
///
/// The specified action violates a limit. For example, ReceiveMessage
returns
/// this error if the maximum number of in flight messages is reached and AddPermission
/// returns this error if the maximum number of permissions for the queue is reached.
///
/// REST API Reference for AddPermission Operation
public virtual Task AddPermissionAsync(AddPermissionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = AddPermissionRequestMarshaller.Instance;
options.ResponseUnmarshaller = AddPermissionResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region CancelMessageMoveTask
internal virtual CancelMessageMoveTaskResponse CancelMessageMoveTask(CancelMessageMoveTaskRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CancelMessageMoveTaskRequestMarshaller.Instance;
options.ResponseUnmarshaller = CancelMessageMoveTaskResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Cancels a specified message movement task. A message movement can only be cancelled
/// when the current status is RUNNING. Cancelling a message movement task does not revert
/// the messages that have already been moved. It can only stop the messages that have
/// not been moved yet.
///
/// -
///
/// This action is currently limited to supporting message redrive from dead-letter
/// queues (DLQs) only. In this context, the source queue is the dead-letter queue
/// (DLQ), while the destination queue can be the original source queue (from which the
/// messages were driven to the dead-letter-queue), or a custom destination queue.
///
///
-
///
/// Currently, only standard queues are supported.
///
///
-
///
/// Only one active message movement task is supported per queue at any given time.
///
///
///
/// Container for the necessary parameters to execute the CancelMessageMoveTask service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the CancelMessageMoveTask service method, as returned by SQS.
///
/// One or more specified resources don't exist.
///
///
/// Error code 400. Unsupported operation.
///
/// REST API Reference for CancelMessageMoveTask Operation
public virtual Task CancelMessageMoveTaskAsync(CancelMessageMoveTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = CancelMessageMoveTaskRequestMarshaller.Instance;
options.ResponseUnmarshaller = CancelMessageMoveTaskResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ChangeMessageVisibility
internal virtual ChangeMessageVisibilityResponse ChangeMessageVisibility(ChangeMessageVisibilityRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ChangeMessageVisibilityRequestMarshaller.Instance;
options.ResponseUnmarshaller = ChangeMessageVisibilityResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// 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 Visibility
/// Timeout in the Amazon SQS Developer Guide.
///
///
///
/// For example, if the default timeout for a queue is 60 seconds, 15 seconds have elapsed
/// since you received the message, and you send a ChangeMessageVisibility call with VisibilityTimeout
/// set to 10 seconds, the 10 seconds begin to count from the time that you make the ChangeMessageVisibility
/// call. Thus, any attempt to change the visibility timeout or to delete that message
/// 10 seconds after you initially change the visibility timeout (a total of 25 seconds)
/// might result in an error.
///
///
///
/// An Amazon SQS message has three basic states:
///
/// -
///
/// Sent to a queue by a producer.
///
///
-
///
/// Received from the queue by a consumer.
///
///
-
///
/// Deleted from the queue.
///
///
///
/// A message is considered to be stored 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
/// in flight 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
/// in flight messages.
///
///
///
/// Limits that apply to in flight messages are unrelated to the unlimited number
/// of stored messages.
///
///
///
/// For most standard queues (depending on queue traffic and message backlog), there can
/// be a maximum of approximately 120,000 in flight messages (received from a queue by
/// a consumer, but not yet deleted from the queue). If you reach this limit, Amazon SQS
/// returns the OverLimit
error message. To avoid reaching the limit, you
/// should delete messages from the queue after they're processed. You can also increase
/// the number of queues you use to process your messages. To request a limit increase,
/// file
/// a support request.
///
///
///
/// For FIFO queues, there can be a maximum of 20,000 in flight 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.
///
///
///
/// If you attempt to set the VisibilityTimeout
to a value greater than the
/// maximum time left, Amazon SQS returns an error. Amazon SQS doesn't automatically recalculate
/// and increase the timeout to the maximum remaining time.
///
///
///
/// Unlike with a queue, when you change the visibility timeout for a specific message
/// the timeout value is applied immediately but isn't saved in memory for that message.
/// If you don'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
/// ChangeMessageVisibility
action) the next time the message is received.
///
///
///
/// The URL of the Amazon SQS queue whose message's visibility is changed. Queue URLs and names are case-sensitive.
/// The receipt handle associated with the message, whose visibility timeout is changed. This parameter is returned by the ReceiveMessage
action.
/// The new value for the message's visibility timeout (in seconds). Values range: 0
to 43200
. Maximum: 12 hours.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ChangeMessageVisibility service method, as returned by SQS.
///
/// The specified message isn't in flight.
///
///
/// The specified receipt handle isn't valid.
///
/// REST API Reference for ChangeMessageVisibility Operation
public virtual Task ChangeMessageVisibilityAsync(string queueUrl, string receiptHandle, int visibilityTimeout, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new ChangeMessageVisibilityRequest();
request.QueueUrl = queueUrl;
request.ReceiptHandle = receiptHandle;
request.VisibilityTimeout = visibilityTimeout;
return ChangeMessageVisibilityAsync(request, cancellationToken);
}
///
/// 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 Visibility
/// Timeout in the Amazon SQS Developer Guide.
///
///
///
/// For example, if the default timeout for a queue is 60 seconds, 15 seconds have elapsed
/// since you received the message, and you send a ChangeMessageVisibility call with VisibilityTimeout
/// set to 10 seconds, the 10 seconds begin to count from the time that you make the ChangeMessageVisibility
/// call. Thus, any attempt to change the visibility timeout or to delete that message
/// 10 seconds after you initially change the visibility timeout (a total of 25 seconds)
/// might result in an error.
///
///
///
/// An Amazon SQS message has three basic states:
///
/// -
///
/// Sent to a queue by a producer.
///
///
-
///
/// Received from the queue by a consumer.
///
///
-
///
/// Deleted from the queue.
///
///
///
/// A message is considered to be stored 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
/// in flight 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
/// in flight messages.
///
///
///
/// Limits that apply to in flight messages are unrelated to the unlimited number
/// of stored messages.
///
///
///
/// For most standard queues (depending on queue traffic and message backlog), there can
/// be a maximum of approximately 120,000 in flight messages (received from a queue by
/// a consumer, but not yet deleted from the queue). If you reach this limit, Amazon SQS
/// returns the OverLimit
error message. To avoid reaching the limit, you
/// should delete messages from the queue after they're processed. You can also increase
/// the number of queues you use to process your messages. To request a limit increase,
/// file
/// a support request.
///
///
///
/// For FIFO queues, there can be a maximum of 20,000 in flight 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.
///
///
///
/// If you attempt to set the VisibilityTimeout
to a value greater than the
/// maximum time left, Amazon SQS returns an error. Amazon SQS doesn't automatically recalculate
/// and increase the timeout to the maximum remaining time.
///
///
///
/// Unlike with a queue, when you change the visibility timeout for a specific message
/// the timeout value is applied immediately but isn't saved in memory for that message.
/// If you don'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
/// ChangeMessageVisibility
action) the next time the message is received.
///
///
///
/// Container for the necessary parameters to execute the ChangeMessageVisibility service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ChangeMessageVisibility service method, as returned by SQS.
///
/// The specified message isn't in flight.
///
///
/// The specified receipt handle isn't valid.
///
/// REST API Reference for ChangeMessageVisibility Operation
public virtual Task ChangeMessageVisibilityAsync(ChangeMessageVisibilityRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ChangeMessageVisibilityRequestMarshaller.Instance;
options.ResponseUnmarshaller = ChangeMessageVisibilityResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ChangeMessageVisibilityBatch
internal virtual ChangeMessageVisibilityBatchResponse ChangeMessageVisibilityBatch(ChangeMessageVisibilityBatchRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ChangeMessageVisibilityBatchRequestMarshaller.Instance;
options.ResponseUnmarshaller = ChangeMessageVisibilityBatchResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Changes the visibility timeout of multiple messages. This is a batch version of
/// ChangeMessageVisibility.
The result of the action on each message is
/// reported individually in the response. You can send up to 10 ChangeMessageVisibility
///
requests with each ChangeMessageVisibilityBatch
action.
///
///
///
/// 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 200
.
///
///
///
/// The URL of the Amazon SQS queue whose messages' visibility is changed. Queue URLs and names are case-sensitive.
/// Lists the receipt handles of the messages for which the visibility timeout must be changed.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ChangeMessageVisibilityBatch service method, as returned by SQS.
///
/// Two or more batch entries in the request have the same Id
.
///
///
/// The batch request doesn't contain any entries.
///
///
/// The Id
of a batch entry in a batch request doesn't abide by the specification.
///
///
/// The batch request contains more entries than permissible.
///
/// REST API Reference for ChangeMessageVisibilityBatch Operation
public virtual Task ChangeMessageVisibilityBatchAsync(string queueUrl, List entries, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new ChangeMessageVisibilityBatchRequest();
request.QueueUrl = queueUrl;
request.Entries = entries;
return ChangeMessageVisibilityBatchAsync(request, cancellationToken);
}
///
/// Changes the visibility timeout of multiple messages. This is a batch version of
/// ChangeMessageVisibility.
The result of the action on each message is
/// reported individually in the response. You can send up to 10 ChangeMessageVisibility
///
requests with each ChangeMessageVisibilityBatch
action.
///
///
///
/// 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 200
.
///
///
///
/// Container for the necessary parameters to execute the ChangeMessageVisibilityBatch service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ChangeMessageVisibilityBatch service method, as returned by SQS.
///
/// Two or more batch entries in the request have the same Id
.
///
///
/// The batch request doesn't contain any entries.
///
///
/// The Id
of a batch entry in a batch request doesn't abide by the specification.
///
///
/// The batch request contains more entries than permissible.
///
/// REST API Reference for ChangeMessageVisibilityBatch Operation
public virtual Task ChangeMessageVisibilityBatchAsync(ChangeMessageVisibilityBatchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ChangeMessageVisibilityBatchRequestMarshaller.Instance;
options.ResponseUnmarshaller = ChangeMessageVisibilityBatchResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region CreateQueue
internal virtual CreateQueueResponse CreateQueue(CreateQueueRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateQueueRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateQueueResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Creates a new standard or FIFO queue. You can pass one or more attributes in the request.
/// Keep the following in mind:
///
/// -
///
/// If you don't specify the
FifoQueue
attribute, Amazon SQS creates a standard
/// queue.
///
///
///
/// You can't change the queue type after you create it and you can'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 Moving
/// From a Standard Queue to a FIFO Queue in the Amazon SQS Developer Guide.
///
///
/// -
///
/// If you don't provide a value for an attribute, the queue is created with the default
/// value for the attribute.
///
///
-
///
/// If you delete a queue, you must wait at least 60 seconds before creating a queue with
/// the same name.
///
///
///
/// To successfully create a new queue, you must provide a queue name that adheres to
/// the limits
/// related to queues and is unique within the scope of your queues.
///
///
///
/// After you create a queue, you must wait at least one second after the queue is created
/// to be able to use the queue.
///
///
///
/// To get the queue URL, use the GetQueueUrl
action. GetQueueUrl
///
requires only the QueueName
parameter. be aware of existing queue
/// names:
///
/// -
///
/// If you provide the name of an existing queue along with the exact names and values
/// of all the queue's attributes,
CreateQueue
returns the queue URL for
/// the existing queue.
///
/// -
///
/// If the queue name, attribute names, or attribute values don't match an existing queue,
///
CreateQueue
returns an error.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
/// The name of the new queue. The following limits apply to this name: - A queue name can have up to 80 characters.
- Valid values: alphanumeric characters, hyphens (
-
), and underscores (_
). - A FIFO queue name must end with the
.fifo
suffix.
Queue URLs and names are case-sensitive.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the CreateQueue service method, as returned by SQS.
///
/// You must wait 60 seconds after deleting a queue before you can create another queue
/// with the same name.
///
///
/// 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.
///
/// REST API Reference for CreateQueue Operation
public virtual Task CreateQueueAsync(string queueName, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new CreateQueueRequest();
request.QueueName = queueName;
return CreateQueueAsync(request, cancellationToken);
}
///
/// Creates a new standard or FIFO queue. You can pass one or more attributes in the request.
/// Keep the following in mind:
///
/// -
///
/// If you don't specify the
FifoQueue
attribute, Amazon SQS creates a standard
/// queue.
///
///
///
/// You can't change the queue type after you create it and you can'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 Moving
/// From a Standard Queue to a FIFO Queue in the Amazon SQS Developer Guide.
///
///
/// -
///
/// If you don't provide a value for an attribute, the queue is created with the default
/// value for the attribute.
///
///
-
///
/// If you delete a queue, you must wait at least 60 seconds before creating a queue with
/// the same name.
///
///
///
/// To successfully create a new queue, you must provide a queue name that adheres to
/// the limits
/// related to queues and is unique within the scope of your queues.
///
///
///
/// After you create a queue, you must wait at least one second after the queue is created
/// to be able to use the queue.
///
///
///
/// To get the queue URL, use the GetQueueUrl
action. GetQueueUrl
///
requires only the QueueName
parameter. be aware of existing queue
/// names:
///
/// -
///
/// If you provide the name of an existing queue along with the exact names and values
/// of all the queue's attributes,
CreateQueue
returns the queue URL for
/// the existing queue.
///
/// -
///
/// If the queue name, attribute names, or attribute values don't match an existing queue,
///
CreateQueue
returns an error.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
/// Container for the necessary parameters to execute the CreateQueue service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the CreateQueue service method, as returned by SQS.
///
/// You must wait 60 seconds after deleting a queue before you can create another queue
/// with the same name.
///
///
/// 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.
///
/// REST API Reference for CreateQueue Operation
public virtual Task CreateQueueAsync(CreateQueueRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = CreateQueueRequestMarshaller.Instance;
options.ResponseUnmarshaller = CreateQueueResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region DeleteMessage
internal virtual DeleteMessageResponse DeleteMessage(DeleteMessageRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteMessageRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteMessageResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Deletes the specified message from the specified queue. To select the message to delete,
/// use the ReceiptHandle
of the message (not the MessageId
/// 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.
///
///
///
/// The ReceiptHandle
is associated with a specific instance of receiving
/// a message. If you receive a message more than once, the ReceiptHandle
/// is different each time you receive a message. When you use the DeleteMessage
/// action, you must provide the most recently received ReceiptHandle
for
/// the message (otherwise, the request succeeds, but the message will not be deleted).
///
///
///
/// 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.
///
///
///
/// The URL of the Amazon SQS queue from which messages are deleted. Queue URLs and names are case-sensitive.
/// The receipt handle associated with the message to delete.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DeleteMessage service method, as returned by SQS.
///
/// The specified receipt handle isn't valid for the current version.
///
///
/// The specified receipt handle isn't valid.
///
/// REST API Reference for DeleteMessage Operation
public virtual Task DeleteMessageAsync(string queueUrl, string receiptHandle, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new DeleteMessageRequest();
request.QueueUrl = queueUrl;
request.ReceiptHandle = receiptHandle;
return DeleteMessageAsync(request, cancellationToken);
}
///
/// Deletes the specified message from the specified queue. To select the message to delete,
/// use the ReceiptHandle
of the message (not the MessageId
/// 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.
///
///
///
/// The ReceiptHandle
is associated with a specific instance of receiving
/// a message. If you receive a message more than once, the ReceiptHandle
/// is different each time you receive a message. When you use the DeleteMessage
/// action, you must provide the most recently received ReceiptHandle
for
/// the message (otherwise, the request succeeds, but the message will not be deleted).
///
///
///
/// 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.
///
///
///
/// Container for the necessary parameters to execute the DeleteMessage service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DeleteMessage service method, as returned by SQS.
///
/// The specified receipt handle isn't valid for the current version.
///
///
/// The specified receipt handle isn't valid.
///
/// REST API Reference for DeleteMessage Operation
public virtual Task DeleteMessageAsync(DeleteMessageRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteMessageRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteMessageResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region DeleteMessageBatch
internal virtual DeleteMessageBatchResponse DeleteMessageBatch(DeleteMessageBatchRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteMessageBatchRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteMessageBatchResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Deletes up to ten messages from the specified queue. This is a batch version of
/// DeleteMessage.
The result of the action on 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 200
.
///
///
///
/// The URL of the Amazon SQS queue from which messages are deleted. Queue URLs and names are case-sensitive.
/// Lists the receipt handles for the messages to be deleted.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DeleteMessageBatch service method, as returned by SQS.
///
/// Two or more batch entries in the request have the same Id
.
///
///
/// The batch request doesn't contain any entries.
///
///
/// The Id
of a batch entry in a batch request doesn't abide by the specification.
///
///
/// The batch request contains more entries than permissible.
///
/// REST API Reference for DeleteMessageBatch Operation
public virtual Task DeleteMessageBatchAsync(string queueUrl, List entries, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new DeleteMessageBatchRequest();
request.QueueUrl = queueUrl;
request.Entries = entries;
return DeleteMessageBatchAsync(request, cancellationToken);
}
///
/// Deletes up to ten messages from the specified queue. This is a batch version of
/// DeleteMessage.
The result of the action on 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 200
.
///
///
///
/// Container for the necessary parameters to execute the DeleteMessageBatch service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DeleteMessageBatch service method, as returned by SQS.
///
/// Two or more batch entries in the request have the same Id
.
///
///
/// The batch request doesn't contain any entries.
///
///
/// The Id
of a batch entry in a batch request doesn't abide by the specification.
///
///
/// The batch request contains more entries than permissible.
///
/// REST API Reference for DeleteMessageBatch Operation
public virtual Task DeleteMessageBatchAsync(DeleteMessageBatchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteMessageBatchRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteMessageBatchResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region DeleteQueue
internal virtual DeleteQueueResponse DeleteQueue(DeleteQueueRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteQueueRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteQueueResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Deletes the queue specified by the QueueUrl
, regardless of the queue's
/// contents.
///
///
///
/// Be careful with the DeleteQueue
action: When you delete a queue, any
/// messages in the queue are no longer available.
///
///
///
/// 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
/// SendMessage
request might succeed, but after 60 seconds the queue and
/// the message you sent no longer exist.
///
///
///
/// When you delete a queue, you must wait at least 60 seconds before creating a queue
/// with the same name.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
/// The delete operation uses the HTTP GET
verb.
///
///
///
/// The URL of the Amazon SQS queue to delete. Queue URLs and names are case-sensitive.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DeleteQueue service method, as returned by SQS.
/// REST API Reference for DeleteQueue Operation
public virtual Task DeleteQueueAsync(string queueUrl, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new DeleteQueueRequest();
request.QueueUrl = queueUrl;
return DeleteQueueAsync(request, cancellationToken);
}
///
/// Deletes the queue specified by the QueueUrl
, regardless of the queue's
/// contents.
///
///
///
/// Be careful with the DeleteQueue
action: When you delete a queue, any
/// messages in the queue are no longer available.
///
///
///
/// 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
/// SendMessage
request might succeed, but after 60 seconds the queue and
/// the message you sent no longer exist.
///
///
///
/// When you delete a queue, you must wait at least 60 seconds before creating a queue
/// with the same name.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
/// The delete operation uses the HTTP GET
verb.
///
///
///
/// Container for the necessary parameters to execute the DeleteQueue service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the DeleteQueue service method, as returned by SQS.
/// REST API Reference for DeleteQueue Operation
public virtual Task DeleteQueueAsync(DeleteQueueRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = DeleteQueueRequestMarshaller.Instance;
options.ResponseUnmarshaller = DeleteQueueResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region GetQueueAttributes
internal virtual GetQueueAttributesResponse GetQueueAttributes(GetQueueAttributesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetQueueAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetQueueAttributesResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Gets attributes for the specified queue.
///
///
///
/// To determine whether a queue is FIFO,
/// you can check whether QueueName
ends with the .fifo
suffix.
///
///
///
/// The URL of the Amazon SQS queue whose attribute information is retrieved. Queue URLs and names are case-sensitive.
/// A list of attributes for which to retrieve information. The AttributeNames
parameter is optional, but if you don't specify values for this parameter, the request returns empty results. 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. The following attributes are supported: The ApproximateNumberOfMessagesDelayed
, ApproximateNumberOfMessagesNotVisible
, and ApproximateNumberOfMessages
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. -
All
– Returns all values. -
ApproximateNumberOfMessages
– Returns the approximate number of messages available for retrieval from the queue. -
ApproximateNumberOfMessagesDelayed
– 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. -
ApproximateNumberOfMessagesNotVisible
– Returns the approximate number of messages that are in flight. Messages are considered to be in flight 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. -
CreatedTimestamp
– Returns the time when the queue was created in seconds (epoch time). -
DelaySeconds
– Returns the default delay on the queue in seconds. -
LastModifiedTimestamp
– Returns the time when the queue was last changed in seconds (epoch time). -
MaximumMessageSize
– Returns the limit of how many bytes a message can contain before Amazon SQS rejects it. -
MessageRetentionPeriod
– Returns the length of time, in seconds, for which Amazon SQS retains a message. When you change a queue'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 MessageRetentionPeriod
attribute can take up to 15 minutes and will impact existing messages in the queue potentially causing them to be expired and deleted if the MessageRetentionPeriod
is reduced below the age of existing messages. -
Policy
– Returns the policy of the queue. -
QueueArn
– Returns the Amazon resource name (ARN) of the queue. -
ReceiveMessageWaitTimeSeconds
– Returns the length of time, in seconds, for which the ReceiveMessage
action waits for a message to arrive. -
VisibilityTimeout
– Returns the visibility timeout for the queue. For more information about the visibility timeout, see Visibility Timeout in the Amazon SQS Developer Guide.
The following attributes apply only to dead-letter queues: -
RedrivePolicy
– The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object. The parameters are as follows: -
deadLetterTargetArn
– The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon SQS moves messages after the value of maxReceiveCount
is exceeded. -
maxReceiveCount
– The number of times a message is delivered to the source queue before being moved to the dead-letter queue. Default: 10. When the ReceiveCount
for a message exceeds the maxReceiveCount
for a queue, Amazon SQS moves the message to the dead-letter-queue.
-
RedriveAllowPolicy
– The string that includes the parameters for the permissions for the dead-letter queue redrive permission and which source queues can specify dead-letter queues as a JSON object. The parameters are as follows: -
redrivePermission
– The permission type that defines which source queues can specify the current queue as the dead-letter queue. Valid values are: -
allowAll
– (Default) Any source queues in this Amazon Web Services account in the same Region can specify this queue as the dead-letter queue. -
denyAll
– No source queues can specify this queue as the dead-letter queue. -
byQueue
– Only queues specified by the sourceQueueArns
parameter can specify this queue as the dead-letter queue.
-
sourceQueueArns
– The Amazon Resource Names (ARN)s of the source queues that can specify this queue as the dead-letter queue and redrive messages. You can specify this parameter only when the redrivePermission
parameter is set to byQueue
. You can specify up to 10 source queue ARNs. To allow more than 10 source queues to specify dead-letter queues, set the redrivePermission
parameter to allowAll
.
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. The following attributes apply only to server-side-encryption: -
KmsMasterKeyId
– Returns the ID of an Amazon Web Services managed customer master key (CMK) for Amazon SQS or a custom CMK. For more information, see Key Terms. -
KmsDataKeyReusePeriodSeconds
– Returns the length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling KMS again. For more information, see How Does the Data Key Reuse Period Work?. -
SqsManagedSseEnabled
– Returns information about whether the queue is using SSE-SQS encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, SSE-KMS or SSE-SQS).
The following attributes apply only to FIFO (first-in-first-out) queues: -
FifoQueue
– Returns information about whether the queue is FIFO. For more information, see FIFO queue logic in the Amazon SQS Developer Guide. To determine whether a queue is FIFO, you can check whether QueueName
ends with the .fifo
suffix. -
ContentBasedDeduplication
– Returns whether content-based deduplication is enabled for the queue. For more information, see Exactly-once processing in the Amazon SQS Developer Guide.
The following attributes apply only to high throughput for FIFO queues: -
DeduplicationScope
– Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup
and queue
. -
FifoThroughputLimit
– Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue
and perMessageGroupId
. The perMessageGroupId
value is allowed only when the value for DeduplicationScope
is messageGroup
.
To enable high throughput for FIFO queues, do the following: - Set
DeduplicationScope
to messageGroup
. - Set
FifoThroughputLimit
to perMessageGroupId
.
If you set these attributes to anything other than the values shown for enabling high throughput, normal throughput is in effect and deduplication occurs as specified. For information on throughput quotas, see Quotas related to messages in the Amazon SQS Developer Guide.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetQueueAttributes service method, as returned by SQS.
///
/// The specified attribute doesn't exist.
///
/// REST API Reference for GetQueueAttributes Operation
public virtual Task GetQueueAttributesAsync(string queueUrl, List attributeNames, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new GetQueueAttributesRequest();
request.QueueUrl = queueUrl;
request.AttributeNames = attributeNames;
return GetQueueAttributesAsync(request, cancellationToken);
}
///
/// Gets attributes for the specified queue.
///
///
///
/// To determine whether a queue is FIFO,
/// you can check whether QueueName
ends with the .fifo
suffix.
///
///
///
/// Container for the necessary parameters to execute the GetQueueAttributes service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetQueueAttributes service method, as returned by SQS.
///
/// The specified attribute doesn't exist.
///
/// REST API Reference for GetQueueAttributes Operation
public virtual Task GetQueueAttributesAsync(GetQueueAttributesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = GetQueueAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetQueueAttributesResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region GetQueueUrl
internal virtual GetQueueUrlResponse GetQueueUrl(GetQueueUrlRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = GetQueueUrlRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetQueueUrlResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Returns the URL of an existing Amazon SQS queue.
///
///
///
/// To access a queue that belongs to another AWS account, use the QueueOwnerAWSAccountId
/// 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 AddPermission
or see Allow
/// Developers to Write Messages to a Shared Queue in the Amazon SQS Developer
/// Guide.
///
///
/// The name of the queue whose URL must be fetched. Maximum 80 characters. Valid values: alphanumeric characters, hyphens (-
), and underscores (_
). Queue URLs and names are case-sensitive.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetQueueUrl service method, as returned by SQS.
///
/// The specified queue doesn't exist.
///
/// REST API Reference for GetQueueUrl Operation
public virtual Task GetQueueUrlAsync(string queueName, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new GetQueueUrlRequest();
request.QueueName = queueName;
return GetQueueUrlAsync(request, cancellationToken);
}
///
/// Returns the URL of an existing Amazon SQS queue.
///
///
///
/// To access a queue that belongs to another AWS account, use the QueueOwnerAWSAccountId
/// 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 AddPermission
or see Allow
/// Developers to Write Messages to a Shared Queue in the Amazon SQS Developer
/// Guide.
///
///
/// Container for the necessary parameters to execute the GetQueueUrl service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the GetQueueUrl service method, as returned by SQS.
///
/// The specified queue doesn't exist.
///
/// REST API Reference for GetQueueUrl Operation
public virtual Task GetQueueUrlAsync(GetQueueUrlRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = GetQueueUrlRequestMarshaller.Instance;
options.ResponseUnmarshaller = GetQueueUrlResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListDeadLetterSourceQueues
internal virtual ListDeadLetterSourceQueuesResponse ListDeadLetterSourceQueues(ListDeadLetterSourceQueuesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListDeadLetterSourceQueuesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListDeadLetterSourceQueuesResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Returns a list of your queues that have the RedrivePolicy
queue attribute
/// configured with a dead-letter queue.
///
///
///
/// The ListDeadLetterSourceQueues
methods supports pagination. Set parameter
/// MaxResults
in the request to specify the maximum number of results to
/// be returned in the response. If you do not set MaxResults
, the response
/// includes a maximum of 1,000 results. If you set MaxResults
and there
/// are additional results to display, the response includes a value for NextToken
.
/// Use NextToken
as a parameter in your next request to ListDeadLetterSourceQueues
/// to receive the next page of results.
///
///
///
/// For more information about using dead-letter queues, see Using
/// Amazon SQS Dead-Letter Queues in the Amazon SQS Developer Guide.
///
///
/// Container for the necessary parameters to execute the ListDeadLetterSourceQueues service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListDeadLetterSourceQueues service method, as returned by SQS.
///
/// The specified queue doesn't exist.
///
/// REST API Reference for ListDeadLetterSourceQueues Operation
public virtual Task ListDeadLetterSourceQueuesAsync(ListDeadLetterSourceQueuesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListDeadLetterSourceQueuesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListDeadLetterSourceQueuesResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListMessageMoveTasks
internal virtual ListMessageMoveTasksResponse ListMessageMoveTasks(ListMessageMoveTasksRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListMessageMoveTasksRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListMessageMoveTasksResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Gets the most recent message movement tasks (up to 10) under a specific source queue.
///
/// -
///
/// This action is currently limited to supporting message redrive from dead-letter
/// queues (DLQs) only. In this context, the source queue is the dead-letter queue
/// (DLQ), while the destination queue can be the original source queue (from which the
/// messages were driven to the dead-letter-queue), or a custom destination queue.
///
///
-
///
/// Currently, only standard queues are supported.
///
///
-
///
/// Only one active message movement task is supported per queue at any given time.
///
///
///
/// Container for the necessary parameters to execute the ListMessageMoveTasks service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListMessageMoveTasks service method, as returned by SQS.
///
/// One or more specified resources don't exist.
///
///
/// Error code 400. Unsupported operation.
///
/// REST API Reference for ListMessageMoveTasks Operation
public virtual Task ListMessageMoveTasksAsync(ListMessageMoveTasksRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListMessageMoveTasksRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListMessageMoveTasksResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListQueues
internal virtual ListQueuesResponse ListQueues(ListQueuesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListQueuesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListQueuesResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Returns a list of your queues in the current region. The response includes a maximum
/// of 1,000 results. If you specify a value for the optional QueueNamePrefix
/// parameter, only queues with a name that begins with the specified value are returned.
///
///
///
/// The listQueues
methods supports pagination. Set parameter MaxResults
/// in the request to specify the maximum number of results to be returned in the response.
/// If you do not set MaxResults
, the response includes a maximum of 1,000
/// results. If you set MaxResults
and there are additional results to display,
/// the response includes a value for NextToken
. Use NextToken
/// as a parameter in your next request to listQueues
to receive the next
/// page of results.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
/// A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned. Queue URLs and names are case-sensitive.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListQueues service method, as returned by SQS.
/// REST API Reference for ListQueues Operation
public virtual Task ListQueuesAsync(string queueNamePrefix, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new ListQueuesRequest();
request.QueueNamePrefix = queueNamePrefix;
return ListQueuesAsync(request, cancellationToken);
}
///
/// Returns a list of your queues in the current region. The response includes a maximum
/// of 1,000 results. If you specify a value for the optional QueueNamePrefix
/// parameter, only queues with a name that begins with the specified value are returned.
///
///
///
/// The listQueues
methods supports pagination. Set parameter MaxResults
/// in the request to specify the maximum number of results to be returned in the response.
/// If you do not set MaxResults
, the response includes a maximum of 1,000
/// results. If you set MaxResults
and there are additional results to display,
/// the response includes a value for NextToken
. Use NextToken
/// as a parameter in your next request to listQueues
to receive the next
/// page of results.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
/// Container for the necessary parameters to execute the ListQueues service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListQueues service method, as returned by SQS.
/// REST API Reference for ListQueues Operation
public virtual Task ListQueuesAsync(ListQueuesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListQueuesRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListQueuesResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ListQueueTags
internal virtual ListQueueTagsResponse ListQueueTags(ListQueueTagsRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ListQueueTagsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListQueueTagsResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// List all cost allocation tags added to the specified Amazon SQS queue. For an overview,
/// see Tagging
/// Your Amazon SQS Queues in the Amazon SQS Developer Guide.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
/// Container for the necessary parameters to execute the ListQueueTags service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ListQueueTags service method, as returned by SQS.
/// REST API Reference for ListQueueTags Operation
public virtual Task ListQueueTagsAsync(ListQueueTagsRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ListQueueTagsRequestMarshaller.Instance;
options.ResponseUnmarshaller = ListQueueTagsResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region PurgeQueue
internal virtual PurgeQueueResponse PurgeQueue(PurgeQueueRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = PurgeQueueRequestMarshaller.Instance;
options.ResponseUnmarshaller = PurgeQueueResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Deletes available messages in a queue (including in-flight messages) specified by
/// the QueueURL
parameter.
///
///
///
/// When you use the PurgeQueue
action, you can't retrieve any messages deleted
/// from a queue.
///
///
///
/// The message deletion process takes up to 60 seconds. We recommend waiting for 60 seconds
/// regardless of your queue's size.
///
///
///
/// Messages sent to the queue before you call PurgeQueue
might be
/// received but are deleted within the next minute.
///
///
///
/// Messages sent to the queue after you call PurgeQueue
might be
/// deleted while the queue is being purged.
///
///
/// The URL of the queue from which the PurgeQueue
action deletes messages. Queue URLs and names are case-sensitive.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the PurgeQueue service method, as returned by SQS.
///
/// Indicates that the specified queue previously received a PurgeQueue
request
/// within the last 60 seconds (the time it can take to delete the messages in the queue).
///
///
/// The specified queue doesn't exist.
///
/// REST API Reference for PurgeQueue Operation
public virtual Task PurgeQueueAsync(string queueUrl, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new PurgeQueueRequest();
request.QueueUrl = queueUrl;
return PurgeQueueAsync(request, cancellationToken);
}
///
/// Deletes available messages in a queue (including in-flight messages) specified by
/// the QueueURL
parameter.
///
///
///
/// When you use the PurgeQueue
action, you can't retrieve any messages deleted
/// from a queue.
///
///
///
/// The message deletion process takes up to 60 seconds. We recommend waiting for 60 seconds
/// regardless of your queue's size.
///
///
///
/// Messages sent to the queue before you call PurgeQueue
might be
/// received but are deleted within the next minute.
///
///
///
/// Messages sent to the queue after you call PurgeQueue
might be
/// deleted while the queue is being purged.
///
///
/// Container for the necessary parameters to execute the PurgeQueue service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the PurgeQueue service method, as returned by SQS.
///
/// Indicates that the specified queue previously received a PurgeQueue
request
/// within the last 60 seconds (the time it can take to delete the messages in the queue).
///
///
/// The specified queue doesn't exist.
///
/// REST API Reference for PurgeQueue Operation
public virtual Task PurgeQueueAsync(PurgeQueueRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = PurgeQueueRequestMarshaller.Instance;
options.ResponseUnmarshaller = PurgeQueueResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region ReceiveMessage
internal virtual ReceiveMessageResponse ReceiveMessage(ReceiveMessageRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = ReceiveMessageRequestMarshaller.Instance;
options.ResponseUnmarshaller = ReceiveMessageResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Retrieves one or more messages (up to 10), from the specified queue. Using the WaitTimeSeconds
/// parameter enables long-poll support. For more information, see Amazon
/// SQS Long Polling in the Amazon SQS Developer Guide.
///
///
///
/// Short poll is the default behavior where a weighted random set of machines is sampled
/// on a ReceiveMessage
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 ReceiveMessage
/// call. If the number of messages in the queue is extremely small, you might not receive
/// any messages in a particular ReceiveMessage
response. If this happens,
/// repeat the request.
///
///
///
/// For each message returned, the response includes the following:
///
/// -
///
/// The message body.
///
///
-
///
/// An MD5 digest of the message body. For information about MD5, see RFC1321.
///
///
-
///
/// The
MessageId
you received when you sent the message to the queue.
///
/// -
///
/// The receipt handle.
///
///
-
///
/// The message attributes.
///
///
-
///
/// An MD5 digest of the message attributes.
///
///
///
/// The receipt handle is the identifier you must provide when deleting the message. For
/// more information, see Queue
/// and Message Identifiers in the Amazon SQS Developer Guide.
///
///
///
/// You can provide the VisibilityTimeout
parameter in your request. The
/// parameter is applied to the messages that Amazon SQS returns in the response. If you
/// don't include the parameter, the overall visibility timeout for the queue is used
/// for the returned messages. For more information, see Visibility
/// Timeout in the Amazon SQS Developer Guide.
///
///
///
/// A message that isn't deleted or a message whose visibility isn't extended before the
/// visibility timeout expires counts as a failed receive. Depending on the configuration
/// of the queue, the message might be sent to the dead-letter queue.
///
///
///
/// 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.
///
///
///
/// The URL of the Amazon SQS queue from which messages are received. Queue URLs and names are case-sensitive.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ReceiveMessage service method, as returned by SQS.
///
/// The specified action violates a limit. For example, ReceiveMessage
returns
/// this error if the maximum number of in flight messages is reached and AddPermission
/// returns this error if the maximum number of permissions for the queue is reached.
///
/// REST API Reference for ReceiveMessage Operation
public virtual Task ReceiveMessageAsync(string queueUrl, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new ReceiveMessageRequest();
request.QueueUrl = queueUrl;
return ReceiveMessageAsync(request, cancellationToken);
}
///
/// Retrieves one or more messages (up to 10), from the specified queue. Using the WaitTimeSeconds
/// parameter enables long-poll support. For more information, see Amazon
/// SQS Long Polling in the Amazon SQS Developer Guide.
///
///
///
/// Short poll is the default behavior where a weighted random set of machines is sampled
/// on a ReceiveMessage
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 ReceiveMessage
/// call. If the number of messages in the queue is extremely small, you might not receive
/// any messages in a particular ReceiveMessage
response. If this happens,
/// repeat the request.
///
///
///
/// For each message returned, the response includes the following:
///
/// -
///
/// The message body.
///
///
-
///
/// An MD5 digest of the message body. For information about MD5, see RFC1321.
///
///
-
///
/// The
MessageId
you received when you sent the message to the queue.
///
/// -
///
/// The receipt handle.
///
///
-
///
/// The message attributes.
///
///
-
///
/// An MD5 digest of the message attributes.
///
///
///
/// The receipt handle is the identifier you must provide when deleting the message. For
/// more information, see Queue
/// and Message Identifiers in the Amazon SQS Developer Guide.
///
///
///
/// You can provide the VisibilityTimeout
parameter in your request. The
/// parameter is applied to the messages that Amazon SQS returns in the response. If you
/// don't include the parameter, the overall visibility timeout for the queue is used
/// for the returned messages. For more information, see Visibility
/// Timeout in the Amazon SQS Developer Guide.
///
///
///
/// A message that isn't deleted or a message whose visibility isn't extended before the
/// visibility timeout expires counts as a failed receive. Depending on the configuration
/// of the queue, the message might be sent to the dead-letter queue.
///
///
///
/// 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.
///
///
///
/// Container for the necessary parameters to execute the ReceiveMessage service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the ReceiveMessage service method, as returned by SQS.
///
/// The specified action violates a limit. For example, ReceiveMessage
returns
/// this error if the maximum number of in flight messages is reached and AddPermission
/// returns this error if the maximum number of permissions for the queue is reached.
///
/// REST API Reference for ReceiveMessage Operation
public virtual Task ReceiveMessageAsync(ReceiveMessageRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = ReceiveMessageRequestMarshaller.Instance;
options.ResponseUnmarshaller = ReceiveMessageResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region RemovePermission
internal virtual RemovePermissionResponse RemovePermission(RemovePermissionRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = RemovePermissionRequestMarshaller.Instance;
options.ResponseUnmarshaller = RemovePermissionResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Revokes any permissions in the queue policy that matches the specified Label
/// parameter.
///
/// -
///
/// Only the owner of a queue can remove permissions from it.
///
///
-
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
-
///
/// To remove the ability to change queue permissions, you must deny permission to the
///
AddPermission
, RemovePermission
, and SetQueueAttributes
/// actions in your IAM policy.
///
///
///
/// The URL of the Amazon SQS queue from which permissions are removed. Queue URLs and names are case-sensitive.
/// The identification of the permission to remove. This is the label added using the AddPermission
action.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the RemovePermission service method, as returned by SQS.
/// REST API Reference for RemovePermission Operation
public virtual Task RemovePermissionAsync(string queueUrl, string label, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new RemovePermissionRequest();
request.QueueUrl = queueUrl;
request.Label = label;
return RemovePermissionAsync(request, cancellationToken);
}
///
/// Revokes any permissions in the queue policy that matches the specified Label
/// parameter.
///
/// -
///
/// Only the owner of a queue can remove permissions from it.
///
///
-
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
-
///
/// To remove the ability to change queue permissions, you must deny permission to the
///
AddPermission
, RemovePermission
, and SetQueueAttributes
/// actions in your IAM policy.
///
///
///
/// Container for the necessary parameters to execute the RemovePermission service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the RemovePermission service method, as returned by SQS.
/// REST API Reference for RemovePermission Operation
public virtual Task RemovePermissionAsync(RemovePermissionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = RemovePermissionRequestMarshaller.Instance;
options.ResponseUnmarshaller = RemovePermissionResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region SendMessage
internal virtual SendMessageResponse SendMessage(SendMessageRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = SendMessageRequestMarshaller.Instance;
options.ResponseUnmarshaller = SendMessageResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Delivers a message to the specified queue.
///
///
///
/// A message can include only XML, JSON, and unformatted text. The following Unicode
/// characters are allowed:
///
///
///
/// #x9
| #xA
| #xD
| #x20
to #xD7FF
/// | #xE000
to #xFFFD
| #x10000
to #x10FFFF
///
///
///
///
/// Any characters not included in this list will be rejected. For more information, see
/// the W3C specification for characters.
///
///
///
/// The URL of the Amazon SQS queue to which a message is sent. Queue URLs and names are case-sensitive.
/// The message to send. The minimum size is one character. The maximum size is 256 KiB. A message can include only XML, JSON, and unformatted text. The following Unicode characters are allowed: #x9
| #xA
| #xD
| #x20
to #xD7FF
| #xE000
to #xFFFD
| #x10000
to #x10FFFF
Any characters not included in this list will be rejected. For more information, see the W3C specification for characters.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the SendMessage service method, as returned by SQS.
///
/// The message contains characters outside the allowed set.
///
///
/// Error code 400. Unsupported operation.
///
/// REST API Reference for SendMessage Operation
public virtual Task SendMessageAsync(string queueUrl, string messageBody, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new SendMessageRequest();
request.QueueUrl = queueUrl;
request.MessageBody = messageBody;
return SendMessageAsync(request, cancellationToken);
}
///
/// Delivers a message to the specified queue.
///
///
///
/// A message can include only XML, JSON, and unformatted text. The following Unicode
/// characters are allowed:
///
///
///
/// #x9
| #xA
| #xD
| #x20
to #xD7FF
/// | #xE000
to #xFFFD
| #x10000
to #x10FFFF
///
///
///
///
/// Any characters not included in this list will be rejected. For more information, see
/// the W3C specification for characters.
///
///
///
/// Container for the necessary parameters to execute the SendMessage service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the SendMessage service method, as returned by SQS.
///
/// The message contains characters outside the allowed set.
///
///
/// Error code 400. Unsupported operation.
///
/// REST API Reference for SendMessage Operation
public virtual Task SendMessageAsync(SendMessageRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = SendMessageRequestMarshaller.Instance;
options.ResponseUnmarshaller = SendMessageResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region SendMessageBatch
internal virtual SendMessageBatchResponse SendMessageBatch(SendMessageBatchRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = SendMessageBatchRequestMarshaller.Instance;
options.ResponseUnmarshaller = SendMessageBatchResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// You can use SendMessageBatch
to send up to 10 messages to the specified
/// queue by assigning either identical or different values to each message (or by not
/// assigning values at all). This is a batch version of SendMessage.
/// For a FIFO queue, multiple messages within a single batch are enqueued in the order
/// they are sent.
///
///
///
/// 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
/// 200
.
///
///
///
/// 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 KiB (262,144
/// bytes).
///
///
///
/// A message can include only XML, JSON, and unformatted text. The following Unicode
/// characters are allowed:
///
///
///
/// #x9
| #xA
| #xD
| #x20
to #xD7FF
/// | #xE000
to #xFFFD
| #x10000
to #x10FFFF
///
///
///
///
/// Any characters not included in this list will be rejected. For more information, see
/// the W3C specification for characters.
///
///
///
/// If you don't specify the DelaySeconds
parameter for an entry, Amazon
/// SQS uses the default value for the queue.
///
///
/// The URL of the Amazon SQS queue to which batched messages are sent. Queue URLs and names are case-sensitive.
/// A list of SendMessageBatchRequestEntry
items.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the SendMessageBatch service method, as returned by SQS.
///
/// Two or more batch entries in the request have the same Id
.
///
///
/// The length of all the messages put together is more than the limit.
///
///
/// The batch request doesn't contain any entries.
///
///
/// The Id
of a batch entry in a batch request doesn't abide by the specification.
///
///
/// The batch request contains more entries than permissible.
///
///
/// Error code 400. Unsupported operation.
///
/// REST API Reference for SendMessageBatch Operation
public virtual Task SendMessageBatchAsync(string queueUrl, List entries, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new SendMessageBatchRequest();
request.QueueUrl = queueUrl;
request.Entries = entries;
return SendMessageBatchAsync(request, cancellationToken);
}
///
/// You can use SendMessageBatch
to send up to 10 messages to the specified
/// queue by assigning either identical or different values to each message (or by not
/// assigning values at all). This is a batch version of SendMessage.
/// For a FIFO queue, multiple messages within a single batch are enqueued in the order
/// they are sent.
///
///
///
/// 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
/// 200
.
///
///
///
/// 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 KiB (262,144
/// bytes).
///
///
///
/// A message can include only XML, JSON, and unformatted text. The following Unicode
/// characters are allowed:
///
///
///
/// #x9
| #xA
| #xD
| #x20
to #xD7FF
/// | #xE000
to #xFFFD
| #x10000
to #x10FFFF
///
///
///
///
/// Any characters not included in this list will be rejected. For more information, see
/// the W3C specification for characters.
///
///
///
/// If you don't specify the DelaySeconds
parameter for an entry, Amazon
/// SQS uses the default value for the queue.
///
///
/// Container for the necessary parameters to execute the SendMessageBatch service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the SendMessageBatch service method, as returned by SQS.
///
/// Two or more batch entries in the request have the same Id
.
///
///
/// The length of all the messages put together is more than the limit.
///
///
/// The batch request doesn't contain any entries.
///
///
/// The Id
of a batch entry in a batch request doesn't abide by the specification.
///
///
/// The batch request contains more entries than permissible.
///
///
/// Error code 400. Unsupported operation.
///
/// REST API Reference for SendMessageBatch Operation
public virtual Task SendMessageBatchAsync(SendMessageBatchRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = SendMessageBatchRequestMarshaller.Instance;
options.ResponseUnmarshaller = SendMessageBatchResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region SetQueueAttributes
internal virtual SetQueueAttributesResponse SetQueueAttributes(SetQueueAttributesRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = SetQueueAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetQueueAttributesResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Sets the value of one or more queue attributes. When you change a queue'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 MessageRetentionPeriod
attribute
/// can take up to 15 minutes and will impact existing messages in the queue potentially
/// causing them to be expired and deleted if the MessageRetentionPeriod
/// is reduced below the age of existing messages.
///
/// -
///
/// 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.
///
///
-
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
-
///
/// To remove the ability to change queue permissions, you must deny permission to the
///
AddPermission
, RemovePermission
, and SetQueueAttributes
/// actions in your IAM policy.
///
///
///
/// The URL of the Amazon SQS queue whose attributes are set. Queue URLs and names are case-sensitive.
/// A map of attributes to set. The following lists the names, descriptions, and values of the special request parameters that the SetQueueAttributes
action uses: -
DelaySeconds
– 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. -
MaximumMessageSize
– 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). -
MessageRetentionPeriod
– 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). When you change a queue'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 MessageRetentionPeriod
attribute can take up to 15 minutes and will impact existing messages in the queue potentially causing them to be expired and deleted if the MessageRetentionPeriod
is reduced below the age of existing messages. -
Policy
– The queue's policy. A valid Amazon Web Services policy. For more information about policy structure, see Overview of Amazon Web Services IAM Policies in the Identity and Access Management User Guide. -
ReceiveMessageWaitTimeSeconds
– The length of time, in seconds, for which a ReceiveMessage
action waits for a message to arrive. Valid values: An integer from 0 to 20 (seconds). Default: 0. -
VisibilityTimeout
– 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 Visibility Timeout in the Amazon SQS Developer Guide.
The following attributes apply only to dead-letter queues: -
RedrivePolicy
– The string that includes the parameters for the dead-letter queue functionality of the source queue as a JSON object. The parameters are as follows: -
deadLetterTargetArn
– The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon SQS moves messages after the value of maxReceiveCount
is exceeded. -
maxReceiveCount
– The number of times a message is delivered to the source queue before being moved to the dead-letter queue. Default: 10. When the ReceiveCount
for a message exceeds the maxReceiveCount
for a queue, Amazon SQS moves the message to the dead-letter-queue.
-
RedriveAllowPolicy
– The string that includes the parameters for the permissions for the dead-letter queue redrive permission and which source queues can specify dead-letter queues as a JSON object. The parameters are as follows: -
redrivePermission
– The permission type that defines which source queues can specify the current queue as the dead-letter queue. Valid values are: -
allowAll
– (Default) Any source queues in this Amazon Web Services account in the same Region can specify this queue as the dead-letter queue. -
denyAll
– No source queues can specify this queue as the dead-letter queue. -
byQueue
– Only queues specified by the sourceQueueArns
parameter can specify this queue as the dead-letter queue.
-
sourceQueueArns
– The Amazon Resource Names (ARN)s of the source queues that can specify this queue as the dead-letter queue and redrive messages. You can specify this parameter only when the redrivePermission
parameter is set to byQueue
. You can specify up to 10 source queue ARNs. To allow more than 10 source queues to specify dead-letter queues, set the redrivePermission
parameter to allowAll
.
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. The following attributes apply only to server-side-encryption: -
KmsMasterKeyId
– The ID of an Amazon Web Services managed customer master key (CMK) for Amazon SQS or a custom CMK. For more information, see Key Terms. While the alias of the AWS-managed CMK for Amazon SQS is always alias/aws/sqs
, the alias of a custom CMK can, for example, be alias/MyAlias
. For more examples, see KeyId in the Key Management Service API Reference. -
KmsDataKeyReusePeriodSeconds
– The length of time, in seconds, for which Amazon SQS can reuse a data key to encrypt or decrypt messages before calling 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 How Does the Data Key Reuse Period Work?. -
SqsManagedSseEnabled
– Enables server-side queue encryption using SQS owned encryption keys. Only one server-side encryption option is supported per queue (for example, SSE-KMS or SSE-SQS).
The following attribute applies only to FIFO (first-in-first-out) queues: -
ContentBasedDeduplication
– Enables content-based deduplication. For more information, see Exactly-once processing in the Amazon SQS Developer Guide. Note the following: - Every message must have a unique
MessageDeduplicationId
. - You may provide a
MessageDeduplicationId
explicitly. - If you aren't able to provide a
MessageDeduplicationId
and you enable ContentBasedDeduplication
for your queue, Amazon SQS uses a SHA-256 hash to generate the MessageDeduplicationId
using the body of the message (but not the attributes of the message). - If you don't provide a
MessageDeduplicationId
and the queue doesn't have ContentBasedDeduplication
set, the action fails with an error. - If the queue has
ContentBasedDeduplication
set, your MessageDeduplicationId
overrides the generated one.
- When
ContentBasedDeduplication
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. - If you send one message with
ContentBasedDeduplication
enabled and then another message with a MessageDeduplicationId
that is the same as the one generated for the first MessageDeduplicationId
, the two messages are treated as duplicates and only one copy of the message is delivered.
The following attributes apply only to high throughput for FIFO queues: -
DeduplicationScope
– Specifies whether message deduplication occurs at the message group or queue level. Valid values are messageGroup
and queue
. -
FifoThroughputLimit
– Specifies whether the FIFO queue throughput quota applies to the entire queue or per message group. Valid values are perQueue
and perMessageGroupId
. The perMessageGroupId
value is allowed only when the value for DeduplicationScope
is messageGroup
.
To enable high throughput for FIFO queues, do the following: - Set
DeduplicationScope
to messageGroup
. - Set
FifoThroughputLimit
to perMessageGroupId
.
If you set these attributes to anything other than the values shown for enabling high throughput, normal throughput is in effect and deduplication occurs as specified. For information on throughput quotas, see Quotas related to messages in the Amazon SQS Developer Guide.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the SetQueueAttributes service method, as returned by SQS.
///
/// The specified attribute doesn't exist.
///
/// REST API Reference for SetQueueAttributes Operation
public virtual Task SetQueueAttributesAsync(string queueUrl, Dictionary attributes, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var request = new SetQueueAttributesRequest();
request.QueueUrl = queueUrl;
request.Attributes = attributes;
return SetQueueAttributesAsync(request, cancellationToken);
}
///
/// Sets the value of one or more queue attributes. When you change a queue'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 MessageRetentionPeriod
attribute
/// can take up to 15 minutes and will impact existing messages in the queue potentially
/// causing them to be expired and deleted if the MessageRetentionPeriod
/// is reduced below the age of existing messages.
///
/// -
///
/// 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.
///
///
-
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
-
///
/// To remove the ability to change queue permissions, you must deny permission to the
///
AddPermission
, RemovePermission
, and SetQueueAttributes
/// actions in your IAM policy.
///
///
///
/// Container for the necessary parameters to execute the SetQueueAttributes service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the SetQueueAttributes service method, as returned by SQS.
///
/// The specified attribute doesn't exist.
///
/// REST API Reference for SetQueueAttributes Operation
public virtual Task SetQueueAttributesAsync(SetQueueAttributesRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = SetQueueAttributesRequestMarshaller.Instance;
options.ResponseUnmarshaller = SetQueueAttributesResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region StartMessageMoveTask
internal virtual StartMessageMoveTaskResponse StartMessageMoveTask(StartMessageMoveTaskRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = StartMessageMoveTaskRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartMessageMoveTaskResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Starts an asynchronous task to move messages from a specified source queue to a specified
/// destination queue.
///
/// -
///
/// This action is currently limited to supporting message redrive from queues that are
/// configured as dead-letter
/// queues (DLQs) of other Amazon SQS queues only. Non-SQS queue sources of dead-letter
/// queues, such as Lambda or Amazon SNS topics, are currently not supported.
///
///
-
///
/// In dead-letter queues redrive context, the
StartMessageMoveTask
the source
/// queue is the DLQ, while the destination queue can be the original source queue (from
/// which the messages were driven to the dead-letter-queue), or a custom destination
/// queue.
///
/// -
///
/// Currently, only standard queues support redrive. FIFO queues don't support redrive.
///
///
-
///
/// Only one active message movement task is supported per queue at any given time.
///
///
///
/// Container for the necessary parameters to execute the StartMessageMoveTask service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the StartMessageMoveTask service method, as returned by SQS.
///
/// One or more specified resources don't exist.
///
///
/// Error code 400. Unsupported operation.
///
/// REST API Reference for StartMessageMoveTask Operation
public virtual Task StartMessageMoveTaskAsync(StartMessageMoveTaskRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = StartMessageMoveTaskRequestMarshaller.Instance;
options.ResponseUnmarshaller = StartMessageMoveTaskResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region TagQueue
internal virtual TagQueueResponse TagQueue(TagQueueRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = TagQueueRequestMarshaller.Instance;
options.ResponseUnmarshaller = TagQueueResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Add cost allocation tags to the specified Amazon SQS queue. For an overview, see Tagging
/// Your Amazon SQS Queues in the Amazon SQS Developer Guide.
///
///
///
/// When you use queue tags, keep the following guidelines in mind:
///
/// -
///
/// Adding more than 50 tags to a queue isn't recommended.
///
///
-
///
/// Tags don't have any semantic meaning. Amazon SQS interprets tags as character strings.
///
///
-
///
/// Tags are case-sensitive.
///
///
-
///
/// A new tag with a key identical to that of an existing tag overwrites the existing
/// tag.
///
///
///
/// For a full list of tag restrictions, see Quotas
/// related to queues in the Amazon SQS Developer Guide.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
/// Container for the necessary parameters to execute the TagQueue service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the TagQueue service method, as returned by SQS.
/// REST API Reference for TagQueue Operation
public virtual Task TagQueueAsync(TagQueueRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = TagQueueRequestMarshaller.Instance;
options.ResponseUnmarshaller = TagQueueResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
#region UntagQueue
internal virtual UntagQueueResponse UntagQueue(UntagQueueRequest request)
{
var options = new InvokeOptions();
options.RequestMarshaller = UntagQueueRequestMarshaller.Instance;
options.ResponseUnmarshaller = UntagQueueResponseUnmarshaller.Instance;
return Invoke(request, options);
}
///
/// Remove cost allocation tags from the specified Amazon SQS queue. For an overview,
/// see Tagging
/// Your Amazon SQS Queues in the Amazon SQS Developer Guide.
///
///
///
/// Cross-account permissions don't apply to this action. For more information, see Grant
/// cross-account permissions to a role and a username in the Amazon SQS Developer
/// Guide.
///
///
///
/// Container for the necessary parameters to execute the UntagQueue service method.
///
/// A cancellation token that can be used by other objects or threads to receive notice of cancellation.
///
///
/// The response from the UntagQueue service method, as returned by SQS.
/// REST API Reference for UntagQueue Operation
public virtual Task UntagQueueAsync(UntagQueueRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
{
var options = new InvokeOptions();
options.RequestMarshaller = UntagQueueRequestMarshaller.Instance;
options.ResponseUnmarshaller = UntagQueueResponseUnmarshaller.Instance;
return InvokeAsync(request, options, cancellationToken);
}
#endregion
}
}