listFindingAggregations method

Future<ListFindingAggregationsResponse> listFindingAggregations({
  1. required AggregationType aggregationType,
  2. List<StringFilter>? accountIds,
  3. AggregationRequest? aggregationRequest,
  4. int? maxResults,
  5. String? nextToken,
})

Lists aggregated finding data for your environment based on specific criteria.

May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter aggregationType : The type of the aggregation request.

Parameter accountIds : The Amazon Web Services account IDs to retrieve finding aggregation data for.

Parameter aggregationRequest : Details of the aggregation request that is used to filter your aggregation results.

Parameter maxResults : The maximum number of results the response can return. If your request would return more than the maximum the response will return a nextToken value, use this value when you call the action again to get the remaining 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 to a list action. If your response returns more than the maxResults maximum value it will also return a nextToken value. For subsequent calls, use the nextToken value returned from the previous request to continue listing results after the first page.

Implementation

Future<ListFindingAggregationsResponse> listFindingAggregations({
  required AggregationType aggregationType,
  List<StringFilter>? accountIds,
  AggregationRequest? aggregationRequest,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    'aggregationType': aggregationType.value,
    if (accountIds != null) 'accountIds': accountIds,
    if (aggregationRequest != null) 'aggregationRequest': aggregationRequest,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/findings/aggregation/list',
    exceptionFnMap: _exceptionFns,
  );
  return ListFindingAggregationsResponse.fromJson(response);
}