software.amazon.awssdk.services.servicequotas.DefaultServiceQuotasClient Maven / Gradle / Ivy
Show all versions of servicequotas Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.servicequotas;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.retry.RetryMode;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.retries.api.RetryStrategy;
import software.amazon.awssdk.services.servicequotas.internal.ServiceQuotasServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.servicequotas.model.AccessDeniedException;
import software.amazon.awssdk.services.servicequotas.model.AssociateServiceQuotaTemplateRequest;
import software.amazon.awssdk.services.servicequotas.model.AssociateServiceQuotaTemplateResponse;
import software.amazon.awssdk.services.servicequotas.model.AwsServiceAccessNotEnabledException;
import software.amazon.awssdk.services.servicequotas.model.DeleteServiceQuotaIncreaseRequestFromTemplateRequest;
import software.amazon.awssdk.services.servicequotas.model.DeleteServiceQuotaIncreaseRequestFromTemplateResponse;
import software.amazon.awssdk.services.servicequotas.model.DependencyAccessDeniedException;
import software.amazon.awssdk.services.servicequotas.model.DisassociateServiceQuotaTemplateRequest;
import software.amazon.awssdk.services.servicequotas.model.DisassociateServiceQuotaTemplateResponse;
import software.amazon.awssdk.services.servicequotas.model.GetAssociationForServiceQuotaTemplateRequest;
import software.amazon.awssdk.services.servicequotas.model.GetAssociationForServiceQuotaTemplateResponse;
import software.amazon.awssdk.services.servicequotas.model.GetAwsDefaultServiceQuotaRequest;
import software.amazon.awssdk.services.servicequotas.model.GetAwsDefaultServiceQuotaResponse;
import software.amazon.awssdk.services.servicequotas.model.GetRequestedServiceQuotaChangeRequest;
import software.amazon.awssdk.services.servicequotas.model.GetRequestedServiceQuotaChangeResponse;
import software.amazon.awssdk.services.servicequotas.model.GetServiceQuotaIncreaseRequestFromTemplateRequest;
import software.amazon.awssdk.services.servicequotas.model.GetServiceQuotaIncreaseRequestFromTemplateResponse;
import software.amazon.awssdk.services.servicequotas.model.GetServiceQuotaRequest;
import software.amazon.awssdk.services.servicequotas.model.GetServiceQuotaResponse;
import software.amazon.awssdk.services.servicequotas.model.IllegalArgumentException;
import software.amazon.awssdk.services.servicequotas.model.InvalidPaginationTokenException;
import software.amazon.awssdk.services.servicequotas.model.InvalidResourceStateException;
import software.amazon.awssdk.services.servicequotas.model.ListAwsDefaultServiceQuotasRequest;
import software.amazon.awssdk.services.servicequotas.model.ListAwsDefaultServiceQuotasResponse;
import software.amazon.awssdk.services.servicequotas.model.ListRequestedServiceQuotaChangeHistoryByQuotaRequest;
import software.amazon.awssdk.services.servicequotas.model.ListRequestedServiceQuotaChangeHistoryByQuotaResponse;
import software.amazon.awssdk.services.servicequotas.model.ListRequestedServiceQuotaChangeHistoryRequest;
import software.amazon.awssdk.services.servicequotas.model.ListRequestedServiceQuotaChangeHistoryResponse;
import software.amazon.awssdk.services.servicequotas.model.ListServiceQuotaIncreaseRequestsInTemplateRequest;
import software.amazon.awssdk.services.servicequotas.model.ListServiceQuotaIncreaseRequestsInTemplateResponse;
import software.amazon.awssdk.services.servicequotas.model.ListServiceQuotasRequest;
import software.amazon.awssdk.services.servicequotas.model.ListServiceQuotasResponse;
import software.amazon.awssdk.services.servicequotas.model.ListServicesRequest;
import software.amazon.awssdk.services.servicequotas.model.ListServicesResponse;
import software.amazon.awssdk.services.servicequotas.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.servicequotas.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.servicequotas.model.NoAvailableOrganizationException;
import software.amazon.awssdk.services.servicequotas.model.NoSuchResourceException;
import software.amazon.awssdk.services.servicequotas.model.OrganizationNotInAllFeaturesModeException;
import software.amazon.awssdk.services.servicequotas.model.PutServiceQuotaIncreaseRequestIntoTemplateRequest;
import software.amazon.awssdk.services.servicequotas.model.PutServiceQuotaIncreaseRequestIntoTemplateResponse;
import software.amazon.awssdk.services.servicequotas.model.QuotaExceededException;
import software.amazon.awssdk.services.servicequotas.model.RequestServiceQuotaIncreaseRequest;
import software.amazon.awssdk.services.servicequotas.model.RequestServiceQuotaIncreaseResponse;
import software.amazon.awssdk.services.servicequotas.model.ResourceAlreadyExistsException;
import software.amazon.awssdk.services.servicequotas.model.ServiceException;
import software.amazon.awssdk.services.servicequotas.model.ServiceQuotaTemplateNotInUseException;
import software.amazon.awssdk.services.servicequotas.model.ServiceQuotasException;
import software.amazon.awssdk.services.servicequotas.model.TagPolicyViolationException;
import software.amazon.awssdk.services.servicequotas.model.TagResourceRequest;
import software.amazon.awssdk.services.servicequotas.model.TagResourceResponse;
import software.amazon.awssdk.services.servicequotas.model.TemplatesNotAvailableInRegionException;
import software.amazon.awssdk.services.servicequotas.model.TooManyRequestsException;
import software.amazon.awssdk.services.servicequotas.model.TooManyTagsException;
import software.amazon.awssdk.services.servicequotas.model.UntagResourceRequest;
import software.amazon.awssdk.services.servicequotas.model.UntagResourceResponse;
import software.amazon.awssdk.services.servicequotas.transform.AssociateServiceQuotaTemplateRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.DeleteServiceQuotaIncreaseRequestFromTemplateRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.DisassociateServiceQuotaTemplateRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.GetAssociationForServiceQuotaTemplateRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.GetAwsDefaultServiceQuotaRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.GetRequestedServiceQuotaChangeRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.GetServiceQuotaIncreaseRequestFromTemplateRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.GetServiceQuotaRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.ListAwsDefaultServiceQuotasRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.ListRequestedServiceQuotaChangeHistoryByQuotaRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.ListRequestedServiceQuotaChangeHistoryRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.ListServiceQuotaIncreaseRequestsInTemplateRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.ListServiceQuotasRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.ListServicesRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.PutServiceQuotaIncreaseRequestIntoTemplateRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.RequestServiceQuotaIncreaseRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.servicequotas.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.utils.Logger;
/**
* Internal implementation of {@link ServiceQuotasClient}.
*
* @see ServiceQuotasClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultServiceQuotasClient implements ServiceQuotasClient {
private static final Logger log = Logger.loggerFor(DefaultServiceQuotasClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.AWS_JSON).build();
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultServiceQuotasClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Associates your quota request template with your organization. When a new Amazon Web Services account is created
* in your organization, the quota increase requests in the template are automatically applied to the account. You
* can add a quota increase request for any adjustable quota to your template.
*
*
* @param associateServiceQuotaTemplateRequest
* @return Result of the AssociateServiceQuotaTemplate operation returned by the service.
* @throws DependencyAccessDeniedException
* You can't perform this action because a dependency does not have access.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws AwsServiceAccessNotEnabledException
* The action you attempted is not allowed unless Service Access with Service Quotas is enabled in your
* organization.
* @throws OrganizationNotInAllFeaturesModeException
* The organization that your Amazon Web Services account belongs to is not in All Features mode.
* @throws TemplatesNotAvailableInRegionException
* The Service Quotas template is not available in this Amazon Web Services Region.
* @throws NoAvailableOrganizationException
* The Amazon Web Services account making this call is not a member of an organization.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.AssociateServiceQuotaTemplate
* @see AWS API Documentation
*/
@Override
public AssociateServiceQuotaTemplateResponse associateServiceQuotaTemplate(
AssociateServiceQuotaTemplateRequest associateServiceQuotaTemplateRequest) throws DependencyAccessDeniedException,
AccessDeniedException, ServiceException, TooManyRequestsException, AwsServiceAccessNotEnabledException,
OrganizationNotInAllFeaturesModeException, TemplatesNotAvailableInRegionException, NoAvailableOrganizationException,
AwsServiceException, SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AssociateServiceQuotaTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateServiceQuotaTemplateRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
associateServiceQuotaTemplateRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateServiceQuotaTemplate");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AssociateServiceQuotaTemplate").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(associateServiceQuotaTemplateRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AssociateServiceQuotaTemplateRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the quota increase request for the specified quota from your quota request template.
*
*
* @param deleteServiceQuotaIncreaseRequestFromTemplateRequest
* @return Result of the DeleteServiceQuotaIncreaseRequestFromTemplate operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws ServiceException
* Something went wrong.
* @throws DependencyAccessDeniedException
* You can't perform this action because a dependency does not have access.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws AwsServiceAccessNotEnabledException
* The action you attempted is not allowed unless Service Access with Service Quotas is enabled in your
* organization.
* @throws TemplatesNotAvailableInRegionException
* The Service Quotas template is not available in this Amazon Web Services Region.
* @throws NoAvailableOrganizationException
* The Amazon Web Services account making this call is not a member of an organization.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.DeleteServiceQuotaIncreaseRequestFromTemplate
* @see AWS API Documentation
*/
@Override
public DeleteServiceQuotaIncreaseRequestFromTemplateResponse deleteServiceQuotaIncreaseRequestFromTemplate(
DeleteServiceQuotaIncreaseRequestFromTemplateRequest deleteServiceQuotaIncreaseRequestFromTemplateRequest)
throws AccessDeniedException, ServiceException, DependencyAccessDeniedException, TooManyRequestsException,
NoSuchResourceException, IllegalArgumentException, AwsServiceAccessNotEnabledException,
TemplatesNotAvailableInRegionException, NoAvailableOrganizationException, AwsServiceException, SdkClientException,
ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeleteServiceQuotaIncreaseRequestFromTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(
deleteServiceQuotaIncreaseRequestFromTemplateRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteServiceQuotaIncreaseRequestFromTemplateRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteServiceQuotaIncreaseRequestFromTemplate");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteServiceQuotaIncreaseRequestFromTemplate")
.withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(deleteServiceQuotaIncreaseRequestFromTemplateRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteServiceQuotaIncreaseRequestFromTemplateRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Disables your quota request template. After a template is disabled, the quota increase requests in the template
* are not applied to new Amazon Web Services accounts in your organization. Disabling a quota request template does
* not apply its quota increase requests.
*
*
* @param disassociateServiceQuotaTemplateRequest
* @return Result of the DisassociateServiceQuotaTemplate operation returned by the service.
* @throws DependencyAccessDeniedException
* You can't perform this action because a dependency does not have access.
* @throws ServiceQuotaTemplateNotInUseException
* The quota request template is not associated with your organization.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws AwsServiceAccessNotEnabledException
* The action you attempted is not allowed unless Service Access with Service Quotas is enabled in your
* organization.
* @throws TemplatesNotAvailableInRegionException
* The Service Quotas template is not available in this Amazon Web Services Region.
* @throws NoAvailableOrganizationException
* The Amazon Web Services account making this call is not a member of an organization.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.DisassociateServiceQuotaTemplate
* @see AWS API Documentation
*/
@Override
public DisassociateServiceQuotaTemplateResponse disassociateServiceQuotaTemplate(
DisassociateServiceQuotaTemplateRequest disassociateServiceQuotaTemplateRequest)
throws DependencyAccessDeniedException, ServiceQuotaTemplateNotInUseException, AccessDeniedException,
ServiceException, TooManyRequestsException, AwsServiceAccessNotEnabledException,
TemplatesNotAvailableInRegionException, NoAvailableOrganizationException, AwsServiceException, SdkClientException,
ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DisassociateServiceQuotaTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateServiceQuotaTemplateRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
disassociateServiceQuotaTemplateRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateServiceQuotaTemplate");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DisassociateServiceQuotaTemplate").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(disassociateServiceQuotaTemplateRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DisassociateServiceQuotaTemplateRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the default value for the specified quota. The default value does not reflect any quota increases.
*
*
* @param getAwsDefaultServiceQuotaRequest
* @return Result of the GetAWSDefaultServiceQuota operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.GetAWSDefaultServiceQuota
* @see AWS API Documentation
*/
@Override
public GetAwsDefaultServiceQuotaResponse getAWSDefaultServiceQuota(
GetAwsDefaultServiceQuotaRequest getAwsDefaultServiceQuotaRequest) throws AccessDeniedException,
NoSuchResourceException, IllegalArgumentException, ServiceException, TooManyRequestsException, AwsServiceException,
SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetAwsDefaultServiceQuotaResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getAwsDefaultServiceQuotaRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getAwsDefaultServiceQuotaRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAWSDefaultServiceQuota");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetAWSDefaultServiceQuota").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getAwsDefaultServiceQuotaRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetAwsDefaultServiceQuotaRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the status of the association for the quota request template.
*
*
* @param getAssociationForServiceQuotaTemplateRequest
* @return Result of the GetAssociationForServiceQuotaTemplate operation returned by the service.
* @throws DependencyAccessDeniedException
* You can't perform this action because a dependency does not have access.
* @throws ServiceQuotaTemplateNotInUseException
* The quota request template is not associated with your organization.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws AwsServiceAccessNotEnabledException
* The action you attempted is not allowed unless Service Access with Service Quotas is enabled in your
* organization.
* @throws TemplatesNotAvailableInRegionException
* The Service Quotas template is not available in this Amazon Web Services Region.
* @throws NoAvailableOrganizationException
* The Amazon Web Services account making this call is not a member of an organization.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.GetAssociationForServiceQuotaTemplate
* @see AWS API Documentation
*/
@Override
public GetAssociationForServiceQuotaTemplateResponse getAssociationForServiceQuotaTemplate(
GetAssociationForServiceQuotaTemplateRequest getAssociationForServiceQuotaTemplateRequest)
throws DependencyAccessDeniedException, ServiceQuotaTemplateNotInUseException, AccessDeniedException,
ServiceException, TooManyRequestsException, AwsServiceAccessNotEnabledException,
TemplatesNotAvailableInRegionException, NoAvailableOrganizationException, AwsServiceException, SdkClientException,
ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, GetAssociationForServiceQuotaTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getAssociationForServiceQuotaTemplateRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getAssociationForServiceQuotaTemplateRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAssociationForServiceQuotaTemplate");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetAssociationForServiceQuotaTemplate").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(getAssociationForServiceQuotaTemplateRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetAssociationForServiceQuotaTemplateRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about the specified quota increase request.
*
*
* @param getRequestedServiceQuotaChangeRequest
* @return Result of the GetRequestedServiceQuotaChange operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.GetRequestedServiceQuotaChange
* @see AWS API Documentation
*/
@Override
public GetRequestedServiceQuotaChangeResponse getRequestedServiceQuotaChange(
GetRequestedServiceQuotaChangeRequest getRequestedServiceQuotaChangeRequest) throws AccessDeniedException,
NoSuchResourceException, IllegalArgumentException, ServiceException, TooManyRequestsException, AwsServiceException,
SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetRequestedServiceQuotaChangeResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getRequestedServiceQuotaChangeRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getRequestedServiceQuotaChangeRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRequestedServiceQuotaChange");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetRequestedServiceQuotaChange").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getRequestedServiceQuotaChangeRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetRequestedServiceQuotaChangeRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the applied quota value for the specified 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.
*
*
* @param getServiceQuotaRequest
* @return Result of the GetServiceQuota operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.GetServiceQuota
* @see AWS API Documentation
*/
@Override
public GetServiceQuotaResponse getServiceQuota(GetServiceQuotaRequest getServiceQuotaRequest) throws AccessDeniedException,
NoSuchResourceException, IllegalArgumentException, ServiceException, TooManyRequestsException, AwsServiceException,
SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetServiceQuotaResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getServiceQuotaRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getServiceQuotaRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetServiceQuota");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetServiceQuota").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(getServiceQuotaRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetServiceQuotaRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves information about the specified quota increase request in your quota request template.
*
*
* @param getServiceQuotaIncreaseRequestFromTemplateRequest
* @return Result of the GetServiceQuotaIncreaseRequestFromTemplate operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws DependencyAccessDeniedException
* You can't perform this action because a dependency does not have access.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws AwsServiceAccessNotEnabledException
* The action you attempted is not allowed unless Service Access with Service Quotas is enabled in your
* organization.
* @throws TemplatesNotAvailableInRegionException
* The Service Quotas template is not available in this Amazon Web Services Region.
* @throws NoAvailableOrganizationException
* The Amazon Web Services account making this call is not a member of an organization.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.GetServiceQuotaIncreaseRequestFromTemplate
* @see AWS API Documentation
*/
@Override
public GetServiceQuotaIncreaseRequestFromTemplateResponse getServiceQuotaIncreaseRequestFromTemplate(
GetServiceQuotaIncreaseRequestFromTemplateRequest getServiceQuotaIncreaseRequestFromTemplateRequest)
throws AccessDeniedException, DependencyAccessDeniedException, ServiceException, TooManyRequestsException,
NoSuchResourceException, IllegalArgumentException, AwsServiceAccessNotEnabledException,
TemplatesNotAvailableInRegionException, NoAvailableOrganizationException, AwsServiceException, SdkClientException,
ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, GetServiceQuotaIncreaseRequestFromTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(
getServiceQuotaIncreaseRequestFromTemplateRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getServiceQuotaIncreaseRequestFromTemplateRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetServiceQuotaIncreaseRequestFromTemplate");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetServiceQuotaIncreaseRequestFromTemplate")
.withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(getServiceQuotaIncreaseRequestFromTemplateRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new GetServiceQuotaIncreaseRequestFromTemplateRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the default values for the quotas for the specified Amazon Web Service. A default value does not reflect
* any quota increases.
*
*
* @param listAwsDefaultServiceQuotasRequest
* @return Result of the ListAWSDefaultServiceQuotas operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws InvalidPaginationTokenException
* Invalid input was provided.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.ListAWSDefaultServiceQuotas
* @see AWS API Documentation
*/
@Override
public ListAwsDefaultServiceQuotasResponse listAWSDefaultServiceQuotas(
ListAwsDefaultServiceQuotasRequest listAwsDefaultServiceQuotasRequest) throws AccessDeniedException,
NoSuchResourceException, IllegalArgumentException, InvalidPaginationTokenException, ServiceException,
TooManyRequestsException, AwsServiceException, SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListAwsDefaultServiceQuotasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAwsDefaultServiceQuotasRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listAwsDefaultServiceQuotasRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAWSDefaultServiceQuotas");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListAWSDefaultServiceQuotas").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listAwsDefaultServiceQuotasRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListAwsDefaultServiceQuotasRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the quota increase requests for the specified Amazon Web Service.
*
*
* @param listRequestedServiceQuotaChangeHistoryRequest
* @return Result of the ListRequestedServiceQuotaChangeHistory operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws InvalidPaginationTokenException
* Invalid input was provided.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.ListRequestedServiceQuotaChangeHistory
* @see AWS API Documentation
*/
@Override
public ListRequestedServiceQuotaChangeHistoryResponse listRequestedServiceQuotaChangeHistory(
ListRequestedServiceQuotaChangeHistoryRequest listRequestedServiceQuotaChangeHistoryRequest)
throws AccessDeniedException, NoSuchResourceException, IllegalArgumentException, InvalidPaginationTokenException,
ServiceException, TooManyRequestsException, AwsServiceException, SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, ListRequestedServiceQuotaChangeHistoryResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listRequestedServiceQuotaChangeHistoryRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listRequestedServiceQuotaChangeHistoryRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRequestedServiceQuotaChangeHistory");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListRequestedServiceQuotaChangeHistory").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration)
.withInput(listRequestedServiceQuotaChangeHistoryRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListRequestedServiceQuotaChangeHistoryRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the quota increase requests for the specified quota.
*
*
* @param listRequestedServiceQuotaChangeHistoryByQuotaRequest
* @return Result of the ListRequestedServiceQuotaChangeHistoryByQuota operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws InvalidPaginationTokenException
* Invalid input was provided.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.ListRequestedServiceQuotaChangeHistoryByQuota
* @see AWS API Documentation
*/
@Override
public ListRequestedServiceQuotaChangeHistoryByQuotaResponse listRequestedServiceQuotaChangeHistoryByQuota(
ListRequestedServiceQuotaChangeHistoryByQuotaRequest listRequestedServiceQuotaChangeHistoryByQuotaRequest)
throws AccessDeniedException, NoSuchResourceException, IllegalArgumentException, InvalidPaginationTokenException,
ServiceException, TooManyRequestsException, AwsServiceException, SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, ListRequestedServiceQuotaChangeHistoryByQuotaResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(
listRequestedServiceQuotaChangeHistoryByQuotaRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listRequestedServiceQuotaChangeHistoryByQuotaRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRequestedServiceQuotaChangeHistoryByQuota");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListRequestedServiceQuotaChangeHistoryByQuota")
.withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(listRequestedServiceQuotaChangeHistoryByQuotaRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListRequestedServiceQuotaChangeHistoryByQuotaRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the quota increase requests in the specified quota request template.
*
*
* @param listServiceQuotaIncreaseRequestsInTemplateRequest
* @return Result of the ListServiceQuotaIncreaseRequestsInTemplate operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws DependencyAccessDeniedException
* You can't perform this action because a dependency does not have access.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws AwsServiceAccessNotEnabledException
* The action you attempted is not allowed unless Service Access with Service Quotas is enabled in your
* organization.
* @throws TemplatesNotAvailableInRegionException
* The Service Quotas template is not available in this Amazon Web Services Region.
* @throws NoAvailableOrganizationException
* The Amazon Web Services account making this call is not a member of an organization.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.ListServiceQuotaIncreaseRequestsInTemplate
* @see AWS API Documentation
*/
@Override
public ListServiceQuotaIncreaseRequestsInTemplateResponse listServiceQuotaIncreaseRequestsInTemplate(
ListServiceQuotaIncreaseRequestsInTemplateRequest listServiceQuotaIncreaseRequestsInTemplateRequest)
throws AccessDeniedException, DependencyAccessDeniedException, ServiceException, TooManyRequestsException,
IllegalArgumentException, AwsServiceAccessNotEnabledException, TemplatesNotAvailableInRegionException,
NoAvailableOrganizationException, AwsServiceException, SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, ListServiceQuotaIncreaseRequestsInTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(
listServiceQuotaIncreaseRequestsInTemplateRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listServiceQuotaIncreaseRequestsInTemplateRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListServiceQuotaIncreaseRequestsInTemplate");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListServiceQuotaIncreaseRequestsInTemplate")
.withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(listServiceQuotaIncreaseRequestsInTemplateRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListServiceQuotaIncreaseRequestsInTemplateRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the applied quota values for the specified Amazon Web 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.
*
*
* @param listServiceQuotasRequest
* @return Result of the ListServiceQuotas operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws InvalidPaginationTokenException
* Invalid input was provided.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.ListServiceQuotas
* @see AWS API Documentation
*/
@Override
public ListServiceQuotasResponse listServiceQuotas(ListServiceQuotasRequest listServiceQuotasRequest)
throws AccessDeniedException, NoSuchResourceException, IllegalArgumentException, InvalidPaginationTokenException,
ServiceException, TooManyRequestsException, AwsServiceException, SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListServiceQuotasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listServiceQuotasRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listServiceQuotasRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListServiceQuotas");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListServiceQuotas").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listServiceQuotasRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListServiceQuotasRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Lists the names and codes for the Amazon Web Services integrated with Service Quotas.
*
*
* @param listServicesRequest
* @return Result of the ListServices operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws InvalidPaginationTokenException
* Invalid input was provided.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.ListServices
* @see AWS
* API Documentation
*/
@Override
public ListServicesResponse listServices(ListServicesRequest listServicesRequest) throws AccessDeniedException,
IllegalArgumentException, InvalidPaginationTokenException, ServiceException, TooManyRequestsException,
AwsServiceException, SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListServicesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listServicesRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listServicesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListServices");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListServices").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listServicesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListServicesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Returns a list of the tags assigned to the specified applied quota.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws ServiceException
* Something went wrong.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
throws TooManyRequestsException, NoSuchResourceException, IllegalArgumentException, AccessDeniedException,
ServiceException, AwsServiceException, SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTagsForResourceRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(listTagsForResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds a quota increase request to your quota request template.
*
*
* @param putServiceQuotaIncreaseRequestIntoTemplateRequest
* @return Result of the PutServiceQuotaIncreaseRequestIntoTemplate operation returned by the service.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws DependencyAccessDeniedException
* You can't perform this action because a dependency does not have access.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws QuotaExceededException
* You have exceeded your service quota. To perform the requested action, remove some of the relevant
* resources, or use Service Quotas to request a service quota increase.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws AwsServiceAccessNotEnabledException
* The action you attempted is not allowed unless Service Access with Service Quotas is enabled in your
* organization.
* @throws TemplatesNotAvailableInRegionException
* The Service Quotas template is not available in this Amazon Web Services Region.
* @throws NoAvailableOrganizationException
* The Amazon Web Services account making this call is not a member of an organization.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.PutServiceQuotaIncreaseRequestIntoTemplate
* @see AWS API Documentation
*/
@Override
public PutServiceQuotaIncreaseRequestIntoTemplateResponse putServiceQuotaIncreaseRequestIntoTemplate(
PutServiceQuotaIncreaseRequestIntoTemplateRequest putServiceQuotaIncreaseRequestIntoTemplateRequest)
throws AccessDeniedException, DependencyAccessDeniedException, ServiceException, TooManyRequestsException,
IllegalArgumentException, QuotaExceededException, NoSuchResourceException, AwsServiceAccessNotEnabledException,
TemplatesNotAvailableInRegionException, NoAvailableOrganizationException, AwsServiceException, SdkClientException,
ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, PutServiceQuotaIncreaseRequestIntoTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(
putServiceQuotaIncreaseRequestIntoTemplateRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
putServiceQuotaIncreaseRequestIntoTemplateRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutServiceQuotaIncreaseRequestIntoTemplate");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("PutServiceQuotaIncreaseRequestIntoTemplate")
.withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(putServiceQuotaIncreaseRequestIntoTemplateRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new PutServiceQuotaIncreaseRequestIntoTemplateRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Submits a quota increase request for the specified quota.
*
*
* @param requestServiceQuotaIncreaseRequest
* @return Result of the RequestServiceQuotaIncrease operation returned by the service.
* @throws DependencyAccessDeniedException
* You can't perform this action because a dependency does not have access.
* @throws QuotaExceededException
* You have exceeded your service quota. To perform the requested action, remove some of the relevant
* resources, or use Service Quotas to request a service quota increase.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws InvalidResourceStateException
* The resource is in an invalid state.
* @throws ServiceException
* Something went wrong.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.RequestServiceQuotaIncrease
* @see AWS API Documentation
*/
@Override
public RequestServiceQuotaIncreaseResponse requestServiceQuotaIncrease(
RequestServiceQuotaIncreaseRequest requestServiceQuotaIncreaseRequest) throws DependencyAccessDeniedException,
QuotaExceededException, ResourceAlreadyExistsException, AccessDeniedException, NoSuchResourceException,
IllegalArgumentException, InvalidResourceStateException, ServiceException, TooManyRequestsException,
AwsServiceException, SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, RequestServiceQuotaIncreaseResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(requestServiceQuotaIncreaseRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, requestServiceQuotaIncreaseRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RequestServiceQuotaIncrease");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("RequestServiceQuotaIncrease").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(requestServiceQuotaIncreaseRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new RequestServiceQuotaIncreaseRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds tags to the specified applied quota. You can include one or more tags to add to the quota.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws TooManyTagsException
* You've exceeded the number of tags allowed for a resource. For more information, see Tag
* restrictions in the Service Quotas User Guide.
* @throws TagPolicyViolationException
* The specified tag is a reserved word and cannot be used.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws ServiceException
* Something went wrong.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.TagResource
* @see AWS
* API Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws TooManyRequestsException,
NoSuchResourceException, TooManyTagsException, TagPolicyViolationException, IllegalArgumentException,
AccessDeniedException, ServiceException, AwsServiceException, SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("TagResource").withProtocolMetadata(protocolMetadata).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withInput(tagResourceRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Removes tags from the specified applied quota. You can specify one or more tags to remove.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws TooManyRequestsException
* Due to throttling, the request was denied. Slow down the rate of request calls, or request an increase
* for this quota.
* @throws NoSuchResourceException
* The specified resource does not exist.
* @throws IllegalArgumentException
* Invalid input was provided.
* @throws AccessDeniedException
* You do not have sufficient permission to perform this action.
* @throws ServiceException
* Something went wrong.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws ServiceQuotasException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample ServiceQuotasClient.UntagResource
* @see AWS
* API Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws TooManyRequestsException,
NoSuchResourceException, IllegalArgumentException, AccessDeniedException, ServiceException, AwsServiceException,
SdkClientException, ServiceQuotasException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Service Quotas");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withProtocolMetadata(protocolMetadata)
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withInput(untagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration,
RequestOverrideConfiguration requestOverrideConfiguration) {
List publishers = null;
if (requestOverrideConfiguration != null) {
publishers = requestOverrideConfiguration.metricPublishers();
}
if (publishers == null || publishers.isEmpty()) {
publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS);
}
if (publishers == null) {
publishers = Collections.emptyList();
}
return publishers;
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
private void updateRetryStrategyClientConfiguration(SdkClientConfiguration.Builder configuration) {
ClientOverrideConfiguration.Builder builder = configuration.asOverrideConfigurationBuilder();
RetryMode retryMode = builder.retryMode();
if (retryMode != null) {
configuration.option(SdkClientOption.RETRY_STRATEGY, AwsRetryStrategy.forRetryMode(retryMode));
} else {
Consumer> configurator = builder.retryStrategyConfigurator();
if (configurator != null) {
RetryStrategy.Builder defaultBuilder = AwsRetryStrategy.defaultRetryStrategy().toBuilder();
configurator.accept(defaultBuilder);
configuration.option(SdkClientOption.RETRY_STRATEGY, defaultBuilder.build());
} else {
RetryStrategy retryStrategy = builder.retryStrategy();
if (retryStrategy != null) {
configuration.option(SdkClientOption.RETRY_STRATEGY, retryStrategy);
}
}
}
configuration.option(SdkClientOption.CONFIGURED_RETRY_MODE, null);
configuration.option(SdkClientOption.CONFIGURED_RETRY_STRATEGY, null);
configuration.option(SdkClientOption.CONFIGURED_RETRY_CONFIGURATOR, null);
}
private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) {
List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList());
SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder();
if (plugins.isEmpty()) {
return configuration.build();
}
ServiceQuotasServiceClientConfigurationBuilder serviceConfigBuilder = new ServiceQuotasServiceClientConfigurationBuilder(
configuration);
for (SdkPlugin plugin : plugins) {
plugin.configureClient(serviceConfigBuilder);
}
updateRetryStrategyClientConfiguration(configuration);
return configuration.build();
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(ServiceQuotasException::builder)
.protocol(AwsJsonProtocol.AWS_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("AccessDeniedException")
.exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyTagsException")
.exceptionBuilderSupplier(TooManyTagsException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidResourceStateException")
.exceptionBuilderSupplier(InvalidResourceStateException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("IllegalArgumentException")
.exceptionBuilderSupplier(IllegalArgumentException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ServiceException")
.exceptionBuilderSupplier(ServiceException::builder).httpStatusCode(500).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("OrganizationNotInAllFeaturesModeException")
.exceptionBuilderSupplier(OrganizationNotInAllFeaturesModeException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AWSServiceAccessNotEnabledException")
.exceptionBuilderSupplier(AwsServiceAccessNotEnabledException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("DependencyAccessDeniedException")
.exceptionBuilderSupplier(DependencyAccessDeniedException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("NoSuchResourceException")
.exceptionBuilderSupplier(NoSuchResourceException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("QuotaExceededException")
.exceptionBuilderSupplier(QuotaExceededException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceAlreadyExistsException")
.exceptionBuilderSupplier(ResourceAlreadyExistsException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("NoAvailableOrganizationException")
.exceptionBuilderSupplier(NoAvailableOrganizationException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TemplatesNotAvailableInRegionException")
.exceptionBuilderSupplier(TemplatesNotAvailableInRegionException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidPaginationTokenException")
.exceptionBuilderSupplier(InvalidPaginationTokenException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TooManyRequestsException")
.exceptionBuilderSupplier(TooManyRequestsException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("TagPolicyViolationException")
.exceptionBuilderSupplier(TagPolicyViolationException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ServiceQuotaTemplateNotInUseException")
.exceptionBuilderSupplier(ServiceQuotaTemplateNotInUseException::builder).httpStatusCode(400)
.build());
}
@Override
public final ServiceQuotasServiceClientConfiguration serviceClientConfiguration() {
return new ServiceQuotasServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build();
}
@Override
public void close() {
clientHandler.close();
}
}