getQuotaUtilizationReport method

Future<GetQuotaUtilizationReportResponse> getQuotaUtilizationReport({
  1. required String reportId,
  2. int? maxResults,
  3. String? nextToken,
})

Retrieves the quota utilization report for your Amazon Web Services account. This operation returns paginated results showing your quota usage across all Amazon Web Services services, sorted by utilization percentage in descending order (highest utilization first).

You must first initiate a report using the StartQuotaUtilizationReport operation. The report generation process is asynchronous and may take several seconds to complete. Poll this operation periodically to check the status and retrieve results when the report is ready.

Each report contains up to 1,000 quota records per page. Use the NextToken parameter to retrieve additional pages of results. Reports are automatically deleted after 15 minutes.

May throw AccessDeniedException. May throw IllegalArgumentException. May throw NoSuchResourceException. May throw ServiceException. May throw TooManyRequestsException.

Parameter reportId : The unique identifier for the quota utilization report. This identifier is returned by the StartQuotaUtilizationReport operation.

Parameter maxResults : The maximum number of results to return per page. The default value is 1,000 and the maximum allowed value is 1,000.

Parameter nextToken : A token that indicates the next page of results to retrieve. This token is returned in the response when there are more results available. Omit this parameter for the first request.

Implementation

Future<GetQuotaUtilizationReportResponse> getQuotaUtilizationReport({
  required String reportId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'ServiceQuotasV20190624.GetQuotaUtilizationReport'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ReportId': reportId,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return GetQuotaUtilizationReportResponse.fromJson(jsonResponse.body);
}