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

software.amazon.awssdk.services.redshiftserverless.DefaultRedshiftServerlessAsyncClient Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Redshift Serverless module holds the client classes that are used for communicating with Redshift Serverless.

There is a newer version: 2.29.15
Show newest version
/*
 * 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.redshiftserverless;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
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.redshiftserverless.internal.RedshiftServerlessServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.redshiftserverless.model.AccessDeniedException;
import software.amazon.awssdk.services.redshiftserverless.model.ConflictException;
import software.amazon.awssdk.services.redshiftserverless.model.ConvertRecoveryPointToSnapshotRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ConvertRecoveryPointToSnapshotResponse;
import software.amazon.awssdk.services.redshiftserverless.model.CreateCustomDomainAssociationRequest;
import software.amazon.awssdk.services.redshiftserverless.model.CreateCustomDomainAssociationResponse;
import software.amazon.awssdk.services.redshiftserverless.model.CreateEndpointAccessRequest;
import software.amazon.awssdk.services.redshiftserverless.model.CreateEndpointAccessResponse;
import software.amazon.awssdk.services.redshiftserverless.model.CreateNamespaceRequest;
import software.amazon.awssdk.services.redshiftserverless.model.CreateNamespaceResponse;
import software.amazon.awssdk.services.redshiftserverless.model.CreateScheduledActionRequest;
import software.amazon.awssdk.services.redshiftserverless.model.CreateScheduledActionResponse;
import software.amazon.awssdk.services.redshiftserverless.model.CreateSnapshotCopyConfigurationRequest;
import software.amazon.awssdk.services.redshiftserverless.model.CreateSnapshotCopyConfigurationResponse;
import software.amazon.awssdk.services.redshiftserverless.model.CreateSnapshotRequest;
import software.amazon.awssdk.services.redshiftserverless.model.CreateSnapshotResponse;
import software.amazon.awssdk.services.redshiftserverless.model.CreateUsageLimitRequest;
import software.amazon.awssdk.services.redshiftserverless.model.CreateUsageLimitResponse;
import software.amazon.awssdk.services.redshiftserverless.model.CreateWorkgroupRequest;
import software.amazon.awssdk.services.redshiftserverless.model.CreateWorkgroupResponse;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteCustomDomainAssociationRequest;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteCustomDomainAssociationResponse;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteEndpointAccessRequest;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteEndpointAccessResponse;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteNamespaceRequest;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteNamespaceResponse;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteResourcePolicyRequest;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteResourcePolicyResponse;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteScheduledActionRequest;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteScheduledActionResponse;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteSnapshotCopyConfigurationRequest;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteSnapshotCopyConfigurationResponse;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteSnapshotRequest;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteSnapshotResponse;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteUsageLimitRequest;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteUsageLimitResponse;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteWorkgroupRequest;
import software.amazon.awssdk.services.redshiftserverless.model.DeleteWorkgroupResponse;
import software.amazon.awssdk.services.redshiftserverless.model.GetCredentialsRequest;
import software.amazon.awssdk.services.redshiftserverless.model.GetCredentialsResponse;
import software.amazon.awssdk.services.redshiftserverless.model.GetCustomDomainAssociationRequest;
import software.amazon.awssdk.services.redshiftserverless.model.GetCustomDomainAssociationResponse;
import software.amazon.awssdk.services.redshiftserverless.model.GetEndpointAccessRequest;
import software.amazon.awssdk.services.redshiftserverless.model.GetEndpointAccessResponse;
import software.amazon.awssdk.services.redshiftserverless.model.GetNamespaceRequest;
import software.amazon.awssdk.services.redshiftserverless.model.GetNamespaceResponse;
import software.amazon.awssdk.services.redshiftserverless.model.GetRecoveryPointRequest;
import software.amazon.awssdk.services.redshiftserverless.model.GetRecoveryPointResponse;
import software.amazon.awssdk.services.redshiftserverless.model.GetResourcePolicyRequest;
import software.amazon.awssdk.services.redshiftserverless.model.GetResourcePolicyResponse;
import software.amazon.awssdk.services.redshiftserverless.model.GetScheduledActionRequest;
import software.amazon.awssdk.services.redshiftserverless.model.GetScheduledActionResponse;
import software.amazon.awssdk.services.redshiftserverless.model.GetSnapshotRequest;
import software.amazon.awssdk.services.redshiftserverless.model.GetSnapshotResponse;
import software.amazon.awssdk.services.redshiftserverless.model.GetTableRestoreStatusRequest;
import software.amazon.awssdk.services.redshiftserverless.model.GetTableRestoreStatusResponse;
import software.amazon.awssdk.services.redshiftserverless.model.GetUsageLimitRequest;
import software.amazon.awssdk.services.redshiftserverless.model.GetUsageLimitResponse;
import software.amazon.awssdk.services.redshiftserverless.model.GetWorkgroupRequest;
import software.amazon.awssdk.services.redshiftserverless.model.GetWorkgroupResponse;
import software.amazon.awssdk.services.redshiftserverless.model.InsufficientCapacityException;
import software.amazon.awssdk.services.redshiftserverless.model.InternalServerException;
import software.amazon.awssdk.services.redshiftserverless.model.InvalidPaginationException;
import software.amazon.awssdk.services.redshiftserverless.model.Ipv6CidrBlockNotFoundException;
import software.amazon.awssdk.services.redshiftserverless.model.ListCustomDomainAssociationsRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ListCustomDomainAssociationsResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ListEndpointAccessRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ListEndpointAccessResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ListNamespacesRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ListNamespacesResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ListRecoveryPointsRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ListRecoveryPointsResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ListScheduledActionsRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ListScheduledActionsResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ListSnapshotCopyConfigurationsRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ListSnapshotCopyConfigurationsResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ListSnapshotsRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ListSnapshotsResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ListTableRestoreStatusRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ListTableRestoreStatusResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ListUsageLimitsRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ListUsageLimitsResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ListWorkgroupsRequest;
import software.amazon.awssdk.services.redshiftserverless.model.ListWorkgroupsResponse;
import software.amazon.awssdk.services.redshiftserverless.model.PutResourcePolicyRequest;
import software.amazon.awssdk.services.redshiftserverless.model.PutResourcePolicyResponse;
import software.amazon.awssdk.services.redshiftserverless.model.RedshiftServerlessException;
import software.amazon.awssdk.services.redshiftserverless.model.ResourceNotFoundException;
import software.amazon.awssdk.services.redshiftserverless.model.RestoreFromRecoveryPointRequest;
import software.amazon.awssdk.services.redshiftserverless.model.RestoreFromRecoveryPointResponse;
import software.amazon.awssdk.services.redshiftserverless.model.RestoreFromSnapshotRequest;
import software.amazon.awssdk.services.redshiftserverless.model.RestoreFromSnapshotResponse;
import software.amazon.awssdk.services.redshiftserverless.model.RestoreTableFromRecoveryPointRequest;
import software.amazon.awssdk.services.redshiftserverless.model.RestoreTableFromRecoveryPointResponse;
import software.amazon.awssdk.services.redshiftserverless.model.RestoreTableFromSnapshotRequest;
import software.amazon.awssdk.services.redshiftserverless.model.RestoreTableFromSnapshotResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.redshiftserverless.model.TagResourceRequest;
import software.amazon.awssdk.services.redshiftserverless.model.TagResourceResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ThrottlingException;
import software.amazon.awssdk.services.redshiftserverless.model.TooManyTagsException;
import software.amazon.awssdk.services.redshiftserverless.model.UntagResourceRequest;
import software.amazon.awssdk.services.redshiftserverless.model.UntagResourceResponse;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateCustomDomainAssociationRequest;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateCustomDomainAssociationResponse;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateEndpointAccessRequest;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateEndpointAccessResponse;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateNamespaceRequest;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateNamespaceResponse;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateScheduledActionRequest;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateScheduledActionResponse;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateSnapshotCopyConfigurationRequest;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateSnapshotCopyConfigurationResponse;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateSnapshotRequest;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateSnapshotResponse;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateUsageLimitRequest;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateUsageLimitResponse;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateWorkgroupRequest;
import software.amazon.awssdk.services.redshiftserverless.model.UpdateWorkgroupResponse;
import software.amazon.awssdk.services.redshiftserverless.model.ValidationException;
import software.amazon.awssdk.services.redshiftserverless.transform.ConvertRecoveryPointToSnapshotRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.CreateCustomDomainAssociationRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.CreateEndpointAccessRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.CreateNamespaceRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.CreateScheduledActionRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.CreateSnapshotCopyConfigurationRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.CreateSnapshotRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.CreateUsageLimitRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.CreateWorkgroupRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.DeleteCustomDomainAssociationRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.DeleteEndpointAccessRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.DeleteNamespaceRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.DeleteResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.DeleteScheduledActionRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.DeleteSnapshotCopyConfigurationRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.DeleteSnapshotRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.DeleteUsageLimitRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.DeleteWorkgroupRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.GetCredentialsRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.GetCustomDomainAssociationRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.GetEndpointAccessRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.GetNamespaceRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.GetRecoveryPointRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.GetResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.GetScheduledActionRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.GetSnapshotRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.GetTableRestoreStatusRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.GetUsageLimitRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.GetWorkgroupRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.ListCustomDomainAssociationsRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.ListEndpointAccessRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.ListNamespacesRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.ListRecoveryPointsRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.ListScheduledActionsRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.ListSnapshotCopyConfigurationsRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.ListSnapshotsRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.ListTableRestoreStatusRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.ListUsageLimitsRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.ListWorkgroupsRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.PutResourcePolicyRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.RestoreFromRecoveryPointRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.RestoreFromSnapshotRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.RestoreTableFromRecoveryPointRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.RestoreTableFromSnapshotRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.UpdateCustomDomainAssociationRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.UpdateEndpointAccessRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.UpdateNamespaceRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.UpdateScheduledActionRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.UpdateSnapshotCopyConfigurationRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.UpdateSnapshotRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.UpdateUsageLimitRequestMarshaller;
import software.amazon.awssdk.services.redshiftserverless.transform.UpdateWorkgroupRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

/**
 * Internal implementation of {@link RedshiftServerlessAsyncClient}.
 *
 * @see RedshiftServerlessAsyncClient#builder()
 */
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultRedshiftServerlessAsyncClient implements RedshiftServerlessAsyncClient {
    private static final Logger log = LoggerFactory.getLogger(DefaultRedshiftServerlessAsyncClient.class);

    private static final AwsProtocolMetadata protocolMetadata = AwsProtocolMetadata.builder()
            .serviceProtocol(AwsServiceProtocol.AWS_JSON).build();

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

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

    /**
     * 

* Converts a recovery point to a snapshot. For more information about recovery points and snapshots, see Working with snapshots * and recovery points. *

* * @param convertRecoveryPointToSnapshotRequest * @return A Java Future containing the result of the ConvertRecoveryPointToSnapshot 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • TooManyTagsException The request exceeded the number of tags allowed for a resource.
  • *
  • ServiceQuotaExceededException The service limit was exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.ConvertRecoveryPointToSnapshot * @see AWS API Documentation */ @Override public CompletableFuture convertRecoveryPointToSnapshot( ConvertRecoveryPointToSnapshotRequest convertRecoveryPointToSnapshotRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(convertRecoveryPointToSnapshotRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, convertRecoveryPointToSnapshotRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ConvertRecoveryPointToSnapshot"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ConvertRecoveryPointToSnapshotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ConvertRecoveryPointToSnapshot").withProtocolMetadata(protocolMetadata) .withMarshaller(new ConvertRecoveryPointToSnapshotRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(convertRecoveryPointToSnapshotRequest)); 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 custom domain association for Amazon Redshift Serverless. *

* * @param createCustomDomainAssociationRequest * @return A Java Future containing the result of the CreateCustomDomainAssociation 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.CreateCustomDomainAssociation * @see AWS API Documentation */ @Override public CompletableFuture createCustomDomainAssociation( CreateCustomDomainAssociationRequest createCustomDomainAssociationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createCustomDomainAssociationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createCustomDomainAssociationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateCustomDomainAssociation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCustomDomainAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCustomDomainAssociation").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateCustomDomainAssociationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createCustomDomainAssociationRequest)); 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 Amazon Redshift Serverless managed VPC endpoint. *

* * @param createEndpointAccessRequest * @return A Java Future containing the result of the CreateEndpointAccess 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ServiceQuotaExceededException The service limit was exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.CreateEndpointAccess * @see AWS API Documentation */ @Override public CompletableFuture createEndpointAccess( CreateEndpointAccessRequest createEndpointAccessRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createEndpointAccessRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createEndpointAccessRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateEndpointAccess"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateEndpointAccessResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateEndpointAccess").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateEndpointAccessRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createEndpointAccessRequest)); 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 namespace in Amazon Redshift Serverless. *

* * @param createNamespaceRequest * @return A Java Future containing the result of the CreateNamespace 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • TooManyTagsException The request exceeded the number of tags allowed for a resource.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.CreateNamespace * @see AWS API Documentation */ @Override public CompletableFuture createNamespace(CreateNamespaceRequest createNamespaceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createNamespaceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createNamespaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateNamespace"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateNamespaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateNamespace").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateNamespaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createNamespaceRequest)); 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 scheduled action. A scheduled action contains a schedule and an Amazon Redshift API action. For * example, you can create a schedule of when to run the CreateSnapshot API operation. *

* * @param createScheduledActionRequest * @return A Java Future containing the result of the CreateScheduledAction 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.CreateScheduledAction * @see AWS API Documentation */ @Override public CompletableFuture createScheduledAction( CreateScheduledActionRequest createScheduledActionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createScheduledActionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createScheduledActionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateScheduledAction"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateScheduledActionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateScheduledAction").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateScheduledActionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createScheduledActionRequest)); 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 snapshot of all databases in a namespace. For more information about snapshots, see Working with * snapshots and recovery points. *

* * @param createSnapshotRequest * @return A Java Future containing the result of the CreateSnapshot 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • TooManyTagsException The request exceeded the number of tags allowed for a resource.
  • *
  • ServiceQuotaExceededException The service limit was exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.CreateSnapshot * @see AWS API Documentation */ @Override public CompletableFuture createSnapshot(CreateSnapshotRequest createSnapshotRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSnapshotRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createSnapshotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSnapshot"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSnapshotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSnapshot").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateSnapshotRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createSnapshotRequest)); 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 snapshot copy configuration that lets you copy snapshots to another Amazon Web Services Region. *

* * @param createSnapshotCopyConfigurationRequest * @return A Java Future containing the result of the CreateSnapshotCopyConfiguration 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ServiceQuotaExceededException The service limit was exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.CreateSnapshotCopyConfiguration * @see AWS API Documentation */ @Override public CompletableFuture createSnapshotCopyConfiguration( CreateSnapshotCopyConfigurationRequest createSnapshotCopyConfigurationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createSnapshotCopyConfigurationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createSnapshotCopyConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateSnapshotCopyConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateSnapshotCopyConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateSnapshotCopyConfiguration").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateSnapshotCopyConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createSnapshotCopyConfigurationRequest)); 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 usage limit for a specified Amazon Redshift Serverless usage type. The usage limit is identified by the * returned usage limit identifier. *

* * @param createUsageLimitRequest * @return A Java Future containing the result of the CreateUsageLimit 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • ServiceQuotaExceededException The service limit was exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.CreateUsageLimit * @see AWS API Documentation */ @Override public CompletableFuture createUsageLimit(CreateUsageLimitRequest createUsageLimitRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createUsageLimitRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createUsageLimitRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateUsageLimit"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateUsageLimitResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateUsageLimit").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateUsageLimitRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createUsageLimitRequest)); 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 workgroup in Amazon Redshift Serverless. *

* * @param createWorkgroupRequest * @return A Java Future containing the result of the CreateWorkgroup 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • InsufficientCapacityException There is an insufficient capacity to perform the action.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • TooManyTagsException The request exceeded the number of tags allowed for a resource.
  • *
  • Ipv6CidrBlockNotFoundException There are no subnets in your VPC with associated IPv6 CIDR blocks. To * use dual-stack mode, associate an IPv6 CIDR block with each subnet in your VPC.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.CreateWorkgroup * @see AWS API Documentation */ @Override public CompletableFuture createWorkgroup(CreateWorkgroupRequest createWorkgroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createWorkgroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createWorkgroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateWorkgroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateWorkgroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateWorkgroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateWorkgroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createWorkgroupRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a custom domain association for Amazon Redshift Serverless. *

* * @param deleteCustomDomainAssociationRequest * @return A Java Future containing the result of the DeleteCustomDomainAssociation 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.DeleteCustomDomainAssociation * @see AWS API Documentation */ @Override public CompletableFuture deleteCustomDomainAssociation( DeleteCustomDomainAssociationRequest deleteCustomDomainAssociationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteCustomDomainAssociationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteCustomDomainAssociationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteCustomDomainAssociation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCustomDomainAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCustomDomainAssociation").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteCustomDomainAssociationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteCustomDomainAssociationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes an Amazon Redshift Serverless managed VPC endpoint. *

* * @param deleteEndpointAccessRequest * @return A Java Future containing the result of the DeleteEndpointAccess 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.DeleteEndpointAccess * @see AWS API Documentation */ @Override public CompletableFuture deleteEndpointAccess( DeleteEndpointAccessRequest deleteEndpointAccessRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteEndpointAccessRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEndpointAccessRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEndpointAccess"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteEndpointAccessResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteEndpointAccess").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteEndpointAccessRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteEndpointAccessRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a namespace from Amazon Redshift Serverless. Before you delete the namespace, you can create a final * snapshot that has all of the data within the namespace. *

* * @param deleteNamespaceRequest * @return A Java Future containing the result of the DeleteNamespace 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.DeleteNamespace * @see AWS API Documentation */ @Override public CompletableFuture deleteNamespace(DeleteNamespaceRequest deleteNamespaceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteNamespaceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteNamespaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteNamespace"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteNamespaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteNamespace").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteNamespaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteNamespaceRequest)); 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 specified resource policy. *

* * @param deleteResourcePolicyRequest * @return A Java Future containing the result of the DeleteResourcePolicy 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.DeleteResourcePolicy * @see AWS API Documentation */ @Override public CompletableFuture deleteResourcePolicy( DeleteResourcePolicyRequest deleteResourcePolicyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteResourcePolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteResourcePolicy").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteResourcePolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteResourcePolicyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a scheduled action. *

* * @param deleteScheduledActionRequest * @return A Java Future containing the result of the DeleteScheduledAction 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.DeleteScheduledAction * @see AWS API Documentation */ @Override public CompletableFuture deleteScheduledAction( DeleteScheduledActionRequest deleteScheduledActionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteScheduledActionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteScheduledActionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteScheduledAction"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteScheduledActionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteScheduledAction").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteScheduledActionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteScheduledActionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a snapshot from Amazon Redshift Serverless. *

* * @param deleteSnapshotRequest * @return A Java Future containing the result of the DeleteSnapshot 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.DeleteSnapshot * @see AWS API Documentation */ @Override public CompletableFuture deleteSnapshot(DeleteSnapshotRequest deleteSnapshotRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSnapshotRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSnapshotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSnapshot"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSnapshotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSnapshot").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteSnapshotRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteSnapshotRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a snapshot copy configuration *

* * @param deleteSnapshotCopyConfigurationRequest * @return A Java Future containing the result of the DeleteSnapshotCopyConfiguration 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.DeleteSnapshotCopyConfiguration * @see AWS API Documentation */ @Override public CompletableFuture deleteSnapshotCopyConfiguration( DeleteSnapshotCopyConfigurationRequest deleteSnapshotCopyConfigurationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteSnapshotCopyConfigurationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteSnapshotCopyConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteSnapshotCopyConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteSnapshotCopyConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteSnapshotCopyConfiguration").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteSnapshotCopyConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteSnapshotCopyConfigurationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a usage limit from Amazon Redshift Serverless. *

* * @param deleteUsageLimitRequest * @return A Java Future containing the result of the DeleteUsageLimit 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.DeleteUsageLimit * @see AWS API Documentation */ @Override public CompletableFuture deleteUsageLimit(DeleteUsageLimitRequest deleteUsageLimitRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteUsageLimitRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteUsageLimitRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteUsageLimit"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteUsageLimitResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteUsageLimit").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteUsageLimitRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteUsageLimitRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes a workgroup. *

* * @param deleteWorkgroupRequest * @return A Java Future containing the result of the DeleteWorkgroup 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.DeleteWorkgroup * @see AWS API Documentation */ @Override public CompletableFuture deleteWorkgroup(DeleteWorkgroupRequest deleteWorkgroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteWorkgroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteWorkgroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteWorkgroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteWorkgroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteWorkgroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteWorkgroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteWorkgroupRequest)); 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 database user name and temporary password with temporary authorization to log in to Amazon Redshift * Serverless. *

*

* By default, the temporary credentials expire in 900 seconds. You can optionally specify a duration between 900 * seconds (15 minutes) and 3600 seconds (60 minutes). *

* *
     *  <p>The Identity and Access Management (IAM) user or role that runs GetCredentials must have an IAM policy attached that allows access to all necessary actions and resources.</p> <p>If the <code>DbName</code> parameter is specified, the IAM policy must allow access to the resource dbname for the specified database name.</p> 
     * 
* * @param getCredentialsRequest * @return A Java Future containing the result of the GetCredentials 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.GetCredentials * @see AWS API Documentation */ @Override public CompletableFuture getCredentials(GetCredentialsRequest getCredentialsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCredentialsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCredentialsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCredentials"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCredentialsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCredentials").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetCredentialsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getCredentialsRequest)); 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 information about a specific custom domain association. *

* * @param getCustomDomainAssociationRequest * @return A Java Future containing the result of the GetCustomDomainAssociation 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.GetCustomDomainAssociation * @see AWS API Documentation */ @Override public CompletableFuture getCustomDomainAssociation( GetCustomDomainAssociationRequest getCustomDomainAssociationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getCustomDomainAssociationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getCustomDomainAssociationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetCustomDomainAssociation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCustomDomainAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCustomDomainAssociation").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetCustomDomainAssociationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getCustomDomainAssociationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information, such as the name, about a VPC endpoint. *

* * @param getEndpointAccessRequest * @return A Java Future containing the result of the GetEndpointAccess 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.GetEndpointAccess * @see AWS API Documentation */ @Override public CompletableFuture getEndpointAccess(GetEndpointAccessRequest getEndpointAccessRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getEndpointAccessRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getEndpointAccessRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEndpointAccess"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetEndpointAccessResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetEndpointAccess").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetEndpointAccessRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getEndpointAccessRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a namespace in Amazon Redshift Serverless. *

* * @param getNamespaceRequest * @return A Java Future containing the result of the GetNamespace 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.GetNamespace * @see AWS API Documentation */ @Override public CompletableFuture getNamespace(GetNamespaceRequest getNamespaceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getNamespaceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getNamespaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetNamespace"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetNamespaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetNamespace").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetNamespaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getNamespaceRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a recovery point. *

* * @param getRecoveryPointRequest * @return A Java Future containing the result of the GetRecoveryPoint 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.GetRecoveryPoint * @see AWS API Documentation */ @Override public CompletableFuture getRecoveryPoint(GetRecoveryPointRequest getRecoveryPointRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getRecoveryPointRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getRecoveryPointRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetRecoveryPoint"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetRecoveryPointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetRecoveryPoint").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetRecoveryPointRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getRecoveryPointRequest)); 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 resource policy. *

* * @param getResourcePolicyRequest * @return A Java Future containing the result of the GetResourcePolicy 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.GetResourcePolicy * @see AWS API Documentation */ @Override public CompletableFuture getResourcePolicy(GetResourcePolicyRequest getResourcePolicyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetResourcePolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetResourcePolicy").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetResourcePolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getResourcePolicyRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a scheduled action. *

* * @param getScheduledActionRequest * @return A Java Future containing the result of the GetScheduledAction 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.GetScheduledAction * @see AWS API Documentation */ @Override public CompletableFuture getScheduledAction(GetScheduledActionRequest getScheduledActionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getScheduledActionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getScheduledActionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetScheduledAction"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetScheduledActionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetScheduledAction").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetScheduledActionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getScheduledActionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a specific snapshot. *

* * @param getSnapshotRequest * @return A Java Future containing the result of the GetSnapshot 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.GetSnapshot * @see AWS API Documentation */ @Override public CompletableFuture getSnapshot(GetSnapshotRequest getSnapshotRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getSnapshotRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getSnapshotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetSnapshot"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetSnapshotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetSnapshot").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetSnapshotRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getSnapshotRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a TableRestoreStatus object. *

* * @param getTableRestoreStatusRequest * @return A Java Future containing the result of the GetTableRestoreStatus 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. *
    *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.GetTableRestoreStatus * @see AWS API Documentation */ @Override public CompletableFuture getTableRestoreStatus( GetTableRestoreStatusRequest getTableRestoreStatusRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getTableRestoreStatusRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getTableRestoreStatusRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetTableRestoreStatus"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetTableRestoreStatusResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetTableRestoreStatus").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetTableRestoreStatusRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getTableRestoreStatusRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a usage limit. *

* * @param getUsageLimitRequest * @return A Java Future containing the result of the GetUsageLimit 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.GetUsageLimit * @see AWS API Documentation */ @Override public CompletableFuture getUsageLimit(GetUsageLimitRequest getUsageLimitRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getUsageLimitRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getUsageLimitRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetUsageLimit"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetUsageLimitResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetUsageLimit").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetUsageLimitRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getUsageLimitRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a specific workgroup. *

* * @param getWorkgroupRequest * @return A Java Future containing the result of the GetWorkgroup 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.GetWorkgroup * @see AWS API Documentation */ @Override public CompletableFuture getWorkgroup(GetWorkgroupRequest getWorkgroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(getWorkgroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, getWorkgroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetWorkgroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetWorkgroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetWorkgroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new GetWorkgroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(getWorkgroupRequest)); 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 custom domain associations for Amazon Redshift Serverless. *

* * @param listCustomDomainAssociationsRequest * @return A Java Future containing the result of the ListCustomDomainAssociations 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • InvalidPaginationException The provided pagination token is invalid.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.ListCustomDomainAssociations * @see AWS API Documentation */ @Override public CompletableFuture listCustomDomainAssociations( ListCustomDomainAssociationsRequest listCustomDomainAssociationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listCustomDomainAssociationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listCustomDomainAssociationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListCustomDomainAssociations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListCustomDomainAssociationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListCustomDomainAssociations").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListCustomDomainAssociationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listCustomDomainAssociationsRequest)); 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 an array of EndpointAccess objects and relevant information. *

* * @param listEndpointAccessRequest * @return A Java Future containing the result of the ListEndpointAccess 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.ListEndpointAccess * @see AWS API Documentation */ @Override public CompletableFuture listEndpointAccess(ListEndpointAccessRequest listEndpointAccessRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listEndpointAccessRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listEndpointAccessRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListEndpointAccess"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListEndpointAccessResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListEndpointAccess").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListEndpointAccessRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listEndpointAccessRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a list of specified namespaces. *

* * @param listNamespacesRequest * @return A Java Future containing the result of the ListNamespaces 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.ListNamespaces * @see AWS API Documentation */ @Override public CompletableFuture listNamespaces(ListNamespacesRequest listNamespacesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listNamespacesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listNamespacesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListNamespaces"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListNamespacesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListNamespaces").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListNamespacesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listNamespacesRequest)); 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 an array of recovery points. *

* * @param listRecoveryPointsRequest * @return A Java Future containing the result of the ListRecoveryPoints 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.ListRecoveryPoints * @see AWS API Documentation */ @Override public CompletableFuture listRecoveryPoints(ListRecoveryPointsRequest listRecoveryPointsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listRecoveryPointsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listRecoveryPointsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListRecoveryPoints"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListRecoveryPointsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListRecoveryPoints").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListRecoveryPointsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listRecoveryPointsRequest)); 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 scheduled actions. You can use the flags to filter the list of returned scheduled actions. *

* * @param listScheduledActionsRequest * @return A Java Future containing the result of the ListScheduledActions 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • InvalidPaginationException The provided pagination token is invalid.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.ListScheduledActions * @see AWS API Documentation */ @Override public CompletableFuture listScheduledActions( ListScheduledActionsRequest listScheduledActionsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listScheduledActionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listScheduledActionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListScheduledActions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListScheduledActionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListScheduledActions").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListScheduledActionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listScheduledActionsRequest)); 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 snapshot copy configurations. *

* * @param listSnapshotCopyConfigurationsRequest * @return A Java Future containing the result of the ListSnapshotCopyConfigurations 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • InvalidPaginationException The provided pagination token is invalid.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.ListSnapshotCopyConfigurations * @see AWS API Documentation */ @Override public CompletableFuture listSnapshotCopyConfigurations( ListSnapshotCopyConfigurationsRequest listSnapshotCopyConfigurationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSnapshotCopyConfigurationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSnapshotCopyConfigurationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSnapshotCopyConfigurations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListSnapshotCopyConfigurationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSnapshotCopyConfigurations").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListSnapshotCopyConfigurationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listSnapshotCopyConfigurationsRequest)); 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 snapshots. *

* * @param listSnapshotsRequest * @return A Java Future containing the result of the ListSnapshots 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.ListSnapshots * @see AWS API Documentation */ @Override public CompletableFuture listSnapshots(ListSnapshotsRequest listSnapshotsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listSnapshotsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listSnapshotsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListSnapshots"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ListSnapshotsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListSnapshots").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListSnapshotsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listSnapshotsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about an array of TableRestoreStatus objects. *

* * @param listTableRestoreStatusRequest * @return A Java Future containing the result of the ListTableRestoreStatus 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. *
    *
  • InvalidPaginationException The provided pagination token is invalid.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.ListTableRestoreStatus * @see AWS API Documentation */ @Override public CompletableFuture listTableRestoreStatus( ListTableRestoreStatusRequest listTableRestoreStatusRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listTableRestoreStatusRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listTableRestoreStatusRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTableRestoreStatus"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListTableRestoreStatusResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListTableRestoreStatus").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListTableRestoreStatusRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listTableRestoreStatusRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the tags assigned to a resource. *

* * @param listTagsForResourceRequest * @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. The exception returned is wrapped with CompletionException, so you need to invoke * {@link Throwable#getCause} to retrieve the underlying exception. *
    *
  • InternalServerException The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.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, "Redshift Serverless"); 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); } } /** *

* Lists all usage limits within Amazon Redshift Serverless. *

* * @param listUsageLimitsRequest * @return A Java Future containing the result of the ListUsageLimits 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • InvalidPaginationException The provided pagination token is invalid.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.ListUsageLimits * @see AWS API Documentation */ @Override public CompletableFuture listUsageLimits(ListUsageLimitsRequest listUsageLimitsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listUsageLimitsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listUsageLimitsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListUsageLimits"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListUsageLimitsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListUsageLimits").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListUsageLimitsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listUsageLimitsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Returns information about a list of specified workgroups. *

* * @param listWorkgroupsRequest * @return A Java Future containing the result of the ListWorkgroups 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.ListWorkgroups * @see AWS API Documentation */ @Override public CompletableFuture listWorkgroups(ListWorkgroupsRequest listWorkgroupsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listWorkgroupsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listWorkgroupsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListWorkgroups"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListWorkgroupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListWorkgroups").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListWorkgroupsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listWorkgroupsRequest)); 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 or updates a resource policy. Currently, you can use policies to share snapshots across Amazon Web * Services accounts. *

* * @param putResourcePolicyRequest * @return A Java Future containing the result of the PutResourcePolicy 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • ServiceQuotaExceededException The service limit was exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.PutResourcePolicy * @see AWS API Documentation */ @Override public CompletableFuture putResourcePolicy(PutResourcePolicyRequest putResourcePolicyRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(putResourcePolicyRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, putResourcePolicyRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutResourcePolicy"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, PutResourcePolicyResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("PutResourcePolicy").withProtocolMetadata(protocolMetadata) .withMarshaller(new PutResourcePolicyRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(putResourcePolicyRequest)); 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); } } /** *

* Restore the data from a recovery point. *

* * @param restoreFromRecoveryPointRequest * @return A Java Future containing the result of the RestoreFromRecoveryPoint 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.RestoreFromRecoveryPoint * @see AWS API Documentation */ @Override public CompletableFuture restoreFromRecoveryPoint( RestoreFromRecoveryPointRequest restoreFromRecoveryPointRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(restoreFromRecoveryPointRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, restoreFromRecoveryPointRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RestoreFromRecoveryPoint"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RestoreFromRecoveryPointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RestoreFromRecoveryPoint").withProtocolMetadata(protocolMetadata) .withMarshaller(new RestoreFromRecoveryPointRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(restoreFromRecoveryPointRequest)); 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); } } /** *

* Restores a namespace from a snapshot. *

* * @param restoreFromSnapshotRequest * @return A Java Future containing the result of the RestoreFromSnapshot 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • ServiceQuotaExceededException The service limit was exceeded.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.RestoreFromSnapshot * @see AWS API Documentation */ @Override public CompletableFuture restoreFromSnapshot( RestoreFromSnapshotRequest restoreFromSnapshotRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(restoreFromSnapshotRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, restoreFromSnapshotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RestoreFromSnapshot"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RestoreFromSnapshotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RestoreFromSnapshot").withProtocolMetadata(protocolMetadata) .withMarshaller(new RestoreFromSnapshotRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(restoreFromSnapshotRequest)); 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); } } /** *

* Restores a table from a recovery point to your Amazon Redshift Serverless instance. You can't use this operation * to restore tables with interleaved sort keys. *

* * @param restoreTableFromRecoveryPointRequest * @return A Java Future containing the result of the RestoreTableFromRecoveryPoint 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.RestoreTableFromRecoveryPoint * @see AWS API Documentation */ @Override public CompletableFuture restoreTableFromRecoveryPoint( RestoreTableFromRecoveryPointRequest restoreTableFromRecoveryPointRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(restoreTableFromRecoveryPointRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, restoreTableFromRecoveryPointRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RestoreTableFromRecoveryPoint"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RestoreTableFromRecoveryPointResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RestoreTableFromRecoveryPoint").withProtocolMetadata(protocolMetadata) .withMarshaller(new RestoreTableFromRecoveryPointRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(restoreTableFromRecoveryPointRequest)); 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); } } /** *

* Restores a table from a snapshot to your Amazon Redshift Serverless instance. You can't use this operation to * restore tables with interleaved * sort keys. *

* * @param restoreTableFromSnapshotRequest * @return A Java Future containing the result of the RestoreTableFromSnapshot 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.RestoreTableFromSnapshot * @see AWS API Documentation */ @Override public CompletableFuture restoreTableFromSnapshot( RestoreTableFromSnapshotRequest restoreTableFromSnapshotRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(restoreTableFromSnapshotRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, restoreTableFromSnapshotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "RestoreTableFromSnapshot"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RestoreTableFromSnapshotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RestoreTableFromSnapshot").withProtocolMetadata(protocolMetadata) .withMarshaller(new RestoreTableFromSnapshotRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(restoreTableFromSnapshotRequest)); 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 to a resource. *

* * @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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • TooManyTagsException The request exceeded the number of tags allowed for a resource.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.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, "Redshift Serverless"); 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 a tag or set of tags from a resource. *

* * @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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.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, "Redshift Serverless"); 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 Amazon Redshift Serverless certificate associated with a custom domain. *

* * @param updateCustomDomainAssociationRequest * @return A Java Future containing the result of the UpdateCustomDomainAssociation 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • ThrottlingException The request was denied due to request throttling.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.UpdateCustomDomainAssociation * @see AWS API Documentation */ @Override public CompletableFuture updateCustomDomainAssociation( UpdateCustomDomainAssociationRequest updateCustomDomainAssociationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateCustomDomainAssociationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateCustomDomainAssociationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateCustomDomainAssociation"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateCustomDomainAssociationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateCustomDomainAssociation").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateCustomDomainAssociationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateCustomDomainAssociationRequest)); 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 Amazon Redshift Serverless managed endpoint. *

* * @param updateEndpointAccessRequest * @return A Java Future containing the result of the UpdateEndpointAccess 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.UpdateEndpointAccess * @see AWS API Documentation */ @Override public CompletableFuture updateEndpointAccess( UpdateEndpointAccessRequest updateEndpointAccessRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateEndpointAccessRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateEndpointAccessRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateEndpointAccess"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateEndpointAccessResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateEndpointAccess").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateEndpointAccessRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateEndpointAccessRequest)); 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 namespace with the specified settings. Unless required, you can't update multiple parameters in one * request. For example, you must specify both adminUsername and adminUserPassword to * update either field, but you can't update both kmsKeyId and logExports in a single * request. *

* * @param updateNamespaceRequest * @return A Java Future containing the result of the UpdateNamespace 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.UpdateNamespace * @see AWS API Documentation */ @Override public CompletableFuture updateNamespace(UpdateNamespaceRequest updateNamespaceRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateNamespaceRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateNamespaceRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateNamespace"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateNamespaceResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateNamespace").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateNamespaceRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateNamespaceRequest)); 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 scheduled action. *

* * @param updateScheduledActionRequest * @return A Java Future containing the result of the UpdateScheduledAction 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.UpdateScheduledAction * @see AWS API Documentation */ @Override public CompletableFuture updateScheduledAction( UpdateScheduledActionRequest updateScheduledActionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateScheduledActionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateScheduledActionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateScheduledAction"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateScheduledActionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateScheduledAction").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateScheduledActionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateScheduledActionRequest)); 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 snapshot. *

* * @param updateSnapshotRequest * @return A Java Future containing the result of the UpdateSnapshot 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.UpdateSnapshot * @see AWS API Documentation */ @Override public CompletableFuture updateSnapshot(UpdateSnapshotRequest updateSnapshotRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSnapshotRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSnapshotRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSnapshot"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateSnapshotResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateSnapshot").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateSnapshotRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateSnapshotRequest)); 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 snapshot copy configuration. *

* * @param updateSnapshotCopyConfigurationRequest * @return A Java Future containing the result of the UpdateSnapshotCopyConfiguration 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • AccessDeniedException You do not have sufficient access to perform this action.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.UpdateSnapshotCopyConfiguration * @see AWS API Documentation */ @Override public CompletableFuture updateSnapshotCopyConfiguration( UpdateSnapshotCopyConfigurationRequest updateSnapshotCopyConfigurationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateSnapshotCopyConfigurationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateSnapshotCopyConfigurationRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateSnapshotCopyConfiguration"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateSnapshotCopyConfigurationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateSnapshotCopyConfiguration").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateSnapshotCopyConfigurationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateSnapshotCopyConfigurationRequest)); 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); } } /** *

* Update a usage limit in Amazon Redshift Serverless. You can't update the usage type or period of a usage limit. *

* * @param updateUsageLimitRequest * @return A Java Future containing the result of the UpdateUsageLimit 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.UpdateUsageLimit * @see AWS API Documentation */ @Override public CompletableFuture updateUsageLimit(UpdateUsageLimitRequest updateUsageLimitRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateUsageLimitRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateUsageLimitRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateUsageLimit"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateUsageLimitResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateUsageLimit").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateUsageLimitRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateUsageLimitRequest)); 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 workgroup with the specified configuration settings. You can't update multiple parameters in one * request. For example, you can update baseCapacity or port in a single request, but you * can't update both in the same request. *

* * @param updateWorkgroupRequest * @return A Java Future containing the result of the UpdateWorkgroup 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 The request processing has failed because of an unknown error, exception or * failure.
  • *
  • InsufficientCapacityException There is an insufficient capacity to perform the action.
  • *
  • ResourceNotFoundException The resource could not be found.
  • *
  • ConflictException The submitted action has conflicts.
  • *
  • ValidationException The input failed to satisfy the constraints specified by an AWS service.
  • *
  • Ipv6CidrBlockNotFoundException There are no subnets in your VPC with associated IPv6 CIDR blocks. To * use dual-stack mode, associate an IPv6 CIDR block with each subnet in your VPC.
  • *
  • 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.
  • *
  • RedshiftServerlessException Base class for all service exceptions. Unknown exceptions will be thrown * as an instance of this type.
  • *
* @sample RedshiftServerlessAsyncClient.UpdateWorkgroup * @see AWS API Documentation */ @Override public CompletableFuture updateWorkgroup(UpdateWorkgroupRequest updateWorkgroupRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateWorkgroupRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateWorkgroupRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "Redshift Serverless"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateWorkgroup"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateWorkgroupResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateWorkgroup").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateWorkgroupRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateWorkgroupRequest)); 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 RedshiftServerlessServiceClientConfiguration serviceClientConfiguration() { return new RedshiftServerlessServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public final String serviceName() { return SERVICE_NAME; } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(RedshiftServerlessException::builder) .protocol(AwsJsonProtocol.AWS_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidPaginationException") .exceptionBuilderSupplier(InvalidPaginationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ThrottlingException") .exceptionBuilderSupplier(ThrottlingException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("Ipv6CidrBlockNotFoundException") .exceptionBuilderSupplier(Ipv6CidrBlockNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceQuotaExceededException") .exceptionBuilderSupplier(ServiceQuotaExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InsufficientCapacityException") .exceptionBuilderSupplier(InsufficientCapacityException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InternalServerException") .exceptionBuilderSupplier(InternalServerException::builder).httpStatusCode(500).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("AccessDeniedException") .exceptionBuilderSupplier(AccessDeniedException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictException") .exceptionBuilderSupplier(ConflictException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TooManyTagsException") .exceptionBuilderSupplier(TooManyTagsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ValidationException") .exceptionBuilderSupplier(ValidationException::builder).httpStatusCode(400).build()); } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private 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(); } RedshiftServerlessServiceClientConfigurationBuilder serviceConfigBuilder = new RedshiftServerlessServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } updateRetryStrategyClientConfiguration(configuration); return configuration.build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy