listServiceQuotas method

Future<ListServiceQuotasResponse> listServiceQuotas({
  1. required String serviceCode,
  2. int? maxResults,
  3. String? nextToken,
})

Lists the applied quota values for the specified AWS service. For some quotas, only the default values are available. If the applied quota value is not available for a quota, the quota is not retrieved.

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

Parameter serviceCode : The service identifier.

Parameter maxResults : The maximum number of results to return with a single call. To retrieve the remaining results, if any, make another call with the token returned from this call.

Parameter nextToken : The token for the next page of results.

Implementation

Future<ListServiceQuotasResponse> listServiceQuotas({
  required String serviceCode,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(serviceCode, 'serviceCode');
  _s.validateStringLength(
    'serviceCode',
    serviceCode,
    1,
    63,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    0,
    2048,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'ServiceQuotasV20190624.ListServiceQuotas'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ServiceCode': serviceCode,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListServiceQuotasResponse.fromJson(jsonResponse.body);
}