listInvestigations method

Future<ListInvestigationsResponse> listInvestigations({
  1. required String detectorId,
  2. int? maxResults,
  3. String? nextToken,
  4. InvestigationSortCriteria? sortCriteria,
})

This API is currently available as a preview. This feature is available in the following Amazon Web Services Regions: US East (N. Virginia), US East (Ohio), US West (Oregon), Canada (Central), Europe (Frankfurt), Europe (Ireland), Europe (London), Europe (Paris), Europe (Stockholm), and Asia Pacific (Tokyo).

Returns a list of investigations associated with the specified GuardDuty detector.

An administrator account sees all investigations across the organization. Member accounts see only the investigations that belong to them.

May throw AccessDeniedException. May throw BadRequestException. May throw InternalServerErrorException.

Parameter detectorId : The unique ID of the GuardDuty detector whose investigations you want to list.

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

Parameter maxResults : You can use this parameter to indicate the maximum number of items you want in the response. The default value is 50.

Parameter nextToken : You can use this parameter when paginating results. Set the value of this parameter to null on your first call to the list action. For subsequent calls to the action, fill nextToken in the request with the value of NextToken from the previous response to continue listing data.

Parameter sortCriteria : Represents the criteria used for sorting investigations.

Implementation

Future<ListInvestigationsResponse> listInvestigations({
  required String detectorId,
  int? maxResults,
  String? nextToken,
  InvestigationSortCriteria? sortCriteria,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final $payload = <String, dynamic>{
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
    if (sortCriteria != null) 'sortCriteria': sortCriteria,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/detector/${Uri.encodeComponent(detectorId)}/investigation/list',
    exceptionFnMap: _exceptionFns,
  );
  return ListInvestigationsResponse.fromJson(response);
}