getFindingStatistics method
Future<GetFindingStatisticsResponse>
getFindingStatistics({
- required GroupBy groupBy,
- FindingCriteria? findingCriteria,
- int? size,
- FindingStatisticsSortCriteria? sortCriteria,
Retrieves (queries) aggregated statistical data about findings.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter groupBy :
The finding property to use to group the query results. Valid values are:
- classificationDetails.jobId - The unique identifier for the classification job that produced the finding.
- resourcesAffected.s3Bucket.name - The name of the S3 bucket that the finding applies to.
- severity.description - The severity level of the finding, such as High or Medium.
- type - The type of finding, such as Policy:IAMUser/S3BucketPublic and SensitiveData:S3Object/Personal.
Parameter findingCriteria :
The criteria to use to filter the query results.
Parameter size :
The maximum number of items to include in each page of the response.
Parameter sortCriteria :
The criteria to use to sort the query results.
Implementation
Future<GetFindingStatisticsResponse> getFindingStatistics({
required GroupBy groupBy,
FindingCriteria? findingCriteria,
int? size,
FindingStatisticsSortCriteria? sortCriteria,
}) async {
final $payload = <String, dynamic>{
'groupBy': groupBy.value,
if (findingCriteria != null) 'findingCriteria': findingCriteria,
if (size != null) 'size': size,
if (sortCriteria != null) 'sortCriteria': sortCriteria,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/findings/statistics',
exceptionFnMap: _exceptionFns,
);
return GetFindingStatisticsResponse.fromJson(response);
}