Class: AWS::SQS::Client

Inherits:
Core::Client show all
Extended by:
Core::Client::QueryXML
Defined in:
lib/aws/sqs/client.rb

Overview

Client class for Amazon Simple Queue Service (SQS).

Constant Summary collapse

API_VERSION =
'2011-10-01'

Instance Attribute Summary

Attributes inherited from Core::Client

#config, #http_read_timeout

Instance Method Summary collapse

Methods inherited from Core::Client

#initialize, #operations, #with_http_handler, #with_options

Constructor Details

This class inherits a constructor from AWS::Core::Client

Instance Method Details

#add_permission(options = {}) ⇒ Core::Response

Calls the AddPermission API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

  • :label - required - (String) The unique identification of the permission you’re setting (e.g., AliceSendMessage). Constraints: Maximum 80 characters; alphanumeric characters, hyphens (-), and underscores (_) are allowed.

  • :aws_account_ids - required - (Array<String>) The AWS account number of the principal who will be given permission. The principal must have an AWS account, but does not need to be signed up for Amazon SQS.

  • :actions - required - (Array<String>) The action the client wants to allow for the specified principal.

Response Structure:

This method returns no response data.

Returns:



53
# File 'lib/aws/sqs/client.rb', line 53

define_client_method :add_permission, 'AddPermission'

#change_message_visibility(options = {}) ⇒ Core::Response

Calls the ChangeMessageVisibility API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

  • :receipt_handle - required - (String) The receipt handle associated with the message whose visibility timeout should be changed.

  • :visibility_timeout - required - (Integer) The new value (in seconds) for the message’s visibility timeout.

Response Structure:

This method returns no response data.

Returns:



74
# File 'lib/aws/sqs/client.rb', line 74

define_client_method :change_message_visibility, 'ChangeMessageVisibility'

#change_message_visibility_batch(options = {}) ⇒ Core::Response

Calls the ChangeMessageVisibilityBatch API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

  • :entries - required - (Array<Hash>) A list of receipt handles of the messages for which the visibility timeout must be changed.

    • :id - required - (String) An identifier for this particular receipt handle. This is used to communicate the result. Note that the Ids of a batch request need to be unique within the request.

    • :receipt_handle - required - (String) A receipt handle.

    • :visibility_timeout - (Integer) The new value (in seconds) for the message’s visibility timeout.

Response Structure:

  • :successful - (Array<Hash>)

    • :id - (String)

  • :failed - (Array<Hash>)

    • :id - (String)

    • :sender_fault - (Boolean)

    • :code - (String)

    • :message - (String)

Returns:



104
# File 'lib/aws/sqs/client.rb', line 104

define_client_method :change_message_visibility_batch, 'ChangeMessageVisibilityBatch'

#create_queue(options = {}) ⇒ Core::Response

Calls the CreateQueue API operation.

Options:

  • :queue_name - required - (String) The name for the queue to be created.

  • :attributes - (Hash<String,String>) A map of attributes with their corresponding values.

Response Structure:

  • :queue_url - (String)

Returns:



122
# File 'lib/aws/sqs/client.rb', line 122

define_client_method :create_queue, 'CreateQueue'

#delete_message(options = {}) ⇒ Core::Response

Calls the DeleteMessage API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

  • :receipt_handle - required - (String) The receipt handle associated with the message to delete.

Response Structure:

This method returns no response data.

Returns:



140
# File 'lib/aws/sqs/client.rb', line 140

define_client_method :delete_message, 'DeleteMessage'

#delete_message_batch(options = {}) ⇒ Core::Response

Calls the DeleteMessageBatch API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

  • :entries - required - (Array<Hash>) A list of receipt handles for the messages to be deleted.

    • :id - required - (String) An identifier for this particular receipt handle. This is used to communicate the result. Note that the Ids of a batch request need to be unique within the request.

    • :receipt_handle - required - (String) A receipt handle.

Response Structure:

  • :successful - (Array<Hash>)

    • :id - (String)

  • :failed - (Array<Hash>)

    • :id - (String)

    • :sender_fault - (Boolean)

    • :code - (String)

    • :message - (String)

Returns:



168
# File 'lib/aws/sqs/client.rb', line 168

define_client_method :delete_message_batch, 'DeleteMessageBatch'

#delete_queue(options = {}) ⇒ Core::Response

Calls the DeleteQueue API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

Response Structure:

This method returns no response data.

Returns:



184
# File 'lib/aws/sqs/client.rb', line 184

define_client_method :delete_queue, 'DeleteQueue'

#get_queue_attributes(options = {}) ⇒ Core::Response

Calls the GetQueueAttributes API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

  • :attribute_names - (Array<String>) A list of attributes to retrieve information for.

Response Structure:

  • :attributes - (Hash<String,String>)

Returns:



202
# File 'lib/aws/sqs/client.rb', line 202

define_client_method :get_queue_attributes, 'GetQueueAttributes'

#get_queue_url(options = {}) ⇒ Core::Response

Calls the GetQueueUrl API operation.

Options:

  • :queue_name - required - (String) The name of the queue whose URL must be fetched.

  • :queue_owner_aws_account_id - (String) The AWS account number of the queue’s owner.

Response Structure:

  • :queue_url - (String)

Returns:



220
# File 'lib/aws/sqs/client.rb', line 220

define_client_method :get_queue_url, 'GetQueueUrl'

#list_queues(options = {}) ⇒ Core::Response

Calls the ListQueues API operation.

Options:

  • :queue_name_prefix - (String) A string to use for filtering the list results. Only those queues whose name begins with the specified string are returned.

Response Structure:

  • :queue_urls - (Array<String>)

Returns:



237
# File 'lib/aws/sqs/client.rb', line 237

define_client_method :list_queues, 'ListQueues'

#receive_message(options = {}) ⇒ Core::Response

Calls the ReceiveMessage API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

  • :attribute_names - (Array<String>) A list of attributes to retrieve information for.

  • :max_number_of_messages - (Integer) The maximum number of messages to return. Amazon SQS never returns more messages than this value but may return fewer. All of the messages are not necessarily returned.

  • :visibility_timeout - (Integer) The duration (in seconds) that the received messages are hidden from subsequent retrieve requests after being retrieved by a ReceiveMessage request.

Response Structure:

  • :messages - (Array<Hash>)

    • :message_id - (String)

    • :receipt_handle - (String)

    • :md5_of_body - (String)

    • :body - (String)

    • :attributes - (Hash<String,String>)

Returns:



266
# File 'lib/aws/sqs/client.rb', line 266

define_client_method :receive_message, 'ReceiveMessage'

#remove_permission(options = {}) ⇒ Core::Response

Calls the RemovePermission API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

  • :label - required - (String) The identification of the permission to remove. This is the label added with the AddPermission operation.

Response Structure:

This method returns no response data.

Returns:



284
# File 'lib/aws/sqs/client.rb', line 284

define_client_method :remove_permission, 'RemovePermission'

#send_message(options = {}) ⇒ Core::Response

Calls the SendMessage API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

  • :message_body - required - (String) The message to send.

  • :delay_seconds - (Integer) The number of seconds the message has to be delayed.

Response Structure:

  • :md5_of_message_body - (String)

  • :message_id - (String)

Returns:



304
# File 'lib/aws/sqs/client.rb', line 304

define_client_method :send_message, 'SendMessage'

#send_message_batch(options = {}) ⇒ Core::Response

Calls the SendMessageBatch API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

  • :entries - required - (Array<Hash>) A list of SendMessageBatchRequestEntrys.

    • :id - required - (String) An identifier for the message in this batch. This is used to communicate the result. Note that the the Ids of a batch request need to be unique within the request.

    • :message_body - required - (String) Body of the message.

    • :delay_seconds - (Integer) The number of seconds for which the message has to be delayed.

Response Structure:

  • :successful - (Array<Hash>)

    • :id - (String)

    • :message_id - (String)

    • :md5_of_message_body - (String)

  • :failed - (Array<Hash>)

    • :id - (String)

    • :sender_fault - (Boolean)

    • :code - (String)

    • :message - (String)

Returns:



336
# File 'lib/aws/sqs/client.rb', line 336

define_client_method :send_message_batch, 'SendMessageBatch'

#set_queue_attributes(options = {}) ⇒ Core::Response

Calls the SetQueueAttributes API operation.

Options:

  • :queue_url - required - (String) The URL of the SQS queue to take action on.

  • :attributes - required - (Hash<String,String>) A map of attributes to set.

Response Structure:

This method returns no response data.

Returns:



354
# File 'lib/aws/sqs/client.rb', line 354

define_client_method :set_queue_attributes, 'SetQueueAttributes'