SQSServiceResource#
Auto-generated documentation for SQS type annotations stubs module types-aiobotocore-sqs.
SQSServiceResource#
Type annotations and code completion for session.resource("sqs")
, included resources and collections.
boto3 documentation
# SQSServiceResource usage example
from types_aiobotocore_sqs.service_resource import SQSServiceResource
def get_sqs_resource() -> SQSServiceResource:
return session.resource("sqs")
Attributes#
-
meta
:SQSResourceMeta
-
queues
:ServiceResourceQueuesCollection
Collections#
ServiceResourceQueuesCollection#
Provides access to Queue resource.
Type annotations and code completion for session.resource("sqs").queues
collection.
boto3 documentation
# ServiceResourceQueuesCollection usage example
from types_aiobotocore_sqs.service_resource import ServiceResourceQueuesCollection
def get_collection() -> ServiceResourceQueuesCollection:
return session.resource("sqs").queues
Methods#
SQSServiceResource.get_available_subresources method#
Returns a list of all the available sub-resources for this resource.
Type annotations and code completion for session.resource("sqs").get_available_subresources
method.
boto3 documentation
# get_available_subresources method definition
await def get_available_subresources(
self,
) -> Sequence[str]:
...
SQSServiceResource.create_queue method#
Creates a new standard or FIFO queue.
Type annotations and code completion for session.resource("sqs").create_queue
method.
boto3 documentation
# create_queue method definition
await def create_queue(
self,
*,
QueueName: str,
Attributes: Mapping[QueueAttributeNameType, str] = ..., # (1)
tags: Mapping[str, str] = ...,
) -> _Queue:
...
- See
Mapping[QueueAttributeNameType, str]
# create_queue method usage example with argument unpacking
kwargs: CreateQueueRequestServiceResourceCreateQueueTypeDef = { # (1)
"QueueName": ...,
}
parent.create_queue(**kwargs)
SQSServiceResource.get_queue_by_name method#
The GetQueueUrl
API returns the URL of an existing Amazon SQS
queue.
Type annotations and code completion for session.resource("sqs").get_queue_by_name
method.
boto3 documentation
# get_queue_by_name method definition
await 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)
SQSServiceResource.Message method#
Creates a Message resource.
Type annotations and code completion for session.resource("sqs").Message
method.
boto3 documentation
# Message method definition
await def Message(
self,
queue_url: str,
receipt_handle: str,
) -> _Message:
...
SQSServiceResource.Queue method#
Creates a Queue resource.
Type annotations and code completion for session.resource("sqs").Queue
method.
boto3 documentation
# Queue method definition
await def Queue(
self,
url: str,
) -> _Queue:
...
Message#
Type annotations and code completion for session.resource("sqs").Message
class.
boto3 documentation
# Message usage example
from types_aiobotocore_sqs.service_resource import Message
def get_resource() -> Message:
return session.resource("sqs").Message(...)
Message attributes#
queue_url
:str
receipt_handle
:str
message_id
:Awaitable
[str
]md5_of_body
:Awaitable
[str
]body
:Awaitable
[str
]attributes
:Awaitable
[Dict
[MessageSystemAttributeNameType,str
]]md5_of_message_attributes
:Awaitable
[str
]message_attributes
:Awaitable
[Dict
[str
, MessageAttributeValueOutputTypeDef]]meta
:SQSResourceMeta
Message methods#
Message.get_available_subresources method#
Returns a list of all the available sub-resources for this Message.
Type annotations and code completion for aiobotocore.resource("sqs").get_available_subresources
method.
boto3 documentation
# get_available_subresources method definition
await def get_available_subresources(
self,
) -> Sequence[str]:
...
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 aiobotocore.resource("sqs").change_visibility
method.
boto3 documentation
# change_visibility method definition
await def change_visibility(
self,
*,
VisibilityTimeout: int,
) -> None:
...
# change_visibility method usage example with argument unpacking
kwargs: ChangeMessageVisibilityRequestMessageChangeVisibilityTypeDef = { # (1)
"VisibilityTimeout": ...,
}
parent.change_visibility(**kwargs)
Message.delete method#
Deletes the specified message from the specified queue.
Type annotations and code completion for aiobotocore.resource("sqs").delete
method.
boto3 documentation
# delete method definition
await def delete(
self,
) -> None:
...
Message.Queue method#
Creates a Queue resource.
Type annotations and code completion for aiobotocore.resource("sqs").Queue
method.
boto3 documentation
# Queue method definition
await def Queue(
self,
) -> _Queue:
...
Queue#
Type annotations and code completion for session.resource("sqs").Queue
class.
boto3 documentation
# Queue usage example
from types_aiobotocore_sqs.service_resource import Queue
def get_resource() -> Queue:
return session.resource("sqs").Queue(...)
Queue attributes#
url
:str
dead_letter_source_queues
:QueueDeadLetterSourceQueuesCollection
attributes
:Awaitable
[Dict
[QueueAttributeNameType,str
]]meta
:SQSResourceMeta
Queue collections#
Queue.dead_letter_source_queues#
Provides access to Queue resource.
Type annotations and code completion for session.resource("sqs").Queue(...).dead_letter_source_queues
collection.
boto3 documentation
# QueueDeadLetterSourceQueuesCollection usage example
from types_aiobotocore_sqs.service_resource import QueueDeadLetterSourceQueuesCollection
def get_collection() -> QueueDeadLetterSourceQueuesCollection:
resource = session.resource("sqs").Queue(...)
return resource.dead_letter_source_queues
Queue methods#
Queue.get_available_subresources method#
Returns a list of all the available sub-resources for this Queue.
Type annotations and code completion for aiobotocore.resource("sqs").get_available_subresources
method.
boto3 documentation
# get_available_subresources method definition
await def get_available_subresources(
self,
) -> Sequence[str]:
...
Queue.add_permission method#
Adds a permission to a queue for a specific principal.
Type annotations and code completion for aiobotocore.resource("sqs").add_permission
method.
boto3 documentation
# add_permission method definition
await def add_permission(
self,
*,
Label: str,
AWSAccountIds: Sequence[str],
Actions: Sequence[str],
) -> None:
...
# add_permission method usage example with argument unpacking
kwargs: AddPermissionRequestQueueAddPermissionTypeDef = { # (1)
"Label": ...,
"AWSAccountIds": ...,
"Actions": ...,
}
parent.add_permission(**kwargs)
Queue.change_message_visibility_batch method#
Changes the visibility timeout of multiple messages.
Type annotations and code completion for aiobotocore.resource("sqs").change_message_visibility_batch
method.
boto3 documentation
# change_message_visibility_batch method definition
await def change_message_visibility_batch(
self,
*,
Entries: Sequence[ChangeMessageVisibilityBatchRequestEntryTypeDef], # (1)
) -> ChangeMessageVisibilityBatchResultTypeDef: # (2)
...
- See
Sequence[ChangeMessageVisibilityBatchRequestEntryTypeDef]
- See ChangeMessageVisibilityBatchResultTypeDef
# change_message_visibility_batch method usage example with argument unpacking
kwargs: ChangeMessageVisibilityBatchRequestQueueChangeMessageVisibilityBatchTypeDef = { # (1)
"Entries": ...,
}
parent.change_message_visibility_batch(**kwargs)
Queue.delete method#
Deletes the queue specified by the QueueUrl
, regardless of the
queue's contents.
Type annotations and code completion for aiobotocore.resource("sqs").delete
method.
boto3 documentation
# delete method definition
await def delete(
self,
) -> None:
...
Queue.delete_messages method#
Deletes up to ten messages from the specified queue.
Type annotations and code completion for aiobotocore.resource("sqs").delete_messages
method.
boto3 documentation
# delete_messages method definition
await def delete_messages(
self,
*,
Entries: Sequence[DeleteMessageBatchRequestEntryTypeDef], # (1)
) -> DeleteMessageBatchResultTypeDef: # (2)
...
- See
Sequence[DeleteMessageBatchRequestEntryTypeDef]
- See DeleteMessageBatchResultTypeDef
# delete_messages method usage example with argument unpacking
kwargs: DeleteMessageBatchRequestQueueDeleteMessagesTypeDef = { # (1)
"Entries": ...,
}
parent.delete_messages(**kwargs)
Queue.purge method#
Deletes available messages in a queue (including in-flight messages) specified
by the QueueURL
parameter.
Type annotations and code completion for aiobotocore.resource("sqs").purge
method.
boto3 documentation
# purge method definition
await def purge(
self,
) -> None:
...
Queue.receive_messages method#
Retrieves one or more messages (up to 10), from the specified queue.
Type annotations and code completion for aiobotocore.resource("sqs").receive_messages
method.
boto3 documentation
# receive_messages method definition
await def receive_messages(
self,
*,
AttributeNames: Sequence[QueueAttributeFilterType] = ..., # (1)
MessageSystemAttributeNames: Sequence[MessageSystemAttributeNameType] = ..., # (2)
MessageAttributeNames: Sequence[str] = ...,
MaxNumberOfMessages: int = ...,
VisibilityTimeout: int = ...,
WaitTimeSeconds: int = ...,
ReceiveRequestAttemptId: str = ...,
) -> List[_Message]:
...
- See
Sequence[QueueAttributeFilterType]
- See
Sequence[MessageSystemAttributeNameType]
# receive_messages method usage example with argument unpacking
kwargs: ReceiveMessageRequestQueueReceiveMessagesTypeDef = { # (1)
"AttributeNames": ...,
}
parent.receive_messages(**kwargs)
Queue.remove_permission method#
Revokes any permissions in the queue policy that matches the specified
Label
parameter.
Type annotations and code completion for aiobotocore.resource("sqs").remove_permission
method.
boto3 documentation
# remove_permission method definition
await def remove_permission(
self,
*,
Label: str,
) -> None:
...
# remove_permission method usage example with argument unpacking
kwargs: RemovePermissionRequestQueueRemovePermissionTypeDef = { # (1)
"Label": ...,
}
parent.remove_permission(**kwargs)
Queue.send_message method#
Delivers a message to the specified queue.
Type annotations and code completion for aiobotocore.resource("sqs").send_message
method.
boto3 documentation
# send_message method definition
await def send_message(
self,
*,
MessageBody: str,
DelaySeconds: int = ...,
MessageAttributes: Mapping[str, MessageAttributeValueUnionTypeDef] = ..., # (1)
MessageSystemAttributes: Mapping[MessageSystemAttributeNameForSendsType, MessageSystemAttributeValueTypeDef] = ..., # (2)
MessageDeduplicationId: str = ...,
MessageGroupId: str = ...,
) -> SendMessageResultTypeDef: # (3)
...
- See
Mapping[str, MessageAttributeValueUnionTypeDef]
- See
Mapping[Literal['AWSTraceHeader'], MessageSystemAttributeValueTypeDef]
- See SendMessageResultTypeDef
# send_message method usage example with argument unpacking
kwargs: SendMessageRequestQueueSendMessageTypeDef = { # (1)
"MessageBody": ...,
}
parent.send_message(**kwargs)
Queue.send_messages method#
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).
Type annotations and code completion for aiobotocore.resource("sqs").send_messages
method.
boto3 documentation
# send_messages method definition
await def send_messages(
self,
*,
Entries: Sequence[SendMessageBatchRequestEntryTypeDef], # (1)
) -> SendMessageBatchResultTypeDef: # (2)
...
- See
Sequence[SendMessageBatchRequestEntryTypeDef]
- See SendMessageBatchResultTypeDef
# send_messages method usage example with argument unpacking
kwargs: SendMessageBatchRequestQueueSendMessagesTypeDef = { # (1)
"Entries": ...,
}
parent.send_messages(**kwargs)
Queue.set_attributes method#
Sets the value of one or more queue attributes, like a policy.
Type annotations and code completion for aiobotocore.resource("sqs").set_attributes
method.
boto3 documentation
# set_attributes method definition
await def set_attributes(
self,
*,
Attributes: Mapping[QueueAttributeNameType, str], # (1)
) -> None:
...
- See
Mapping[QueueAttributeNameType, str]
# set_attributes method usage example with argument unpacking
kwargs: SetQueueAttributesRequestQueueSetAttributesTypeDef = { # (1)
"Attributes": ...,
}
parent.set_attributes(**kwargs)
Queue.Message method#
Creates a Message resource.
Type annotations and code completion for aiobotocore.resource("sqs").Message
method.
boto3 documentation
# Message method definition
await def Message(
self,
receipt_handle: str,
) -> _Message:
...
Queue.load method#
Type annotations and code completion for aiobotocore.resource("sqs").load
method.
boto3 documentation
# load method definition
await def load(
self,
) -> None:
...
Queue.reload method#
Type annotations and code completion for aiobotocore.resource("sqs").reload
method.
boto3 documentation
# reload method definition
await def reload(
self,
) -> None:
...