getFindings method

Future<GetFindingsResponse> getFindings({
  1. required String detectorId,
  2. required List<String> findingIds,
  3. SortCriteria? sortCriteria,
})

Describes Amazon GuardDuty findings specified by finding IDs.

May throw BadRequestException. May throw InternalServerErrorException.

Parameter detectorId : The ID of the detector that specifies the GuardDuty service whose findings you want to retrieve.

To find the detectorId in the current Region, see the Settings page in the GuardDuty console, or run the ListDetectors API.

Parameter findingIds : The IDs of the findings that you want to retrieve.

Parameter sortCriteria : Represents the criteria used for sorting findings.

Implementation

Future<GetFindingsResponse> getFindings({
  required String detectorId,
  required List<String> findingIds,
  SortCriteria? sortCriteria,
}) async {
  final $payload = <String, dynamic>{
    'findingIds': findingIds,
    if (sortCriteria != null) 'sortCriteria': sortCriteria,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/detector/${Uri.encodeComponent(detectorId)}/findings/get',
    exceptionFnMap: _exceptionFns,
  );
  return GetFindingsResponse.fromJson(response);
}