software.amazon.awssdk.services.appstream.DefaultAppStreamClient Maven / Gradle / Ivy
Show all versions of appstream Show documentation
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.appstream;
import java.util.Collections;
import java.util.List;
import java.util.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.RequestOverrideConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.config.SdkClientOption;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.util.VersionInfo;
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.model.AppStreamException;
import software.amazon.awssdk.services.appstream.model.AppStreamRequest;
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.CreateDirectoryConfigRequest;
import software.amazon.awssdk.services.appstream.model.CreateDirectoryConfigResponse;
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.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.DeleteDirectoryConfigRequest;
import software.amazon.awssdk.services.appstream.model.DeleteDirectoryConfigResponse;
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.DescribeDirectoryConfigsRequest;
import software.amazon.awssdk.services.appstream.model.DescribeDirectoryConfigsResponse;
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.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.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.ListTagsForResourceRequest;
import software.amazon.awssdk.services.appstream.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.appstream.model.OperationNotPermittedException;
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.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.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.UpdateDirectoryConfigRequest;
import software.amazon.awssdk.services.appstream.model.UpdateDirectoryConfigResponse;
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.paginators.DescribeImagePermissionsIterable;
import software.amazon.awssdk.services.appstream.paginators.DescribeImagesIterable;
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.CreateDirectoryConfigRequestMarshaller;
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.CreateUsageReportSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.CreateUserRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.DeleteDirectoryConfigRequestMarshaller;
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.DescribeDirectoryConfigsRequestMarshaller;
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.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.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.StartFleetRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.StartImageBuilderRequestMarshaller;
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.UpdateDirectoryConfigRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.UpdateFleetRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.UpdateImagePermissionsRequestMarshaller;
import software.amazon.awssdk.services.appstream.transform.UpdateStackRequestMarshaller;
/**
* Internal implementation of {@link AppStreamClient}.
*
* @see AppStreamClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultAppStreamClient implements AppStreamClient {
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultAppStreamClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
/**
*
* Associates the specified fleet with the specified stack.
*
*
* @param associateFleetRequest
* @return Result of the AssociateFleet operation returned by the service.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws IncompatibleImageException
* The image does not support storage connectors.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.AssociateFleet
* @see AWS API
* Documentation
*/
@Override
public AssociateFleetResponse associateFleet(AssociateFleetRequest associateFleetRequest) throws LimitExceededException,
InvalidAccountStatusException, ResourceNotFoundException, ConcurrentModificationException,
IncompatibleImageException, OperationNotPermittedException, AwsServiceException, SdkClientException,
AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AssociateFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AssociateFleet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(associateFleetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new AssociateFleetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the BatchAssociateUserStack operation returned by the service.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.BatchAssociateUserStack
* @see AWS API Documentation
*/
@Override
public BatchAssociateUserStackResponse batchAssociateUserStack(BatchAssociateUserStackRequest batchAssociateUserStackRequest)
throws OperationNotPermittedException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, BatchAssociateUserStackResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchAssociateUserStack").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(batchAssociateUserStackRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new BatchAssociateUserStackRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Disassociates the specified users from the specified stacks.
*
*
* @param batchDisassociateUserStackRequest
* @return Result of the BatchDisassociateUserStack operation returned by the service.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.BatchDisassociateUserStack
* @see AWS API Documentation
*/
@Override
public BatchDisassociateUserStackResponse batchDisassociateUserStack(
BatchDisassociateUserStackRequest batchDisassociateUserStackRequest) throws AwsServiceException, SdkClientException,
AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, BatchDisassociateUserStackResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("BatchDisassociateUserStack").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(batchDisassociateUserStackRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new BatchDisassociateUserStackRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CopyImage operation returned by the service.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ResourceNotAvailableException
* The specified resource exists and is not in use, but isn't available.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws IncompatibleImageException
* The image does not support storage connectors.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.CopyImage
* @see AWS API
* Documentation
*/
@Override
public CopyImageResponse copyImage(CopyImageRequest copyImageRequest) throws ResourceAlreadyExistsException,
ResourceNotFoundException, ResourceNotAvailableException, LimitExceededException, InvalidAccountStatusException,
IncompatibleImageException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CopyImageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CopyImage").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(copyImageRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new CopyImageRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateDirectoryConfig operation returned by the service.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.CreateDirectoryConfig
* @see AWS API Documentation
*/
@Override
public CreateDirectoryConfigResponse createDirectoryConfig(CreateDirectoryConfigRequest createDirectoryConfigRequest)
throws ResourceAlreadyExistsException, LimitExceededException, InvalidAccountStatusException, AwsServiceException,
SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateDirectoryConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateDirectoryConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createDirectoryConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateDirectoryConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a fleet. A fleet consists of streaming instances that run a specified image.
*
*
* @param createFleetRequest
* @return Result of the CreateFleet operation returned by the service.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws ResourceNotAvailableException
* The specified resource exists and is not in use, but isn't available.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws InvalidRoleException
* The specified role is invalid.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws IncompatibleImageException
* The image does not support storage connectors.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.CreateFleet
* @see AWS API
* Documentation
*/
@Override
public CreateFleetResponse createFleet(CreateFleetRequest createFleetRequest) throws ResourceAlreadyExistsException,
ResourceNotAvailableException, ResourceNotFoundException, LimitExceededException, InvalidAccountStatusException,
InvalidRoleException, ConcurrentModificationException, InvalidParameterCombinationException,
IncompatibleImageException, OperationNotPermittedException, AwsServiceException, SdkClientException,
AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateFleet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createFleetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateFleetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateImageBuilder operation returned by the service.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws ResourceNotAvailableException
* The specified resource exists and is not in use, but isn't available.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidRoleException
* The specified role is invalid.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws IncompatibleImageException
* The image does not support storage connectors.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.CreateImageBuilder
* @see AWS
* API Documentation
*/
@Override
public CreateImageBuilderResponse createImageBuilder(CreateImageBuilderRequest createImageBuilderRequest)
throws LimitExceededException, InvalidAccountStatusException, ResourceAlreadyExistsException,
ResourceNotAvailableException, ResourceNotFoundException, InvalidRoleException, ConcurrentModificationException,
InvalidParameterCombinationException, IncompatibleImageException, OperationNotPermittedException,
AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateImageBuilderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateImageBuilder").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createImageBuilderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateImageBuilderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a URL to start an image builder streaming session.
*
*
* @param createImageBuilderStreamingUrlRequest
* @return Result of the CreateImageBuilderStreamingURL operation returned by the service.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.CreateImageBuilderStreamingURL
* @see AWS API Documentation
*/
@Override
public CreateImageBuilderStreamingUrlResponse createImageBuilderStreamingURL(
CreateImageBuilderStreamingUrlRequest createImageBuilderStreamingUrlRequest) throws OperationNotPermittedException,
ResourceNotFoundException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateImageBuilderStreamingUrlResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateImageBuilderStreamingURL").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createImageBuilderStreamingUrlRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateImageBuilderStreamingUrlRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateStack operation returned by the service.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws InvalidRoleException
* The specified role is invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.CreateStack
* @see AWS API
* Documentation
*/
@Override
public CreateStackResponse createStack(CreateStackRequest createStackRequest) throws LimitExceededException,
InvalidAccountStatusException, ResourceAlreadyExistsException, ConcurrentModificationException, InvalidRoleException,
ResourceNotFoundException, InvalidParameterCombinationException, AwsServiceException, SdkClientException,
AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateStackResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateStack").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createStackRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateStackRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the CreateStreamingURL operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ResourceNotAvailableException
* The specified resource exists and is not in use, but isn't available.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.CreateStreamingURL
* @see AWS
* API Documentation
*/
@Override
public CreateStreamingUrlResponse createStreamingURL(CreateStreamingUrlRequest createStreamingUrlRequest)
throws ResourceNotFoundException, ResourceNotAvailableException, OperationNotPermittedException,
InvalidParameterCombinationException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateStreamingUrlResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateStreamingURL").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createStreamingUrlRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateStreamingUrlRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a usage report subscription. Usage reports are generated daily.
*
*
* @param createUsageReportSubscriptionRequest
* @return Result of the CreateUsageReportSubscription operation returned by the service.
* @throws InvalidRoleException
* The specified role is invalid.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.CreateUsageReportSubscription
* @see AWS API Documentation
*/
@Override
public CreateUsageReportSubscriptionResponse createUsageReportSubscription(
CreateUsageReportSubscriptionRequest createUsageReportSubscriptionRequest) throws InvalidRoleException,
InvalidAccountStatusException, LimitExceededException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateUsageReportSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateUsageReportSubscription").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createUsageReportSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateUsageReportSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Creates a new user in the user pool.
*
*
* @param createUserRequest
* @return Result of the CreateUser operation returned by the service.
* @throws ResourceAlreadyExistsException
* The specified resource already exists.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.CreateUser
* @see AWS API
* Documentation
*/
@Override
public CreateUserResponse createUser(CreateUserRequest createUserRequest) throws ResourceAlreadyExistsException,
InvalidAccountStatusException, InvalidParameterCombinationException, LimitExceededException,
OperationNotPermittedException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("CreateUser")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(createUserRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new CreateUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DeleteDirectoryConfig operation returned by the service.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DeleteDirectoryConfig
* @see AWS API Documentation
*/
@Override
public DeleteDirectoryConfigResponse deleteDirectoryConfig(DeleteDirectoryConfigRequest deleteDirectoryConfigRequest)
throws ResourceInUseException, ResourceNotFoundException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteDirectoryConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteDirectoryConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteDirectoryConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteDirectoryConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified fleet.
*
*
* @param deleteFleetRequest
* @return Result of the DeleteFleet operation returned by the service.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DeleteFleet
* @see AWS API
* Documentation
*/
@Override
public DeleteFleetResponse deleteFleet(DeleteFleetRequest deleteFleetRequest) throws ResourceInUseException,
ResourceNotFoundException, ConcurrentModificationException, AwsServiceException, SdkClientException,
AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteFleet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteFleetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteFleetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DeleteImage operation returned by the service.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DeleteImage
* @see AWS API
* Documentation
*/
@Override
public DeleteImageResponse deleteImage(DeleteImageRequest deleteImageRequest) throws ResourceInUseException,
ResourceNotFoundException, OperationNotPermittedException, ConcurrentModificationException, AwsServiceException,
SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteImageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteImage").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteImageRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteImageRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes the specified image builder and releases the capacity.
*
*
* @param deleteImageBuilderRequest
* @return Result of the DeleteImageBuilder operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DeleteImageBuilder
* @see AWS
* API Documentation
*/
@Override
public DeleteImageBuilderResponse deleteImageBuilder(DeleteImageBuilderRequest deleteImageBuilderRequest)
throws ResourceNotFoundException, OperationNotPermittedException, ConcurrentModificationException,
AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteImageBuilderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteImageBuilder").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteImageBuilderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteImageBuilderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DeleteImagePermissions operation returned by the service.
* @throws ResourceNotAvailableException
* The specified resource exists and is not in use, but isn't available.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DeleteImagePermissions
* @see AWS API Documentation
*/
@Override
public DeleteImagePermissionsResponse deleteImagePermissions(DeleteImagePermissionsRequest deleteImagePermissionsRequest)
throws ResourceNotAvailableException, ResourceNotFoundException, AwsServiceException, SdkClientException,
AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteImagePermissionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteImagePermissions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteImagePermissionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteImagePermissionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DeleteStack operation returned by the service.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DeleteStack
* @see AWS API
* Documentation
*/
@Override
public DeleteStackResponse deleteStack(DeleteStackRequest deleteStackRequest) throws ResourceInUseException,
ResourceNotFoundException, ConcurrentModificationException, AwsServiceException, SdkClientException,
AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteStackResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteStack").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteStackRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteStackRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Disables usage report generation.
*
*
* @param deleteUsageReportSubscriptionRequest
* @return Result of the DeleteUsageReportSubscription operation returned by the service.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DeleteUsageReportSubscription
* @see AWS API Documentation
*/
@Override
public DeleteUsageReportSubscriptionResponse deleteUsageReportSubscription(
DeleteUsageReportSubscriptionRequest deleteUsageReportSubscriptionRequest) throws InvalidAccountStatusException,
ResourceNotFoundException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteUsageReportSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteUsageReportSubscription").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteUsageReportSubscriptionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteUsageReportSubscriptionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Deletes a user from the user pool.
*
*
* @param deleteUserRequest
* @return Result of the DeleteUser operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DeleteUser
* @see AWS API
* Documentation
*/
@Override
public DeleteUserResponse deleteUser(DeleteUserRequest deleteUserRequest) throws ResourceNotFoundException,
AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("DeleteUser")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(deleteUserRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DeleteUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeDirectoryConfigs operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeDirectoryConfigs
* @see AWS API Documentation
*/
@Override
public DescribeDirectoryConfigsResponse describeDirectoryConfigs(
DescribeDirectoryConfigsRequest describeDirectoryConfigsRequest) throws ResourceNotFoundException,
AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeDirectoryConfigsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeDirectoryConfigs").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeDirectoryConfigsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeDirectoryConfigsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeFleets operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeFleets
* @see AWS API
* Documentation
*/
@Override
public DescribeFleetsResponse describeFleets(DescribeFleetsRequest describeFleetsRequest) throws ResourceNotFoundException,
AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeFleetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeFleets").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeFleetsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeFleetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeImageBuilders operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeImageBuilders
* @see AWS API Documentation
*/
@Override
public DescribeImageBuildersResponse describeImageBuilders(DescribeImageBuildersRequest describeImageBuildersRequest)
throws ResourceNotFoundException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeImageBuildersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeImageBuilders").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeImageBuildersRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeImageBuildersRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a list that describes the permissions for shared AWS account IDs on a private image that you own.
*
*
* @param describeImagePermissionsRequest
* @return Result of the DescribeImagePermissions operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeImagePermissions
* @see AWS API Documentation
*/
@Override
public DescribeImagePermissionsResponse describeImagePermissions(
DescribeImagePermissionsRequest describeImagePermissionsRequest) throws ResourceNotFoundException,
AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeImagePermissionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeImagePermissions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeImagePermissionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeImagePermissionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a list that describes the permissions for shared AWS account IDs on a private image that you own.
*
*
*
* This is a variant of
* {@link #describeImagePermissions(software.amazon.awssdk.services.appstream.model.DescribeImagePermissionsRequest)}
* operation. The return type is a custom iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.appstream.paginators.DescribeImagePermissionsIterable responses = client.describeImagePermissionsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.appstream.paginators.DescribeImagePermissionsIterable responses = client
* .describeImagePermissionsPaginator(request);
* for (software.amazon.awssdk.services.appstream.model.DescribeImagePermissionsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.appstream.paginators.DescribeImagePermissionsIterable responses = client.describeImagePermissionsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeImagePermissions(software.amazon.awssdk.services.appstream.model.DescribeImagePermissionsRequest)}
* operation.
*
*
* @param describeImagePermissionsRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeImagePermissions
* @see AWS API Documentation
*/
@Override
public DescribeImagePermissionsIterable describeImagePermissionsPaginator(
DescribeImagePermissionsRequest describeImagePermissionsRequest) throws ResourceNotFoundException,
AwsServiceException, SdkClientException, AppStreamException {
return new DescribeImagePermissionsIterable(this, applyPaginatorUserAgent(describeImagePermissionsRequest));
}
/**
*
* 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 Result of the DescribeImages operation returned by the service.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeImages
* @see AWS API
* Documentation
*/
@Override
public DescribeImagesResponse describeImages(DescribeImagesRequest describeImagesRequest)
throws InvalidParameterCombinationException, ResourceNotFoundException, AwsServiceException, SdkClientException,
AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeImagesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeImages").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeImagesRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeImagesRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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.
*
*
*
* This is a variant of
* {@link #describeImages(software.amazon.awssdk.services.appstream.model.DescribeImagesRequest)} operation. The
* return type is a custom iterable that can be used to iterate through all the pages. SDK will internally handle
* making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.appstream.paginators.DescribeImagesIterable responses = client.describeImagesPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.appstream.paginators.DescribeImagesIterable responses = client
* .describeImagesPaginator(request);
* for (software.amazon.awssdk.services.appstream.model.DescribeImagesResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.appstream.paginators.DescribeImagesIterable responses = client.describeImagesPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* Please notice that the configuration of MaxResults won't limit the number of results you get with the
* paginator. It only limits the number of results in each page.
*
*
* Note: If you prefer to have control on service calls, use the
* {@link #describeImages(software.amazon.awssdk.services.appstream.model.DescribeImagesRequest)} operation.
*
*
* @param describeImagesRequest
* @return A custom iterable that can be used to iterate through all the response pages.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeImages
* @see AWS API
* Documentation
*/
@Override
public DescribeImagesIterable describeImagesPaginator(DescribeImagesRequest describeImagesRequest)
throws InvalidParameterCombinationException, ResourceNotFoundException, AwsServiceException, SdkClientException,
AppStreamException {
return new DescribeImagesIterable(this, applyPaginatorUserAgent(describeImagesRequest));
}
/**
*
* 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 Result of the DescribeSessions operation returned by the service.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeSessions
* @see AWS API
* Documentation
*/
@Override
public DescribeSessionsResponse describeSessions(DescribeSessionsRequest describeSessionsRequest)
throws InvalidParameterCombinationException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeSessionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeSessions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeSessionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeSessionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeStacks operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeStacks
* @see AWS API
* Documentation
*/
@Override
public DescribeStacksResponse describeStacks(DescribeStacksRequest describeStacksRequest) throws ResourceNotFoundException,
AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeStacksResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeStacks").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeStacksRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeStacksRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a list that describes one or more usage report subscriptions.
*
*
* @param describeUsageReportSubscriptionsRequest
* @return Result of the DescribeUsageReportSubscriptions operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeUsageReportSubscriptions
* @see AWS API Documentation
*/
@Override
public DescribeUsageReportSubscriptionsResponse describeUsageReportSubscriptions(
DescribeUsageReportSubscriptionsRequest describeUsageReportSubscriptionsRequest) throws ResourceNotFoundException,
InvalidAccountStatusException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeUsageReportSubscriptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeUsageReportSubscriptions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeUsageReportSubscriptionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeUsageReportSubscriptionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DescribeUserStackAssociations operation returned by the service.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeUserStackAssociations
* @see AWS API Documentation
*/
@Override
public DescribeUserStackAssociationsResponse describeUserStackAssociations(
DescribeUserStackAssociationsRequest describeUserStackAssociationsRequest)
throws InvalidParameterCombinationException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeUserStackAssociationsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeUserStackAssociations").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeUserStackAssociationsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeUserStackAssociationsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves a list that describes one or more specified users in the user pool.
*
*
* @param describeUsersRequest
* @return Result of the DescribeUsers operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DescribeUsers
* @see AWS API
* Documentation
*/
@Override
public DescribeUsersResponse describeUsers(DescribeUsersRequest describeUsersRequest) throws ResourceNotFoundException,
InvalidParameterCombinationException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeUsersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeUsers").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeUsersRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DescribeUsersRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the DisableUser operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DisableUser
* @see AWS API
* Documentation
*/
@Override
public DisableUserResponse disableUser(DisableUserRequest disableUserRequest) throws ResourceNotFoundException,
AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DisableUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DisableUser").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(disableUserRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DisableUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Disassociates the specified fleet from the specified stack.
*
*
* @param disassociateFleetRequest
* @return Result of the DisassociateFleet operation returned by the service.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.DisassociateFleet
* @see AWS
* API Documentation
*/
@Override
public DisassociateFleetResponse disassociateFleet(DisassociateFleetRequest disassociateFleetRequest)
throws ResourceInUseException, ResourceNotFoundException, ConcurrentModificationException, AwsServiceException,
SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DisassociateFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DisassociateFleet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(disassociateFleetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new DisassociateFleetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the EnableUser operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.EnableUser
* @see AWS API
* Documentation
*/
@Override
public EnableUserResponse enableUser(EnableUserRequest enableUserRequest) throws ResourceNotFoundException,
InvalidAccountStatusException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
EnableUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("EnableUser")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(enableUserRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new EnableUserRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Immediately stops the specified streaming session.
*
*
* @param expireSessionRequest
* @return Result of the ExpireSession operation returned by the service.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.ExpireSession
* @see AWS API
* Documentation
*/
@Override
public ExpireSessionResponse expireSession(ExpireSessionRequest expireSessionRequest) throws AwsServiceException,
SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ExpireSessionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ExpireSession").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(expireSessionRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ExpireSessionRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the name of the fleet that is associated with the specified stack.
*
*
* @param listAssociatedFleetsRequest
* @return Result of the ListAssociatedFleets operation returned by the service.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.ListAssociatedFleets
* @see AWS
* API Documentation
*/
@Override
public ListAssociatedFleetsResponse listAssociatedFleets(ListAssociatedFleetsRequest listAssociatedFleetsRequest)
throws AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListAssociatedFleetsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListAssociatedFleets").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listAssociatedFleetsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListAssociatedFleetsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Retrieves the name of the stack with which the specified fleet is associated.
*
*
* @param listAssociatedStacksRequest
* @return Result of the ListAssociatedStacks operation returned by the service.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.ListAssociatedStacks
* @see AWS
* API Documentation
*/
@Override
public ListAssociatedStacksResponse listAssociatedStacks(ListAssociatedStacksRequest listAssociatedStacksRequest)
throws AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListAssociatedStacksResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListAssociatedStacks").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listAssociatedStacksRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListAssociatedStacksRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the ListTagsForResource operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.ListTagsForResource
* @see AWS
* API Documentation
*/
@Override
public ListTagsForResourceResponse listTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest)
throws ResourceNotFoundException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(listTagsForResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Starts the specified fleet.
*
*
* @param startFleetRequest
* @return Result of the StartFleet operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws ResourceNotAvailableException
* The specified resource exists and is not in use, but isn't available.
* @throws InvalidRoleException
* The specified role is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.StartFleet
* @see AWS API
* Documentation
*/
@Override
public StartFleetResponse startFleet(StartFleetRequest startFleetRequest) throws ResourceNotFoundException,
OperationNotPermittedException, LimitExceededException, InvalidAccountStatusException,
ConcurrentModificationException, ResourceNotAvailableException, InvalidRoleException, AwsServiceException,
SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StartFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams().withOperationName("StartFleet")
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withInput(startFleetRequest).withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartFleetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Starts the specified image builder.
*
*
* @param startImageBuilderRequest
* @return Result of the StartImageBuilder operation returned by the service.
* @throws ResourceNotAvailableException
* The specified resource exists and is not in use, but isn't available.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws IncompatibleImageException
* The image does not support storage connectors.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.StartImageBuilder
* @see AWS
* API Documentation
*/
@Override
public StartImageBuilderResponse startImageBuilder(StartImageBuilderRequest startImageBuilderRequest)
throws ResourceNotAvailableException, ResourceNotFoundException, ConcurrentModificationException,
InvalidAccountStatusException, IncompatibleImageException, AwsServiceException, SdkClientException,
AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StartImageBuilderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StartImageBuilder").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(startImageBuilderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StartImageBuilderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Stops the specified fleet.
*
*
* @param stopFleetRequest
* @return Result of the StopFleet operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.StopFleet
* @see AWS API
* Documentation
*/
@Override
public StopFleetResponse stopFleet(StopFleetRequest stopFleetRequest) throws ResourceNotFoundException,
ConcurrentModificationException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StopFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StopFleet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(stopFleetRequest)
.withMetricCollector(apiCallMetricCollector).withMarshaller(new StopFleetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Stops the specified image builder.
*
*
* @param stopImageBuilderRequest
* @return Result of the StopImageBuilder operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.StopImageBuilder
* @see AWS API
* Documentation
*/
@Override
public StopImageBuilderResponse stopImageBuilder(StopImageBuilderRequest stopImageBuilderRequest)
throws ResourceNotFoundException, OperationNotPermittedException, ConcurrentModificationException,
AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
StopImageBuilderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("StopImageBuilder").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(stopImageBuilderRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new StopImageBuilderRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the TagResource operation returned by the service.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.TagResource
* @see AWS API
* Documentation
*/
@Override
public TagResourceResponse tagResource(TagResourceRequest tagResourceRequest) throws LimitExceededException,
InvalidAccountStatusException, ResourceNotFoundException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
TagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("TagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(tagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new TagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the UntagResource operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.UntagResource
* @see AWS API
* Documentation
*/
@Override
public UntagResourceResponse untagResource(UntagResourceRequest untagResourceRequest) throws ResourceNotFoundException,
AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UntagResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UntagResource").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(untagResourceRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UntagResourceRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 Result of the UpdateDirectoryConfig operation returned by the service.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.UpdateDirectoryConfig
* @see AWS API Documentation
*/
@Override
public UpdateDirectoryConfigResponse updateDirectoryConfig(UpdateDirectoryConfigRequest updateDirectoryConfigRequest)
throws ResourceInUseException, ResourceNotFoundException, ConcurrentModificationException, AwsServiceException,
SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateDirectoryConfigResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateDirectoryConfig").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateDirectoryConfigRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateDirectoryConfigRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* 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 DisplayName
,
* ComputeCapacity
, ImageARN
, ImageName
,
* IdleDisconnectTimeoutInSeconds
, and DisconnectTimeoutInSeconds
attributes. If the fleet
* is in the STARTING
or STOPPING
state, you can't update it.
*
*
* @param updateFleetRequest
* @return Result of the UpdateFleet operation returned by the service.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws InvalidRoleException
* The specified role is invalid.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ResourceNotAvailableException
* The specified resource exists and is not in use, but isn't available.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws IncompatibleImageException
* The image does not support storage connectors.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.UpdateFleet
* @see AWS API
* Documentation
*/
@Override
public UpdateFleetResponse updateFleet(UpdateFleetRequest updateFleetRequest) throws ResourceInUseException,
LimitExceededException, InvalidAccountStatusException, InvalidRoleException, ResourceNotFoundException,
ResourceNotAvailableException, InvalidParameterCombinationException, ConcurrentModificationException,
IncompatibleImageException, OperationNotPermittedException, AwsServiceException, SdkClientException,
AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateFleetResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateFleet").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateFleetRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateFleetRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Adds or updates permissions for the specified private image.
*
*
* @param updateImagePermissionsRequest
* @return Result of the UpdateImagePermissions operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ResourceNotAvailableException
* The specified resource exists and is not in use, but isn't available.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.UpdateImagePermissions
* @see AWS API Documentation
*/
@Override
public UpdateImagePermissionsResponse updateImagePermissions(UpdateImagePermissionsRequest updateImagePermissionsRequest)
throws ResourceNotFoundException, ResourceNotAvailableException, LimitExceededException, AwsServiceException,
SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateImagePermissionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("UpdateImagePermissions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateImagePermissionsRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateImagePermissionsRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
/**
*
* Updates the specified fields for the specified stack.
*
*
* @param updateStackRequest
* @return Result of the UpdateStack operation returned by the service.
* @throws ResourceNotFoundException
* The specified resource was not found.
* @throws ResourceInUseException
* The specified resource is in use.
* @throws InvalidRoleException
* The specified role is invalid.
* @throws InvalidParameterCombinationException
* Indicates an incorrect combination of parameters, or a missing parameter.
* @throws LimitExceededException
* The requested limit exceeds the permitted limit for an account.
* @throws InvalidAccountStatusException
* The resource cannot be created because your AWS account is suspended. For assistance, contact AWS
* Support.
* @throws IncompatibleImageException
* The image does not support storage connectors.
* @throws OperationNotPermittedException
* The attempted operation is not permitted.
* @throws ConcurrentModificationException
* An API error occurred. Wait a few minutes and try again.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws AppStreamException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample AppStreamClient.UpdateStack
* @see AWS API
* Documentation
*/
@Override
public UpdateStackResponse updateStack(UpdateStackRequest updateStackRequest) throws ResourceNotFoundException,
ResourceInUseException, InvalidRoleException, InvalidParameterCombinationException, LimitExceededException,
InvalidAccountStatusException, IncompatibleImageException, OperationNotPermittedException,
ConcurrentModificationException, AwsServiceException, SdkClientException, AppStreamException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateStackResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
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");
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateStack").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateStackRequest)
.withMetricCollector(apiCallMetricCollector)
.withMarshaller(new UpdateStackRequestMarshaller(protocolFactory)));
} finally {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
}
}
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 HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
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).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceInUseException")
.exceptionBuilderSupplier(ResourceInUseException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("IncompatibleImageException")
.exceptionBuilderSupplier(IncompatibleImageException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotAvailableException")
.exceptionBuilderSupplier(ResourceNotAvailableException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidAccountStatusException")
.exceptionBuilderSupplier(InvalidAccountStatusException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("OperationNotPermittedException")
.exceptionBuilderSupplier(OperationNotPermittedException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("LimitExceededException")
.exceptionBuilderSupplier(LimitExceededException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceNotFoundException")
.exceptionBuilderSupplier(ResourceNotFoundException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidRoleException")
.exceptionBuilderSupplier(InvalidRoleException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("InvalidParameterCombinationException")
.exceptionBuilderSupplier(InvalidParameterCombinationException::builder).build())
.registerModeledException(
ExceptionMetadata.builder().errorCode("ResourceAlreadyExistsException")
.exceptionBuilderSupplier(ResourceAlreadyExistsException::builder).build());
}
@Override
public void close() {
clientHandler.close();
}
private T applyPaginatorUserAgent(T request) {
Consumer userAgentApplier = b -> b.addApiName(ApiName.builder()
.version(VersionInfo.SDK_VERSION).name("PAGINATED").build());
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
}