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.
Parameters:
-
queue_url
(String)
–
The URL of the Amazon SQS queue whose messages' visibility is changed.
Queue URLs and names are case-sensitive.
-
entries
(ChangeMessageVisibilityBatchRequestEntryList)
–
Lists the receipt handles of the messages for which the visibility timeout must be changed.
Raises:
Source code in docs_src/capo_sqs/_services/sqs.py
| def change_message_visibility_batch(
self,
queue_url: "capo_sqs.types.string.String",
entries: "capo_sqs.types.change_message_visibility_batch_request_entry_list.ChangeMessageVisibilityBatchRequestEntryList",
*,
config_overrides: Optional[SQSClientConfig] = None,
) -> "capo_sqs.types.change_message_visibility_batch_result.ChangeMessageVisibilityBatchResult":
"""<p>Changes the visibility timeout of multiple messages. This is a batch version of <code> <a>ChangeMessageVisibility</a>.</code> The result of the action on each message is reported individually in the response. You can send up to 10 <code> <a>ChangeMessageVisibility</a> </code> requests with each <code>ChangeMessageVisibilityBatch</code> action.</p> <important> <p>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 <code>200</code>.</p> </important>
Args:
queue_url: <p>The URL of the Amazon SQS queue whose messages' visibility is changed.</p> <p>Queue URLs and names are case-sensitive.</p>
entries: <p>Lists the receipt handles of the messages for which the visibility timeout must be changed.</p>
Raises:
capo_sqs.errors.batch_entry_ids_not_distinct.BatchEntryIdsNotDistinct: <p>Two or more batch entries in the request have the same <code>Id</code>.</p>
capo_sqs.errors.empty_batch_request.EmptyBatchRequest: <p>The batch request doesn't contain any entries.</p>
capo_sqs.errors.invalid_address.InvalidAddress: <p>The specified ID is invalid.</p>
capo_sqs.errors.invalid_batch_entry_id.InvalidBatchEntryId: <p>The <code>Id</code> of a batch entry in a batch request doesn't abide by the specification.</p>
capo_sqs.errors.invalid_security.InvalidSecurity: <p>The request was not made over HTTPS or did not use SigV4 for signing.</p>
capo_sqs.errors.queue_does_not_exist.QueueDoesNotExist: <p>Ensure that the <code>QueueUrl</code> is correct and that the queue has not been deleted.</p>
capo_sqs.errors.request_throttled.RequestThrottled: <p>The request was denied due to request throttling.</p> <ul> <li> <p>Exceeds the permitted request rate for the queue or for the recipient of the request.</p> </li> <li> <p>Ensure that the request rate is within the Amazon SQS limits for sending messages. For more information, see <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-quotas.html#quotas-requests">Amazon SQS quotas</a> in the <i>Amazon SQS Developer Guide</i>.</p> </li> </ul>
capo_sqs.errors.too_many_entries_in_batch_request.TooManyEntriesInBatchRequest: <p>The batch request contains more entries than permissible. For Amazon SQS, the maximum number of entries you can include in a single <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SendMessageBatch.html">SendMessageBatch</a>, <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_DeleteMessageBatch.html">DeleteMessageBatch</a>, or <a href="https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ChangeMessageVisibilityBatch.html">ChangeMessageVisibilityBatch</a> request is 10.</p>
capo_sqs.errors.unsupported_operation.UnsupportedOperation: <p>Error code 400. Unsupported operation.</p>
capo_sqs.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_sqs.types.change_message_visibility_batch_request.ChangeMessageVisibilityBatchRequest]",
) -> OperationResponse[
"capo_sqs.types.change_message_visibility_batch_result.ChangeMessageVisibilityBatchResult"
]:
import capo_sqs._operations.amazon_sqs.change_message_visibility_batch
output, http_response = (
capo_sqs._operations.amazon_sqs.change_message_visibility_batch.change_message_visibility_batch(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("ChangeMessageVisibilityBatch")
)
input_: capo_sqs.types.change_message_visibility_batch_request.ChangeMessageVisibilityBatchRequest = {
"queue_url": queue_url,
"entries": entries,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|