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.

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 {
  ArgumentError.checkNotNull(detectorId, 'detectorId');
  _s.validateStringLength(
    'detectorId',
    detectorId,
    1,
    300,
    isRequired: true,
  );
  ArgumentError.checkNotNull(findingIds, 'findingIds');
  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);
}