listDeadLetterSourceQueues method

Future<ListDeadLetterSourceQueuesResult> listDeadLetterSourceQueues({
  1. required String queueUrl,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of your queues that have the RedrivePolicy queue attribute configured with a dead-letter queue.

The ListDeadLetterSourceQueues methods supports pagination. Set parameter MaxResults in the request to specify the maximum number of results to be returned in the response. If you do not set MaxResults, the response includes a maximum of 1,000 results. If you set MaxResults and there are additional results to display, the response includes a value for NextToken. Use NextToken as a parameter in your next request to ListDeadLetterSourceQueues to receive the next page of results.

For more information about using dead-letter queues, see Using Amazon SQS Dead-Letter Queues in the Amazon SQS Developer Guide.

May throw InvalidAddress. May throw InvalidSecurity. May throw QueueDoesNotExist. May throw RequestThrottled. May throw UnsupportedOperation.

Parameter queueUrl : The URL of a dead-letter queue.

Queue URLs and names are case-sensitive.

Parameter maxResults : Maximum number of results to include in the response. Value range is 1 to 1000. You must set MaxResults to receive a value for NextToken in the response.

Parameter nextToken : Pagination token to request the next set of results.

Implementation

Future<ListDeadLetterSourceQueuesResult> listDeadLetterSourceQueues({
  required String queueUrl,
  int? maxResults,
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AmazonSQS.ListDeadLetterSourceQueues'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'QueueUrl': queueUrl,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListDeadLetterSourceQueuesResult.fromJson(jsonResponse.body);
}