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

software.amazon.awssdk.services.appstream.DefaultAppStreamAsyncClient Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.39
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.appstream;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ScheduledExecutorService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.awscore.internal.AwsProtocolMetadata;
import software.amazon.awssdk.awscore.internal.AwsServiceProtocol;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkPlugin;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.metrics.MetricCollector;
import software.amazon.awssdk.metrics.MetricPublisher;
import software.amazon.awssdk.metrics.NoOpMetricCollector;
import software.amazon.awssdk.protocols.core.ExceptionMetadata;
import software.amazon.awssdk.protocols.json.AwsJsonProtocol;
import software.amazon.awssdk.protocols.json.AwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory;
import software.amazon.awssdk.protocols.json.JsonOperationMetadata;
import software.amazon.awssdk.services.appstream.internal.AppStreamServiceClientConfigurationBuilder;
import software.amazon.awssdk.services.appstream.model.AppStreamException;
import software.amazon.awssdk.services.appstream.model.AssociateAppBlockBuilderAppBlockRequest;
import software.amazon.awssdk.services.appstream.model.AssociateAppBlockBuilderAppBlockResponse;
import software.amazon.awssdk.services.appstream.model.AssociateApplicationFleetRequest;
import software.amazon.awssdk.services.appstream.model.AssociateApplicationFleetResponse;
import software.amazon.awssdk.services.appstream.model.AssociateApplicationToEntitlementRequest;
import software.amazon.awssdk.services.appstream.model.AssociateApplicationToEntitlementResponse;
import software.amazon.awssdk.services.appstream.model.AssociateFleetRequest;
import software.amazon.awssdk.services.appstream.model.AssociateFleetResponse;
import software.amazon.awssdk.services.appstream.model.BatchAssociateUserStackRequest;
import software.amazon.awssdk.services.appstream.model.BatchAssociateUserStackResponse;
import software.amazon.awssdk.services.appstream.model.BatchDisassociateUserStackRequest;
import software.amazon.awssdk.services.appstream.model.BatchDisassociateUserStackResponse;
import software.amazon.awssdk.services.appstream.model.ConcurrentModificationException;
import software.amazon.awssdk.services.appstream.model.CopyImageRequest;
import software.amazon.awssdk.services.appstream.model.CopyImageResponse;
import software.amazon.awssdk.services.appstream.model.CreateAppBlockBuilderRequest;
import software.amazon.awssdk.services.appstream.model.CreateAppBlockBuilderResponse;
import software.amazon.awssdk.services.appstream.model.CreateAppBlockBuilderStreamingUrlRequest;
import software.amazon.awssdk.services.appstream.model.CreateAppBlockBuilderStreamingUrlResponse;
import software.amazon.awssdk.services.appstream.model.CreateAppBlockRequest;
import software.amazon.awssdk.services.appstream.model.CreateAppBlockResponse;
import software.amazon.awssdk.services.appstream.model.CreateApplicationRequest;
import software.amazon.awssdk.services.appstream.model.CreateApplicationResponse;
import software.amazon.awssdk.services.appstream.model.CreateDirectoryConfigRequest;
import software.amazon.awssdk.services.appstream.model.CreateDirectoryConfigResponse;
import software.amazon.awssdk.services.appstream.model.CreateEntitlementRequest;
import software.amazon.awssdk.services.appstream.model.CreateEntitlementResponse;
import software.amazon.awssdk.services.appstream.model.CreateFleetRequest;
import software.amazon.awssdk.services.appstream.model.CreateFleetResponse;
import software.amazon.awssdk.services.appstream.model.CreateImageBuilderRequest;
import software.amazon.awssdk.services.appstream.model.CreateImageBuilderResponse;
import software.amazon.awssdk.services.appstream.model.CreateImageBuilderStreamingUrlRequest;
import software.amazon.awssdk.services.appstream.model.CreateImageBuilderStreamingUrlResponse;
import software.amazon.awssdk.services.appstream.model.CreateStackRequest;
import software.amazon.awssdk.services.appstream.model.CreateStackResponse;
import software.amazon.awssdk.services.appstream.model.CreateStreamingUrlRequest;
import software.amazon.awssdk.services.appstream.model.CreateStreamingUrlResponse;
import software.amazon.awssdk.services.appstream.model.CreateUpdatedImageRequest;
import software.amazon.awssdk.services.appstream.model.CreateUpdatedImageResponse;
import software.amazon.awssdk.services.appstream.model.CreateUsageReportSubscriptionRequest;
import software.amazon.awssdk.services.appstream.model.CreateUsageReportSubscriptionResponse;
import software.amazon.awssdk.services.appstream.model.CreateUserRequest;
import software.amazon.awssdk.services.appstream.model.CreateUserResponse;
import software.amazon.awssdk.services.appstream.model.DeleteAppBlockBuilderRequest;
import software.amazon.awssdk.services.appstream.model.DeleteAppBlockBuilderResponse;
import software.amazon.awssdk.services.appstream.model.DeleteAppBlockRequest;
import software.amazon.awssdk.services.appstream.model.DeleteAppBlockResponse;
import software.amazon.awssdk.services.appstream.model.DeleteApplicationRequest;
import software.amazon.awssdk.services.appstream.model.DeleteApplicationResponse;
import software.amazon.awssdk.services.appstream.model.DeleteDirectoryConfigRequest;
import software.amazon.awssdk.services.appstream.model.DeleteDirectoryConfigResponse;
import software.amazon.awssdk.services.appstream.model.DeleteEntitlementRequest;
import software.amazon.awssdk.services.appstream.model.DeleteEntitlementResponse;
import software.amazon.awssdk.services.appstream.model.DeleteFleetRequest;
import software.amazon.awssdk.services.appstream.model.DeleteFleetResponse;
import software.amazon.awssdk.services.appstream.model.DeleteImageBuilderRequest;
import software.amazon.awssdk.services.appstream.model.DeleteImageBuilderResponse;
import software.amazon.awssdk.services.appstream.model.DeleteImagePermissionsRequest;
import software.amazon.awssdk.services.appstream.model.DeleteImagePermissionsResponse;
import software.amazon.awssdk.services.appstream.model.DeleteImageRequest;
import software.amazon.awssdk.services.appstream.model.DeleteImageResponse;
import software.amazon.awssdk.services.appstream.model.DeleteStackRequest;
import software.amazon.awssdk.services.appstream.model.DeleteStackResponse;
import software.amazon.awssdk.services.appstream.model.DeleteUsageReportSubscriptionRequest;
import software.amazon.awssdk.services.appstream.model.DeleteUsageReportSubscriptionResponse;
import software.amazon.awssdk.services.appstream.model.DeleteUserRequest;
import software.amazon.awssdk.services.appstream.model.DeleteUserResponse;
import software.amazon.awssdk.services.appstream.model.DescribeAppBlockBuilderAppBlockAssociationsRequest;
import software.amazon.awssdk.services.appstream.model.DescribeAppBlockBuilderAppBlockAssociationsResponse;
import software.amazon.awssdk.services.appstream.model.DescribeAppBlockBuildersRequest;
import software.amazon.awssdk.services.appstream.model.DescribeAppBlockBuildersResponse;
import software.amazon.awssdk.services.appstream.model.DescribeAppBlocksRequest;
import software.amazon.awssdk.services.appstream.model.DescribeAppBlocksResponse;
import software.amazon.awssdk.services.appstream.model.DescribeApplicationFleetAssociationsRequest;
import software.amazon.awssdk.services.appstream.model.DescribeApplicationFleetAssociationsResponse;
import software.amazon.awssdk.services.appstream.model.DescribeApplicationsRequest;
import software.amazon.awssdk.services.appstream.model.DescribeApplicationsResponse;
import software.amazon.awssdk.services.appstream.model.DescribeDirectoryConfigsRequest;
import software.amazon.awssdk.services.appstream.model.DescribeDirectoryConfigsResponse;
import software.amazon.awssdk.services.appstream.model.DescribeEntitlementsRequest;
import software.amazon.awssdk.services.appstream.model.DescribeEntitlementsResponse;
import software.amazon.awssdk.services.appstream.model.DescribeFleetsRequest;
import software.amazon.awssdk.services.appstream.model.DescribeFleetsResponse;
import software.amazon.awssdk.services.appstream.model.DescribeImageBuildersRequest;
import software.amazon.awssdk.services.appstream.model.DescribeImageBuildersResponse;
import software.amazon.awssdk.services.appstream.model.DescribeImagePermissionsRequest;
import software.amazon.awssdk.services.appstream.model.DescribeImagePermissionsResponse;
import software.amazon.awssdk.services.appstream.model.DescribeImagesRequest;
import software.amazon.awssdk.services.appstream.model.DescribeImagesResponse;
import software.amazon.awssdk.services.appstream.model.DescribeSessionsRequest;
import software.amazon.awssdk.services.appstream.model.DescribeSessionsResponse;
import software.amazon.awssdk.services.appstream.model.DescribeStacksRequest;
import software.amazon.awssdk.services.appstream.model.DescribeStacksResponse;
import software.amazon.awssdk.services.appstream.model.DescribeUsageReportSubscriptionsRequest;
import software.amazon.awssdk.services.appstream.model.DescribeUsageReportSubscriptionsResponse;
import software.amazon.awssdk.services.appstream.model.DescribeUserStackAssociationsRequest;
import software.amazon.awssdk.services.appstream.model.DescribeUserStackAssociationsResponse;
import software.amazon.awssdk.services.appstream.model.DescribeUsersRequest;
import software.amazon.awssdk.services.appstream.model.DescribeUsersResponse;
import software.amazon.awssdk.services.appstream.model.DisableUserRequest;
import software.amazon.awssdk.services.appstream.model.DisableUserResponse;
import software.amazon.awssdk.services.appstream.model.DisassociateAppBlockBuilderAppBlockRequest;
import software.amazon.awssdk.services.appstream.model.DisassociateAppBlockBuilderAppBlockResponse;
import software.amazon.awssdk.services.appstream.model.DisassociateApplicationFleetRequest;
import software.amazon.awssdk.services.appstream.model.DisassociateApplicationFleetResponse;
import software.amazon.awssdk.services.appstream.model.DisassociateApplicationFromEntitlementRequest;
import software.amazon.awssdk.services.appstream.model.DisassociateApplicationFromEntitlementResponse;
import software.amazon.awssdk.services.appstream.model.DisassociateFleetRequest;
import software.amazon.awssdk.services.appstream.model.DisassociateFleetResponse;
import software.amazon.awssdk.services.appstream.model.EnableUserRequest;
import software.amazon.awssdk.services.appstream.model.EnableUserResponse;
import software.amazon.awssdk.services.appstream.model.EntitlementAlreadyExistsException;
import software.amazon.awssdk.services.appstream.model.EntitlementNotFoundException;
import software.amazon.awssdk.services.appstream.model.ExpireSessionRequest;
import software.amazon.awssdk.services.appstream.model.ExpireSessionResponse;
import software.amazon.awssdk.services.appstream.model.IncompatibleImageException;
import software.amazon.awssdk.services.appstream.model.InvalidAccountStatusException;
import software.amazon.awssdk.services.appstream.model.InvalidParameterCombinationException;
import software.amazon.awssdk.services.appstream.model.InvalidRoleException;
import software.amazon.awssdk.services.appstream.model.LimitExceededException;
import software.amazon.awssdk.services.appstream.model.ListAssociatedFleetsRequest;
import software.amazon.awssdk.services.appstream.model.ListAssociatedFleetsResponse;
import software.amazon.awssdk.services.appstream.model.ListAssociatedStacksRequest;
import software.amazon.awssdk.services.appstream.model.ListAssociatedStacksResponse;
import software.amazon.awssdk.services.appstream.model.ListEntitledApplicationsRequest;
import software.amazon.awssdk.services.appstream.model.ListEntitledApplicationsResponse;
import software.amazon.awssdk.services.appstream.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.appstream.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.appstream.model.OperationNotPermittedException;
import software.amazon.awssdk.services.appstream.model.RequestLimitExceededException;
import software.amazon.awssdk.services.appstream.model.ResourceAlreadyExistsException;
import software.amazon.awssdk.services.appstream.model.ResourceInUseException;
import software.amazon.awssdk.services.appstream.model.ResourceNotAvailableException;
import software.amazon.awssdk.services.appstream.model.ResourceNotFoundException;
import software.amazon.awssdk.services.appstream.model.StartAppBlockBuilderRequest;
import software.amazon.awssdk.services.appstream.model.StartAppBlockBuilderResponse;
import software.amazon.awssdk.services.appstream.model.StartFleetRequest;
import software.amazon.awssdk.services.appstream.model.StartFleetResponse;
import software.amazon.awssdk.services.appstream.model.StartImageBuilderRequest;
import software.amazon.awssdk.services.appstream.model.StartImageBuilderResponse;
import software.amazon.awssdk.services.appstream.model.StopAppBlockBuilderRequest;
import software.amazon.awssdk.services.appstream.model.StopAppBlockBuilderResponse;
import software.amazon.awssdk.services.appstream.model.StopFleetRequest;
import software.amazon.awssdk.services.appstream.model.StopFleetResponse;
import software.amazon.awssdk.services.appstream.model.StopImageBuilderRequest;
import software.amazon.awssdk.services.appstream.model.StopImageBuilderResponse;
import software.amazon.awssdk.services.appstream.model.TagResourceRequest;
import software.amazon.awssdk.services.appstream.model.TagResourceResponse;
import software.amazon.awssdk.services.appstream.model.UntagResourceRequest;
import software.amazon.awssdk.services.appstream.model.UntagResourceResponse;
import software.amazon.awssdk.services.appstream.model.UpdateAppBlockBuilderRequest;
import software.amazon.awssdk.services.appstream.model.UpdateAppBlockBuilderResponse;
import software.amazon.awssdk.services.appstream.model.UpdateApplicationRequest;
import software.amazon.awssdk.services.appstream.model.UpdateApplicationResponse;
import software.amazon.awssdk.services.appstream.model.UpdateDirectoryConfigRequest;
import software.amazon.awssdk.services.appstream.model.UpdateDirectoryConfigResponse;
import software.amazon.awssdk.services.appstream.model.UpdateEntitlementRequest;
import software.amazon.awssdk.services.appstream.model.UpdateEntitlementResponse;
import software.amazon.awssdk.services.appstream.model.UpdateFleetRequest;
import software.amazon.awssdk.services.appstream.model.UpdateFleetResponse;
import software.amazon.awssdk.services.appstream.model.UpdateImagePermissionsRequest;
import software.amazon.awssdk.services.appstream.model.UpdateImagePermissionsResponse;
import software.amazon.awssdk.services.appstream.model.UpdateStackRequest;
import software.amazon.awssdk.services.appstream.model.UpdateStackResponse;
import software.amazon.awssdk.services.appstream.transform.AssociateAppBlockBuilderAppBlockRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.AssociateApplicationFleetRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.AssociateApplicationToEntitlementRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.AssociateFleetRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.BatchAssociateUserStackRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.BatchDisassociateUserStackRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CopyImageRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateAppBlockBuilderRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateAppBlockBuilderStreamingUrlRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateAppBlockRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateApplicationRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateDirectoryConfigRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateEntitlementRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateFleetRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateImageBuilderRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateImageBuilderStreamingUrlRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateStackRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateStreamingUrlRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateUpdatedImageRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateUsageReportSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateUserRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteAppBlockBuilderRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteAppBlockRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteApplicationRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteDirectoryConfigRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteEntitlementRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteFleetRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteImageBuilderRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteImagePermissionsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteImageRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteStackRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteUsageReportSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteUserRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeAppBlockBuilderAppBlockAssociationsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeAppBlockBuildersRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeAppBlocksRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeApplicationFleetAssociationsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeApplicationsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeDirectoryConfigsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeEntitlementsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeFleetsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeImageBuildersRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeImagePermissionsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeImagesRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeSessionsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeStacksRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeUsageReportSubscriptionsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeUserStackAssociationsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DescribeUsersRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DisableUserRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DisassociateAppBlockBuilderAppBlockRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DisassociateApplicationFleetRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DisassociateApplicationFromEntitlementRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DisassociateFleetRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.EnableUserRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.ExpireSessionRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.ListAssociatedFleetsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.ListAssociatedStacksRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.ListEntitledApplicationsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.StartAppBlockBuilderRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.StartFleetRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.StartImageBuilderRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.StopAppBlockBuilderRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.StopFleetRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.StopImageBuilderRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.UpdateAppBlockBuilderRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.UpdateApplicationRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.UpdateDirectoryConfigRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.UpdateEntitlementRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.UpdateFleetRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.UpdateImagePermissionsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.UpdateStackRequestMarshaller;
import software.amazon.awssdk.services.appstream.waiters.AppStreamAsyncWaiter;
import software.amazon.awssdk.utils.CompletableFutureUtils;

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

    private final ScheduledExecutorService executorService;

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

    /**
     * 

* Associates the specified app block builder with the specified app block. *

* * @param associateAppBlockBuilderAppBlockRequest * @return A Java Future containing the result of the AssociateAppBlockBuilderAppBlock operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.AssociateAppBlockBuilderAppBlock * @see AWS API Documentation */ @Override public CompletableFuture associateAppBlockBuilderAppBlock( AssociateAppBlockBuilderAppBlockRequest associateAppBlockBuilderAppBlockRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateAppBlockBuilderAppBlockRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateAppBlockBuilderAppBlockRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateAppBlockBuilderAppBlock"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, AssociateAppBlockBuilderAppBlockResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateAppBlockBuilderAppBlock").withProtocolMetadata(protocolMetadata) .withMarshaller(new AssociateAppBlockBuilderAppBlockRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(associateAppBlockBuilderAppBlockRequest)); 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); } } /** *

* Associates the specified application with the specified fleet. This is only supported for Elastic fleets. *

* * @param associateApplicationFleetRequest * @return A Java Future containing the result of the AssociateApplicationFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.AssociateApplicationFleet * @see AWS API Documentation */ @Override public CompletableFuture associateApplicationFleet( AssociateApplicationFleetRequest associateApplicationFleetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateApplicationFleetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateApplicationFleetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateApplicationFleet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateApplicationFleetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateApplicationFleet").withProtocolMetadata(protocolMetadata) .withMarshaller(new AssociateApplicationFleetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(associateApplicationFleetRequest)); 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); } } /** *

* Associates an application to entitle. *

* * @param associateApplicationToEntitlementRequest * @return A Java Future containing the result of the AssociateApplicationToEntitlement operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • EntitlementNotFoundException The entitlement can't be found.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.AssociateApplicationToEntitlement * @see AWS API Documentation */ @Override public CompletableFuture associateApplicationToEntitlement( AssociateApplicationToEntitlementRequest associateApplicationToEntitlementRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateApplicationToEntitlementRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateApplicationToEntitlementRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateApplicationToEntitlement"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, AssociateApplicationToEntitlementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateApplicationToEntitlement").withProtocolMetadata(protocolMetadata) .withMarshaller(new AssociateApplicationToEntitlementRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(associateApplicationToEntitlementRequest)); 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); } } /** *

* Associates the specified fleet with the specified stack. *

* * @param associateFleetRequest * @return A Java Future containing the result of the AssociateFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • IncompatibleImageException The image can't be updated because it's not compatible for updates.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.AssociateFleet * @see AWS API * Documentation */ @Override public CompletableFuture associateFleet(AssociateFleetRequest associateFleetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(associateFleetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, associateFleetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AssociateFleet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AssociateFleetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AssociateFleet").withProtocolMetadata(protocolMetadata) .withMarshaller(new AssociateFleetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(associateFleetRequest)); 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); } } /** *

* Associates the specified users with the specified stacks. Users in a user pool cannot be assigned to stacks with * fleets that are joined to an Active Directory domain. *

* * @param batchAssociateUserStackRequest * @return A Java Future containing the result of the BatchAssociateUserStack operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.BatchAssociateUserStack * @see AWS API Documentation */ @Override public CompletableFuture batchAssociateUserStack( BatchAssociateUserStackRequest batchAssociateUserStackRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchAssociateUserStackRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchAssociateUserStackRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchAssociateUserStack"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, BatchAssociateUserStackResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("BatchAssociateUserStack").withProtocolMetadata(protocolMetadata) .withMarshaller(new BatchAssociateUserStackRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(batchAssociateUserStackRequest)); 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); } } /** *

* Disassociates the specified users from the specified stacks. *

* * @param batchDisassociateUserStackRequest * @return A Java Future containing the result of the BatchDisassociateUserStack operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.BatchDisassociateUserStack * @see AWS API Documentation */ @Override public CompletableFuture batchDisassociateUserStack( BatchDisassociateUserStackRequest batchDisassociateUserStackRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(batchDisassociateUserStackRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, batchDisassociateUserStackRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "BatchDisassociateUserStack"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, BatchDisassociateUserStackResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("BatchDisassociateUserStack").withProtocolMetadata(protocolMetadata) .withMarshaller(new BatchDisassociateUserStackRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(batchDisassociateUserStackRequest)); 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); } } /** *

* Copies the image within the same region or to a new region within the same AWS account. Note that any tags you * added to the image will not be copied. *

* * @param copyImageRequest * @return A Java Future containing the result of the CopyImage operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • IncompatibleImageException The image can't be updated because it's not compatible for updates.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CopyImage * @see AWS API * Documentation */ @Override public CompletableFuture copyImage(CopyImageRequest copyImageRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(copyImageRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, copyImageRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CopyImage"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CopyImageResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CopyImage") .withProtocolMetadata(protocolMetadata) .withMarshaller(new CopyImageRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(copyImageRequest)); 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 app block. *

*

* App blocks are an Amazon AppStream 2.0 resource that stores the details about the virtual hard disk in an S3 * bucket. It also stores the setup script with details about how to mount the virtual hard disk. The virtual hard * disk includes the application binaries and other files necessary to launch your applications. Multiple * applications can be assigned to a single app block. *

*

* This is only supported for Elastic fleets. *

* * @param createAppBlockRequest * @return A Java Future containing the result of the CreateAppBlock operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateAppBlock * @see AWS API * Documentation */ @Override public CompletableFuture createAppBlock(CreateAppBlockRequest createAppBlockRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAppBlockRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createAppBlockRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAppBlock"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateAppBlockResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateAppBlock").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateAppBlockRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createAppBlockRequest)); 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 app block builder. *

* * @param createAppBlockBuilderRequest * @return A Java Future containing the result of the CreateAppBlockBuilder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • RequestLimitExceededException AppStream 2.0 can’t process the request right now because the Describe * calls from your AWS account are being throttled by Amazon EC2. Try again later.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • InvalidRoleException The specified role is invalid.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateAppBlockBuilder * @see AWS API Documentation */ @Override public CompletableFuture createAppBlockBuilder( CreateAppBlockBuilderRequest createAppBlockBuilderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAppBlockBuilderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createAppBlockBuilderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAppBlockBuilder"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateAppBlockBuilderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateAppBlockBuilder").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateAppBlockBuilderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createAppBlockBuilderRequest)); 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 URL to start a create app block builder streaming session. *

* * @param createAppBlockBuilderStreamingUrlRequest * @return A Java Future containing the result of the CreateAppBlockBuilderStreamingURL operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateAppBlockBuilderStreamingURL * @see AWS API Documentation */ @Override public CompletableFuture createAppBlockBuilderStreamingURL( CreateAppBlockBuilderStreamingUrlRequest createAppBlockBuilderStreamingUrlRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createAppBlockBuilderStreamingUrlRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createAppBlockBuilderStreamingUrlRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateAppBlockBuilderStreamingURL"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, CreateAppBlockBuilderStreamingUrlResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateAppBlockBuilderStreamingURL").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateAppBlockBuilderStreamingUrlRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createAppBlockBuilderStreamingUrlRequest)); 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 application. *

*

* Applications are an Amazon AppStream 2.0 resource that stores the details about how to launch applications on * Elastic fleet streaming instances. An application consists of the launch details, icon, and display name. * Applications are associated with an app block that contains the application binaries and other files. The * applications assigned to an Elastic fleet are the applications users can launch. *

*

* This is only supported for Elastic fleets. *

* * @param createApplicationRequest * @return A Java Future containing the result of the CreateApplication operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateApplication * @see AWS * API Documentation */ @Override public CompletableFuture createApplication(CreateApplicationRequest createApplicationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createApplicationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createApplicationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateApplication"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateApplicationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateApplication").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateApplicationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createApplicationRequest)); 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 Directory Config object in AppStream 2.0. This object includes the configuration information required * to join fleets and image builders to Microsoft Active Directory domains. *

* * @param createDirectoryConfigRequest * @return A Java Future containing the result of the CreateDirectoryConfig operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • InvalidRoleException The specified role is invalid.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateDirectoryConfig * @see AWS API Documentation */ @Override public CompletableFuture createDirectoryConfig( CreateDirectoryConfigRequest createDirectoryConfigRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createDirectoryConfigRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createDirectoryConfigRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateDirectoryConfig"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateDirectoryConfigResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateDirectoryConfig").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateDirectoryConfigRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createDirectoryConfigRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new entitlement. Entitlements control access to specific applications within a stack, based on user * attributes. Entitlements apply to SAML 2.0 federated user identities. Amazon AppStream 2.0 user pool and * streaming URL users are entitled to all applications in a stack. Entitlements don't apply to the desktop stream * view application, or to applications managed by a dynamic app provider using the Dynamic Application Framework. *

* * @param createEntitlementRequest * @return A Java Future containing the result of the CreateEntitlement operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • EntitlementAlreadyExistsException The entitlement already exists.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateEntitlement * @see AWS * API Documentation */ @Override public CompletableFuture createEntitlement(CreateEntitlementRequest createEntitlementRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createEntitlementRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createEntitlementRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateEntitlement"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateEntitlementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateEntitlement").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateEntitlementRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createEntitlementRequest)); 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 fleet. A fleet consists of streaming instances that your users access for their applications and * desktops. *

* * @param createFleetRequest * @return A Java Future containing the result of the CreateFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • RequestLimitExceededException AppStream 2.0 can’t process the request right now because the Describe * calls from your AWS account are being throttled by Amazon EC2. Try again later.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • InvalidRoleException The specified role is invalid.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • IncompatibleImageException The image can't be updated because it's not compatible for updates.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateFleet * @see AWS API * Documentation */ @Override public CompletableFuture createFleet(CreateFleetRequest createFleetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createFleetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createFleetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateFleet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateFleetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateFleet").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateFleetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createFleetRequest)); 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 image builder. An image builder is a virtual machine that is used to create an image. *

*

* The initial state of the builder is PENDING. When it is ready, the state is RUNNING. *

* * @param createImageBuilderRequest * @return A Java Future containing the result of the CreateImageBuilder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • RequestLimitExceededException AppStream 2.0 can’t process the request right now because the Describe * calls from your AWS account are being throttled by Amazon EC2. Try again later.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • InvalidRoleException The specified role is invalid.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • IncompatibleImageException The image can't be updated because it's not compatible for updates.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateImageBuilder * @see AWS * API Documentation */ @Override public CompletableFuture createImageBuilder(CreateImageBuilderRequest createImageBuilderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createImageBuilderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createImageBuilderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateImageBuilder"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateImageBuilderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateImageBuilder").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateImageBuilderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createImageBuilderRequest)); 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 URL to start an image builder streaming session. *

* * @param createImageBuilderStreamingUrlRequest * @return A Java Future containing the result of the CreateImageBuilderStreamingURL operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateImageBuilderStreamingURL * @see AWS API Documentation */ @Override public CompletableFuture createImageBuilderStreamingURL( CreateImageBuilderStreamingUrlRequest createImageBuilderStreamingUrlRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createImageBuilderStreamingUrlRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createImageBuilderStreamingUrlRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateImageBuilderStreamingURL"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateImageBuilderStreamingUrlResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateImageBuilderStreamingURL").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateImageBuilderStreamingUrlRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createImageBuilderStreamingUrlRequest)); 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 stack to start streaming applications to users. A stack consists of an associated fleet, user access * policies, and storage configurations. *

* * @param createStackRequest * @return A Java Future containing the result of the CreateStack operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • InvalidRoleException The specified role is invalid.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateStack * @see AWS API * Documentation */ @Override public CompletableFuture createStack(CreateStackRequest createStackRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createStackRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createStackRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateStack"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateStackResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateStack").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateStackRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createStackRequest)); 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 temporary URL to start an AppStream 2.0 streaming session for the specified user. A streaming URL * enables application streaming to be tested without user setup. *

* * @param createStreamingUrlRequest * @return A Java Future containing the result of the CreateStreamingURL operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateStreamingURL * @see AWS * API Documentation */ @Override public CompletableFuture createStreamingURL(CreateStreamingUrlRequest createStreamingUrlRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createStreamingUrlRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createStreamingUrlRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateStreamingURL"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateStreamingUrlResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateStreamingURL").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateStreamingUrlRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createStreamingUrlRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new image with the latest Windows operating system updates, driver updates, and AppStream 2.0 agent * software. *

*

* For more information, see the "Update an Image by Using Managed AppStream 2.0 Image Updates" section in Administer Your * AppStream 2.0 Images, in the Amazon AppStream 2.0 Administration Guide. *

* * @param createUpdatedImageRequest * @return A Java Future containing the result of the CreateUpdatedImage operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • IncompatibleImageException The image can't be updated because it's not compatible for updates.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateUpdatedImage * @see AWS * API Documentation */ @Override public CompletableFuture createUpdatedImage(CreateUpdatedImageRequest createUpdatedImageRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createUpdatedImageRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createUpdatedImageRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateUpdatedImage"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateUpdatedImageResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateUpdatedImage").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateUpdatedImageRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createUpdatedImageRequest)); 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 report subscription. Usage reports are generated daily. *

* * @param createUsageReportSubscriptionRequest * @return A Java Future containing the result of the CreateUsageReportSubscription operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidRoleException The specified role is invalid.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateUsageReportSubscription * @see AWS API Documentation */ @Override public CompletableFuture createUsageReportSubscription( CreateUsageReportSubscriptionRequest createUsageReportSubscriptionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createUsageReportSubscriptionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createUsageReportSubscriptionRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateUsageReportSubscription"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateUsageReportSubscriptionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateUsageReportSubscription").withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateUsageReportSubscriptionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createUsageReportSubscriptionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new user in the user pool. *

* * @param createUserRequest * @return A Java Future containing the result of the CreateUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceAlreadyExistsException The specified resource already exists.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.CreateUser * @see AWS API * Documentation */ @Override public CompletableFuture createUser(CreateUserRequest createUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(createUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, createUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CreateUser") .withProtocolMetadata(protocolMetadata) .withMarshaller(new CreateUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(createUserRequest)); 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 app block. *

* * @param deleteAppBlockRequest * @return A Java Future containing the result of the DeleteAppBlock operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteAppBlock * @see AWS API * Documentation */ @Override public CompletableFuture deleteAppBlock(DeleteAppBlockRequest deleteAppBlockRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAppBlockRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAppBlockRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAppBlock"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAppBlockResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAppBlock").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteAppBlockRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteAppBlockRequest)); 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 app block builder. *

*

* An app block builder can only be deleted when it has no association with an app block. *

* * @param deleteAppBlockBuilderRequest * @return A Java Future containing the result of the DeleteAppBlockBuilder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteAppBlockBuilder * @see AWS API Documentation */ @Override public CompletableFuture deleteAppBlockBuilder( DeleteAppBlockBuilderRequest deleteAppBlockBuilderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteAppBlockBuilderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteAppBlockBuilderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteAppBlockBuilder"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteAppBlockBuilderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteAppBlockBuilder").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteAppBlockBuilderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteAppBlockBuilderRequest)); 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 application. *

* * @param deleteApplicationRequest * @return A Java Future containing the result of the DeleteApplication operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteApplication * @see AWS * API Documentation */ @Override public CompletableFuture deleteApplication(DeleteApplicationRequest deleteApplicationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteApplicationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteApplicationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteApplication"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteApplicationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteApplication").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteApplicationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteApplicationRequest)); 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 Directory Config object from AppStream 2.0. This object includes the information required * to join streaming instances to an Active Directory domain. *

* * @param deleteDirectoryConfigRequest * @return A Java Future containing the result of the DeleteDirectoryConfig operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceInUseException The specified resource is in use.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteDirectoryConfig * @see AWS API Documentation */ @Override public CompletableFuture deleteDirectoryConfig( DeleteDirectoryConfigRequest deleteDirectoryConfigRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteDirectoryConfigRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteDirectoryConfigRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteDirectoryConfig"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteDirectoryConfigResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDirectoryConfig").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteDirectoryConfigRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteDirectoryConfigRequest)); 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 entitlement. *

* * @param deleteEntitlementRequest * @return A Java Future containing the result of the DeleteEntitlement operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • EntitlementNotFoundException The entitlement can't be found.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteEntitlement * @see AWS * API Documentation */ @Override public CompletableFuture deleteEntitlement(DeleteEntitlementRequest deleteEntitlementRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteEntitlementRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteEntitlementRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteEntitlement"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteEntitlementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteEntitlement").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteEntitlementRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteEntitlementRequest)); 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 fleet. *

* * @param deleteFleetRequest * @return A Java Future containing the result of the DeleteFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceInUseException The specified resource is in use.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteFleet * @see AWS API * Documentation */ @Override public CompletableFuture deleteFleet(DeleteFleetRequest deleteFleetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteFleetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteFleetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteFleet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteFleetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteFleet").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteFleetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteFleetRequest)); 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 image. You cannot delete an image when it is in use. After you delete an image, you cannot * provision new capacity using the image. *

* * @param deleteImageRequest * @return A Java Future containing the result of the DeleteImage operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceInUseException The specified resource is in use.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteImage * @see AWS API * Documentation */ @Override public CompletableFuture deleteImage(DeleteImageRequest deleteImageRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteImageRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteImageRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteImage"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteImageResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteImage").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteImageRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteImageRequest)); 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 image builder and releases the capacity. *

* * @param deleteImageBuilderRequest * @return A Java Future containing the result of the DeleteImageBuilder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteImageBuilder * @see AWS * API Documentation */ @Override public CompletableFuture deleteImageBuilder(DeleteImageBuilderRequest deleteImageBuilderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteImageBuilderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteImageBuilderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteImageBuilder"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteImageBuilderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteImageBuilder").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteImageBuilderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteImageBuilderRequest)); 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 permissions for the specified private image. After you delete permissions for an image, AWS accounts to * which you previously granted these permissions can no longer use the image. *

* * @param deleteImagePermissionsRequest * @return A Java Future containing the result of the DeleteImagePermissions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteImagePermissions * @see AWS API Documentation */ @Override public CompletableFuture deleteImagePermissions( DeleteImagePermissionsRequest deleteImagePermissionsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteImagePermissionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteImagePermissionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteImagePermissions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteImagePermissionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteImagePermissions").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteImagePermissionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteImagePermissionsRequest)); 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 stack. After the stack is deleted, the application streaming environment provided by the * stack is no longer available to users. Also, any reservations made for application streaming sessions for the * stack are released. *

* * @param deleteStackRequest * @return A Java Future containing the result of the DeleteStack operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceInUseException The specified resource is in use.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteStack * @see AWS API * Documentation */ @Override public CompletableFuture deleteStack(DeleteStackRequest deleteStackRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteStackRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteStackRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteStack"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteStackResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteStack").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteStackRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteStackRequest)); 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); } } /** *

* Disables usage report generation. *

* * @param deleteUsageReportSubscriptionRequest * @return A Java Future containing the result of the DeleteUsageReportSubscription operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteUsageReportSubscription * @see AWS API Documentation */ @Override public CompletableFuture deleteUsageReportSubscription( DeleteUsageReportSubscriptionRequest deleteUsageReportSubscriptionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteUsageReportSubscriptionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteUsageReportSubscriptionRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteUsageReportSubscription"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteUsageReportSubscriptionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteUsageReportSubscription").withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteUsageReportSubscriptionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteUsageReportSubscriptionRequest)); 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 user from the user pool. *

* * @param deleteUserRequest * @return A Java Future containing the result of the DeleteUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DeleteUser * @see AWS API * Documentation */ @Override public CompletableFuture deleteUser(DeleteUserRequest deleteUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(deleteUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("DeleteUser") .withProtocolMetadata(protocolMetadata) .withMarshaller(new DeleteUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(deleteUserRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more app block builder associations. *

* * @param describeAppBlockBuilderAppBlockAssociationsRequest * @return A Java Future containing the result of the DescribeAppBlockBuilderAppBlockAssociations operation returned * by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeAppBlockBuilderAppBlockAssociations * @see AWS API Documentation */ @Override public CompletableFuture describeAppBlockBuilderAppBlockAssociations( DescribeAppBlockBuilderAppBlockAssociationsRequest describeAppBlockBuilderAppBlockAssociationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration( describeAppBlockBuilderAppBlockAssociationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAppBlockBuilderAppBlockAssociationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAppBlockBuilderAppBlockAssociations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeAppBlockBuilderAppBlockAssociationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAppBlockBuilderAppBlockAssociations") .withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeAppBlockBuilderAppBlockAssociationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeAppBlockBuilderAppBlockAssociationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more app block builders. *

* * @param describeAppBlockBuildersRequest * @return A Java Future containing the result of the DescribeAppBlockBuilders operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeAppBlockBuilders * @see AWS API Documentation */ @Override public CompletableFuture describeAppBlockBuilders( DescribeAppBlockBuildersRequest describeAppBlockBuildersRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAppBlockBuildersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAppBlockBuildersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAppBlockBuilders"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAppBlockBuildersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAppBlockBuilders").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeAppBlockBuildersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeAppBlockBuildersRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more app blocks. *

* * @param describeAppBlocksRequest * @return A Java Future containing the result of the DescribeAppBlocks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeAppBlocks * @see AWS * API Documentation */ @Override public CompletableFuture describeAppBlocks(DescribeAppBlocksRequest describeAppBlocksRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeAppBlocksRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeAppBlocksRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeAppBlocks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeAppBlocksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeAppBlocks").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeAppBlocksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeAppBlocksRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more application fleet associations. Either ApplicationArn or FleetName * must be specified. *

* * @param describeApplicationFleetAssociationsRequest * @return A Java Future containing the result of the DescribeApplicationFleetAssociations operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeApplicationFleetAssociations * @see AWS API Documentation */ @Override public CompletableFuture describeApplicationFleetAssociations( DescribeApplicationFleetAssociationsRequest describeApplicationFleetAssociationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeApplicationFleetAssociationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeApplicationFleetAssociationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeApplicationFleetAssociations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeApplicationFleetAssociationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeApplicationFleetAssociations").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeApplicationFleetAssociationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeApplicationFleetAssociationsRequest)); CompletableFuture whenCompleted = executeFuture .whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more applications. *

* * @param describeApplicationsRequest * @return A Java Future containing the result of the DescribeApplications operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeApplications * @see AWS API Documentation */ @Override public CompletableFuture describeApplications( DescribeApplicationsRequest describeApplicationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeApplicationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeApplicationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeApplications"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeApplicationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeApplications").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeApplicationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeApplicationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more specified Directory Config objects for AppStream 2.0, if the names * for these objects are provided. Otherwise, all Directory Config objects in the account are described. These * objects include the configuration information required to join fleets and image builders to Microsoft Active * Directory domains. *

*

* Although the response syntax in this topic includes the account password, this password is not returned in the * actual response. *

* * @param describeDirectoryConfigsRequest * @return A Java Future containing the result of the DescribeDirectoryConfigs operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeDirectoryConfigs * @see AWS API Documentation */ @Override public CompletableFuture describeDirectoryConfigs( DescribeDirectoryConfigsRequest describeDirectoryConfigsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeDirectoryConfigsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeDirectoryConfigsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeDirectoryConfigs"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDirectoryConfigsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDirectoryConfigs").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeDirectoryConfigsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeDirectoryConfigsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one of more entitlements. *

* * @param describeEntitlementsRequest * @return A Java Future containing the result of the DescribeEntitlements operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • EntitlementNotFoundException The entitlement can't be found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeEntitlements * @see AWS API Documentation */ @Override public CompletableFuture describeEntitlements( DescribeEntitlementsRequest describeEntitlementsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeEntitlementsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeEntitlementsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeEntitlements"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeEntitlementsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeEntitlements").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeEntitlementsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeEntitlementsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more specified fleets, if the fleet names are provided. Otherwise, all * fleets in the account are described. *

* * @param describeFleetsRequest * @return A Java Future containing the result of the DescribeFleets operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeFleets * @see AWS API * Documentation */ @Override public CompletableFuture describeFleets(DescribeFleetsRequest describeFleetsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeFleetsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeFleetsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeFleets"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeFleetsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeFleets").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeFleetsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeFleetsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more specified image builders, if the image builder names are provided. * Otherwise, all image builders in the account are described. *

* * @param describeImageBuildersRequest * @return A Java Future containing the result of the DescribeImageBuilders operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeImageBuilders * @see AWS API Documentation */ @Override public CompletableFuture describeImageBuilders( DescribeImageBuildersRequest describeImageBuildersRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeImageBuildersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeImageBuildersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeImageBuilders"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeImageBuildersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeImageBuilders").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeImageBuildersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeImageBuildersRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes the permissions for shared AWS account IDs on a private image that you own. *

* * @param describeImagePermissionsRequest * @return A Java Future containing the result of the DescribeImagePermissions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeImagePermissions * @see AWS API Documentation */ @Override public CompletableFuture describeImagePermissions( DescribeImagePermissionsRequest describeImagePermissionsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeImagePermissionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeImagePermissionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeImagePermissions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeImagePermissionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeImagePermissions").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeImagePermissionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeImagePermissionsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more specified images, if the image names or image ARNs are provided. * Otherwise, all images in the account are described. *

* * @param describeImagesRequest * @return A Java Future containing the result of the DescribeImages operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeImages * @see AWS API * Documentation */ @Override public CompletableFuture describeImages(DescribeImagesRequest describeImagesRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeImagesRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeImagesRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeImages"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeImagesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeImages").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeImagesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeImagesRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes the streaming sessions for a specified stack and fleet. If a UserId is provided * for the stack and fleet, only streaming sessions for that user are described. If an authentication type is not * provided, the default is to authenticate users using a streaming URL. *

* * @param describeSessionsRequest * @return A Java Future containing the result of the DescribeSessions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeSessions * @see AWS * API Documentation */ @Override public CompletableFuture describeSessions(DescribeSessionsRequest describeSessionsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeSessionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeSessionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeSessions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeSessionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeSessions").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeSessionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeSessionsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more specified stacks, if the stack names are provided. Otherwise, all * stacks in the account are described. *

* * @param describeStacksRequest * @return A Java Future containing the result of the DescribeStacks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeStacks * @see AWS API * Documentation */ @Override public CompletableFuture describeStacks(DescribeStacksRequest describeStacksRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeStacksRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeStacksRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeStacks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeStacksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeStacks").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeStacksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeStacksRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more usage report subscriptions. *

* * @param describeUsageReportSubscriptionsRequest * @return A Java Future containing the result of the DescribeUsageReportSubscriptions operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeUsageReportSubscriptions * @see AWS API Documentation */ @Override public CompletableFuture describeUsageReportSubscriptions( DescribeUsageReportSubscriptionsRequest describeUsageReportSubscriptionsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeUsageReportSubscriptionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeUsageReportSubscriptionsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeUsageReportSubscriptions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeUsageReportSubscriptionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeUsageReportSubscriptions").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeUsageReportSubscriptionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeUsageReportSubscriptionsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes the UserStackAssociation objects. You must specify either or both of the * following: *

*
    *
  • *

    * The stack name *

    *
  • *
  • *

    * The user name (email address of the user associated with the stack) and the authentication type for the user *

    *
  • *
* * @param describeUserStackAssociationsRequest * @return A Java Future containing the result of the DescribeUserStackAssociations operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeUserStackAssociations * @see AWS API Documentation */ @Override public CompletableFuture describeUserStackAssociations( DescribeUserStackAssociationsRequest describeUserStackAssociationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeUserStackAssociationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeUserStackAssociationsRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeUserStackAssociations"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeUserStackAssociationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeUserStackAssociations").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeUserStackAssociationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeUserStackAssociationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list that describes one or more specified users in the user pool. *

* * @param describeUsersRequest * @return A Java Future containing the result of the DescribeUsers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DescribeUsers * @see AWS API * Documentation */ @Override public CompletableFuture describeUsers(DescribeUsersRequest describeUsersRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(describeUsersRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, describeUsersRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DescribeUsers"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeUsersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeUsers").withProtocolMetadata(protocolMetadata) .withMarshaller(new DescribeUsersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(describeUsersRequest)); 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); } } /** *

* Disables the specified user in the user pool. Users can't sign in to AppStream 2.0 until they are re-enabled. * This action does not delete the user. *

* * @param disableUserRequest * @return A Java Future containing the result of the DisableUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DisableUser * @see AWS API * Documentation */ @Override public CompletableFuture disableUser(DisableUserRequest disableUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disableUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disableUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisableUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DisableUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisableUser").withProtocolMetadata(protocolMetadata) .withMarshaller(new DisableUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(disableUserRequest)); 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); } } /** *

* Disassociates a specified app block builder from a specified app block. *

* * @param disassociateAppBlockBuilderAppBlockRequest * @return A Java Future containing the result of the DisassociateAppBlockBuilderAppBlock operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DisassociateAppBlockBuilderAppBlock * @see AWS API Documentation */ @Override public CompletableFuture disassociateAppBlockBuilderAppBlock( DisassociateAppBlockBuilderAppBlockRequest disassociateAppBlockBuilderAppBlockRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateAppBlockBuilderAppBlockRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateAppBlockBuilderAppBlockRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateAppBlockBuilderAppBlock"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DisassociateAppBlockBuilderAppBlockResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateAppBlockBuilderAppBlock").withProtocolMetadata(protocolMetadata) .withMarshaller(new DisassociateAppBlockBuilderAppBlockRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(disassociateAppBlockBuilderAppBlockRequest)); 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); } } /** *

* Disassociates the specified application from the fleet. *

* * @param disassociateApplicationFleetRequest * @return A Java Future containing the result of the DisassociateApplicationFleet operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DisassociateApplicationFleet * @see AWS API Documentation */ @Override public CompletableFuture disassociateApplicationFleet( DisassociateApplicationFleetRequest disassociateApplicationFleetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateApplicationFleetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateApplicationFleetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateApplicationFleet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisassociateApplicationFleetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateApplicationFleet").withProtocolMetadata(protocolMetadata) .withMarshaller(new DisassociateApplicationFleetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(disassociateApplicationFleetRequest)); 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 application from the specified entitlement. *

* * @param disassociateApplicationFromEntitlementRequest * @return A Java Future containing the result of the DisassociateApplicationFromEntitlement operation returned by * the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • EntitlementNotFoundException The entitlement can't be found.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DisassociateApplicationFromEntitlement * @see AWS API Documentation */ @Override public CompletableFuture disassociateApplicationFromEntitlement( DisassociateApplicationFromEntitlementRequest disassociateApplicationFromEntitlementRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateApplicationFromEntitlementRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateApplicationFromEntitlementRequest.overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateApplicationFromEntitlement"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DisassociateApplicationFromEntitlementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateApplicationFromEntitlement").withProtocolMetadata(protocolMetadata) .withMarshaller(new DisassociateApplicationFromEntitlementRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(disassociateApplicationFromEntitlementRequest)); 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); } } /** *

* Disassociates the specified fleet from the specified stack. *

* * @param disassociateFleetRequest * @return A Java Future containing the result of the DisassociateFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceInUseException The specified resource is in use.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.DisassociateFleet * @see AWS * API Documentation */ @Override public CompletableFuture disassociateFleet(DisassociateFleetRequest disassociateFleetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(disassociateFleetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, disassociateFleetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DisassociateFleet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DisassociateFleetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DisassociateFleet").withProtocolMetadata(protocolMetadata) .withMarshaller(new DisassociateFleetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(disassociateFleetRequest)); 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); } } /** *

* Enables a user in the user pool. After being enabled, users can sign in to AppStream 2.0 and open applications * from the stacks to which they are assigned. *

* * @param enableUserRequest * @return A Java Future containing the result of the EnableUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.EnableUser * @see AWS API * Documentation */ @Override public CompletableFuture enableUser(EnableUserRequest enableUserRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(enableUserRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, enableUserRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "EnableUser"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, EnableUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("EnableUser") .withProtocolMetadata(protocolMetadata) .withMarshaller(new EnableUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(enableUserRequest)); 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); } } /** *

* Immediately stops the specified streaming session. *

* * @param expireSessionRequest * @return A Java Future containing the result of the ExpireSession operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.ExpireSession * @see AWS API * Documentation */ @Override public CompletableFuture expireSession(ExpireSessionRequest expireSessionRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(expireSessionRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, expireSessionRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ExpireSession"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ExpireSessionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ExpireSession").withProtocolMetadata(protocolMetadata) .withMarshaller(new ExpireSessionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(expireSessionRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the name of the fleet that is associated with the specified stack. *

* * @param listAssociatedFleetsRequest * @return A Java Future containing the result of the ListAssociatedFleets operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.ListAssociatedFleets * @see AWS API Documentation */ @Override public CompletableFuture listAssociatedFleets( ListAssociatedFleetsRequest listAssociatedFleetsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAssociatedFleetsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAssociatedFleetsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAssociatedFleets"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAssociatedFleetsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAssociatedFleets").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListAssociatedFleetsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listAssociatedFleetsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the name of the stack with which the specified fleet is associated. *

* * @param listAssociatedStacksRequest * @return A Java Future containing the result of the ListAssociatedStacks operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.ListAssociatedStacks * @see AWS API Documentation */ @Override public CompletableFuture listAssociatedStacks( ListAssociatedStacksRequest listAssociatedStacksRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listAssociatedStacksRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listAssociatedStacksRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListAssociatedStacks"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListAssociatedStacksResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListAssociatedStacks").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListAssociatedStacksRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listAssociatedStacksRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list of entitled applications. *

* * @param listEntitledApplicationsRequest * @return A Java Future containing the result of the ListEntitledApplications operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • EntitlementNotFoundException The entitlement can't be found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.ListEntitledApplications * @see AWS API Documentation */ @Override public CompletableFuture listEntitledApplications( ListEntitledApplicationsRequest listEntitledApplicationsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(listEntitledApplicationsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, listEntitledApplicationsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListEntitledApplications"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, ListEntitledApplicationsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ListEntitledApplications").withProtocolMetadata(protocolMetadata) .withMarshaller(new ListEntitledApplicationsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(listEntitledApplicationsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a list of all tags for the specified AppStream 2.0 resource. You can tag AppStream 2.0 image builders, * images, fleets, and stacks. *

*

* For more information about tags, see Tagging Your Resources * in the Amazon AppStream 2.0 Administration Guide. *

* * @param listTagsForResourceRequest * @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.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, "AppStream"); 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); } } /** *

* Starts an app block builder. *

*

* An app block builder can only be started when it's associated with an app block. *

*

* Starting an app block builder starts a new instance, which is equivalent to an elastic fleet instance with * application builder assistance functionality. *

* * @param startAppBlockBuilderRequest * @return A Java Future containing the result of the StartAppBlockBuilder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • RequestLimitExceededException AppStream 2.0 can’t process the request right now because the Describe * calls from your AWS account are being throttled by Amazon EC2. Try again later.
  • *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.StartAppBlockBuilder * @see AWS API Documentation */ @Override public CompletableFuture startAppBlockBuilder( StartAppBlockBuilderRequest startAppBlockBuilderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startAppBlockBuilderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startAppBlockBuilderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartAppBlockBuilder"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartAppBlockBuilderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartAppBlockBuilder").withProtocolMetadata(protocolMetadata) .withMarshaller(new StartAppBlockBuilderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(startAppBlockBuilderRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Starts the specified fleet. *

* * @param startFleetRequest * @return A Java Future containing the result of the StartFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • RequestLimitExceededException AppStream 2.0 can’t process the request right now because the Describe * calls from your AWS account are being throttled by Amazon EC2. Try again later.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • InvalidRoleException The specified role is invalid.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.StartFleet * @see AWS API * Documentation */ @Override public CompletableFuture startFleet(StartFleetRequest startFleetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startFleetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startFleetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartFleet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StartFleetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("StartFleet") .withProtocolMetadata(protocolMetadata) .withMarshaller(new StartFleetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(startFleetRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Starts the specified image builder. *

* * @param startImageBuilderRequest * @return A Java Future containing the result of the StartImageBuilder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • IncompatibleImageException The image can't be updated because it's not compatible for updates.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.StartImageBuilder * @see AWS * API Documentation */ @Override public CompletableFuture startImageBuilder(StartImageBuilderRequest startImageBuilderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(startImageBuilderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, startImageBuilderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StartImageBuilder"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StartImageBuilderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StartImageBuilder").withProtocolMetadata(protocolMetadata) .withMarshaller(new StartImageBuilderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(startImageBuilderRequest)); 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); } } /** *

* Stops an app block builder. *

*

* Stopping an app block builder terminates the instance, and the instance state is not persisted. *

* * @param stopAppBlockBuilderRequest * @return A Java Future containing the result of the StopAppBlockBuilder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.StopAppBlockBuilder * @see AWS * API Documentation */ @Override public CompletableFuture stopAppBlockBuilder( StopAppBlockBuilderRequest stopAppBlockBuilderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopAppBlockBuilderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopAppBlockBuilderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopAppBlockBuilder"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StopAppBlockBuilderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StopAppBlockBuilder").withProtocolMetadata(protocolMetadata) .withMarshaller(new StopAppBlockBuilderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(stopAppBlockBuilderRequest)); 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); } } /** *

* Stops the specified fleet. *

* * @param stopFleetRequest * @return A Java Future containing the result of the StopFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.StopFleet * @see AWS API * Documentation */ @Override public CompletableFuture stopFleet(StopFleetRequest stopFleetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopFleetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopFleetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopFleet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, StopFleetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("StopFleet") .withProtocolMetadata(protocolMetadata) .withMarshaller(new StopFleetRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withRequestConfiguration(clientConfiguration) .withMetricCollector(apiCallMetricCollector).withInput(stopFleetRequest)); 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); } } /** *

* Stops the specified image builder. *

* * @param stopImageBuilderRequest * @return A Java Future containing the result of the StopImageBuilder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.StopImageBuilder * @see AWS * API Documentation */ @Override public CompletableFuture stopImageBuilder(StopImageBuilderRequest stopImageBuilderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(stopImageBuilderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, stopImageBuilderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "StopImageBuilder"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, StopImageBuilderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("StopImageBuilder").withProtocolMetadata(protocolMetadata) .withMarshaller(new StopImageBuilderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(stopImageBuilderRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds or overwrites one or more tags for the specified AppStream 2.0 resource. You can tag AppStream 2.0 image * builders, images, fleets, and stacks. *

*

* Each tag consists of a key and an optional value. If a resource already has a tag with the same key, this * operation updates its value. *

*

* To list the current tags for your resources, use ListTagsForResource. To disassociate tags from your * resources, use UntagResource. *

*

* For more information about tags, see Tagging Your Resources * in the Amazon AppStream 2.0 Administration Guide. *

* * @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. *
    *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.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, "AppStream"); 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); } } /** *

* Disassociates one or more specified tags from the specified AppStream 2.0 resource. *

*

* To list the current tags for your resources, use ListTagsForResource. *

*

* For more information about tags, see Tagging Your Resources * in the Amazon AppStream 2.0 Administration Guide. *

* * @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. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.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, "AppStream"); 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 app block builder. *

*

* If the app block builder is in the STARTING or STOPPING state, you can't update it. If * the app block builder is in the RUNNING state, you can only update the DisplayName and Description. * If the app block builder is in the STOPPED state, you can update any attribute except the Name. *

* * @param updateAppBlockBuilderRequest * @return A Java Future containing the result of the UpdateAppBlockBuilder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • InvalidRoleException The specified role is invalid.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • RequestLimitExceededException AppStream 2.0 can’t process the request right now because the Describe * calls from your AWS account are being throttled by Amazon EC2. Try again later.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.UpdateAppBlockBuilder * @see AWS API Documentation */ @Override public CompletableFuture updateAppBlockBuilder( UpdateAppBlockBuilderRequest updateAppBlockBuilderRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateAppBlockBuilderRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateAppBlockBuilderRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateAppBlockBuilder"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateAppBlockBuilderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateAppBlockBuilder").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateAppBlockBuilderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateAppBlockBuilderRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the specified application. *

* * @param updateApplicationRequest * @return A Java Future containing the result of the UpdateApplication operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.UpdateApplication * @see AWS * API Documentation */ @Override public CompletableFuture updateApplication(UpdateApplicationRequest updateApplicationRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateApplicationRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateApplicationRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateApplication"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateApplicationResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateApplication").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateApplicationRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateApplicationRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the specified Directory Config object in AppStream 2.0. This object includes the configuration * information required to join fleets and image builders to Microsoft Active Directory domains. *

* * @param updateDirectoryConfigRequest * @return A Java Future containing the result of the UpdateDirectoryConfig operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceInUseException The specified resource is in use.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • InvalidRoleException The specified role is invalid.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.UpdateDirectoryConfig * @see AWS API Documentation */ @Override public CompletableFuture updateDirectoryConfig( UpdateDirectoryConfigRequest updateDirectoryConfigRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateDirectoryConfigRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateDirectoryConfigRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateDirectoryConfig"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateDirectoryConfigResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateDirectoryConfig").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateDirectoryConfigRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateDirectoryConfigRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the specified entitlement. *

* * @param updateEntitlementRequest * @return A Java Future containing the result of the UpdateEntitlement operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • EntitlementNotFoundException The entitlement can't be found.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.UpdateEntitlement * @see AWS * API Documentation */ @Override public CompletableFuture updateEntitlement(UpdateEntitlementRequest updateEntitlementRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateEntitlementRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateEntitlementRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateEntitlement"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateEntitlementResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateEntitlement").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateEntitlementRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateEntitlementRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the specified fleet. *

*

* If the fleet is in the STOPPED state, you can update any attribute except the fleet name. *

*

* If the fleet is in the RUNNING state, you can update the following based on the fleet type: *

*
    *
  • *

    * Always-On and On-Demand fleet types *

    *

    * You can update the DisplayName, ComputeCapacity, ImageARN, * ImageName, IdleDisconnectTimeoutInSeconds, and DisconnectTimeoutInSeconds * attributes. *

    *
  • *
  • *

    * Elastic fleet type *

    *

    * You can update the DisplayName, IdleDisconnectTimeoutInSeconds, * DisconnectTimeoutInSeconds, MaxConcurrentSessions, SessionScriptS3Location * and UsbDeviceFilterStrings attributes. *

    *
  • *
*

* If the fleet is in the STARTING or STOPPED state, you can't update it. *

* * @param updateFleetRequest * @return A Java Future containing the result of the UpdateFleet operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceInUseException The specified resource is in use.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • RequestLimitExceededException AppStream 2.0 can’t process the request right now because the Describe * calls from your AWS account are being throttled by Amazon EC2. Try again later.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • InvalidRoleException The specified role is invalid.
  • *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • IncompatibleImageException The image can't be updated because it's not compatible for updates.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.UpdateFleet * @see AWS API * Documentation */ @Override public CompletableFuture updateFleet(UpdateFleetRequest updateFleetRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateFleetRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateFleetRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateFleet"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateFleetResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateFleet").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateFleetRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateFleetRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds or updates permissions for the specified private image. *

* * @param updateImagePermissionsRequest * @return A Java Future containing the result of the UpdateImagePermissions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ResourceNotAvailableException The specified resource exists and is not in use, but isn't available.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.UpdateImagePermissions * @see AWS API Documentation */ @Override public CompletableFuture updateImagePermissions( UpdateImagePermissionsRequest updateImagePermissionsRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateImagePermissionsRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateImagePermissionsRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateImagePermissions"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateImagePermissionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateImagePermissions").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateImagePermissionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateImagePermissionsRequest)); CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); }); executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture); return executeFuture; } catch (Throwable t) { metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect())); return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the specified fields for the specified stack. *

* * @param updateStackRequest * @return A Java Future containing the result of the UpdateStack operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • ResourceNotFoundException The specified resource was not found.
  • *
  • ResourceInUseException The specified resource is in use.
  • *
  • InvalidRoleException The specified role is invalid.
  • *
  • InvalidParameterCombinationException Indicates an incorrect combination of parameters, or a missing * parameter.
  • *
  • LimitExceededException The requested limit exceeds the permitted limit for an account.
  • *
  • InvalidAccountStatusException The resource cannot be created because your AWS account is suspended. * For assistance, contact AWS Support.
  • *
  • IncompatibleImageException The image can't be updated because it's not compatible for updates.
  • *
  • OperationNotPermittedException The attempted operation is not permitted.
  • *
  • ConcurrentModificationException An API error occurred. Wait a few minutes and try again.
  • *
  • 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.
  • *
  • AppStreamException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample AppStreamAsyncClient.UpdateStack * @see AWS API * Documentation */ @Override public CompletableFuture updateStack(UpdateStackRequest updateStackRequest) { SdkClientConfiguration clientConfiguration = updateSdkClientConfiguration(updateStackRequest, this.clientConfiguration); List metricPublishers = resolveMetricPublishers(clientConfiguration, updateStackRequest .overrideConfiguration().orElse(null)); MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector .create("ApiCall"); try { apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "AppStream"); apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "UpdateStack"); JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateStackResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateStack").withProtocolMetadata(protocolMetadata) .withMarshaller(new UpdateStackRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withRequestConfiguration(clientConfiguration).withMetricCollector(apiCallMetricCollector) .withInput(updateStackRequest)); 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 AppStreamAsyncWaiter waiter() { return AppStreamAsyncWaiter.builder().client(this).scheduledExecutorService(executorService).build(); } @Override public final AppStreamServiceClientConfiguration serviceClientConfiguration() { return new AppStreamServiceClientConfigurationBuilder(this.clientConfiguration.toBuilder()).build(); } @Override public final String serviceName() { return SERVICE_NAME; } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(AppStreamException::builder) .protocol(AwsJsonProtocol.AWS_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("ConcurrentModificationException") .exceptionBuilderSupplier(ConcurrentModificationException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("RequestLimitExceededException") .exceptionBuilderSupplier(RequestLimitExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("LimitExceededException") .exceptionBuilderSupplier(LimitExceededException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotFoundException") .exceptionBuilderSupplier(ResourceNotFoundException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceAlreadyExistsException") .exceptionBuilderSupplier(ResourceAlreadyExistsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceInUseException") .exceptionBuilderSupplier(ResourceInUseException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("IncompatibleImageException") .exceptionBuilderSupplier(IncompatibleImageException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceNotAvailableException") .exceptionBuilderSupplier(ResourceNotAvailableException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidAccountStatusException") .exceptionBuilderSupplier(InvalidAccountStatusException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("OperationNotPermittedException") .exceptionBuilderSupplier(OperationNotPermittedException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidRoleException") .exceptionBuilderSupplier(InvalidRoleException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidParameterCombinationException") .exceptionBuilderSupplier(InvalidParameterCombinationException::builder).httpStatusCode(400) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("EntitlementAlreadyExistsException") .exceptionBuilderSupplier(EntitlementAlreadyExistsException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("EntitlementNotFoundException") .exceptionBuilderSupplier(EntitlementNotFoundException::builder).httpStatusCode(400).build()); } private static List resolveMetricPublishers(SdkClientConfiguration clientConfiguration, RequestOverrideConfiguration requestOverrideConfiguration) { List publishers = null; if (requestOverrideConfiguration != null) { publishers = requestOverrideConfiguration.metricPublishers(); } if (publishers == null || publishers.isEmpty()) { publishers = clientConfiguration.option(SdkClientOption.METRIC_PUBLISHERS); } if (publishers == null) { publishers = Collections.emptyList(); } return publishers; } private SdkClientConfiguration updateSdkClientConfiguration(SdkRequest request, SdkClientConfiguration clientConfiguration) { List plugins = request.overrideConfiguration().map(c -> c.plugins()).orElse(Collections.emptyList()); SdkClientConfiguration.Builder configuration = clientConfiguration.toBuilder(); if (plugins.isEmpty()) { return configuration.build(); } AppStreamServiceClientConfigurationBuilder serviceConfigBuilder = new AppStreamServiceClientConfigurationBuilder( configuration); for (SdkPlugin plugin : plugins) { plugin.configureClient(serviceConfigBuilder); } return configuration.build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } @Override public void close() { clientHandler.close(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy