Skip to content

SQSServiceResource#

Index > SQS > SQSServiceResource

Auto-generated documentation for SQS type annotations stubs module mypy-boto3-sqs.

SQSServiceResource#

Type annotations and code completion for boto3.resource("sqs"), included resources and collections. boto3 documentation

# SQSServiceResource usage example

from mypy_boto3_sqs.service_resource import SQSServiceResource

def get_sqs_resource() -> SQSServiceResource:
    return boto3.resource("sqs")

Attributes#

Collections#

ServiceResourceQueuesCollection#

Provides access to Queue resource.

Type annotations and code completion for boto3.resource("sqs").queues collection. boto3 documentation

# ServiceResourceQueuesCollection usage example

from mypy_boto3_sqs.service_resource import ServiceResourceQueuesCollection

def get_collection() -> ServiceResourceQueuesCollection:
    return boto3.resource("sqs").queues

Methods#

SQSServiceResource.Message method#

Creates a Message resource.

Type annotations and code completion for boto3.resource("sqs").Message method. boto3 documentation

# Message method definition

def Message(
    self,
    queue_url: str,
    receipt_handle: str,
) -> Message:
    ...

SQSServiceResource.Queue method#

Creates a Queue resource.

Type annotations and code completion for boto3.resource("sqs").Queue method. boto3 documentation

# Queue method definition

def Queue(
    self,
    url: str,
) -> Queue:
    ...

SQSServiceResource.create_queue method#

Creates a new standard or FIFO queue.

Type annotations and code completion for boto3.resource("sqs").create_queue method. boto3 documentation

# create_queue method definition

def create_queue(
    self,
    *,
    QueueName: str,
    Attributes: Mapping[QueueAttributeNameType, str] = ...,  # (1)
    tags: Mapping[str, str] = ...,
) -> Queue:
    ...
  1. See QueueAttributeNameType
# create_queue method usage example with argument unpacking

kwargs: CreateQueueRequestServiceResourceCreateQueueTypeDef = {  # (1)
    "QueueName": ...,
}

parent.create_queue(**kwargs)
  1. See CreateQueueRequestServiceResourceCreateQueueTypeDef

SQSServiceResource.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("sqs").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

SQSServiceResource.get_queue_by_name method#

Returns the URL of an existing Amazon SQS queue.

Type annotations and code completion for boto3.resource("sqs").get_queue_by_name method. boto3 documentation

# get_queue_by_name method definition

def get_queue_by_name(
    self,
    *,
    QueueName: str,
    QueueOwnerAWSAccountId: str = ...,
) -> Queue:
    ...
# get_queue_by_name method usage example with argument unpacking

kwargs: GetQueueUrlRequestServiceResourceGetQueueByNameTypeDef = {  # (1)
    "QueueName": ...,
}

parent.get_queue_by_name(**kwargs)
  1. See GetQueueUrlRequestServiceResourceGetQueueByNameTypeDef

Message#

Type annotations and code completion for boto3.resource("sqs").Message class. boto3 documentation

# Message usage example

from mypy_boto3_sqs.service_resource import Message

def get_resource() -> Message:
    return boto3.resource("sqs").Message(...)

Message attributes#

Message methods#

Message.Queue method#

Creates a Queue resource.

Type annotations and code completion for boto3.resource("sqs").Queue method. boto3 documentation

# Queue method definition

def Queue(
    self,
) -> Queue:
    ...

Message.change_visibility method#

Changes the visibility timeout of a specified message in a queue to a new value.

Type annotations and code completion for boto3.resource("sqs").change_visibility method. boto3 documentation

# change_visibility method definition

def change_visibility(
    self,
    *,
    VisibilityTimeout: int,
) -> None:
    ...
# change_visibility method usage example with argument unpacking

kwargs: ChangeMessageVisibilityRequestMessageChangeVisibilityTypeDef = {  # (1)
    "VisibilityTimeout": ...,
}

parent.change_visibility(**kwargs)
  1. See ChangeMessageVisibilityRequestMessageChangeVisibilityTypeDef

Message.delete method#

Deletes the specified message from the specified queue.

Type annotations and code completion for boto3.resource("sqs").delete method. boto3 documentation

# delete method definition

def delete(
    self,
) -> None:
    ...

Message.get_available_subresources method#

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("sqs").get_available_subresources method. boto3 documentation

# get_available_subresources method definition

def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

Queue#

Type annotations and code completion for boto3.resource("sqs").Queue class. boto3 documentation

# Queue usage example

from mypy_boto3_sqs.service_resource import Queue

def get_resource() -> Queue:
    return boto3.resource("sqs").Queue(...)

Queue attributes#

Queue collections#

Queue.dead_letter_source_queues#

Provides access to Queue resource.

Type annotations and code completion for boto3.resource("sqs").Queue(...).dead_letter_source_queues collection. boto3 documentation

# QueueDeadLetterSourceQueuesCollection usage example

from mypy_boto3_sqs.service_resource import QueueDeadLetterSourceQueuesCollection

def get_collection() -> QueueDeadLetterSourceQueuesCollection:
    resource = boto3.resource("sqs").Queue(...)
    return resource.dead_letter_source_queues

Queue methods#

Queue.Message method#

Creates a Message resource.

Type annotations and code completion for boto3.resource("sqs").Message method.