changeMessageVisibilityBatch method

Future<ChangeMessageVisibilityBatchResult> changeMessageVisibilityBatch({
  1. required List<ChangeMessageVisibilityBatchRequestEntry> entries,
  2. required String queueUrl,
})

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. Some actions take lists of parameters. These lists are specified using the param.n notation. Values of n are integers starting from 1. For example, a parameter list with two elements looks like this:

&AttributeName.1=first

&AttributeName.2=second

May throw TooManyEntriesInBatchRequest. May throw EmptyBatchRequest. May throw BatchEntryIdsNotDistinct. May throw InvalidBatchEntryId.

Parameter entries : A list of receipt handles of the messages for which the visibility timeout must be changed.

Parameter queueUrl : The URL of the Amazon SQS queue whose messages' visibility is changed.

Queue URLs and names are case-sensitive.

Implementation

Future<ChangeMessageVisibilityBatchResult> changeMessageVisibilityBatch({
  required List<ChangeMessageVisibilityBatchRequestEntry> entries,
  required String queueUrl,
}) async {
  ArgumentError.checkNotNull(entries, 'entries');
  ArgumentError.checkNotNull(queueUrl, 'queueUrl');
  final $request = <String, dynamic>{};
  $request['Entries'] = entries;
  $request['QueueUrl'] = queueUrl;
  final $result = await _protocol.send(
    $request,
    action: 'ChangeMessageVisibilityBatch',
    version: '2012-11-05',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['ChangeMessageVisibilityBatchRequest'],
    shapes: shapes,
    resultWrapper: 'ChangeMessageVisibilityBatchResult',
  );
  return ChangeMessageVisibilityBatchResult.fromXml($result);
}