purgeQueue method

Future<void> purgeQueue({
  1. required String queueUrl,
})

Deletes the messages in a queue specified by the QueueURL parameter.

The message deletion process takes up to 60 seconds. We recommend waiting for 60 seconds regardless of your queue's size. Messages sent to the queue before you call PurgeQueue might be received but are deleted within the next minute.

Messages sent to the queue after you call PurgeQueue might be deleted while the queue is being purged.

May throw QueueDoesNotExist. May throw PurgeQueueInProgress.

Parameter queueUrl : The URL of the queue from which the PurgeQueue action deletes messages.

Queue URLs and names are case-sensitive.

Implementation

Future<void> purgeQueue({
  required String queueUrl,
}) async {
  ArgumentError.checkNotNull(queueUrl, 'queueUrl');
  final $request = <String, dynamic>{};
  $request['QueueUrl'] = queueUrl;
  await _protocol.send(
    $request,
    action: 'PurgeQueue',
    version: '2012-11-05',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    shape: shapes['PurgeQueueRequest'],
    shapes: shapes,
  );
}