getUsageStatistics method

Future<GetUsageStatisticsResponse> getUsageStatistics({
  1. List<UsageStatisticsFilter>? filterBy,
  2. int? maxResults,
  3. String? nextToken,
  4. UsageStatisticsSortBy? sortBy,
  5. TimeRange? timeRange,
})

Retrieves (queries) quotas and aggregated usage data for one or more accounts.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter filterBy : An array of objects, one for each condition to use to filter the query results. If you specify more than one condition, Amazon Macie uses an AND operator to join the conditions.

Parameter maxResults : The maximum number of items to include in each page of the response.

Parameter nextToken : The nextToken string that specifies which page of results to return in a paginated response.

Parameter sortBy : The criteria to use to sort the query results.

Parameter timeRange : The inclusive time period to query usage data for. Valid values are: MONTH_TO_DATE, for the current calendar month to date; and, PAST_30_DAYS, for the preceding 30 days. If you don't specify a value, Amazon Macie provides usage data for the preceding 30 days.

Implementation

Future<GetUsageStatisticsResponse> getUsageStatistics({
  List<UsageStatisticsFilter>? filterBy,
  int? maxResults,
  String? nextToken,
  UsageStatisticsSortBy? sortBy,
  TimeRange? timeRange,
}) async {
  final $payload = <String, dynamic>{
    if (filterBy != null) 'filterBy': filterBy,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
    if (sortBy != null) 'sortBy': sortBy,
    if (timeRange != null) 'timeRange': timeRange.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/usage/statistics',
    exceptionFnMap: _exceptionFns,
  );
  return GetUsageStatisticsResponse.fromJson(response);
}