All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.entityresolution.DefaultEntityResolutionAsyncClient Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.entityresolution;

import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import java.util.function.Function;
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.awscore.retry.AwsRetryStrategy;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.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.core.retry.RetryMode;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.retries.api.RetryStrategy;
import software.amazon.awssdk.services.entityresolution.internal.EntityResolutionServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.entityresolution.model.AccessDeniedException;
import software.amazon.awssdk.services.entityresolution.model.AddPolicyStatementRequest;
import software.amazon.awssdk.services.entityresolution.model.AddPolicyStatementResponse;
import software.amazon.awssdk.services.entityresolution.model.BatchDeleteUniqueIdRequest;
import software.amazon.awssdk.services.entityresolution.model.BatchDeleteUniqueIdResponse;
import software.amazon.awssdk.services.entityresolution.model.ConflictException;
import software.amazon.awssdk.services.entityresolution.model.CreateIdMappingWorkflowRequest;
import software.amazon.awssdk.services.entityresolution.model.CreateIdMappingWorkflowResponse;
import software.amazon.awssdk.services.entityresolution.model.CreateIdNamespaceRequest;
import software.amazon.awssdk.services.entityresolution.model.CreateIdNamespaceResponse;
import software.amazon.awssdk.services.entityresolution.model.CreateMatchingWorkflowRequest;
import software.amazon.awssdk.services.entityresolution.model.CreateMatchingWorkflowResponse;
import software.amazon.awssdk.services.entityresolution.model.CreateSchemaMappingRequest;
import software.amazon.awssdk.services.entityresolution.model.CreateSchemaMappingResponse;
import software.amazon.awssdk.services.entityresolution.model.DeleteIdMappingWorkflowRequest;
import software.amazon.awssdk.services.entityresolution.model.DeleteIdMappingWorkflowResponse;
import software.amazon.awssdk.services.entityresolution.model.DeleteIdNamespaceRequest;
import software.amazon.awssdk.services.entityresolution.model.DeleteIdNamespaceResponse;
import software.amazon.awssdk.services.entityresolution.model.DeleteMatchingWorkflowRequest;
import software.amazon.awssdk.services.entityresolution.model.DeleteMatchingWorkflowResponse;
import software.amazon.awssdk.services.entityresolution.model.DeletePolicyStatementRequest;
import software.amazon.awssdk.services.entityresolution.model.DeletePolicyStatementResponse;
import software.amazon.awssdk.services.entityresolution.model.DeleteSchemaMappingRequest;
import software.amazon.awssdk.services.entityresolution.model.DeleteSchemaMappingResponse;
import software.amazon.awssdk.services.entityresolution.model.EntityResolutionException;
import software.amazon.awssdk.services.entityresolution.model.ExceedsLimitException;
import software.amazon.awssdk.services.entityresolution.model.GetIdMappingJobRequest;
import software.amazon.awssdk.services.entityresolution.model.GetIdMappingJobResponse;
import software.amazon.awssdk.services.entityresolution.model.GetIdMappingWorkflowRequest;
import software.amazon.awssdk.services.entityresolution.model.GetIdMappingWorkflowResponse;
import software.amazon.awssdk.services.entityresolution.model.GetIdNamespaceRequest;
import software.amazon.awssdk.services.entityresolution.model.GetIdNamespaceResponse;
import software.amazon.awssdk.services.entityresolution.model.GetMatchIdRequest;
import software.amazon.awssdk.services.entityresolution.model.GetMatchIdResponse;
import software.amazon.awssdk.services.entityresolution.model.GetMatchingJobRequest;
import software.amazon.awssdk.services.entityresolution.model.GetMatchingJobResponse;
import software.amazon.awssdk.services.entityresolution.model.GetMatchingWorkflowRequest;
import software.amazon.awssdk.services.entityresolution.model.GetMatchingWorkflowResponse;
import software.amazon.awssdk.services.entityresolution.model.GetPolicyRequest;
import software.amazon.awssdk.services.entityresolution.model.GetPolicyResponse;
import software.amazon.awssdk.services.entityresolution.model.GetProviderServiceRequest;
import software.amazon.awssdk.services.entityresolution.model.GetProviderServiceResponse;
import software.amazon.awssdk.services.entityresolution.model.GetSchemaMappingRequest;
import software.amazon.awssdk.services.entityresolution.model.GetSchemaMappingResponse;
import software.amazon.awssdk.services.entityresolution.model.InternalServerException;
import software.amazon.awssdk.services.entityresolution.model.ListIdMappingJobsRequest;
import software.amazon.awssdk.services.entityresolution.model.ListIdMappingJobsResponse;
import software.amazon.awssdk.services.entityresolution.model.ListIdMappingWorkflowsRequest;
import software.amazon.awssdk.services.entityresolution.model.ListIdMappingWorkflowsResponse;
import software.amazon.awssdk.services.entityresolution.model.ListIdNamespacesRequest;
import software.amazon.awssdk.services.entityresolution.model.ListIdNamespacesResponse;
import software.amazon.awssdk.services.entityresolution.model.ListMatchingJobsRequest;
import software.amazon.awssdk.services.entityresolution.model.ListMatchingJobsResponse;
import software.amazon.awssdk.services.entityresolution.model.ListMatchingWorkflowsRequest;
import software.amazon.awssdk.services.entityresolution.model.ListMatchingWorkflowsResponse;
import software.amazon.awssdk.services.entityresolution.model.ListProviderServicesRequest;
import software.amazon.awssdk.services.entityresolution.model.ListProviderServicesResponse;
import software.amazon.awssdk.services.entityresolution.model.ListSchemaMappingsRequest;
import software.amazon.awssdk.services.entityresolution.model.ListSchemaMappingsResponse;
import software.amazon.awssdk.services.entityresolution.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.entityresolution.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.entityresolution.model.PutPolicyRequest;
import software.amazon.awssdk.services.entityresolution.model.PutPolicyResponse;
import software.amazon.awssdk.services.entityresolution.model.ResourceNotFoundException;
import software.amazon.awssdk.services.entityresolution.model.StartIdMappingJobRequest;
import software.amazon.awssdk.services.entityresolution.model.StartIdMappingJobResponse;
import software.amazon.awssdk.services.entityresolution.model.StartMatchingJobRequest;
import software.amazon.awssdk.services.entityresolution.model.StartMatchingJobResponse;
import software.amazon.awssdk.services.entityresolution.model.TagResourceRequest;
import software.amazon.awssdk.services.entityresolution.model.TagResourceResponse;
import software.amazon.awssdk.services.entityresolution.model.ThrottlingException;
import software.amazon.awssdk.services.entityresolution.model.UntagResourceRequest;
import software.amazon.awssdk.services.entityresolution.model.UntagResourceResponse;
import software.amazon.awssdk.services.entityresolution.model.UpdateIdMappingWorkflowRequest;
import software.amazon.awssdk.services.entityresolution.model.UpdateIdMappingWorkflowResponse;
import software.amazon.awssdk.services.entityresolution.model.UpdateIdNamespaceRequest;
import software.amazon.awssdk.services.entityresolution.model.UpdateIdNamespaceResponse;
import software.amazon.awssdk.services.entityresolution.model.UpdateMatchingWorkflowRequest;
import software.amazon.awssdk.services.entityresolution.model.UpdateMatchingWorkflowResponse;
import software.amazon.awssdk.services.entityresolution.model.UpdateSchemaMappingRequest;
import software.amazon.awssdk.services.entityresolution.model.UpdateSchemaMappingResponse;
import software.amazon.awssdk.services.entityresolution.model.ValidationException;
import software.amazon.awssdk.services.entityresolution.transform.AddPolicyStatementRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.BatchDeleteUniqueIdRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.CreateIdMappingWorkflowRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.CreateIdNamespaceRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.CreateMatchingWorkflowRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.CreateSchemaMappingRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.DeleteIdMappingWorkflowRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.DeleteIdNamespaceRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.DeleteMatchingWorkflowRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.DeletePolicyStatementRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.DeleteSchemaMappingRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.GetIdMappingJobRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.GetIdMappingWorkflowRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.GetIdNamespaceRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.GetMatchIdRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.GetMatchingJobRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.GetMatchingWorkflowRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.GetPolicyRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.GetProviderServiceRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.GetSchemaMappingRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.ListIdMappingJobsRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.ListIdMappingWorkflowsRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.ListIdNamespacesRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.ListMatchingJobsRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.ListMatchingWorkflowsRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.ListProviderServicesRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.ListSchemaMappingsRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.PutPolicyRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.StartIdMappingJobRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.StartMatchingJobRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.UpdateIdMappingWorkflowRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.UpdateIdNamespaceRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.UpdateMatchingWorkflowRequestMarshaller;
import software.amazon.awssdk.services.entityresolution.transform.UpdateSchemaMappingRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

/**
 * Internal implementation of {@link EntityResolutionAsyncClient}.
 *
 * @see EntityResolutionAsyncClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultEntityResolutionAsyncClient implements EntityResolutionAsyncClient {
    private static final Logger log = LoggerFactory.getLogger(DefaultEntityResolutionAsyncClient.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;

    protected DefaultEntityResolutionAsyncClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration.toBuilder().option(SdkClientOption.SDK_CLIENT, this).build();
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    /**
     * 

* Adds a policy statement object. To retrieve a list of existing policy statements, use the GetPolicy * API. *

* * @param addPolicyStatementRequest * @return A Java Future containing the result of the AddPolicyStatement operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.AddPolicyStatement * @see AWS API Documentation */ @Override public CompletableFuture addPolicyStatement(AddPolicyStatementRequest addPolicyStatementRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(addPolicyStatementRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, addPolicyStatementRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AddPolicyStatement"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AddPolicyStatementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AddPolicyStatement").withProtocolMetadata(protocolMetadata) .withMarshaller(new AddPolicyStatementRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(addPolicyStatementRequest)); 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 multiple unique IDs in a matching workflow. *

* * @param batchDeleteUniqueIdRequest * @return A Java Future containing the result of the BatchDeleteUniqueId operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.BatchDeleteUniqueId * @see AWS API Documentation */ @Override public CompletableFuture batchDeleteUniqueId( BatchDeleteUniqueIdRequest batchDeleteUniqueIdRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchDeleteUniqueIdRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchDeleteUniqueIdRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchDeleteUniqueId"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, BatchDeleteUniqueIdResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("BatchDeleteUniqueId").withProtocolMetadata(protocolMetadata) .withMarshaller(new BatchDeleteUniqueIdRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(batchDeleteUniqueIdRequest)); 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 an IdMappingWorkflow object which stores the configuration of the data processing job to be * run. Each IdMappingWorkflow must have a unique workflow name. To modify an existing workflow, use * the UpdateIdMappingWorkflow API. *

* * @param createIdMappingWorkflowRequest * @return A Java Future containing the result of the CreateIdMappingWorkflow operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ExceedsLimitException The request was rejected because it attempted to create resources beyond the * current Entity Resolution account limits. The error message describes the limit exceeded.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.CreateIdMappingWorkflow * @see AWS API Documentation */ @Override public CompletableFuture createIdMappingWorkflow( CreateIdMappingWorkflowRequest createIdMappingWorkflowRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createIdMappingWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createIdMappingWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateIdMappingWorkflow"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateIdMappingWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateIdMappingWorkflow").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateIdMappingWorkflowRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createIdMappingWorkflowRequest)); 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 an ID namespace object which will help customers provide metadata explaining their dataset and how to use * it. Each ID namespace must have a unique name. To modify an existing ID namespace, use the * UpdateIdNamespace API. *

* * @param createIdNamespaceRequest * @return A Java Future containing the result of the CreateIdNamespace operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ExceedsLimitException The request was rejected because it attempted to create resources beyond the * current Entity Resolution account limits. The error message describes the limit exceeded.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.CreateIdNamespace * @see AWS API Documentation */ @Override public CompletableFuture createIdNamespace(CreateIdNamespaceRequest createIdNamespaceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createIdNamespaceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createIdNamespaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateIdNamespace"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateIdNamespaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateIdNamespace").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateIdNamespaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createIdNamespaceRequest)); 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 MatchingWorkflow object which stores the configuration of the data processing job to be * run. It is important to note that there should not be a pre-existing MatchingWorkflow with the same * name. To modify an existing workflow, utilize the UpdateMatchingWorkflow API. *

* * @param createMatchingWorkflowRequest * @return A Java Future containing the result of the CreateMatchingWorkflow operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ExceedsLimitException The request was rejected because it attempted to create resources beyond the * current Entity Resolution account limits. The error message describes the limit exceeded.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.CreateMatchingWorkflow * @see AWS API Documentation */ @Override public CompletableFuture createMatchingWorkflow( CreateMatchingWorkflowRequest createMatchingWorkflowRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createMatchingWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createMatchingWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateMatchingWorkflow"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateMatchingWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateMatchingWorkflow").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateMatchingWorkflowRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createMatchingWorkflowRequest)); 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 schema mapping, which defines the schema of the input customer records table. The * SchemaMapping also provides Entity Resolution with some metadata about the table, such as the * attribute types of the columns and which columns to match on. *

* * @param createSchemaMappingRequest * @return A Java Future containing the result of the CreateSchemaMapping operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ExceedsLimitException The request was rejected because it attempted to create resources beyond the * current Entity Resolution account limits. The error message describes the limit exceeded.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.CreateSchemaMapping * @see AWS API Documentation */ @Override public CompletableFuture createSchemaMapping( CreateSchemaMappingRequest createSchemaMappingRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSchemaMappingRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createSchemaMappingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSchemaMapping"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSchemaMappingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSchemaMapping").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateSchemaMappingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createSchemaMappingRequest)); 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 the IdMappingWorkflow with a given name. This operation will succeed even if a workflow with * the given name does not exist. *

* * @param deleteIdMappingWorkflowRequest * @return A Java Future containing the result of the DeleteIdMappingWorkflow operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.DeleteIdMappingWorkflow * @see AWS API Documentation */ @Override public CompletableFuture deleteIdMappingWorkflow( DeleteIdMappingWorkflowRequest deleteIdMappingWorkflowRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteIdMappingWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteIdMappingWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteIdMappingWorkflow"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteIdMappingWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteIdMappingWorkflow").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteIdMappingWorkflowRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteIdMappingWorkflowRequest)); 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 the IdNamespace with a given name. *

* * @param deleteIdNamespaceRequest * @return A Java Future containing the result of the DeleteIdNamespace operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.DeleteIdNamespace * @see AWS API Documentation */ @Override public CompletableFuture deleteIdNamespace(DeleteIdNamespaceRequest deleteIdNamespaceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteIdNamespaceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteIdNamespaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteIdNamespace"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteIdNamespaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteIdNamespace").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteIdNamespaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteIdNamespaceRequest)); 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 the MatchingWorkflow with a given name. This operation will succeed even if a workflow with * the given name does not exist. *

* * @param deleteMatchingWorkflowRequest * @return A Java Future containing the result of the DeleteMatchingWorkflow operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.DeleteMatchingWorkflow * @see AWS API Documentation */ @Override public CompletableFuture deleteMatchingWorkflow( DeleteMatchingWorkflowRequest deleteMatchingWorkflowRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteMatchingWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteMatchingWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteMatchingWorkflow"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteMatchingWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteMatchingWorkflow").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteMatchingWorkflowRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteMatchingWorkflowRequest)); 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 the policy statement. *

* * @param deletePolicyStatementRequest * @return A Java Future containing the result of the DeletePolicyStatement operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.DeletePolicyStatement * @see AWS API Documentation */ @Override public CompletableFuture deletePolicyStatement( DeletePolicyStatementRequest deletePolicyStatementRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deletePolicyStatementRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deletePolicyStatementRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeletePolicyStatement"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeletePolicyStatementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeletePolicyStatement").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeletePolicyStatementRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deletePolicyStatementRequest)); 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 the SchemaMapping with a given name. This operation will succeed even if a schema with the * given name does not exist. This operation will fail if there is a MatchingWorkflow object that * references the SchemaMapping in the workflow's InputSourceConfig. *

* * @param deleteSchemaMappingRequest * @return A Java Future containing the result of the DeleteSchemaMapping operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.DeleteSchemaMapping * @see AWS API Documentation */ @Override public CompletableFuture deleteSchemaMapping( DeleteSchemaMappingRequest deleteSchemaMappingRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSchemaMappingRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSchemaMappingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSchemaMapping"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSchemaMappingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSchemaMapping").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteSchemaMappingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteSchemaMappingRequest)); 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); } } /** *

* Gets the status, metrics, and errors (if there are any) that are associated with a job. *

* * @param getIdMappingJobRequest * @return A Java Future containing the result of the GetIdMappingJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.GetIdMappingJob * @see AWS API Documentation */ @Override public CompletableFuture getIdMappingJob(GetIdMappingJobRequest getIdMappingJobRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getIdMappingJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getIdMappingJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetIdMappingJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetIdMappingJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetIdMappingJob").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetIdMappingJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getIdMappingJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the IdMappingWorkflow with a given name, if it exists. *

* * @param getIdMappingWorkflowRequest * @return A Java Future containing the result of the GetIdMappingWorkflow operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.GetIdMappingWorkflow * @see AWS API Documentation */ @Override public CompletableFuture getIdMappingWorkflow( GetIdMappingWorkflowRequest getIdMappingWorkflowRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getIdMappingWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getIdMappingWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetIdMappingWorkflow"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetIdMappingWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetIdMappingWorkflow").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetIdMappingWorkflowRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getIdMappingWorkflowRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the IdNamespace with a given name, if it exists. *

* * @param getIdNamespaceRequest * @return A Java Future containing the result of the GetIdNamespace operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.GetIdNamespace * @see AWS API Documentation */ @Override public CompletableFuture getIdNamespace(GetIdNamespaceRequest getIdNamespaceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getIdNamespaceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getIdNamespaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetIdNamespace"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetIdNamespaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetIdNamespace").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetIdNamespaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getIdNamespaceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the corresponding Match ID of a customer record if the record has been processed. *

* * @param getMatchIdRequest * @return A Java Future containing the result of the GetMatchId operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.GetMatchId * @see AWS * API Documentation */ @Override public CompletableFuture getMatchId(GetMatchIdRequest getMatchIdRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getMatchIdRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getMatchIdRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetMatchId"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetMatchIdResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetMatchId") .withProtocolMetadata(protocolMetadata) .withMarshaller(new GetMatchIdRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getMatchIdRequest)); 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); } } /** *

* Gets the status, metrics, and errors (if there are any) that are associated with a job. *

* * @param getMatchingJobRequest * @return A Java Future containing the result of the GetMatchingJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.GetMatchingJob * @see AWS API Documentation */ @Override public CompletableFuture getMatchingJob(GetMatchingJobRequest getMatchingJobRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getMatchingJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getMatchingJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetMatchingJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetMatchingJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetMatchingJob").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetMatchingJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getMatchingJobRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the MatchingWorkflow with a given name, if it exists. *

* * @param getMatchingWorkflowRequest * @return A Java Future containing the result of the GetMatchingWorkflow operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.GetMatchingWorkflow * @see AWS API Documentation */ @Override public CompletableFuture getMatchingWorkflow( GetMatchingWorkflowRequest getMatchingWorkflowRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getMatchingWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getMatchingWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetMatchingWorkflow"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetMatchingWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetMatchingWorkflow").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetMatchingWorkflowRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getMatchingWorkflowRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the resource-based policy. *

* * @param getPolicyRequest * @return A Java Future containing the result of the GetPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.GetPolicy * @see AWS * API Documentation */ @Override public CompletableFuture getPolicy(GetPolicyRequest getPolicyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getPolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getPolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetPolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetPolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetPolicy") .withProtocolMetadata(protocolMetadata) .withMarshaller(new GetPolicyRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(getPolicyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the ProviderService of a given name. *

* * @param getProviderServiceRequest * @return A Java Future containing the result of the GetProviderService operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.GetProviderService * @see AWS API Documentation */ @Override public CompletableFuture getProviderService(GetProviderServiceRequest getProviderServiceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getProviderServiceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getProviderServiceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetProviderService"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetProviderServiceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetProviderService").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetProviderServiceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getProviderServiceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns the SchemaMapping of a given name. *

* * @param getSchemaMappingRequest * @return A Java Future containing the result of the GetSchemaMapping operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.GetSchemaMapping * @see AWS API Documentation */ @Override public CompletableFuture getSchemaMapping(GetSchemaMappingRequest getSchemaMappingRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSchemaMappingRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSchemaMappingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSchemaMapping"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetSchemaMappingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSchemaMapping").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetSchemaMappingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getSchemaMappingRequest)); 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 ID mapping jobs for a given workflow. *

* * @param listIdMappingJobsRequest * @return A Java Future containing the result of the ListIdMappingJobs operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.ListIdMappingJobs * @see AWS API Documentation */ @Override public CompletableFuture listIdMappingJobs(ListIdMappingJobsRequest listIdMappingJobsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listIdMappingJobsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listIdMappingJobsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListIdMappingJobs"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListIdMappingJobsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListIdMappingJobs").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListIdMappingJobsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listIdMappingJobsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of all the IdMappingWorkflows that have been created for an Amazon Web Services * account. *

* * @param listIdMappingWorkflowsRequest * @return A Java Future containing the result of the ListIdMappingWorkflows operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.ListIdMappingWorkflows * @see AWS API Documentation */ @Override public CompletableFuture listIdMappingWorkflows( ListIdMappingWorkflowsRequest listIdMappingWorkflowsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listIdMappingWorkflowsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listIdMappingWorkflowsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListIdMappingWorkflows"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListIdMappingWorkflowsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListIdMappingWorkflows").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListIdMappingWorkflowsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listIdMappingWorkflowsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of all ID namespaces. *

* * @param listIdNamespacesRequest * @return A Java Future containing the result of the ListIdNamespaces operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.ListIdNamespaces * @see AWS API Documentation */ @Override public CompletableFuture listIdNamespaces(ListIdNamespacesRequest listIdNamespacesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listIdNamespacesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listIdNamespacesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListIdNamespaces"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListIdNamespacesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListIdNamespaces").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListIdNamespacesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listIdNamespacesRequest)); 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 jobs for a given workflow. *

* * @param listMatchingJobsRequest * @return A Java Future containing the result of the ListMatchingJobs operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.ListMatchingJobs * @see AWS API Documentation */ @Override public CompletableFuture listMatchingJobs(ListMatchingJobsRequest listMatchingJobsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listMatchingJobsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listMatchingJobsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListMatchingJobs"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListMatchingJobsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListMatchingJobs").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListMatchingJobsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listMatchingJobsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of all the MatchingWorkflows that have been created for an Amazon Web Services * account. *

* * @param listMatchingWorkflowsRequest * @return A Java Future containing the result of the ListMatchingWorkflows operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.ListMatchingWorkflows * @see AWS API Documentation */ @Override public CompletableFuture listMatchingWorkflows( ListMatchingWorkflowsRequest listMatchingWorkflowsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listMatchingWorkflowsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listMatchingWorkflowsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListMatchingWorkflows"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListMatchingWorkflowsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListMatchingWorkflows").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListMatchingWorkflowsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listMatchingWorkflowsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of all the ProviderServices that are available in this Amazon Web Services Region. *

* * @param listProviderServicesRequest * @return A Java Future containing the result of the ListProviderServices operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.ListProviderServices * @see AWS API Documentation */ @Override public CompletableFuture listProviderServices( ListProviderServicesRequest listProviderServicesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listProviderServicesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listProviderServicesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListProviderServices"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListProviderServicesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListProviderServices").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListProviderServicesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listProviderServicesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns a list of all the SchemaMappings that have been created for an Amazon Web Services account. *

* * @param listSchemaMappingsRequest * @return A Java Future containing the result of the ListSchemaMappings operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.ListSchemaMappings * @see AWS API Documentation */ @Override public CompletableFuture listSchemaMappings(ListSchemaMappingsRequest listSchemaMappingsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSchemaMappingsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSchemaMappingsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSchemaMappings"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSchemaMappingsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSchemaMappings").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListSchemaMappingsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listSchemaMappingsRequest)); 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); } } /** *

* Displays the tags associated with an Entity Resolution resource. In Entity Resolution, SchemaMapping * , and MatchingWorkflow can be tagged. *

* * @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. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.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, "EntityResolution"); 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); } } /** *

* Updates the resource-based policy. *

* * @param putPolicyRequest * @return A Java Future containing the result of the PutPolicy operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.PutPolicy * @see AWS * API Documentation */ @Override public CompletableFuture putPolicy(PutPolicyRequest putPolicyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putPolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putPolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutPolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, PutPolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("PutPolicy") .withProtocolMetadata(protocolMetadata) .withMarshaller(new PutPolicyRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(putPolicyRequest)); 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); } } /** *

* Starts the IdMappingJob of a workflow. The workflow must have previously been created using the * CreateIdMappingWorkflow endpoint. *

* * @param startIdMappingJobRequest * @return A Java Future containing the result of the StartIdMappingJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ExceedsLimitException The request was rejected because it attempted to create resources beyond the * current Entity Resolution account limits. The error message describes the limit exceeded.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.StartIdMappingJob * @see AWS API Documentation */ @Override public CompletableFuture startIdMappingJob(StartIdMappingJobRequest startIdMappingJobRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startIdMappingJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startIdMappingJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartIdMappingJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartIdMappingJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartIdMappingJob").withProtocolMetadata(protocolMetadata) .withMarshaller(new StartIdMappingJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(startIdMappingJobRequest)); 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); } } /** *

* Starts the MatchingJob of a workflow. The workflow must have previously been created using the * CreateMatchingWorkflow endpoint. *

* * @param startMatchingJobRequest * @return A Java Future containing the result of the StartMatchingJob operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ExceedsLimitException The request was rejected because it attempted to create resources beyond the * current Entity Resolution account limits. The error message describes the limit exceeded.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.StartMatchingJob * @see AWS API Documentation */ @Override public CompletableFuture startMatchingJob(StartMatchingJobRequest startMatchingJobRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startMatchingJobRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startMatchingJobRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartMatchingJob"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartMatchingJobResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartMatchingJob").withProtocolMetadata(protocolMetadata) .withMarshaller(new StartMatchingJobRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(startMatchingJobRequest)); 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); } } /** *

* Assigns one or more tags (key-value pairs) to the specified Entity Resolution resource. Tags can help you * organize and categorize your resources. You can also use them to scope user permissions by granting a user * permission to access or change only resources with certain tag values. In Entity Resolution, * SchemaMapping and MatchingWorkflow can be tagged. Tags don't have any semantic meaning * to Amazon Web Services and are interpreted strictly as strings of characters. You can use the * TagResource action with a resource that already has tags. If you specify a new tag key, this tag is * appended to the list of tags associated with the resource. If you specify a tag key that is already associated * with the resource, the new tag value that you specify replaces the previous value for that tag. *

* * @param tagResourceRequest * @return A Java Future containing the result of the TagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.TagResource * @see AWS * API Documentation */ @Override public CompletableFuture tagResource(TagResourceRequest tagResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(tagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, tagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "TagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, TagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("TagResource").withProtocolMetadata(protocolMetadata) .withMarshaller(new TagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(tagResourceRequest)); 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 one or more tags from the specified Entity Resolution resource. In Entity Resolution, * SchemaMapping, and MatchingWorkflow can be tagged. *

* * @param untagResourceRequest * @return A Java Future containing the result of the UntagResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.UntagResource * @see AWS API Documentation */ @Override public CompletableFuture untagResource(UntagResourceRequest untagResourceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(untagResourceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, untagResourceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UntagResource"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UntagResourceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UntagResource").withProtocolMetadata(protocolMetadata) .withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(untagResourceRequest)); 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); } } /** *

* Updates an existing IdMappingWorkflow. This method is identical to * CreateIdMappingWorkflow, except it uses an HTTP PUT request instead of a * POST request, and the IdMappingWorkflow must already exist for the method to succeed. *

* * @param updateIdMappingWorkflowRequest * @return A Java Future containing the result of the UpdateIdMappingWorkflow operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.UpdateIdMappingWorkflow * @see AWS API Documentation */ @Override public CompletableFuture updateIdMappingWorkflow( UpdateIdMappingWorkflowRequest updateIdMappingWorkflowRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateIdMappingWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateIdMappingWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateIdMappingWorkflow"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateIdMappingWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateIdMappingWorkflow").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateIdMappingWorkflowRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateIdMappingWorkflowRequest)); 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); } } /** *

* Updates an existing ID namespace. *

* * @param updateIdNamespaceRequest * @return A Java Future containing the result of the UpdateIdNamespace operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.UpdateIdNamespace * @see AWS API Documentation */ @Override public CompletableFuture updateIdNamespace(UpdateIdNamespaceRequest updateIdNamespaceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateIdNamespaceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateIdNamespaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateIdNamespace"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateIdNamespaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateIdNamespace").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateIdNamespaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateIdNamespaceRequest)); 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); } } /** *

* Updates an existing MatchingWorkflow. This method is identical to * CreateMatchingWorkflow, except it uses an HTTP PUT request instead of a * POST request, and the MatchingWorkflow must already exist for the method to succeed. *

* * @param updateMatchingWorkflowRequest * @return A Java Future containing the result of the UpdateMatchingWorkflow operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.UpdateMatchingWorkflow * @see AWS API Documentation */ @Override public CompletableFuture updateMatchingWorkflow( UpdateMatchingWorkflowRequest updateMatchingWorkflowRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateMatchingWorkflowRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateMatchingWorkflowRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateMatchingWorkflow"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateMatchingWorkflowResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateMatchingWorkflow").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateMatchingWorkflowRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateMatchingWorkflowRequest)); 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); } } /** *

* Updates a schema mapping. *

* *

* A schema is immutable if it is being used by a workflow. Therefore, you can't update a schema mapping if it's * associated with a workflow. *

*
* * @param updateSchemaMappingRequest * @return A Java Future containing the result of the UpdateSchemaMapping operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • InternalServerException This exception occurs when there is an internal failure in the Entity * Resolution service.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ConflictException The request could not be processed because of conflict in the current state of the * resource. Example: Workflow already exists, Schema already exists, Workflow is currently running, etc.
  • *
  • ValidationException The input fails to satisfy the constraints specified by Entity Resolution.
  • *
  • 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.
  • *
  • EntityResolutionException Base class for all service exceptions. Unknown exceptions will be thrown as * an instance of this type.
  • *
* @sample EntityResolutionAsyncClient.UpdateSchemaMapping * @see AWS API Documentation */ @Override public CompletableFuture updateSchemaMapping( UpdateSchemaMappingRequest updateSchemaMappingRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSchemaMappingRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSchemaMappingRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "EntityResolution"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSchemaMapping"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateSchemaMappingResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateSchemaMapping").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateSchemaMappingRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateSchemaMappingRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } @Override public final EntityResolutionServiceClientConfiguration serviceClientConfiguration() { return new EntityResolutionServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public final String serviceName() { return SERVICE_NAME; } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(EntityResolutionException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerException") .exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ValidationException") .exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ExceedsLimitException") .exceptionBuilderSupplier(ExceedsLimitException::builder).httpStatusCode(402).build()); } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private void updateRetryStrategyClientConfiguration(SdkClientConfiguration.Builder configuration) { ClientOverrideConfiguration.Builder builder = configuration.asOverrideConfigurationBuilder(); RetryMode retryMode = builder.retryMode(); if (retryMode != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, AwsRetryStrategy.forRetryMode(retryMode)); } else { Consumer> configurator = builder.retryStrategyConfigurator(); if (configurator != null) { RetryStrategy.Builder defaultBuilder = AwsRetryStrategy.defaultRetryStrategy().toBuilder(); configurator.accept(defaultBuilder); configuration.option(SdkClientOption.RETRY_STRATEGY, defaultBuilder.build()); } else { RetryStrategy retryStrategy = builder.retryStrategy(); if (retryStrategy != null) { configuration.option(SdkClientOption.RETRY_STRATEGY, retryStrategy); } } } configuration.option(SdkClientOption.CONFIGURED_RETRY_MODE, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_STRATEGY, null); configuration.option(SdkClientOption.CONFIGURED_RETRY_CONFIGURATOR, null); } private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) { List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList()); SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder(); if (plugins.isEmpty()) { return configuration.build(); } EntityResolutionServiceClientConfigurationBuilder serviceConfigBuilder = new EntityResolutionServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } updateRetryStrategyClientConfiguration(configuration); return configuration.build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata, Function> exceptionMetadataMapper) { return protocolFactory.createErrorResponseHandler(operationMetadata, exceptionMetadataMapper); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy