
software.amazon.awssdk.services.nimble.DefaultNimbleAsyncClient Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.nimble;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.function.Consumer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsAsyncClientHandler;
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.AsyncClientHandler;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.metrics.CoreMetric;
import software.amazon.awssdk.core.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.nimble.model.AcceptEulasRequest;
import software.amazon.awssdk.services.nimble.model.AcceptEulasResponse;
import software.amazon.awssdk.services.nimble.model.AccessDeniedException;
import software.amazon.awssdk.services.nimble.model.ConflictException;
import software.amazon.awssdk.services.nimble.model.CreateLaunchProfileRequest;
import software.amazon.awssdk.services.nimble.model.CreateLaunchProfileResponse;
import software.amazon.awssdk.services.nimble.model.CreateStreamingImageRequest;
import software.amazon.awssdk.services.nimble.model.CreateStreamingImageResponse;
import software.amazon.awssdk.services.nimble.model.CreateStreamingSessionRequest;
import software.amazon.awssdk.services.nimble.model.CreateStreamingSessionResponse;
import software.amazon.awssdk.services.nimble.model.CreateStreamingSessionStreamRequest;
import software.amazon.awssdk.services.nimble.model.CreateStreamingSessionStreamResponse;
import software.amazon.awssdk.services.nimble.model.CreateStudioComponentRequest;
import software.amazon.awssdk.services.nimble.model.CreateStudioComponentResponse;
import software.amazon.awssdk.services.nimble.model.CreateStudioRequest;
import software.amazon.awssdk.services.nimble.model.CreateStudioResponse;
import software.amazon.awssdk.services.nimble.model.DeleteLaunchProfileMemberRequest;
import software.amazon.awssdk.services.nimble.model.DeleteLaunchProfileMemberResponse;
import software.amazon.awssdk.services.nimble.model.DeleteLaunchProfileRequest;
import software.amazon.awssdk.services.nimble.model.DeleteLaunchProfileResponse;
import software.amazon.awssdk.services.nimble.model.DeleteStreamingImageRequest;
import software.amazon.awssdk.services.nimble.model.DeleteStreamingImageResponse;
import software.amazon.awssdk.services.nimble.model.DeleteStreamingSessionRequest;
import software.amazon.awssdk.services.nimble.model.DeleteStreamingSessionResponse;
import software.amazon.awssdk.services.nimble.model.DeleteStudioComponentRequest;
import software.amazon.awssdk.services.nimble.model.DeleteStudioComponentResponse;
import software.amazon.awssdk.services.nimble.model.DeleteStudioMemberRequest;
import software.amazon.awssdk.services.nimble.model.DeleteStudioMemberResponse;
import software.amazon.awssdk.services.nimble.model.DeleteStudioRequest;
import software.amazon.awssdk.services.nimble.model.DeleteStudioResponse;
import software.amazon.awssdk.services.nimble.model.GetEulaRequest;
import software.amazon.awssdk.services.nimble.model.GetEulaResponse;
import software.amazon.awssdk.services.nimble.model.GetLaunchProfileDetailsRequest;
import software.amazon.awssdk.services.nimble.model.GetLaunchProfileDetailsResponse;
import software.amazon.awssdk.services.nimble.model.GetLaunchProfileInitializationRequest;
import software.amazon.awssdk.services.nimble.model.GetLaunchProfileInitializationResponse;
import software.amazon.awssdk.services.nimble.model.GetLaunchProfileMemberRequest;
import software.amazon.awssdk.services.nimble.model.GetLaunchProfileMemberResponse;
import software.amazon.awssdk.services.nimble.model.GetLaunchProfileRequest;
import software.amazon.awssdk.services.nimble.model.GetLaunchProfileResponse;
import software.amazon.awssdk.services.nimble.model.GetStreamingImageRequest;
import software.amazon.awssdk.services.nimble.model.GetStreamingImageResponse;
import software.amazon.awssdk.services.nimble.model.GetStreamingSessionRequest;
import software.amazon.awssdk.services.nimble.model.GetStreamingSessionResponse;
import software.amazon.awssdk.services.nimble.model.GetStreamingSessionStreamRequest;
import software.amazon.awssdk.services.nimble.model.GetStreamingSessionStreamResponse;
import software.amazon.awssdk.services.nimble.model.GetStudioComponentRequest;
import software.amazon.awssdk.services.nimble.model.GetStudioComponentResponse;
import software.amazon.awssdk.services.nimble.model.GetStudioMemberRequest;
import software.amazon.awssdk.services.nimble.model.GetStudioMemberResponse;
import software.amazon.awssdk.services.nimble.model.GetStudioRequest;
import software.amazon.awssdk.services.nimble.model.GetStudioResponse;
import software.amazon.awssdk.services.nimble.model.InternalServerErrorException;
import software.amazon.awssdk.services.nimble.model.ListEulaAcceptancesRequest;
import software.amazon.awssdk.services.nimble.model.ListEulaAcceptancesResponse;
import software.amazon.awssdk.services.nimble.model.ListEulasRequest;
import software.amazon.awssdk.services.nimble.model.ListEulasResponse;
import software.amazon.awssdk.services.nimble.model.ListLaunchProfileMembersRequest;
import software.amazon.awssdk.services.nimble.model.ListLaunchProfileMembersResponse;
import software.amazon.awssdk.services.nimble.model.ListLaunchProfilesRequest;
import software.amazon.awssdk.services.nimble.model.ListLaunchProfilesResponse;
import software.amazon.awssdk.services.nimble.model.ListStreamingImagesRequest;
import software.amazon.awssdk.services.nimble.model.ListStreamingImagesResponse;
import software.amazon.awssdk.services.nimble.model.ListStreamingSessionsRequest;
import software.amazon.awssdk.services.nimble.model.ListStreamingSessionsResponse;
import software.amazon.awssdk.services.nimble.model.ListStudioComponentsRequest;
import software.amazon.awssdk.services.nimble.model.ListStudioComponentsResponse;
import software.amazon.awssdk.services.nimble.model.ListStudioMembersRequest;
import software.amazon.awssdk.services.nimble.model.ListStudioMembersResponse;
import software.amazon.awssdk.services.nimble.model.ListStudiosRequest;
import software.amazon.awssdk.services.nimble.model.ListStudiosResponse;
import software.amazon.awssdk.services.nimble.model.ListTagsForResourceRequest;
import software.amazon.awssdk.services.nimble.model.ListTagsForResourceResponse;
import software.amazon.awssdk.services.nimble.model.NimbleException;
import software.amazon.awssdk.services.nimble.model.NimbleRequest;
import software.amazon.awssdk.services.nimble.model.PutLaunchProfileMembersRequest;
import software.amazon.awssdk.services.nimble.model.PutLaunchProfileMembersResponse;
import software.amazon.awssdk.services.nimble.model.PutStudioMembersRequest;
import software.amazon.awssdk.services.nimble.model.PutStudioMembersResponse;
import software.amazon.awssdk.services.nimble.model.ResourceNotFoundException;
import software.amazon.awssdk.services.nimble.model.ServiceQuotaExceededException;
import software.amazon.awssdk.services.nimble.model.StartStudioSsoConfigurationRepairRequest;
import software.amazon.awssdk.services.nimble.model.StartStudioSsoConfigurationRepairResponse;
import software.amazon.awssdk.services.nimble.model.TagResourceRequest;
import software.amazon.awssdk.services.nimble.model.TagResourceResponse;
import software.amazon.awssdk.services.nimble.model.ThrottlingException;
import software.amazon.awssdk.services.nimble.model.UntagResourceRequest;
import software.amazon.awssdk.services.nimble.model.UntagResourceResponse;
import software.amazon.awssdk.services.nimble.model.UpdateLaunchProfileMemberRequest;
import software.amazon.awssdk.services.nimble.model.UpdateLaunchProfileMemberResponse;
import software.amazon.awssdk.services.nimble.model.UpdateLaunchProfileRequest;
import software.amazon.awssdk.services.nimble.model.UpdateLaunchProfileResponse;
import software.amazon.awssdk.services.nimble.model.UpdateStreamingImageRequest;
import software.amazon.awssdk.services.nimble.model.UpdateStreamingImageResponse;
import software.amazon.awssdk.services.nimble.model.UpdateStudioComponentRequest;
import software.amazon.awssdk.services.nimble.model.UpdateStudioComponentResponse;
import software.amazon.awssdk.services.nimble.model.UpdateStudioRequest;
import software.amazon.awssdk.services.nimble.model.UpdateStudioResponse;
import software.amazon.awssdk.services.nimble.model.ValidationException;
import software.amazon.awssdk.services.nimble.paginators.ListEulaAcceptancesPublisher;
import software.amazon.awssdk.services.nimble.paginators.ListEulasPublisher;
import software.amazon.awssdk.services.nimble.paginators.ListLaunchProfileMembersPublisher;
import software.amazon.awssdk.services.nimble.paginators.ListLaunchProfilesPublisher;
import software.amazon.awssdk.services.nimble.paginators.ListStreamingImagesPublisher;
import software.amazon.awssdk.services.nimble.paginators.ListStreamingSessionsPublisher;
import software.amazon.awssdk.services.nimble.paginators.ListStudioComponentsPublisher;
import software.amazon.awssdk.services.nimble.paginators.ListStudioMembersPublisher;
import software.amazon.awssdk.services.nimble.paginators.ListStudiosPublisher;
import software.amazon.awssdk.services.nimble.transform.AcceptEulasRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.CreateLaunchProfileRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.CreateStreamingImageRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.CreateStreamingSessionRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.CreateStreamingSessionStreamRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.CreateStudioComponentRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.CreateStudioRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.DeleteLaunchProfileMemberRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.DeleteLaunchProfileRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.DeleteStreamingImageRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.DeleteStreamingSessionRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.DeleteStudioComponentRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.DeleteStudioMemberRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.DeleteStudioRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.GetEulaRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.GetLaunchProfileDetailsRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.GetLaunchProfileInitializationRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.GetLaunchProfileMemberRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.GetLaunchProfileRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.GetStreamingImageRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.GetStreamingSessionRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.GetStreamingSessionStreamRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.GetStudioComponentRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.GetStudioMemberRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.GetStudioRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.ListEulaAcceptancesRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.ListEulasRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.ListLaunchProfileMembersRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.ListLaunchProfilesRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.ListStreamingImagesRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.ListStreamingSessionsRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.ListStudioComponentsRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.ListStudioMembersRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.ListStudiosRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.ListTagsForResourceRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.PutLaunchProfileMembersRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.PutStudioMembersRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.StartStudioSsoConfigurationRepairRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.TagResourceRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.UntagResourceRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.UpdateLaunchProfileMemberRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.UpdateLaunchProfileRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.UpdateStreamingImageRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.UpdateStudioComponentRequestMarshaller;
import software.amazon.awssdk.services.nimble.transform.UpdateStudioRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;
/**
* Internal implementation of {@link NimbleAsyncClient}.
*
* @see NimbleAsyncClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultNimbleAsyncClient implements NimbleAsyncClient {
private static final Logger log = LoggerFactory.getLogger(DefaultNimbleAsyncClient.class);
private final AsyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultNimbleAsyncClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
this.clientConfiguration = clientConfiguration;
this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
}
@Override
public final String serviceName() {
return SERVICE_NAME;
}
/**
*
* Accept EULAs.
*
*
* @param acceptEulasRequest
* A collection of EULA acceptances.
* @return A Java Future containing the result of the AcceptEulas operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.AcceptEulas
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture acceptEulas(AcceptEulasRequest acceptEulasRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, acceptEulasRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "AcceptEulas");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
AcceptEulasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AcceptEulas").withMarshaller(new AcceptEulasRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(acceptEulasRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = acceptEulasRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Create a launch profile.
*
*
* @param createLaunchProfileRequest
* A collection of launch profiles.
* @return A Java Future containing the result of the CreateLaunchProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.CreateLaunchProfile
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createLaunchProfile(
CreateLaunchProfileRequest createLaunchProfileRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createLaunchProfileRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateLaunchProfile");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateLaunchProfileResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateLaunchProfile")
.withMarshaller(new CreateLaunchProfileRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createLaunchProfileRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = createLaunchProfileRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a streaming image resource in a studio.
*
*
* @param createStreamingImageRequest
* A collection of streaming images.
* @return A Java Future containing the result of the CreateStreamingImage operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.CreateStreamingImage
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createStreamingImage(
CreateStreamingImageRequest createStreamingImageRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createStreamingImageRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateStreamingImage");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateStreamingImageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateStreamingImage")
.withMarshaller(new CreateStreamingImageRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createStreamingImageRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = createStreamingImageRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a streaming session in a studio.
*
*
* After invoking this operation, you must poll GetStreamingSession until the streaming session is in state READY.
*
*
* @param createStreamingSessionRequest
* A collection of streaming sessions.
* @return A Java Future containing the result of the CreateStreamingSession operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.CreateStreamingSession
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createStreamingSession(
CreateStreamingSessionRequest createStreamingSessionRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createStreamingSessionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateStreamingSession");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateStreamingSessionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateStreamingSession")
.withMarshaller(new CreateStreamingSessionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createStreamingSessionRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = createStreamingSessionRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a streaming session stream for a streaming session.
*
*
* After invoking this API, invoke GetStreamingSessionStream with the returned streamId to poll the resource until
* it is in state READY.
*
*
* @param createStreamingSessionStreamRequest
* A list collection streams.
* @return A Java Future containing the result of the CreateStreamingSessionStream operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.CreateStreamingSessionStream
* @see AWS API Documentation
*/
@Override
public CompletableFuture createStreamingSessionStream(
CreateStreamingSessionStreamRequest createStreamingSessionStreamRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createStreamingSessionStreamRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateStreamingSessionStream");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateStreamingSessionStreamResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateStreamingSessionStream")
.withMarshaller(new CreateStreamingSessionStreamRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createStreamingSessionStreamRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = createStreamingSessionStreamRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Create a new Studio.
*
*
* When creating a Studio, two IAM roles must be provided: the admin role and the user Role. These roles are assumed
* by your users when they log in to the Nimble Studio portal.
*
*
* The user role must have the AmazonNimbleStudio-StudioUser managed policy attached for the portal to function
* properly.
*
*
* The Admin Role must have the AmazonNimbleStudio-StudioAdmin managed policy attached for the portal to function
* properly.
*
*
* You may optionally specify a KMS key in the StudioEncryptionConfiguration.
*
*
* In Nimble Studio, resource names, descriptions, initialization scripts, and other data you provide are always
* encrypted at rest using an KMS key. By default, this key is owned by Amazon Web Services and managed on your
* behalf. You may provide your own KMS key when calling CreateStudio to encrypt this data using a key you own and
* manage.
*
*
* When providing an KMS key during studio creation, Nimble Studio creates KMS grants in your account to provide
* your studio user and admin roles access to these KMS keys.
*
*
* If you delete this grant, the studio will no longer be accessible to your portal users.
*
*
* If you delete the studio KMS key, your studio will no longer be accessible.
*
*
* @param createStudioRequest
* A collection of studio resources.
* @return A Java Future containing the result of the CreateStudio operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.CreateStudio
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture createStudio(CreateStudioRequest createStudioRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createStudioRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateStudio");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateStudioResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateStudio").withMarshaller(new CreateStudioRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createStudioRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = createStudioRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Creates a studio component resource.
*
*
* @param createStudioComponentRequest
* The studio components.
* @return A Java Future containing the result of the CreateStudioComponent operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.CreateStudioComponent
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture createStudioComponent(
CreateStudioComponentRequest createStudioComponentRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, createStudioComponentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "CreateStudioComponent");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateStudioComponentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateStudioComponent")
.withMarshaller(new CreateStudioComponentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(createStudioComponentRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = createStudioComponentRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Permanently delete a launch profile.
*
*
* @param deleteLaunchProfileRequest
* @return A Java Future containing the result of the DeleteLaunchProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.DeleteLaunchProfile
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteLaunchProfile(
DeleteLaunchProfileRequest deleteLaunchProfileRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteLaunchProfileRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteLaunchProfile");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteLaunchProfileResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteLaunchProfile")
.withMarshaller(new DeleteLaunchProfileRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteLaunchProfileRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteLaunchProfileRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Delete a user from launch profile membership.
*
*
* @param deleteLaunchProfileMemberRequest
* @return A Java Future containing the result of the DeleteLaunchProfileMember operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.DeleteLaunchProfileMember
* @see AWS API Documentation
*/
@Override
public CompletableFuture deleteLaunchProfileMember(
DeleteLaunchProfileMemberRequest deleteLaunchProfileMemberRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteLaunchProfileMemberRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteLaunchProfileMember");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteLaunchProfileMemberResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteLaunchProfileMember")
.withMarshaller(new DeleteLaunchProfileMemberRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteLaunchProfileMemberRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteLaunchProfileMemberRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Delete streaming image.
*
*
* @param deleteStreamingImageRequest
* @return A Java Future containing the result of the DeleteStreamingImage operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.DeleteStreamingImage
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteStreamingImage(
DeleteStreamingImageRequest deleteStreamingImageRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteStreamingImageRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteStreamingImage");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteStreamingImageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteStreamingImage")
.withMarshaller(new DeleteStreamingImageRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteStreamingImageRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteStreamingImageRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes streaming session resource.
*
*
* After invoking this operation, use GetStreamingSession to poll the resource until it transitions to a DELETED
* state.
*
*
* A streaming session will count against your streaming session quota until it is marked DELETED.
*
*
* @param deleteStreamingSessionRequest
* @return A Java Future containing the result of the DeleteStreamingSession operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.DeleteStreamingSession
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteStreamingSession(
DeleteStreamingSessionRequest deleteStreamingSessionRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteStreamingSessionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteStreamingSession");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteStreamingSessionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteStreamingSession")
.withMarshaller(new DeleteStreamingSessionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteStreamingSessionRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteStreamingSessionRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Delete a studio resource.
*
*
* @param deleteStudioRequest
* @return A Java Future containing the result of the DeleteStudio operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.DeleteStudio
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteStudio(DeleteStudioRequest deleteStudioRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteStudioRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteStudio");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteStudioResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteStudio").withMarshaller(new DeleteStudioRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteStudioRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteStudioRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Deletes a studio component resource.
*
*
* @param deleteStudioComponentRequest
* @return A Java Future containing the result of the DeleteStudioComponent operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.DeleteStudioComponent
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture deleteStudioComponent(
DeleteStudioComponentRequest deleteStudioComponentRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteStudioComponentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteStudioComponent");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteStudioComponentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteStudioComponent")
.withMarshaller(new DeleteStudioComponentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteStudioComponentRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteStudioComponentRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Delete a user from studio membership.
*
*
* @param deleteStudioMemberRequest
* @return A Java Future containing the result of the DeleteStudioMember operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.DeleteStudioMember
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture deleteStudioMember(DeleteStudioMemberRequest deleteStudioMemberRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, deleteStudioMemberRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "DeleteStudioMember");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteStudioMemberResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteStudioMember")
.withMarshaller(new DeleteStudioMemberRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(deleteStudioMemberRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = deleteStudioMemberRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Get Eula.
*
*
* @param getEulaRequest
* @return A Java Future containing the result of the GetEula operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.GetEula
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getEula(GetEulaRequest getEulaRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getEulaRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetEula");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetEulaResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("GetEula")
.withMarshaller(new GetEulaRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector)
.withInput(getEulaRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getEulaRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Get a launch profile.
*
*
* @param getLaunchProfileRequest
* @return A Java Future containing the result of the GetLaunchProfile operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.GetLaunchProfile
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getLaunchProfile(GetLaunchProfileRequest getLaunchProfileRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getLaunchProfileRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLaunchProfile");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLaunchProfileResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetLaunchProfile")
.withMarshaller(new GetLaunchProfileRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getLaunchProfileRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getLaunchProfileRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Launch profile details include the launch profile resource and summary information of resources that are used by,
* or available to, the launch profile. This includes the name and description of all studio components used by the
* launch profiles, and the name and description of streaming images that can be used with this launch profile.
*
*
* @param getLaunchProfileDetailsRequest
* @return A Java Future containing the result of the GetLaunchProfileDetails operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.GetLaunchProfileDetails
* @see AWS API Documentation
*/
@Override
public CompletableFuture getLaunchProfileDetails(
GetLaunchProfileDetailsRequest getLaunchProfileDetailsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getLaunchProfileDetailsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLaunchProfileDetails");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLaunchProfileDetailsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetLaunchProfileDetails")
.withMarshaller(new GetLaunchProfileDetailsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getLaunchProfileDetailsRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getLaunchProfileDetailsRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Get a launch profile initialization.
*
*
* @param getLaunchProfileInitializationRequest
* @return A Java Future containing the result of the GetLaunchProfileInitialization operation returned by the
* service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.GetLaunchProfileInitialization
* @see AWS API Documentation
*/
@Override
public CompletableFuture getLaunchProfileInitialization(
GetLaunchProfileInitializationRequest getLaunchProfileInitializationRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration,
getLaunchProfileInitializationRequest.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLaunchProfileInitialization");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLaunchProfileInitializationResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetLaunchProfileInitialization")
.withMarshaller(new GetLaunchProfileInitializationRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getLaunchProfileInitializationRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getLaunchProfileInitializationRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Get a user persona in launch profile membership.
*
*
* @param getLaunchProfileMemberRequest
* @return A Java Future containing the result of the GetLaunchProfileMember operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.GetLaunchProfileMember
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getLaunchProfileMember(
GetLaunchProfileMemberRequest getLaunchProfileMemberRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getLaunchProfileMemberRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetLaunchProfileMember");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetLaunchProfileMemberResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetLaunchProfileMember")
.withMarshaller(new GetLaunchProfileMemberRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getLaunchProfileMemberRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getLaunchProfileMemberRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Get streaming image.
*
*
* @param getStreamingImageRequest
* @return A Java Future containing the result of the GetStreamingImage operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.GetStreamingImage
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getStreamingImage(GetStreamingImageRequest getStreamingImageRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getStreamingImageRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetStreamingImage");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetStreamingImageResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetStreamingImage")
.withMarshaller(new GetStreamingImageRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getStreamingImageRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getStreamingImageRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets StreamingSession resource.
*
*
* Invoke this operation to poll for a streaming session state while creating or deleting a session.
*
*
* @param getStreamingSessionRequest
* @return A Java Future containing the result of the GetStreamingSession operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.GetStreamingSession
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture getStreamingSession(
GetStreamingSessionRequest getStreamingSessionRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getStreamingSessionRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetStreamingSession");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetStreamingSessionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetStreamingSession")
.withMarshaller(new GetStreamingSessionRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getStreamingSessionRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getStreamingSessionRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets a StreamingSessionStream for a streaming session.
*
*
* Invoke this operation to poll the resource after invoking CreateStreamingSessionStream.
*
*
* After the StreamingSessionStream changes to the state READY, the url property will contain a stream to be used
* with the DCV streaming client.
*
*
* @param getStreamingSessionStreamRequest
* @return A Java Future containing the result of the GetStreamingSessionStream operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.GetStreamingSessionStream
* @see AWS API Documentation
*/
@Override
public CompletableFuture getStreamingSessionStream(
GetStreamingSessionStreamRequest getStreamingSessionStreamRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getStreamingSessionStreamRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetStreamingSessionStream");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetStreamingSessionStreamResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetStreamingSessionStream")
.withMarshaller(new GetStreamingSessionStreamRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getStreamingSessionStreamRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getStreamingSessionStreamRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Get a Studio resource.
*
*
* @param getStudioRequest
* @return A Java Future containing the result of the GetStudio operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.GetStudio
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getStudio(GetStudioRequest getStudioRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getStudioRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetStudio");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetStudioResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("GetStudio")
.withMarshaller(new GetStudioRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector)
.withInput(getStudioRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getStudioRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Gets a studio component resource.
*
*
* @param getStudioComponentRequest
* @return A Java Future containing the result of the GetStudioComponent operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.GetStudioComponent
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getStudioComponent(GetStudioComponentRequest getStudioComponentRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getStudioComponentRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetStudioComponent");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetStudioComponentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetStudioComponent")
.withMarshaller(new GetStudioComponentRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getStudioComponentRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getStudioComponentRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Get a user's membership in a studio.
*
*
* @param getStudioMemberRequest
* @return A Java Future containing the result of the GetStudioMember operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.GetStudioMember
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture getStudioMember(GetStudioMemberRequest getStudioMemberRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, getStudioMemberRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "GetStudioMember");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetStudioMemberResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("GetStudioMember")
.withMarshaller(new GetStudioMemberRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(getStudioMemberRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = getStudioMemberRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* List Eula Acceptances.
*
*
* @param listEulaAcceptancesRequest
* @return A Java Future containing the result of the ListEulaAcceptances operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListEulaAcceptances
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listEulaAcceptances(
ListEulaAcceptancesRequest listEulaAcceptancesRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listEulaAcceptancesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListEulaAcceptances");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListEulaAcceptancesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListEulaAcceptances")
.withMarshaller(new ListEulaAcceptancesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listEulaAcceptancesRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listEulaAcceptancesRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* List Eula Acceptances.
*
*
*
* This is a variant of
* {@link #listEulaAcceptances(software.amazon.awssdk.services.nimble.model.ListEulaAcceptancesRequest)} operation.
* The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
* internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListEulaAcceptancesPublisher publisher = client.listEulaAcceptancesPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListEulaAcceptancesPublisher publisher = client.listEulaAcceptancesPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.nimble.model.ListEulaAcceptancesResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of null 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 #listEulaAcceptances(software.amazon.awssdk.services.nimble.model.ListEulaAcceptancesRequest)}
* operation.
*
*
* @param listEulaAcceptancesRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListEulaAcceptances
* @see AWS
* API Documentation
*/
public ListEulaAcceptancesPublisher listEulaAcceptancesPaginator(ListEulaAcceptancesRequest listEulaAcceptancesRequest) {
return new ListEulaAcceptancesPublisher(this, applyPaginatorUserAgent(listEulaAcceptancesRequest));
}
/**
*
* List Eulas.
*
*
* @param listEulasRequest
* @return A Java Future containing the result of the ListEulas operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListEulas
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listEulas(ListEulasRequest listEulasRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listEulasRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListEulas");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListEulasResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams().withOperationName("ListEulas")
.withMarshaller(new ListEulasRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector)
.withInput(listEulasRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listEulasRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* List Eulas.
*
*
*
* This is a variant of {@link #listEulas(software.amazon.awssdk.services.nimble.model.ListEulasRequest)} operation.
* The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
* internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListEulasPublisher publisher = client.listEulasPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListEulasPublisher publisher = client.listEulasPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.nimble.model.ListEulasResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of null 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 #listEulas(software.amazon.awssdk.services.nimble.model.ListEulasRequest)} operation.
*
*
* @param listEulasRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListEulas
* @see AWS API
* Documentation
*/
public ListEulasPublisher listEulasPaginator(ListEulasRequest listEulasRequest) {
return new ListEulasPublisher(this, applyPaginatorUserAgent(listEulasRequest));
}
/**
*
* Get all users in a given launch profile membership.
*
*
* @param listLaunchProfileMembersRequest
* @return A Java Future containing the result of the ListLaunchProfileMembers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListLaunchProfileMembers
* @see AWS API Documentation
*/
@Override
public CompletableFuture listLaunchProfileMembers(
ListLaunchProfileMembersRequest listLaunchProfileMembersRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listLaunchProfileMembersRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListLaunchProfileMembers");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListLaunchProfileMembersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListLaunchProfileMembers")
.withMarshaller(new ListLaunchProfileMembersRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listLaunchProfileMembersRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listLaunchProfileMembersRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Get all users in a given launch profile membership.
*
*
*
* This is a variant of
* {@link #listLaunchProfileMembers(software.amazon.awssdk.services.nimble.model.ListLaunchProfileMembersRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListLaunchProfileMembersPublisher publisher = client.listLaunchProfileMembersPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListLaunchProfileMembersPublisher publisher = client.listLaunchProfileMembersPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.nimble.model.ListLaunchProfileMembersResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* 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 #listLaunchProfileMembers(software.amazon.awssdk.services.nimble.model.ListLaunchProfileMembersRequest)}
* operation.
*
*
* @param listLaunchProfileMembersRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListLaunchProfileMembers
* @see AWS API Documentation
*/
public ListLaunchProfileMembersPublisher listLaunchProfileMembersPaginator(
ListLaunchProfileMembersRequest listLaunchProfileMembersRequest) {
return new ListLaunchProfileMembersPublisher(this, applyPaginatorUserAgent(listLaunchProfileMembersRequest));
}
/**
*
* List all the launch profiles a studio.
*
*
* @param listLaunchProfilesRequest
* @return A Java Future containing the result of the ListLaunchProfiles operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListLaunchProfiles
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listLaunchProfiles(ListLaunchProfilesRequest listLaunchProfilesRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listLaunchProfilesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListLaunchProfiles");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListLaunchProfilesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListLaunchProfiles")
.withMarshaller(new ListLaunchProfilesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listLaunchProfilesRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listLaunchProfilesRequest.overrideConfiguration()
.orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* List all the launch profiles a studio.
*
*
*
* This is a variant of
* {@link #listLaunchProfiles(software.amazon.awssdk.services.nimble.model.ListLaunchProfilesRequest)} operation.
* The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
* internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListLaunchProfilesPublisher publisher = client.listLaunchProfilesPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListLaunchProfilesPublisher publisher = client.listLaunchProfilesPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.nimble.model.ListLaunchProfilesResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* 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 #listLaunchProfiles(software.amazon.awssdk.services.nimble.model.ListLaunchProfilesRequest)}
* operation.
*
*
* @param listLaunchProfilesRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListLaunchProfiles
* @see AWS API
* Documentation
*/
public ListLaunchProfilesPublisher listLaunchProfilesPaginator(ListLaunchProfilesRequest listLaunchProfilesRequest) {
return new ListLaunchProfilesPublisher(this, applyPaginatorUserAgent(listLaunchProfilesRequest));
}
/**
*
* List the streaming image resources available to this studio.
*
*
* This list will contain both images provided by Amazon Web Services, as well as streaming images that you have
* created in your studio.
*
*
* @param listStreamingImagesRequest
* @return A Java Future containing the result of the ListStreamingImages operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListStreamingImages
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listStreamingImages(
ListStreamingImagesRequest listStreamingImagesRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listStreamingImagesRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListStreamingImages");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListStreamingImagesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListStreamingImages")
.withMarshaller(new ListStreamingImagesRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listStreamingImagesRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listStreamingImagesRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* List the streaming image resources available to this studio.
*
*
* This list will contain both images provided by Amazon Web Services, as well as streaming images that you have
* created in your studio.
*
*
*
* This is a variant of
* {@link #listStreamingImages(software.amazon.awssdk.services.nimble.model.ListStreamingImagesRequest)} operation.
* The return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
* internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListStreamingImagesPublisher publisher = client.listStreamingImagesPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListStreamingImagesPublisher publisher = client.listStreamingImagesPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.nimble.model.ListStreamingImagesResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of null 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 #listStreamingImages(software.amazon.awssdk.services.nimble.model.ListStreamingImagesRequest)}
* operation.
*
*
* @param listStreamingImagesRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListStreamingImages
* @see AWS
* API Documentation
*/
public ListStreamingImagesPublisher listStreamingImagesPaginator(ListStreamingImagesRequest listStreamingImagesRequest) {
return new ListStreamingImagesPublisher(this, applyPaginatorUserAgent(listStreamingImagesRequest));
}
/**
*
* Lists the streaming image resources in a studio.
*
*
* @param listStreamingSessionsRequest
* @return A Java Future containing the result of the ListStreamingSessions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListStreamingSessions
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listStreamingSessions(
ListStreamingSessionsRequest listStreamingSessionsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listStreamingSessionsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListStreamingSessions");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListStreamingSessionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListStreamingSessions")
.withMarshaller(new ListStreamingSessionsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listStreamingSessionsRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listStreamingSessionsRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists the streaming image resources in a studio.
*
*
*
* This is a variant of
* {@link #listStreamingSessions(software.amazon.awssdk.services.nimble.model.ListStreamingSessionsRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListStreamingSessionsPublisher publisher = client.listStreamingSessionsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListStreamingSessionsPublisher publisher = client.listStreamingSessionsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.nimble.model.ListStreamingSessionsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of null 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 #listStreamingSessions(software.amazon.awssdk.services.nimble.model.ListStreamingSessionsRequest)}
* operation.
*
*
* @param listStreamingSessionsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListStreamingSessions
* @see AWS
* API Documentation
*/
public ListStreamingSessionsPublisher listStreamingSessionsPaginator(ListStreamingSessionsRequest listStreamingSessionsRequest) {
return new ListStreamingSessionsPublisher(this, applyPaginatorUserAgent(listStreamingSessionsRequest));
}
/**
*
* Lists the StudioComponents in a studio.
*
*
* @param listStudioComponentsRequest
* @return A Java Future containing the result of the ListStudioComponents operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListStudioComponents
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listStudioComponents(
ListStudioComponentsRequest listStudioComponentsRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listStudioComponentsRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListStudioComponents");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListStudioComponentsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListStudioComponents")
.withMarshaller(new ListStudioComponentsRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listStudioComponentsRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listStudioComponentsRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Lists the StudioComponents in a studio.
*
*
*
* This is a variant of
* {@link #listStudioComponents(software.amazon.awssdk.services.nimble.model.ListStudioComponentsRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListStudioComponentsPublisher publisher = client.listStudioComponentsPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListStudioComponentsPublisher publisher = client.listStudioComponentsPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.nimble.model.ListStudioComponentsResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* 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 #listStudioComponents(software.amazon.awssdk.services.nimble.model.ListStudioComponentsRequest)}
* operation.
*
*
* @param listStudioComponentsRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListStudioComponents
* @see AWS
* API Documentation
*/
public ListStudioComponentsPublisher listStudioComponentsPaginator(ListStudioComponentsRequest listStudioComponentsRequest) {
return new ListStudioComponentsPublisher(this, applyPaginatorUserAgent(listStudioComponentsRequest));
}
/**
*
* Get all users in a given studio membership.
*
*
* @param listStudioMembersRequest
* @return A Java Future containing the result of the ListStudioMembers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListStudioMembers
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listStudioMembers(ListStudioMembersRequest listStudioMembersRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listStudioMembersRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListStudioMembers");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListStudioMembersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListStudioMembers")
.withMarshaller(new ListStudioMembersRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listStudioMembersRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listStudioMembersRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Get all users in a given studio membership.
*
*
*
* This is a variant of
* {@link #listStudioMembers(software.amazon.awssdk.services.nimble.model.ListStudioMembersRequest)} operation. The
* return type is a custom publisher that can be subscribed to request a stream of response pages. SDK will
* internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListStudioMembersPublisher publisher = client.listStudioMembersPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListStudioMembersPublisher publisher = client.listStudioMembersPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.nimble.model.ListStudioMembersResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* 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 #listStudioMembers(software.amazon.awssdk.services.nimble.model.ListStudioMembersRequest)} operation.
*
*
* @param listStudioMembersRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListStudioMembers
* @see AWS API
* Documentation
*/
public ListStudioMembersPublisher listStudioMembersPaginator(ListStudioMembersRequest listStudioMembersRequest) {
return new ListStudioMembersPublisher(this, applyPaginatorUserAgent(listStudioMembersRequest));
}
/**
*
* List studios in your Amazon Web Services account in the requested Amazon Web Services Region.
*
*
* @param listStudiosRequest
* @return A Java Future containing the result of the ListStudios operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListStudios
* @see AWS API
* Documentation
*/
@Override
public CompletableFuture listStudios(ListStudiosRequest listStudiosRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listStudiosRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListStudios");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ListStudiosResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListStudios").withMarshaller(new ListStudiosRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listStudiosRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listStudiosRequest.overrideConfiguration().orElse(null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* List studios in your Amazon Web Services account in the requested Amazon Web Services Region.
*
*
*
* This is a variant of {@link #listStudios(software.amazon.awssdk.services.nimble.model.ListStudiosRequest)}
* operation. The return type is a custom publisher that can be subscribed to request a stream of response pages.
* SDK will internally handle making service calls for you.
*
*
* When the operation is called, an instance of this class is returned. At this point, no service calls are made yet
* and so there is no guarantee that the request is valid. If there are errors in your request, you will see the
* failures only after you start streaming the data. The subscribe method should be called as a request to start
* streaming data. For more info, see
* {@link org.reactivestreams.Publisher#subscribe(org.reactivestreams.Subscriber)}. Each call to the subscribe
* method will result in a new {@link org.reactivestreams.Subscription} i.e., a new contract to stream data from the
* starting request.
*
*
*
* The following are few ways to use the response class:
*
* 1) Using the subscribe helper method
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListStudiosPublisher publisher = client.listStudiosPaginator(request);
* CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
* future.get();
* }
*
*
* 2) Using a custom subscriber
*
*
* {@code
* software.amazon.awssdk.services.nimble.paginators.ListStudiosPublisher publisher = client.listStudiosPaginator(request);
* publisher.subscribe(new Subscriber() {
*
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
*
*
* public void onNext(software.amazon.awssdk.services.nimble.model.ListStudiosResponse response) { //... };
* });}
*
*
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
*
* Please notice that the configuration of null 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 #listStudios(software.amazon.awssdk.services.nimble.model.ListStudiosRequest)} operation.
*
*
* @param listStudiosRequest
* @return A custom publisher that can be subscribed to request a stream of response pages.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListStudios
* @see AWS API
* Documentation
*/
public ListStudiosPublisher listStudiosPaginator(ListStudiosRequest listStudiosRequest) {
return new ListStudiosPublisher(this, applyPaginatorUserAgent(listStudiosRequest));
}
/**
*
* Gets the tags for a resource, given its Amazon Resource Names (ARN).
*
*
* This operation supports ARNs for all resource types in Nimble Studio that support tags, including studio, studio
* component, launch profile, streaming image, and streaming session. All resources that can be tagged will contain
* an ARN property, so you do not have to create this ARN yourself.
*
*
* @param listTagsForResourceRequest
* @return A Java Future containing the result of the ListTagsForResource operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.ListTagsForResource
* @see AWS
* API Documentation
*/
@Override
public CompletableFuture listTagsForResource(
ListTagsForResourceRequest listTagsForResourceRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, listTagsForResourceRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "ListTagsForResource");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, ListTagsForResourceResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams()
.withOperationName("ListTagsForResource")
.withMarshaller(new ListTagsForResourceRequestMarshaller(protocolFactory))
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
.withMetricCollector(apiCallMetricCollector).withInput(listTagsForResourceRequest));
AwsRequestOverrideConfiguration requestOverrideConfig = listTagsForResourceRequest.overrideConfiguration().orElse(
null);
CompletableFuture whenCompleted = executeFuture.whenComplete((r, e) -> {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
});
executeFuture = CompletableFutureUtils.forwardExceptionTo(whenCompleted, executeFuture);
return executeFuture;
} catch (Throwable t) {
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
return CompletableFutureUtils.failedFuture(t);
}
}
/**
*
* Add/update users with given persona to launch profile membership.
*
*
* @param putLaunchProfileMembersRequest
* Information about a launch profile membership.
* @return A Java Future containing the result of the PutLaunchProfileMembers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following
* exceptions.
*
* - ValidationException One of the parameters in the request is invalid.
* - InternalServerErrorException A service fault has occurred. Please retry your request and contact
* Amazon Web Services Support if this error continues.
* - ServiceQuotaExceededException This request would cause a service quota to be exceeded. Please use the
* Amazon Web Services Service Quotas console to request an increase.
* - AccessDeniedException You do not have permission to perform this action.
* - ResourceNotFoundException A requested resource was not found.
* - ThrottlingException The request was denied due to request throttling. Please retry your request.
* - ConflictException This request conflicts with another concurrent request. Please retry your request.
* - SdkException Base class for all exceptions that can be thrown by the SDK (both service and client).
* Can be used for catch all scenarios.
* - SdkClientException If any client side error occurs such as an IO related failure, failure to get
* credentials, etc.
* - NimbleException Base class for all service exceptions. Unknown exceptions will be thrown as an
* instance of this type.
*
* @sample NimbleAsyncClient.PutLaunchProfileMembers
* @see AWS API Documentation
*/
@Override
public CompletableFuture putLaunchProfileMembers(
PutLaunchProfileMembersRequest putLaunchProfileMembersRequest) {
List metricPublishers = resolveMetricPublishers(clientConfiguration, putLaunchProfileMembersRequest
.overrideConfiguration().orElse(null));
MetricCollector apiCallMetricCollector = metricPublishers.isEmpty() ? NoOpMetricCollector.create() : MetricCollector
.create("ApiCall");
try {
apiCallMetricCollector.reportMetric(CoreMetric.SERVICE_ID, "nimble");
apiCallMetricCollector.reportMetric(CoreMetric.OPERATION_NAME, "PutLaunchProfileMembers");
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, PutLaunchProfileMembersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
CompletableFuture executeFuture = clientHandler
.execute(new ClientExecutionParams