listFindings method

Future<ListFindingsResponse> listFindings({
  1. required String analyzerArn,
  2. Map<String, Criterion>? filter,
  3. int? maxResults,
  4. String? nextToken,
  5. SortCriteria? sort,
})

Retrieves a list of findings generated by the specified analyzer.

To learn about filter keys that you can use to create an archive rule, see Access Analyzer filter keys in the IAM User Guide.

May throw ResourceNotFoundException. May throw ValidationException. May throw InternalServerException. May throw ThrottlingException. May throw AccessDeniedException.

Parameter analyzerArn : The ARN of the analyzer to retrieve findings from.

Parameter filter : A filter to match for the findings to return.

Parameter maxResults : The maximum number of results to return in the response.

Parameter nextToken : A token used for pagination of results returned.

Parameter sort : The sort order for the findings returned.

Implementation

Future<ListFindingsResponse> listFindings({
  required String analyzerArn,
  Map<String, Criterion>? filter,
  int? maxResults,
  String? nextToken,
  SortCriteria? sort,
}) async {
  ArgumentError.checkNotNull(analyzerArn, 'analyzerArn');
  final $payload = <String, dynamic>{
    'analyzerArn': analyzerArn,
    if (filter != null) 'filter': filter,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
    if (sort != null) 'sort': sort,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/finding',
    exceptionFnMap: _exceptionFns,
  );
  return ListFindingsResponse.fromJson(response);
}