listTargets method

Future<ListTargetsResult> listTargets({
  1. List<ListTargetsFilter>? filters,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of the notification rule targets for an AWS account.

May throw InvalidNextTokenException. May throw ValidationException.

Parameter filters : The filters to use to return information by service or resource type. Valid filters include target type, target address, and target status.

Parameter maxResults : A non-negative integer used to limit the number of returned results. The maximum number of results that can be returned is 100.

Parameter nextToken : An enumeration token that, when provided in a request, returns the next batch of the results.

Implementation

Future<ListTargetsResult> listTargets({
  List<ListTargetsFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    if (filters != null) 'Filters': filters,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/listTargets',
    exceptionFnMap: _exceptionFns,
  );
  return ListTargetsResult.fromJson(response);
}