getCoverageStatistics method

Future<GetCoverageStatisticsResponse> getCoverageStatistics({
  1. required String detectorId,
  2. required List<CoverageStatisticsType> statisticsType,
  3. CoverageFilterCriteria? filterCriteria,
})

Retrieves aggregated statistics for your account. If you are a GuardDuty administrator, you can retrieve the statistics for all the resources associated with the active member accounts in your organization who have enabled Runtime Monitoring and have the GuardDuty security agent running on their resources.

May throw BadRequestException. May throw InternalServerErrorException.

Parameter detectorId : The unique ID of the GuardDuty detector.

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

Parameter statisticsType : Represents the statistics type used to aggregate the coverage details.

Parameter filterCriteria : Represents the criteria used to filter the coverage statistics.

Implementation

Future<GetCoverageStatisticsResponse> getCoverageStatistics({
  required String detectorId,
  required List<CoverageStatisticsType> statisticsType,
  CoverageFilterCriteria? filterCriteria,
}) async {
  final $payload = <String, dynamic>{
    'statisticsType': statisticsType.map((e) => e.value).toList(),
    if (filterCriteria != null) 'filterCriteria': filterCriteria,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/detector/${Uri.encodeComponent(detectorId)}/coverage/statistics',
    exceptionFnMap: _exceptionFns,
  );
  return GetCoverageStatisticsResponse.fromJson(response);
}