getFindings method

Future<GetFindingsResponse> getFindings({
  1. required String scanName,
  2. int? maxResults,
  3. String? nextToken,
  4. Status? status,
})

Returns a list of all findings generated by a particular scan.

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

Parameter scanName : The name of the scan you want to retrieve findings from.

Parameter maxResults : The maximum number of results to return in the response. Use this parameter when paginating results. If additional results exist beyond the number you specify, the nextToken element is returned in the response. Use nextToken in a subsequent request to retrieve additional results. If not specified, returns 1000 results.

Parameter nextToken : A token to use for paginating results that are returned in the response. Set the value of this parameter to null for the first request. For subsequent calls, use the nextToken value returned from the previous request to continue listing results after the first page.

Parameter status : The status of the findings you want to get. Pass either Open, Closed, or All.

Implementation

Future<GetFindingsResponse> getFindings({
  required String scanName,
  int? maxResults,
  String? nextToken,
  Status? status,
}) async {
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (status != null) 'status': [status.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/findings/${Uri.encodeComponent(scanName)}',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetFindingsResponse.fromJson(response);
}