software.amazon.awssdk.services.cleanrooms.DefaultCleanRoomsAsyncClient Maven / Gradle / Ivy
Show all versions of cleanrooms 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.cleanrooms;
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.cleanrooms.internal.CleanRoomsServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.cleanrooms.model.AccessDeniedException;
import software.amazon.awssdk.services.cleanrooms.model.BatchGetCollaborationAnalysisTemplateRequest;
import software.amazon.awssdk.services.cleanrooms.model.BatchGetCollaborationAnalysisTemplateResponse;
import software.amazon.awssdk.services.cleanrooms.model.BatchGetSchemaRequest;
import software.amazon.awssdk.services.cleanrooms.model.BatchGetSchemaResponse;
import software.amazon.awssdk.services.cleanrooms.model.CleanRoomsException;
import software.amazon.awssdk.services.cleanrooms.model.ConflictException;
import software.amazon.awssdk.services.cleanrooms.model.CreateAnalysisTemplateRequest;
import software.amazon.awssdk.services.cleanrooms.model.CreateAnalysisTemplateResponse;
import software.amazon.awssdk.services.cleanrooms.model.CreateCollaborationRequest;
import software.amazon.awssdk.services.cleanrooms.model.CreateCollaborationResponse;
import software.amazon.awssdk.services.cleanrooms.model.CreateConfiguredTableAnalysisRuleRequest;
import software.amazon.awssdk.services.cleanrooms.model.CreateConfiguredTableAnalysisRuleResponse;
import software.amazon.awssdk.services.cleanrooms.model.CreateConfiguredTableAssociationRequest;
import software.amazon.awssdk.services.cleanrooms.model.CreateConfiguredTableAssociationResponse;
import software.amazon.awssdk.services.cleanrooms.model.CreateConfiguredTableRequest;
import software.amazon.awssdk.services.cleanrooms.model.CreateConfiguredTableResponse;
import software.amazon.awssdk.services.cleanrooms.model.CreateMembershipRequest;
import software.amazon.awssdk.services.cleanrooms.model.CreateMembershipResponse;
import software.amazon.awssdk.services.cleanrooms.model.DeleteAnalysisTemplateRequest;
import software.amazon.awssdk.services.cleanrooms.model.DeleteAnalysisTemplateResponse;
import software.amazon.awssdk.services.cleanrooms.model.DeleteCollaborationRequest;
import software.amazon.awssdk.services.cleanrooms.model.DeleteCollaborationResponse;
import software.amazon.awssdk.services.cleanrooms.model.DeleteConfiguredTableAnalysisRuleRequest;
import software.amazon.awssdk.services.cleanrooms.model.DeleteConfiguredTableAnalysisRuleResponse;
import software.amazon.awssdk.services.cleanrooms.model.DeleteConfiguredTableAssociationRequest;
import software.amazon.awssdk.services.cleanrooms.model.DeleteConfiguredTableAssociationResponse;
import software.amazon.awssdk.services.cleanrooms.model.DeleteConfiguredTableRequest;
import software.amazon.awssdk.services.cleanrooms.model.DeleteConfiguredTableResponse;
import software.amazon.awssdk.services.cleanrooms.model.DeleteMemberRequest;
import software.amazon.awssdk.services.cleanrooms.model.DeleteMemberResponse;
import software.amazon.awssdk.services.cleanrooms.model.DeleteMembershipRequest;
import software.amazon.awssdk.services.cleanrooms.model.DeleteMembershipResponse;
import software.amazon.awssdk.services.cleanrooms.model.GetAnalysisTemplateRequest;
import software.amazon.awssdk.services.cleanrooms.model.GetAnalysisTemplateResponse;
import software.amazon.awssdk.services.cleanrooms.model.GetCollaborationAnalysisTemplateRequest;
import software.amazon.awssdk.services.cleanrooms.model.GetCollaborationAnalysisTemplateResponse;
import software.amazon.awssdk.services.cleanrooms.model.GetCollaborationRequest;
import software.amazon.awssdk.services.cleanrooms.model.GetCollaborationResponse;
import software.amazon.awssdk.services.cleanrooms.model.GetConfiguredTableAnalysisRuleRequest;
import software.amazon.awssdk.services.cleanrooms.model.GetConfiguredTableAnalysisRuleResponse;
import software.amazon.awssdk.services.cleanrooms.model.GetConfiguredTableAssociationRequest;
import software.amazon.awssdk.services.cleanrooms.model.GetConfiguredTableAssociationResponse;
import software.amazon.awssdk.services.cleanrooms.model.GetConfiguredTableRequest;
import software.amazon.awssdk.services.cleanrooms.model.GetConfiguredTableResponse;
import software.amazon.awssdk.services.cleanrooms.model.GetMembershipRequest;
import software.amazon.awssdk.services.cleanrooms.model.GetMembershipResponse;
import software.amazon.awssdk.services.cleanrooms.model.GetProtectedQueryRequest;
import software.amazon.awssdk.services.cleanrooms.model.GetProtectedQueryResponse;
import software.amazon.awssdk.services.cleanrooms.model.GetSchemaAnalysisRuleRequest;
import software.amazon.awssdk.services.cleanrooms.model.GetSchemaAnalysisRuleResponse;
import software.amazon.awssdk.services.cleanrooms.model.GetSchemaRequest;
import software.amazon.awssdk.services.cleanrooms.model.GetSchemaResponse;
import software.amazon.awssdk.services.cleanrooms.model.InternalServerException;
import software.amazon.awssdk.services.cleanrooms.model.ListAnalysisTemplatesRequest;
import software.amazon.awssdk.services.cleanrooms.model.ListAnalysisTemplatesResponse;
import software.amazon.awssdk.services.cleanrooms.model.ListCollaborationAnalysisTemplatesRequest;
import software.amazon.awssdk.services.cleanrooms.model.ListCollaborationAnalysisTemplatesResponse;
import software.amazon.awssdk.services.cleanrooms.model.ListCollaborationsRequest;
import software.amazon.awssdk.services.cleanrooms.model.ListCollaborationsResponse;
import software.amazon.awssdk.services.cleanrooms.model.ListConfiguredTableAssociationsRequest;
import software.amazon.awssdk.services.cleanrooms.model.ListConfiguredTableAssociationsResponse;
import software.amazon.awssdk.services.cleanrooms.model.ListConfiguredTablesRequest;
import software.amazon.awssdk.services.cleanrooms.model.ListConfiguredTablesResponse;
import software.amazon.awssdk.services.cleanrooms.model.ListMembersRequest;
import software.amazon.awssdk.services.cleanrooms.model.ListMembersResponse;
import software.amazon.awssdk.services.cleanrooms.model.ListMembershipsRequest;
import software.amazon.awssdk.services.cleanrooms.model.ListMembershipsResponse;
import software.amazon.awssdk.services.cleanrooms.model.ListProtectedQueriesRequest;
import software.amazon.awssdk.services.cleanrooms.model.ListProtectedQueriesResponse;
import software.amazon.awssdk.services.cleanrooms.model.ListSchemasRequest;
import software.amazon.awssdk.services.cleanrooms.model.ListSchemasResponse;
import software.amazon.awssdk.services.cleanrooms.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.cleanrooms.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.cleanrooms.model.ResourceNotFoundException;
import software.amazon.awssdk.services.cleanrooms.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.cleanrooms.model.StartProtectedQueryRequest;
import software.amazon.awssdk.services.cleanrooms.model.StartProtectedQueryResponse;
import software.amazon.awssdk.services.cleanrooms.model.TagResourceRequest;
import software.amazon.awssdk.services.cleanrooms.model.TagResourceResponse;
import software.amazon.awssdk.services.cleanrooms.model.ThrottlingException;
import software.amazon.awssdk.services.cleanrooms.model.UntagResourceRequest;
import software.amazon.awssdk.services.cleanrooms.model.UntagResourceResponse;
import software.amazon.awssdk.services.cleanrooms.model.UpdateAnalysisTemplateRequest;
import software.amazon.awssdk.services.cleanrooms.model.UpdateAnalysisTemplateResponse;
import software.amazon.awssdk.services.cleanrooms.model.UpdateCollaborationRequest;
import software.amazon.awssdk.services.cleanrooms.model.UpdateCollaborationResponse;
import software.amazon.awssdk.services.cleanrooms.model.UpdateConfiguredTableAnalysisRuleRequest;
import software.amazon.awssdk.services.cleanrooms.model.UpdateConfiguredTableAnalysisRuleResponse;
import software.amazon.awssdk.services.cleanrooms.model.UpdateConfiguredTableAssociationRequest;
import software.amazon.awssdk.services.cleanrooms.model.UpdateConfiguredTableAssociationResponse;
import software.amazon.awssdk.services.cleanrooms.model.UpdateConfiguredTableRequest;
import software.amazon.awssdk.services.cleanrooms.model.UpdateConfiguredTableResponse;
import software.amazon.awssdk.services.cleanrooms.model.UpdateMembershipRequest;
import software.amazon.awssdk.services.cleanrooms.model.UpdateMembershipResponse;
import software.amazon.awssdk.services.cleanrooms.model.UpdateProtectedQueryRequest;
import software.amazon.awssdk.services.cleanrooms.model.UpdateProtectedQueryResponse;
import software.amazon.awssdk.services.cleanrooms.model.ValidationException;
import software.amazon.awssdk.services.cleanrooms.transform.BatchGetCollaborationAnalysisTemplateRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.BatchGetSchemaRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.CreateAnalysisTemplateRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.CreateCollaborationRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.CreateConfiguredTableAnalysisRuleRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.CreateConfiguredTableAssociationRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.CreateConfiguredTableRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.CreateMembershipRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.DeleteAnalysisTemplateRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.DeleteCollaborationRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.DeleteConfiguredTableAnalysisRuleRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.DeleteConfiguredTableAssociationRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.DeleteConfiguredTableRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.DeleteMemberRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.DeleteMembershipRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.GetAnalysisTemplateRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.GetCollaborationAnalysisTemplateRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.GetCollaborationRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.GetConfiguredTableAnalysisRuleRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.GetConfiguredTableAssociationRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.GetConfiguredTableRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.GetMembershipRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.GetProtectedQueryRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.GetSchemaAnalysisRuleRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.GetSchemaRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.ListAnalysisTemplatesRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.ListCollaborationAnalysisTemplatesRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.ListCollaborationsRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.ListConfiguredTableAssociationsRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.ListConfiguredTablesRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.ListMembersRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.ListMembershipsRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.ListProtectedQueriesRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.ListSchemasRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.StartProtectedQueryRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.UpdateAnalysisTemplateRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.UpdateCollaborationRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.UpdateConfiguredTableAnalysisRuleRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.UpdateConfiguredTableAssociationRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.UpdateConfiguredTableRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.UpdateMembershipRequestMarshaller;
import software.amazon.awssdk.services.cleanrooms.transform.UpdateProtectedQueryRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link CleanRoomsAsyncClient}.
*
* @see CleanRoomsAsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultCleanRoomsAsyncClient implements CleanRoomsAsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultCleanRoomsAsyncClient.class);
private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
.serviceProtocol(AwsServiceProtocol.REST_JSON).build();
private final AsyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
private final CleanRoomsServiceClientConfiguration serviceClientConfiguration;
protected DefaultCleanRoomsAsyncClient(CleanRoomsServiceClientConfiguration serviceClientConfiguration,
SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.serviceClientConfiguration = serviceClientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
/**
*
* Retrieves multiple analysis templates within a collaboration by their Amazon Resource Names (ARNs).
*
*
* @param batchGetCollaborationAnalysisTemplateRequest
* @return A Java Future containing the result of the BatchGetCollaborationAnalysisTemplate operation returned by
* the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.BatchGetCollaborationAnalysisTemplate
* @see AWS API Documentation
*/
@Override
public CompletableFuture batchGetCollaborationAnalysisTemplate(
BatchGetCollaborationAnalysisTemplateRequest batchGetCollaborationAnalysisTemplateRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchGetCollaborationAnalysisTemplateRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
batchGetCollaborationAnalysisTemplateRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchGetCollaborationAnalysisTemplate");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, BatchGetCollaborationAnalysisTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchGetCollaborationAnalysisTemplate").withProtocolMetadata(protocolMetadata)
.withMarshaller(new BatchGetCollaborationAnalysisTemplateRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(batchGetCollaborationAnalysisTemplateRequest));
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);
}
}
/**
*
* Retrieves multiple schemas by their identifiers.
*
*
* @param batchGetSchemaRequest
* @return A Java Future containing the result of the BatchGetSchema operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.BatchGetSchema
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture batchGetSchema(BatchGetSchemaRequest batchGetSchemaRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchGetSchemaRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, batchGetSchemaRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchGetSchema");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, BatchGetSchemaResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchGetSchema").withProtocolMetadata(protocolMetadata)
.withMarshaller(new BatchGetSchemaRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(batchGetSchemaRequest));
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 new analysis template.
*
*
* @param createAnalysisTemplateRequest
* @return A Java Future containing the result of the CreateAnalysisTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ConflictException Updating or deleting a resource can cause an inconsistent state.
* - ServiceQuotaExceededException Request denied because service quota has been exceeded.
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.CreateAnalysisTemplate
* @see AWS API Documentation
*/
@Override
public CompletableFuture createAnalysisTemplate(
CreateAnalysisTemplateRequest createAnalysisTemplateRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAnalysisTemplateRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createAnalysisTemplateRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAnalysisTemplate");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateAnalysisTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateAnalysisTemplate").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateAnalysisTemplateRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createAnalysisTemplateRequest));
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 new collaboration.
*
*
* @param createCollaborationRequest
* @return A Java Future containing the result of the CreateCollaboration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ServiceQuotaExceededException Request denied because service quota has been exceeded.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.CreateCollaboration
* @see AWS API Documentation
*/
@Override
public CompletableFuture createCollaboration(
CreateCollaborationRequest createCollaborationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCollaborationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createCollaborationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCollaboration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateCollaborationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateCollaboration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateCollaborationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createCollaborationRequest));
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 new configured table resource.
*
*
* @param createConfiguredTableRequest
* @return A Java Future containing the result of the CreateConfiguredTable operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ConflictException Updating or deleting a resource can cause an inconsistent state.
* - ServiceQuotaExceededException Request denied because service quota has been exceeded.
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.CreateConfiguredTable
* @see AWS API Documentation
*/
@Override
public CompletableFuture createConfiguredTable(
CreateConfiguredTableRequest createConfiguredTableRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConfiguredTableRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createConfiguredTableRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConfiguredTable");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateConfiguredTableResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateConfiguredTable").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateConfiguredTableRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createConfiguredTableRequest));
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 new analysis rule for a configured table. Currently, only one analysis rule can be created for a given
* configured table.
*
*
* @param createConfiguredTableAnalysisRuleRequest
* @return A Java Future containing the result of the CreateConfiguredTableAnalysisRule operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ConflictException Updating or deleting a resource can cause an inconsistent state.
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.CreateConfiguredTableAnalysisRule
* @see AWS API Documentation
*/
@Override
public CompletableFuture createConfiguredTableAnalysisRule(
CreateConfiguredTableAnalysisRuleRequest createConfiguredTableAnalysisRuleRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConfiguredTableAnalysisRuleRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createConfiguredTableAnalysisRuleRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConfiguredTableAnalysisRule");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, CreateConfiguredTableAnalysisRuleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateConfiguredTableAnalysisRule").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateConfiguredTableAnalysisRuleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createConfiguredTableAnalysisRuleRequest));
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 configured table association. A configured table association links a configured table with a
* collaboration.
*
*
* @param createConfiguredTableAssociationRequest
* @return A Java Future containing the result of the CreateConfiguredTableAssociation operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ConflictException Updating or deleting a resource can cause an inconsistent state.
* - ServiceQuotaExceededException Request denied because service quota has been exceeded.
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.CreateConfiguredTableAssociation
* @see AWS API Documentation
*/
@Override
public CompletableFuture createConfiguredTableAssociation(
CreateConfiguredTableAssociationRequest createConfiguredTableAssociationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createConfiguredTableAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
createConfiguredTableAssociationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateConfiguredTableAssociation");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, CreateConfiguredTableAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateConfiguredTableAssociation").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateConfiguredTableAssociationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createConfiguredTableAssociationRequest));
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 membership for a specific collaboration identifier and joins the collaboration.
*
*
* @param createMembershipRequest
* @return A Java Future containing the result of the CreateMembership operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ConflictException Updating or deleting a resource can cause an inconsistent state.
* - ServiceQuotaExceededException Request denied because service quota has been exceeded.
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.CreateMembership
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createMembership(CreateMembershipRequest createMembershipRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createMembershipRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, createMembershipRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateMembership");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateMembershipResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateMembership").withProtocolMetadata(protocolMetadata)
.withMarshaller(new CreateMembershipRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(createMembershipRequest));
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);
}
}
/**
*
* Deletes an analysis template.
*
*
* @param deleteAnalysisTemplateRequest
* @return A Java Future containing the result of the DeleteAnalysisTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.DeleteAnalysisTemplate
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteAnalysisTemplate(
DeleteAnalysisTemplateRequest deleteAnalysisTemplateRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAnalysisTemplateRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAnalysisTemplateRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAnalysisTemplate");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteAnalysisTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteAnalysisTemplate").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteAnalysisTemplateRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteAnalysisTemplateRequest));
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);
}
}
/**
*
* Deletes a collaboration. It can only be called by the collaboration owner.
*
*
* @param deleteCollaborationRequest
* @return A Java Future containing the result of the DeleteCollaboration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.DeleteCollaboration
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteCollaboration(
DeleteCollaborationRequest deleteCollaborationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCollaborationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCollaborationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCollaboration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteCollaborationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteCollaboration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteCollaborationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteCollaborationRequest));
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);
}
}
/**
*
* Deletes a configured table.
*
*
* @param deleteConfiguredTableRequest
* @return A Java Future containing the result of the DeleteConfiguredTable operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ConflictException Updating or deleting a resource can cause an inconsistent state.
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.DeleteConfiguredTable
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteConfiguredTable(
DeleteConfiguredTableRequest deleteConfiguredTableRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConfiguredTableRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteConfiguredTableRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConfiguredTable");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteConfiguredTableResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteConfiguredTable").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteConfiguredTableRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteConfiguredTableRequest));
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);
}
}
/**
*
* Deletes a configured table analysis rule.
*
*
* @param deleteConfiguredTableAnalysisRuleRequest
* @return A Java Future containing the result of the DeleteConfiguredTableAnalysisRule operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ConflictException Updating or deleting a resource can cause an inconsistent state.
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.DeleteConfiguredTableAnalysisRule
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteConfiguredTableAnalysisRule(
DeleteConfiguredTableAnalysisRuleRequest deleteConfiguredTableAnalysisRuleRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConfiguredTableAnalysisRuleRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteConfiguredTableAnalysisRuleRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConfiguredTableAnalysisRule");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeleteConfiguredTableAnalysisRuleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteConfiguredTableAnalysisRule").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteConfiguredTableAnalysisRuleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteConfiguredTableAnalysisRuleRequest));
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);
}
}
/**
*
* Deletes a configured table association.
*
*
* @param deleteConfiguredTableAssociationRequest
* @return A Java Future containing the result of the DeleteConfiguredTableAssociation operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ConflictException Updating or deleting a resource can cause an inconsistent state.
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.DeleteConfiguredTableAssociation
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteConfiguredTableAssociation(
DeleteConfiguredTableAssociationRequest deleteConfiguredTableAssociationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteConfiguredTableAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
deleteConfiguredTableAssociationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteConfiguredTableAssociation");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, DeleteConfiguredTableAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteConfiguredTableAssociation").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteConfiguredTableAssociationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteConfiguredTableAssociationRequest));
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);
}
}
/**
*
* Removes the specified member from a collaboration. The removed member is placed in the Removed status and can't
* interact with the collaboration. The removed member's data is inaccessible to active members of the
* collaboration.
*
*
* @param deleteMemberRequest
* @return A Java Future containing the result of the DeleteMember operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ConflictException Updating or deleting a resource can cause an inconsistent state.
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.DeleteMember
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteMember(DeleteMemberRequest deleteMemberRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteMemberRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteMemberRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteMember");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteMemberResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteMember").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteMemberRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteMemberRequest));
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);
}
}
/**
*
* Deletes a specified membership. All resources under a membership must be deleted.
*
*
* @param deleteMembershipRequest
* @return A Java Future containing the result of the DeleteMembership operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ConflictException Updating or deleting a resource can cause an inconsistent state.
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.DeleteMembership
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteMembership(DeleteMembershipRequest deleteMembershipRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteMembershipRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteMembershipRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteMembership");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteMembershipResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteMembership").withProtocolMetadata(protocolMetadata)
.withMarshaller(new DeleteMembershipRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(deleteMembershipRequest));
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);
}
}
/**
*
* Retrieves an analysis template.
*
*
* @param getAnalysisTemplateRequest
* @return A Java Future containing the result of the GetAnalysisTemplate operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.GetAnalysisTemplate
* @see AWS API Documentation
*/
@Override
public CompletableFuture getAnalysisTemplate(
GetAnalysisTemplateRequest getAnalysisTemplateRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getAnalysisTemplateRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getAnalysisTemplateRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetAnalysisTemplate");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetAnalysisTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetAnalysisTemplate").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetAnalysisTemplateRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getAnalysisTemplateRequest));
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 metadata about a collaboration.
*
*
* @param getCollaborationRequest
* @return A Java Future containing the result of the GetCollaboration operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.GetCollaboration
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getCollaboration(GetCollaborationRequest getCollaborationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCollaborationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getCollaborationRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCollaboration");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetCollaborationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetCollaboration").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetCollaborationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getCollaborationRequest));
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);
}
}
/**
*
* Retrieves an analysis template within a collaboration.
*
*
* @param getCollaborationAnalysisTemplateRequest
* @return A Java Future containing the result of the GetCollaborationAnalysisTemplate operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.GetCollaborationAnalysisTemplate
* @see AWS API Documentation
*/
@Override
public CompletableFuture getCollaborationAnalysisTemplate(
GetCollaborationAnalysisTemplateRequest getCollaborationAnalysisTemplateRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCollaborationAnalysisTemplateRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getCollaborationAnalysisTemplateRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCollaborationAnalysisTemplate");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, GetCollaborationAnalysisTemplateResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetCollaborationAnalysisTemplate").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetCollaborationAnalysisTemplateRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getCollaborationAnalysisTemplateRequest));
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);
}
}
/**
*
* Retrieves a configured table.
*
*
* @param getConfiguredTableRequest
* @return A Java Future containing the result of the GetConfiguredTable operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.GetConfiguredTable
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getConfiguredTable(GetConfiguredTableRequest getConfiguredTableRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConfiguredTableRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getConfiguredTableRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConfiguredTable");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetConfiguredTableResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetConfiguredTable").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetConfiguredTableRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getConfiguredTableRequest));
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);
}
}
/**
*
* Retrieves a configured table analysis rule.
*
*
* @param getConfiguredTableAnalysisRuleRequest
* @return A Java Future containing the result of the GetConfiguredTableAnalysisRule operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.GetConfiguredTableAnalysisRule
* @see AWS API Documentation
*/
@Override
public CompletableFuture getConfiguredTableAnalysisRule(
GetConfiguredTableAnalysisRuleRequest getConfiguredTableAnalysisRuleRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConfiguredTableAnalysisRuleRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getConfiguredTableAnalysisRuleRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConfiguredTableAnalysisRule");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetConfiguredTableAnalysisRuleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetConfiguredTableAnalysisRule").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetConfiguredTableAnalysisRuleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getConfiguredTableAnalysisRuleRequest));
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);
}
}
/**
*
* Retrieves a configured table association.
*
*
* @param getConfiguredTableAssociationRequest
* @return A Java Future containing the result of the GetConfiguredTableAssociation operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.GetConfiguredTableAssociation
* @see AWS API Documentation
*/
@Override
public CompletableFuture getConfiguredTableAssociation(
GetConfiguredTableAssociationRequest getConfiguredTableAssociationRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getConfiguredTableAssociationRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getConfiguredTableAssociationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetConfiguredTableAssociation");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetConfiguredTableAssociationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetConfiguredTableAssociation").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetConfiguredTableAssociationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getConfiguredTableAssociationRequest));
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);
}
}
/**
*
* Retrieves a specified membership for an identifier.
*
*
* @param getMembershipRequest
* @return A Java Future containing the result of the GetMembership operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.GetMembership
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getMembership(GetMembershipRequest getMembershipRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getMembershipRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getMembershipRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetMembership");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetMembershipResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetMembership").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetMembershipRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getMembershipRequest));
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 query processing metadata.
*
*
* @param getProtectedQueryRequest
* @return A Java Future containing the result of the GetProtectedQuery operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.GetProtectedQuery
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getProtectedQuery(GetProtectedQueryRequest getProtectedQueryRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getProtectedQueryRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getProtectedQueryRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetProtectedQuery");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetProtectedQueryResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetProtectedQuery").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetProtectedQueryRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getProtectedQueryRequest));
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);
}
}
/**
*
* Retrieves the schema for a relation within a collaboration.
*
*
* @param getSchemaRequest
* @return A Java Future containing the result of the GetSchema operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.GetSchema
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getSchema(GetSchemaRequest getSchemaRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSchemaRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getSchemaRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSchema");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetSchemaResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("GetSchema")
.withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetSchemaRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration)
.withMetricCollector(apiCallMetricCollector).withInput(getSchemaRequest));
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);
}
}
/**
*
* Retrieves a schema analysis rule.
*
*
* @param getSchemaAnalysisRuleRequest
* @return A Java Future containing the result of the GetSchemaAnalysisRule operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.GetSchemaAnalysisRule
* @see AWS API Documentation
*/
@Override
public CompletableFuture getSchemaAnalysisRule(
GetSchemaAnalysisRuleRequest getSchemaAnalysisRuleRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSchemaAnalysisRuleRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, getSchemaAnalysisRuleRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSchemaAnalysisRule");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetSchemaAnalysisRuleResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetSchemaAnalysisRule").withProtocolMetadata(protocolMetadata)
.withMarshaller(new GetSchemaAnalysisRuleRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(getSchemaAnalysisRuleRequest));
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);
}
}
/**
*
* Lists analysis templates that the caller owns.
*
*
* @param listAnalysisTemplatesRequest
* @return A Java Future containing the result of the ListAnalysisTemplates operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.ListAnalysisTemplates
* @see AWS API Documentation
*/
@Override
public CompletableFuture listAnalysisTemplates(
ListAnalysisTemplatesRequest listAnalysisTemplatesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAnalysisTemplatesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listAnalysisTemplatesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAnalysisTemplates");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListAnalysisTemplatesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListAnalysisTemplates").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListAnalysisTemplatesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listAnalysisTemplatesRequest));
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);
}
}
/**
*
* Lists analysis templates within a collaboration.
*
*
* @param listCollaborationAnalysisTemplatesRequest
* @return A Java Future containing the result of the ListCollaborationAnalysisTemplates operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.ListCollaborationAnalysisTemplates
* @see AWS API Documentation
*/
@Override
public CompletableFuture listCollaborationAnalysisTemplates(
ListCollaborationAnalysisTemplatesRequest listCollaborationAnalysisTemplatesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCollaborationAnalysisTemplatesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listCollaborationAnalysisTemplatesRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCollaborationAnalysisTemplates");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory
.createResponseHandler(operationMetadata, ListCollaborationAnalysisTemplatesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListCollaborationAnalysisTemplates").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListCollaborationAnalysisTemplatesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listCollaborationAnalysisTemplatesRequest));
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);
}
}
/**
*
* Lists collaborations the caller owns, is active in, or has been invited to.
*
*
* @param listCollaborationsRequest
* @return A Java Future containing the result of the ListCollaborations operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.ListCollaborations
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listCollaborations(ListCollaborationsRequest listCollaborationsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCollaborationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listCollaborationsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCollaborations");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListCollaborationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListCollaborations").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListCollaborationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listCollaborationsRequest));
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);
}
}
/**
*
* Lists configured table associations for a membership.
*
*
* @param listConfiguredTableAssociationsRequest
* @return A Java Future containing the result of the ListConfiguredTableAssociations operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.ListConfiguredTableAssociations
* @see AWS API Documentation
*/
@Override
public CompletableFuture listConfiguredTableAssociations(
ListConfiguredTableAssociationsRequest listConfiguredTableAssociationsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listConfiguredTableAssociationsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration,
listConfiguredTableAssociationsRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListConfiguredTableAssociations");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListConfiguredTableAssociationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListConfiguredTableAssociations").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListConfiguredTableAssociationsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listConfiguredTableAssociationsRequest));
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);
}
}
/**
*
* Lists configured tables.
*
*
* @param listConfiguredTablesRequest
* @return A Java Future containing the result of the ListConfiguredTables operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.ListConfiguredTables
* @see AWS API Documentation
*/
@Override
public CompletableFuture listConfiguredTables(
ListConfiguredTablesRequest listConfiguredTablesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listConfiguredTablesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listConfiguredTablesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListConfiguredTables");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListConfiguredTablesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListConfiguredTables").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListConfiguredTablesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listConfiguredTablesRequest));
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);
}
}
/**
*
* Lists all members within a collaboration.
*
*
* @param listMembersRequest
* @return A Java Future containing the result of the ListMembers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.ListMembers
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listMembers(ListMembersRequest listMembersRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listMembersRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listMembersRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListMembers");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListMembersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListMembers").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListMembersRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listMembersRequest));
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);
}
}
/**
*
* Lists all memberships resources within the caller's account.
*
*
* @param listMembershipsRequest
* @return A Java Future containing the result of the ListMemberships operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.ListMemberships
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listMemberships(ListMembershipsRequest listMembershipsRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listMembershipsRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listMembershipsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListMemberships");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListMembershipsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListMemberships").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListMembershipsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listMembershipsRequest));
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);
}
}
/**
*
* Lists protected queries, sorted by the most recent query.
*
*
* @param listProtectedQueriesRequest
* @return A Java Future containing the result of the ListProtectedQueries operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.ListProtectedQueries
* @see AWS API Documentation
*/
@Override
public CompletableFuture listProtectedQueries(
ListProtectedQueriesRequest listProtectedQueriesRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listProtectedQueriesRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listProtectedQueriesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListProtectedQueries");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListProtectedQueriesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListProtectedQueries").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListProtectedQueriesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listProtectedQueriesRequest));
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);
}
}
/**
*
* Lists the schemas for relations within a collaboration.
*
*
* @param listSchemasRequest
* @return A Java Future containing the result of the ListSchemas operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.ListSchemas
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listSchemas(ListSchemasRequest listSchemasRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSchemasRequest, this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, listSchemasRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSchemas");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListSchemasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListSchemas").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListSchemasRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listSchemasRequest));
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);
}
}
/**
*
* Lists all of the tags that have been added to a resource.
*
*
* @param listTagsForResourceRequest
* @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ResourceNotFoundException Request references a resource which does not exist.
* - ValidationException The input fails to satisfy the specified constraints.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.ListTagsForResource
* @see AWS API Documentation
*/
@Override
public CompletableFuture listTagsForResource(
ListTagsForResourceRequest listTagsForResourceRequest) {
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, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withProtocolMetadata(protocolMetadata)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(listTagsForResourceRequest));
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 protected query that is started by Clean Rooms.
*
*
* @param startProtectedQueryRequest
* @return A Java Future containing the result of the StartProtectedQuery operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ServiceQuotaExceededException Request denied because service quota has been exceeded.
* - ResourceNotFoundException Request references a resource which does not exist.
* - InternalServerException Unexpected error during processing of request.
* - ValidationException The input fails to satisfy the specified constraints.
* - ThrottlingException Request was denied due to request throttling.
* - AccessDeniedException Caller does not have sufficient access to perform this action.
* - 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.
* - CleanRoomsException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample CleanRoomsAsyncClient.StartProtectedQuery
* @see AWS API Documentation
*/
@Override
public CompletableFuture startProtectedQuery(
StartProtectedQueryRequest startProtectedQueryRequest) {
SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startProtectedQueryRequest,
this.clientConfiguration);
List metricPublishers = resolveMetricPublishers(clientConfiguration, startProtectedQueryRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "CleanRooms");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartProtectedQuery");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, StartProtectedQueryResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("StartProtectedQuery").withProtocolMetadata(protocolMetadata)
.withMarshaller(new StartProtectedQueryRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector)
.withInput(startProtectedQueryRequest));
CompletableFuture