Class: AWS::SQS::Client

Inherits:
Core::QueryClient show all
Defined in:
lib/aws/sqs/client.rb

Overview

Client class for Amazon Simple Queue Service (SQS).

Instance Attribute Summary

Attributes inherited from Core::Client

#config, #http_read_timeout

Instance Method Summary collapse

Methods inherited from Core::Client

#initialize, #log_warning, #operations, 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.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:



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

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

Calls the ChangeMessageVisibility API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:



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

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

Calls the ChangeMessageVisibilityBatch API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :successful - (Array<Hash>)

      • :id - (String)

    • :failed - (Array<Hash>)

      • :id - (String)

      • :sender_fault - (Boolean)

      • :code - (String)

      • :message - (String)



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

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

Calls the CreateQueue API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :queue_name - required - (String) The name for the queue to be created.

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

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :queue_url - (String)



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

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

Calls the DeleteMessage API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:



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

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

Calls the DeleteMessageBatch API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :successful - (Array<Hash>)

      • :id - (String)

    • :failed - (Array<Hash>)

      • :id - (String)

      • :sender_fault - (Boolean)

      • :code - (String)

      • :message - (String)



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

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

Calls the DeleteQueue API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :queue_url - required - (String) The URL of the SQS queue to take action on.

Returns:



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

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

Calls the GetQueueAttributes API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

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



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

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

Calls the GetQueueUrl API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :queue_url - (String)



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

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

Calls the ListQueues API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :queue_urls - (Array<String>)



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

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

Calls the ReceiveMessage API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :queue_url - required - (String) The URL of the SQS queue to take action on.

    • :attribute_names - (Array<String>) A list of attributes that need to be returned along with each message. The set of valid attributes are [SenderId, ApproximateFirstReceiveTimestamp, ApproximateReceiveCount, SentTimestamp].

    • :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.

    • :wait_time_seconds - (Integer) The duration (in seconds) for which the call will wait for a message to arrive in the queue before returning. If a message is available, the call will return sooner than WaitTimeSeconds.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :messages - (Array<Hash>)

      • :message_id - (String)

      • :receipt_handle - (String)

      • :md5_of_body - (String)

      • :body - (String)

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



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

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

Calls the RemovePermission API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:



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

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

Calls the SendMessage API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following structure:

    • :md5_of_message_body - (String)

    • :message_id - (String)



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

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

Calls the SendMessageBatch API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:

  • (Core::Response)

    The #data method of the response object returns a hash with the following 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)



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

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

Calls the SetQueueAttributes API operation.

Parameters:

  • options (Hash) (defaults to: {})
    • :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.

Returns:



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