
software.amazon.awssdk.services.support.DefaultSupportAsyncClient Maven / Gradle / Ivy
/*
* 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.support;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
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.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
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.services.support.internal.SupportServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.support.model.AddAttachmentsToSetRequest;
import software.amazon.awssdk.services.support.model.AddAttachmentsToSetResponse;
import software.amazon.awssdk.services.support.model.AddCommunicationToCaseRequest;
import software.amazon.awssdk.services.support.model.AddCommunicationToCaseResponse;
import software.amazon.awssdk.services.support.model.AttachmentIdNotFoundException;
import software.amazon.awssdk.services.support.model.AttachmentLimitExceededException;
import software.amazon.awssdk.services.support.model.AttachmentSetExpiredException;
import software.amazon.awssdk.services.support.model.AttachmentSetIdNotFoundException;
import software.amazon.awssdk.services.support.model.AttachmentSetSizeLimitExceededException;
import software.amazon.awssdk.services.support.model.CaseCreationLimitExceededException;
import software.amazon.awssdk.services.support.model.CaseIdNotFoundException;
import software.amazon.awssdk.services.support.model.CreateCaseRequest;
import software.amazon.awssdk.services.support.model.CreateCaseResponse;
import software.amazon.awssdk.services.support.model.DescribeAttachmentLimitExceededException;
import software.amazon.awssdk.services.support.model.DescribeAttachmentRequest;
import software.amazon.awssdk.services.support.model.DescribeAttachmentResponse;
import software.amazon.awssdk.services.support.model.DescribeCasesRequest;
import software.amazon.awssdk.services.support.model.DescribeCasesResponse;
import software.amazon.awssdk.services.support.model.DescribeCommunicationsRequest;
import software.amazon.awssdk.services.support.model.DescribeCommunicationsResponse;
import software.amazon.awssdk.services.support.model.DescribeCreateCaseOptionsRequest;
import software.amazon.awssdk.services.support.model.DescribeCreateCaseOptionsResponse;
import software.amazon.awssdk.services.support.model.DescribeServicesRequest;
import software.amazon.awssdk.services.support.model.DescribeServicesResponse;
import software.amazon.awssdk.services.support.model.DescribeSeverityLevelsRequest;
import software.amazon.awssdk.services.support.model.DescribeSeverityLevelsResponse;
import software.amazon.awssdk.services.support.model.DescribeSupportedLanguagesRequest;
import software.amazon.awssdk.services.support.model.DescribeSupportedLanguagesResponse;
import software.amazon.awssdk.services.support.model.DescribeTrustedAdvisorCheckRefreshStatusesRequest;
import software.amazon.awssdk.services.support.model.DescribeTrustedAdvisorCheckRefreshStatusesResponse;
import software.amazon.awssdk.services.support.model.DescribeTrustedAdvisorCheckResultRequest;
import software.amazon.awssdk.services.support.model.DescribeTrustedAdvisorCheckResultResponse;
import software.amazon.awssdk.services.support.model.DescribeTrustedAdvisorCheckSummariesRequest;
import software.amazon.awssdk.services.support.model.DescribeTrustedAdvisorCheckSummariesResponse;
import software.amazon.awssdk.services.support.model.DescribeTrustedAdvisorChecksRequest;
import software.amazon.awssdk.services.support.model.DescribeTrustedAdvisorChecksResponse;
import software.amazon.awssdk.services.support.model.InternalServerErrorException;
import software.amazon.awssdk.services.support.model.RefreshTrustedAdvisorCheckRequest;
import software.amazon.awssdk.services.support.model.RefreshTrustedAdvisorCheckResponse;
import software.amazon.awssdk.services.support.model.ResolveCaseRequest;
import software.amazon.awssdk.services.support.model.ResolveCaseResponse;
import software.amazon.awssdk.services.support.model.SupportException;
import software.amazon.awssdk.services.support.model.ThrottlingException;
import software.amazon.awssdk.services.support.transform.AddAttachmentsToSetRequestMarshaller;
import software.amazon.awssdk.services.support.transform.AddCommunicationToCaseRequestMarshaller;
import software.amazon.awssdk.services.support.transform.CreateCaseRequestMarshaller;
import software.amazon.awssdk.services.support.transform.DescribeAttachmentRequestMarshaller;
import software.amazon.awssdk.services.support.transform.DescribeCasesRequestMarshaller;
import software.amazon.awssdk.services.support.transform.DescribeCommunicationsRequestMarshaller;
import software.amazon.awssdk.services.support.transform.DescribeCreateCaseOptionsRequestMarshaller;
import software.amazon.awssdk.services.support.transform.DescribeServicesRequestMarshaller;
import software.amazon.awssdk.services.support.transform.DescribeSeverityLevelsRequestMarshaller;
import software.amazon.awssdk.services.support.transform.DescribeSupportedLanguagesRequestMarshaller;
import software.amazon.awssdk.services.support.transform.DescribeTrustedAdvisorCheckRefreshStatusesRequestMarshaller;
import software.amazon.awssdk.services.support.transform.DescribeTrustedAdvisorCheckResultRequestMarshaller;
import software.amazon.awssdk.services.support.transform.DescribeTrustedAdvisorCheckSummariesRequestMarshaller;
import software.amazon.awssdk.services.support.transform.DescribeTrustedAdvisorChecksRequestMarshaller;
import software.amazon.awssdk.services.support.transform.RefreshTrustedAdvisorCheckRequestMarshaller;
import software.amazon.awssdk.services.support.transform.ResolveCaseRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link SupportAsyncClient}.
*
* @see SupportAsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultSupportAsyncClient implements SupportAsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultSupportAsyncClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.AWS_JSON).build();
private final AsyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultSupportAsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Adds one or more attachments to an attachment set.
*
*
* An attachment set is a temporary container for attachments that you add to a case or case communication. The set
* is available for 1 hour after it's created. The expiryTime
returned in the response is when the set
* expires.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* @param addAttachmentsToSetRequest
* @return A Java Future containing the result of the AddAttachmentsToSet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - AttachmentSetIdNotFoundException An attachment set with the specified ID could not be found.
* - AttachmentSetExpiredException The expiration time of the attachment set has passed. The set expires 1
* hour after it is created.
* - AttachmentSetSizeLimitExceededException A limit for the size of an attachment set has been exceeded.
* The limits are three attachments and 5 MB per attachment.
* - AttachmentLimitExceededException The limit for the number of attachment sets created in a short
* period of time has been exceeded.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.AddAttachmentsToSet
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture addAttachmentsToSet(
AddAttachmentsToSetRequest addAttachmentsToSetRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(addAttachmentsToSetRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, addAttachmentsToSetRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddAttachmentsToSet");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AddAttachmentsToSetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AddAttachmentsToSet").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AddAttachmentsToSetRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(addAttachmentsToSetRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Adds additional customer communication to an Amazon Web Services Support case. Use the caseId
* parameter to identify the case to which to add communication. You can list a set of email addresses to copy on
* the communication by using the ccEmailAddresses
parameter. The communicationBody
value
* contains the text of the communication.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* @param addCommunicationToCaseRequest
* @return A Java Future containing the result of the AddCommunicationToCase operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - CaseIdNotFoundException The requested
caseId
couldn't be located.
* - AttachmentSetIdNotFoundException An attachment set with the specified ID could not be found.
* - AttachmentSetExpiredException The expiration time of the attachment set has passed. The set expires 1
* hour after it is created.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.AddCommunicationToCase
* @see AWS API Documentation
*/
@Override
public CompletableFuture addCommunicationToCase(
AddCommunicationToCaseRequest addCommunicationToCaseRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(addCommunicationToCaseRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, addCommunicationToCaseRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddCommunicationToCase");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AddCommunicationToCaseResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AddCommunicationToCase").withProtocolMetadata(protocolMetadata)
.withMarshaller(new AddCommunicationToCaseRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(addCommunicationToCaseRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a case in the Amazon Web Services Support Center. This operation is similar to how you create a case in
* the Amazon Web Services Support Center Create
* Case page.
*
*
* The Amazon Web Services Support API doesn't support requesting service limit increases. You can submit a service
* limit increase in the following ways:
*
*
* -
*
* Submit a request from the Amazon Web Services Support Center Create Case page.
*
*
* -
*
* Use the Service Quotas RequestServiceQuotaIncrease operation.
*
*
*
*
* A successful CreateCase
request returns an Amazon Web Services Support case number. You can use the
* DescribeCases operation and specify the case number to get existing Amazon Web Services Support cases.
* After you create a case, use the AddCommunicationToCase operation to add additional communication or
* attachments to an existing case.
*
*
* The caseId
is separate from the displayId
that appears in the Amazon Web Services Support Center. Use the
* DescribeCases operation to get the displayId
.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* @param createCaseRequest
* @return A Java Future containing the result of the CreateCase operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - CaseCreationLimitExceededException The case creation limit for the account has been exceeded.
* - AttachmentSetIdNotFoundException An attachment set with the specified ID could not be found.
* - AttachmentSetExpiredException The expiration time of the attachment set has passed. The set expires 1
* hour after it is created.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.CreateCase
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createCase(CreateCaseRequest createCaseRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCaseRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createCaseRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCase");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateCaseResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("CreateCase")
.withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateCaseRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createCaseRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the attachment that has the specified ID. Attachments can include screenshots, error logs, or other files
* that describe your issue. Attachment IDs are generated by the case management system when you add an attachment
* to a case or case communication. Attachment IDs are returned in the AttachmentDetails objects that are
* returned by the DescribeCommunications operation.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* @param describeAttachmentRequest
* @return A Java Future containing the result of the DescribeAttachment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - DescribeAttachmentLimitExceededException The limit for the number of DescribeAttachment
* requests in a short period of time has been exceeded.
* - AttachmentIdNotFoundException An attachment with the specified ID could not be found.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.DescribeAttachment
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture describeAttachment(DescribeAttachmentRequest describeAttachmentRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAttachmentRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAttachmentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAttachment");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeAttachmentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeAttachment").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeAttachmentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeAttachmentRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns a list of cases that you specify by passing one or more case IDs. You can use the afterTime
* and beforeTime
parameters to filter the cases by date. You can set values for the
* includeResolvedCases
and includeCommunications
parameters to specify how much
* information to return.
*
*
* The response returns the following in JSON format:
*
*
* -
*
* One or more CaseDetails data
* types.
*
*
* -
*
* One or more nextToken
values, which specify where to paginate the returned records represented by
* the CaseDetails
objects.
*
*
*
*
* Case data is available for 12 months after creation. If a case was created more than 12 months ago, a request
* might return an error.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* @param describeCasesRequest
* @return A Java Future containing the result of the DescribeCases operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - CaseIdNotFoundException The requested
caseId
couldn't be located.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.DescribeCases
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeCases(DescribeCasesRequest describeCasesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCasesRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCasesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCases");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeCasesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeCases").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeCasesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeCasesRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns communications and attachments for one or more support cases. Use the afterTime
and
* beforeTime
parameters to filter by date. You can use the caseId
parameter to restrict
* the results to a specific case.
*
*
* Case data is available for 12 months after creation. If a case was created more than 12 months ago, a request for
* data might cause an error.
*
*
* You can use the maxResults
and nextToken
parameters to control the pagination of the
* results. Set maxResults
to the number of cases that you want to display on each page, and use
* nextToken
to specify the resumption of pagination.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* @param describeCommunicationsRequest
* @return A Java Future containing the result of the DescribeCommunications operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - CaseIdNotFoundException The requested
caseId
couldn't be located.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.DescribeCommunications
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeCommunications(
DescribeCommunicationsRequest describeCommunicationsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCommunicationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCommunicationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCommunications");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeCommunicationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeCommunications").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeCommunicationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeCommunicationsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns a list of CreateCaseOption types along with the corresponding supported hours and language availability.
* You can specify the language
categoryCode
, issueType
and
* serviceCode
used to retrieve the CreateCaseOptions.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* @param describeCreateCaseOptionsRequest
* @return A Java Future containing the result of the DescribeCreateCaseOptions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - ThrottlingException You have exceeded the maximum allowed TPS (Transactions Per Second) for the
* operations.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.DescribeCreateCaseOptions
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeCreateCaseOptions(
DescribeCreateCaseOptionsRequest describeCreateCaseOptionsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeCreateCaseOptionsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeCreateCaseOptionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeCreateCaseOptions");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeCreateCaseOptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeCreateCaseOptions").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeCreateCaseOptionsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeCreateCaseOptionsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the current list of Amazon Web Services services and a list of service categories for each service. You
* then use service names and categories in your CreateCase requests. Each Amazon Web Services service has
* its own set of categories.
*
*
* The service codes and category codes correspond to the values that appear in the Service and
* Category lists on the Amazon Web Services Support Center Create Case page. The values in those fields
* don't necessarily match the service codes and categories returned by the DescribeServices
operation.
* Always use the service codes and categories that the DescribeServices
operation returns, so that you
* have the most recent set of service and category codes.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* @param describeServicesRequest
* @return A Java Future containing the result of the DescribeServices operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.DescribeServices
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture describeServices(DescribeServicesRequest describeServicesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeServicesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeServicesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeServices");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeServicesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeServices").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeServicesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeServicesRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the list of severity levels that you can assign to a support case. The severity level for a case is also
* a field in the CaseDetails data type that you include for a CreateCase request.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* @param describeSeverityLevelsRequest
* @return A Java Future containing the result of the DescribeSeverityLevels operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.DescribeSeverityLevels
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeSeverityLevels(
DescribeSeverityLevelsRequest describeSeverityLevelsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeSeverityLevelsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeSeverityLevelsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeSeverityLevels");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeSeverityLevelsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeSeverityLevels").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeSeverityLevelsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeSeverityLevelsRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns a list of supported languages for a specified categoryCode
, issueType
and
* serviceCode
. The returned supported languages will include a ISO 639-1 code for the
* language
, and the language display name.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* @param describeSupportedLanguagesRequest
* @return A Java Future containing the result of the DescribeSupportedLanguages operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - ThrottlingException You have exceeded the maximum allowed TPS (Transactions Per Second) for the
* operations.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.DescribeSupportedLanguages
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeSupportedLanguages(
DescribeSupportedLanguagesRequest describeSupportedLanguagesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeSupportedLanguagesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeSupportedLanguagesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeSupportedLanguages");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeSupportedLanguagesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeSupportedLanguages").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeSupportedLanguagesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeSupportedLanguagesRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the refresh status of the Trusted Advisor checks that have the specified check IDs. You can get the check
* IDs by calling the DescribeTrustedAdvisorChecks operation.
*
*
* Some checks are refreshed automatically, and you can't return their refresh statuses by using the
* DescribeTrustedAdvisorCheckRefreshStatuses
operation. If you call this operation for these checks,
* you might see an InvalidParameterValue
error.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* To call the Trusted Advisor operations in the Amazon Web Services Support API, you must use the US East (N.
* Virginia) endpoint. Currently, the US West (Oregon) and Europe (Ireland) endpoints don't support the Trusted
* Advisor operations. For more information, see About the Amazon Web
* Services Support API in the Amazon Web Services Support User Guide.
*
*
* @param describeTrustedAdvisorCheckRefreshStatusesRequest
* @return A Java Future containing the result of the DescribeTrustedAdvisorCheckRefreshStatuses operation returned
* by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - ThrottlingException You have exceeded the maximum allowed TPS (Transactions Per Second) for the
* operations.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.DescribeTrustedAdvisorCheckRefreshStatuses
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeTrustedAdvisorCheckRefreshStatuses(
DescribeTrustedAdvisorCheckRefreshStatusesRequest describeTrustedAdvisorCheckRefreshStatusesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(
describeTrustedAdvisorCheckRefreshStatusesRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeTrustedAdvisorCheckRefreshStatusesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeTrustedAdvisorCheckRefreshStatuses");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DescribeTrustedAdvisorCheckRefreshStatusesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeTrustedAdvisorCheckRefreshStatuses")
.withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeTrustedAdvisorCheckRefreshStatusesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeTrustedAdvisorCheckRefreshStatusesRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r,
e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the results of the Trusted Advisor check that has the specified check ID. You can get the check IDs by
* calling the DescribeTrustedAdvisorChecks operation.
*
*
* The response contains a TrustedAdvisorCheckResult object, which contains these three objects:
*
*
* -
*
*
* -
*
*
* -
*
*
*
*
* In addition, the response contains these fields:
*
*
* -
*
* status - The alert status of the check can be ok
(green), warning
(yellow),
* error
(red), or not_available
.
*
*
* -
*
* timestamp - The time of the last refresh of the check.
*
*
* -
*
* checkId - The unique identifier for the check.
*
*
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* To call the Trusted Advisor operations in the Amazon Web Services Support API, you must use the US East (N.
* Virginia) endpoint. Currently, the US West (Oregon) and Europe (Ireland) endpoints don't support the Trusted
* Advisor operations. For more information, see About the Amazon Web
* Services Support API in the Amazon Web Services Support User Guide.
*
*
* @param describeTrustedAdvisorCheckResultRequest
* @return A Java Future containing the result of the DescribeTrustedAdvisorCheckResult operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - ThrottlingException You have exceeded the maximum allowed TPS (Transactions Per Second) for the
* operations.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.DescribeTrustedAdvisorCheckResult
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeTrustedAdvisorCheckResult(
DescribeTrustedAdvisorCheckResultRequest describeTrustedAdvisorCheckResultRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeTrustedAdvisorCheckResultRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeTrustedAdvisorCheckResultRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeTrustedAdvisorCheckResult");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DescribeTrustedAdvisorCheckResultResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeTrustedAdvisorCheckResult").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeTrustedAdvisorCheckResultRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeTrustedAdvisorCheckResultRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns the results for the Trusted Advisor check summaries for the check IDs that you specified. You can get the
* check IDs by calling the DescribeTrustedAdvisorChecks operation.
*
*
* The response contains an array of TrustedAdvisorCheckSummary objects.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* To call the Trusted Advisor operations in the Amazon Web Services Support API, you must use the US East (N.
* Virginia) endpoint. Currently, the US West (Oregon) and Europe (Ireland) endpoints don't support the Trusted
* Advisor operations. For more information, see About the Amazon Web
* Services Support API in the Amazon Web Services Support User Guide.
*
*
* @param describeTrustedAdvisorCheckSummariesRequest
* @return A Java Future containing the result of the DescribeTrustedAdvisorCheckSummaries operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - ThrottlingException You have exceeded the maximum allowed TPS (Transactions Per Second) for the
* operations.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.DescribeTrustedAdvisorCheckSummaries
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeTrustedAdvisorCheckSummaries(
DescribeTrustedAdvisorCheckSummariesRequest describeTrustedAdvisorCheckSummariesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeTrustedAdvisorCheckSummariesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
describeTrustedAdvisorCheckSummariesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeTrustedAdvisorCheckSummaries");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DescribeTrustedAdvisorCheckSummariesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeTrustedAdvisorCheckSummaries").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeTrustedAdvisorCheckSummariesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeTrustedAdvisorCheckSummariesRequest));
CompletableFuture whenCompleted = executeFuture
.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Returns information about all available Trusted Advisor checks, including the name, ID, category, description,
* and metadata. You must specify a language code.
*
*
* The response contains a TrustedAdvisorCheckDescription object for each check. You must set the Amazon Web
* Services Region to us-east-1.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
* -
*
* The names and descriptions for Trusted Advisor checks are subject to change. We recommend that you specify the
* check ID in your code to uniquely identify a check.
*
*
*
*
*
* To call the Trusted Advisor operations in the Amazon Web Services Support API, you must use the US East (N.
* Virginia) endpoint. Currently, the US West (Oregon) and Europe (Ireland) endpoints don't support the Trusted
* Advisor operations. For more information, see About the Amazon Web
* Services Support API in the Amazon Web Services Support User Guide.
*
*
* @param describeTrustedAdvisorChecksRequest
* @return A Java Future containing the result of the DescribeTrustedAdvisorChecks operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - ThrottlingException You have exceeded the maximum allowed TPS (Transactions Per Second) for the
* operations.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.DescribeTrustedAdvisorChecks
* @see AWS API Documentation
*/
@Override
public CompletableFuture describeTrustedAdvisorChecks(
DescribeTrustedAdvisorChecksRequest describeTrustedAdvisorChecksRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeTrustedAdvisorChecksRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, describeTrustedAdvisorChecksRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeTrustedAdvisorChecks");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeTrustedAdvisorChecksResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeTrustedAdvisorChecks").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DescribeTrustedAdvisorChecksRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(describeTrustedAdvisorChecksRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Refreshes the Trusted Advisor check that you specify using the check ID. You can get the check IDs by calling the
* DescribeTrustedAdvisorChecks operation.
*
*
* Some checks are refreshed automatically. If you call the RefreshTrustedAdvisorCheck
operation to
* refresh them, you might see the InvalidParameterValue
error.
*
*
* The response contains a TrustedAdvisorCheckRefreshStatus object.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* To call the Trusted Advisor operations in the Amazon Web Services Support API, you must use the US East (N.
* Virginia) endpoint. Currently, the US West (Oregon) and Europe (Ireland) endpoints don't support the Trusted
* Advisor operations. For more information, see About the Amazon Web
* Services Support API in the Amazon Web Services Support User Guide.
*
*
* @param refreshTrustedAdvisorCheckRequest
* @return A Java Future containing the result of the RefreshTrustedAdvisorCheck operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.RefreshTrustedAdvisorCheck
* @see AWS API Documentation
*/
@Override
public CompletableFuture refreshTrustedAdvisorCheck(
RefreshTrustedAdvisorCheckRequest refreshTrustedAdvisorCheckRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(refreshTrustedAdvisorCheckRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, refreshTrustedAdvisorCheckRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RefreshTrustedAdvisorCheck");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, RefreshTrustedAdvisorCheckResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("RefreshTrustedAdvisorCheck").withProtocolMetadata(protocolMetadata)
.withMarshaller(new RefreshTrustedAdvisorCheckRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(refreshTrustedAdvisorCheckRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Resolves a support case. This operation takes a caseId
and returns the initial and final state of
* the case.
*
*
*
* -
*
* You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API.
*
*
* -
*
* If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp,
* or Enterprise Support plan, the SubscriptionRequiredException
error message appears. For information
* about changing your support plan, see Amazon Web Services
* Support.
*
*
*
*
*
* @param resolveCaseRequest
* @return A Java Future containing the result of the ResolveCase operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions. The exception returned is wrapped with CompletionException, so you need to invoke
* {@link Throwable#getCause} to retrieve the underlying exception.
*
* - InternalServerErrorException An internal server error occurred.
* - CaseIdNotFoundException The requested
caseId
couldn't be located.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - SupportException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample SupportAsyncClient.ResolveCase
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture resolveCase(ResolveCaseRequest resolveCaseRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(resolveCaseRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, resolveCaseRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Support");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ResolveCase");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ResolveCaseResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ResolveCase").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ResolveCaseRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(resolveCaseRequest));
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
@Override
public final SupportServiceClientConfiguration serviceClientConfiguration() {
return new SupportServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build();
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
private > T init(T builder) {
return builder
.clientConfiguration(clientConfiguration)
.defaultServiceExceptionSupplier(SupportException::builder)
.protocol(AwsJsonProtocol.AWS_JSON)
.protocolVersion("1.1")
.registerModeledException(
ExceptionMetadata.builder().errorCode("AttachmentSetIdNotFound")
.exceptionBuilderSupplier(AttachmentSetIdNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("CaseCreationLimitExceeded")
.exceptionBuilderSupplier(CaseCreationLimitExceededException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AttachmentIdNotFound")
.exceptionBuilderSupplier(AttachmentIdNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AttachmentSetExpired")
.exceptionBuilderSupplier(AttachmentSetExpiredException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ThrottlingException")
.exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AttachmentLimitExceeded")
.exceptionBuilderSupplier(AttachmentLimitExceededException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("CaseIdNotFound")
.exceptionBuilderSupplier(CaseIdNotFoundException::builder).httpStatusCode(400).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("DescribeAttachmentLimitExceeded")
.exceptionBuilderSupplier(DescribeAttachmentLimitExceededException::builder).httpStatusCode(400)
.build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InternalServerError")
.exceptionBuilderSupplier(InternalServerErrorException::builder).httpStatusCode(500).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("AttachmentSetSizeLimitExceeded")
.exceptionBuilderSupplier(AttachmentSetSizeLimitExceededException::builder).httpStatusCode(400)
.build());
}
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 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();
}
SupportServiceClientConfigurationBuilder serviceConfigBuilder = new SupportServiceClientConfigurationBuilder(
configuration);
for (SdkPlugin plugin : plugins) {
plugin.configureClient(serviceConfigBuilder);
}
return configuration.build();
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
@Override
public void close() {
clientHandler.close();
}
}