getServiceQuota method

Future<GetServiceQuotaResponse> getServiceQuota({
  1. required String quotaCode,
  2. required String serviceCode,
  3. String? contextId,
})

Retrieves the applied quota value for the specified account-level or resource-level quota. 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 IllegalArgumentException. May throw NoSuchResourceException. May throw ServiceException. May throw TooManyRequestsException.

Parameter quotaCode : Specifies the quota identifier. To find the quota code for a specific quota, use the ListServiceQuotas operation, and look for the QuotaCode response in the output for the quota you want.

Parameter serviceCode : Specifies the service identifier. To find the service code value for an Amazon Web Services service, use the ListServices operation.

Parameter contextId : Specifies the resource with an Amazon Resource Name (ARN).

Implementation

Future<GetServiceQuotaResponse> getServiceQuota({
  required String quotaCode,
  required String serviceCode,
  String? contextId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'ServiceQuotasV20190624.GetServiceQuota'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'QuotaCode': quotaCode,
      'ServiceCode': serviceCode,
      if (contextId != null) 'ContextId': contextId,
    },
  );

  return GetServiceQuotaResponse.fromJson(jsonResponse.body);
}