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

software.amazon.awssdk.services.workdocs.DefaultWorkDocsAsyncClient Maven / Gradle / Ivy

/*
 * Copyright 2014-2019 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.workdocs;

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.client.config.SdkClientConfiguration;
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.util.VersionInfo;
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.workdocs.model.AbortDocumentVersionUploadRequest;
import software.amazon.awssdk.services.workdocs.model.AbortDocumentVersionUploadResponse;
import software.amazon.awssdk.services.workdocs.model.ActivateUserRequest;
import software.amazon.awssdk.services.workdocs.model.ActivateUserResponse;
import software.amazon.awssdk.services.workdocs.model.AddResourcePermissionsRequest;
import software.amazon.awssdk.services.workdocs.model.AddResourcePermissionsResponse;
import software.amazon.awssdk.services.workdocs.model.ConcurrentModificationException;
import software.amazon.awssdk.services.workdocs.model.ConflictingOperationException;
import software.amazon.awssdk.services.workdocs.model.CreateCommentRequest;
import software.amazon.awssdk.services.workdocs.model.CreateCommentResponse;
import software.amazon.awssdk.services.workdocs.model.CreateCustomMetadataRequest;
import software.amazon.awssdk.services.workdocs.model.CreateCustomMetadataResponse;
import software.amazon.awssdk.services.workdocs.model.CreateFolderRequest;
import software.amazon.awssdk.services.workdocs.model.CreateFolderResponse;
import software.amazon.awssdk.services.workdocs.model.CreateLabelsRequest;
import software.amazon.awssdk.services.workdocs.model.CreateLabelsResponse;
import software.amazon.awssdk.services.workdocs.model.CreateNotificationSubscriptionRequest;
import software.amazon.awssdk.services.workdocs.model.CreateNotificationSubscriptionResponse;
import software.amazon.awssdk.services.workdocs.model.CreateUserRequest;
import software.amazon.awssdk.services.workdocs.model.CreateUserResponse;
import software.amazon.awssdk.services.workdocs.model.CustomMetadataLimitExceededException;
import software.amazon.awssdk.services.workdocs.model.DeactivateUserRequest;
import software.amazon.awssdk.services.workdocs.model.DeactivateUserResponse;
import software.amazon.awssdk.services.workdocs.model.DeactivatingLastSystemUserException;
import software.amazon.awssdk.services.workdocs.model.DeleteCommentRequest;
import software.amazon.awssdk.services.workdocs.model.DeleteCommentResponse;
import software.amazon.awssdk.services.workdocs.model.DeleteCustomMetadataRequest;
import software.amazon.awssdk.services.workdocs.model.DeleteCustomMetadataResponse;
import software.amazon.awssdk.services.workdocs.model.DeleteDocumentRequest;
import software.amazon.awssdk.services.workdocs.model.DeleteDocumentResponse;
import software.amazon.awssdk.services.workdocs.model.DeleteFolderContentsRequest;
import software.amazon.awssdk.services.workdocs.model.DeleteFolderContentsResponse;
import software.amazon.awssdk.services.workdocs.model.DeleteFolderRequest;
import software.amazon.awssdk.services.workdocs.model.DeleteFolderResponse;
import software.amazon.awssdk.services.workdocs.model.DeleteLabelsRequest;
import software.amazon.awssdk.services.workdocs.model.DeleteLabelsResponse;
import software.amazon.awssdk.services.workdocs.model.DeleteNotificationSubscriptionRequest;
import software.amazon.awssdk.services.workdocs.model.DeleteNotificationSubscriptionResponse;
import software.amazon.awssdk.services.workdocs.model.DeleteUserRequest;
import software.amazon.awssdk.services.workdocs.model.DeleteUserResponse;
import software.amazon.awssdk.services.workdocs.model.DescribeActivitiesRequest;
import software.amazon.awssdk.services.workdocs.model.DescribeActivitiesResponse;
import software.amazon.awssdk.services.workdocs.model.DescribeCommentsRequest;
import software.amazon.awssdk.services.workdocs.model.DescribeCommentsResponse;
import software.amazon.awssdk.services.workdocs.model.DescribeDocumentVersionsRequest;
import software.amazon.awssdk.services.workdocs.model.DescribeDocumentVersionsResponse;
import software.amazon.awssdk.services.workdocs.model.DescribeFolderContentsRequest;
import software.amazon.awssdk.services.workdocs.model.DescribeFolderContentsResponse;
import software.amazon.awssdk.services.workdocs.model.DescribeGroupsRequest;
import software.amazon.awssdk.services.workdocs.model.DescribeGroupsResponse;
import software.amazon.awssdk.services.workdocs.model.DescribeNotificationSubscriptionsRequest;
import software.amazon.awssdk.services.workdocs.model.DescribeNotificationSubscriptionsResponse;
import software.amazon.awssdk.services.workdocs.model.DescribeResourcePermissionsRequest;
import software.amazon.awssdk.services.workdocs.model.DescribeResourcePermissionsResponse;
import software.amazon.awssdk.services.workdocs.model.DescribeRootFoldersRequest;
import software.amazon.awssdk.services.workdocs.model.DescribeRootFoldersResponse;
import software.amazon.awssdk.services.workdocs.model.DescribeUsersRequest;
import software.amazon.awssdk.services.workdocs.model.DescribeUsersResponse;
import software.amazon.awssdk.services.workdocs.model.DocumentLockedForCommentsException;
import software.amazon.awssdk.services.workdocs.model.DraftUploadOutOfSyncException;
import software.amazon.awssdk.services.workdocs.model.EntityAlreadyExistsException;
import software.amazon.awssdk.services.workdocs.model.EntityNotExistsException;
import software.amazon.awssdk.services.workdocs.model.FailedDependencyException;
import software.amazon.awssdk.services.workdocs.model.GetCurrentUserRequest;
import software.amazon.awssdk.services.workdocs.model.GetCurrentUserResponse;
import software.amazon.awssdk.services.workdocs.model.GetDocumentPathRequest;
import software.amazon.awssdk.services.workdocs.model.GetDocumentPathResponse;
import software.amazon.awssdk.services.workdocs.model.GetDocumentRequest;
import software.amazon.awssdk.services.workdocs.model.GetDocumentResponse;
import software.amazon.awssdk.services.workdocs.model.GetDocumentVersionRequest;
import software.amazon.awssdk.services.workdocs.model.GetDocumentVersionResponse;
import software.amazon.awssdk.services.workdocs.model.GetFolderPathRequest;
import software.amazon.awssdk.services.workdocs.model.GetFolderPathResponse;
import software.amazon.awssdk.services.workdocs.model.GetFolderRequest;
import software.amazon.awssdk.services.workdocs.model.GetFolderResponse;
import software.amazon.awssdk.services.workdocs.model.GetResourcesRequest;
import software.amazon.awssdk.services.workdocs.model.GetResourcesResponse;
import software.amazon.awssdk.services.workdocs.model.IllegalUserStateException;
import software.amazon.awssdk.services.workdocs.model.InitiateDocumentVersionUploadRequest;
import software.amazon.awssdk.services.workdocs.model.InitiateDocumentVersionUploadResponse;
import software.amazon.awssdk.services.workdocs.model.InvalidArgumentException;
import software.amazon.awssdk.services.workdocs.model.InvalidCommentOperationException;
import software.amazon.awssdk.services.workdocs.model.InvalidOperationException;
import software.amazon.awssdk.services.workdocs.model.InvalidPasswordException;
import software.amazon.awssdk.services.workdocs.model.LimitExceededException;
import software.amazon.awssdk.services.workdocs.model.ProhibitedStateException;
import software.amazon.awssdk.services.workdocs.model.RemoveAllResourcePermissionsRequest;
import software.amazon.awssdk.services.workdocs.model.RemoveAllResourcePermissionsResponse;
import software.amazon.awssdk.services.workdocs.model.RemoveResourcePermissionRequest;
import software.amazon.awssdk.services.workdocs.model.RemoveResourcePermissionResponse;
import software.amazon.awssdk.services.workdocs.model.RequestedEntityTooLargeException;
import software.amazon.awssdk.services.workdocs.model.ResourceAlreadyCheckedOutException;
import software.amazon.awssdk.services.workdocs.model.ServiceUnavailableException;
import software.amazon.awssdk.services.workdocs.model.StorageLimitExceededException;
import software.amazon.awssdk.services.workdocs.model.StorageLimitWillExceedException;
import software.amazon.awssdk.services.workdocs.model.TooManyLabelsException;
import software.amazon.awssdk.services.workdocs.model.TooManySubscriptionsException;
import software.amazon.awssdk.services.workdocs.model.UnauthorizedOperationException;
import software.amazon.awssdk.services.workdocs.model.UnauthorizedResourceAccessException;
import software.amazon.awssdk.services.workdocs.model.UpdateDocumentRequest;
import software.amazon.awssdk.services.workdocs.model.UpdateDocumentResponse;
import software.amazon.awssdk.services.workdocs.model.UpdateDocumentVersionRequest;
import software.amazon.awssdk.services.workdocs.model.UpdateDocumentVersionResponse;
import software.amazon.awssdk.services.workdocs.model.UpdateFolderRequest;
import software.amazon.awssdk.services.workdocs.model.UpdateFolderResponse;
import software.amazon.awssdk.services.workdocs.model.UpdateUserRequest;
import software.amazon.awssdk.services.workdocs.model.UpdateUserResponse;
import software.amazon.awssdk.services.workdocs.model.WorkDocsException;
import software.amazon.awssdk.services.workdocs.model.WorkDocsRequest;
import software.amazon.awssdk.services.workdocs.paginators.DescribeDocumentVersionsPublisher;
import software.amazon.awssdk.services.workdocs.paginators.DescribeFolderContentsPublisher;
import software.amazon.awssdk.services.workdocs.paginators.DescribeUsersPublisher;
import software.amazon.awssdk.services.workdocs.transform.AbortDocumentVersionUploadRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.ActivateUserRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.AddResourcePermissionsRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.CreateCommentRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.CreateCustomMetadataRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.CreateFolderRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.CreateLabelsRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.CreateNotificationSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.CreateUserRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DeactivateUserRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DeleteCommentRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DeleteCustomMetadataRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DeleteDocumentRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DeleteFolderContentsRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DeleteFolderRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DeleteLabelsRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DeleteNotificationSubscriptionRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DeleteUserRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DescribeActivitiesRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DescribeCommentsRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DescribeDocumentVersionsRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DescribeFolderContentsRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DescribeGroupsRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DescribeNotificationSubscriptionsRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DescribeResourcePermissionsRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DescribeRootFoldersRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.DescribeUsersRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.GetCurrentUserRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.GetDocumentPathRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.GetDocumentRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.GetDocumentVersionRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.GetFolderPathRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.GetFolderRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.GetResourcesRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.InitiateDocumentVersionUploadRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.RemoveAllResourcePermissionsRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.RemoveResourcePermissionRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.UpdateDocumentRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.UpdateDocumentVersionRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.UpdateFolderRequestMarshaller;
import software.amazon.awssdk.services.workdocs.transform.UpdateUserRequestMarshaller;
import software.amazon.awssdk.utils.CompletableFutureUtils;

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

    private final AsyncClientHandler clientHandler;

    private final AwsJsonProtocolFactory protocolFactory;

    private final SdkClientConfiguration clientConfiguration;

    protected DefaultWorkDocsAsyncClient(SdkClientConfiguration clientConfiguration) {
        this.clientHandler = new AwsAsyncClientHandler(clientConfiguration);
        this.clientConfiguration = clientConfiguration;
        this.protocolFactory = init(AwsJsonProtocolFactory.builder()).build();
    }

    @Override
    public final String serviceName() {
        return SERVICE_NAME;
    }

    /**
     * 

* Aborts the upload of the specified document version that was previously initiated by * InitiateDocumentVersionUpload. The client should make this call only when it no longer intends to upload * the document version, or fails to do so. *

* * @param abortDocumentVersionUploadRequest * @return A Java Future containing the result of the AbortDocumentVersionUpload operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.AbortDocumentVersionUpload * @see AWS API Documentation */ @Override public CompletableFuture abortDocumentVersionUpload( AbortDocumentVersionUploadRequest abortDocumentVersionUploadRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AbortDocumentVersionUploadResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AbortDocumentVersionUpload") .withMarshaller(new AbortDocumentVersionUploadRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(abortDocumentVersionUploadRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Activates the specified user. Only active users can access Amazon WorkDocs. *

* * @param activateUserRequest * @return A Java Future containing the result of the ActivateUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.ActivateUser * @see AWS API * Documentation */ @Override public CompletableFuture activateUser(ActivateUserRequest activateUserRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, ActivateUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("ActivateUser").withMarshaller(new ActivateUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(activateUserRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a set of permissions for the specified folder or document. The resource permissions are overwritten if * the principals already have different permissions. *

* * @param addResourcePermissionsRequest * @return A Java Future containing the result of the AddResourcePermissions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.AddResourcePermissions * @see AWS API Documentation */ @Override public CompletableFuture addResourcePermissions( AddResourcePermissionsRequest addResourcePermissionsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, AddResourcePermissionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("AddResourcePermissions") .withMarshaller(new AddResourcePermissionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(addResourcePermissionsRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds a new comment to the specified document version. *

* * @param createCommentRequest * @return A Java Future containing the result of the CreateComment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • DocumentLockedForCommentsException This exception is thrown when the document is locked for comments * and user tries to create or delete a comment on that document.
  • *
  • InvalidCommentOperationException The requested operation is not allowed on the specified comment * object.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.CreateComment * @see AWS API * Documentation */ @Override public CompletableFuture createComment(CreateCommentRequest createCommentRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateCommentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateComment") .withMarshaller(new CreateCommentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(createCommentRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds one or more custom properties to the specified resource (a folder, document, or version). *

* * @param createCustomMetadataRequest * @return A Java Future containing the result of the CreateCustomMetadata operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • CustomMetadataLimitExceededException The limit has been reached on the number of custom properties * for the specified resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.CreateCustomMetadata * @see AWS * API Documentation */ @Override public CompletableFuture createCustomMetadata( CreateCustomMetadataRequest createCustomMetadataRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateCustomMetadataResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateCustomMetadata") .withMarshaller(new CreateCustomMetadataRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(createCustomMetadataRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a folder with the specified name and parent folder. *

* * @param createFolderRequest * @return A Java Future containing the result of the CreateFolder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • EntityAlreadyExistsException The resource already exists.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • ConflictingOperationException Another operation is in progress on the resource that conflicts with * the current operation.
  • *
  • LimitExceededException The maximum of 100,000 folders under the parent folder has been exceeded.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.CreateFolder * @see AWS API * Documentation */ @Override public CompletableFuture createFolder(CreateFolderRequest createFolderRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateFolderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateFolder").withMarshaller(new CreateFolderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(createFolderRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Adds the specified list of labels to the given resource (a document or folder) *

* * @param createLabelsRequest * @return A Java Future containing the result of the CreateLabels operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • TooManyLabelsException The limit has been reached on the number of labels for the specified resource. *
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.CreateLabels * @see AWS API * Documentation */ @Override public CompletableFuture createLabels(CreateLabelsRequest createLabelsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateLabelsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateLabels").withMarshaller(new CreateLabelsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(createLabelsRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Configure Amazon WorkDocs to use Amazon SNS notifications. The endpoint receives a confirmation message, and must * confirm the subscription. *

*

* For more information, see Subscribe to * Notifications in the Amazon WorkDocs Developer Guide. *

* * @param createNotificationSubscriptionRequest * @return A Java Future containing the result of the CreateNotificationSubscription operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • TooManySubscriptionsException You've reached the limit on the number of subscriptions for the * WorkDocs instance.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.CreateNotificationSubscription * @see AWS API Documentation */ @Override public CompletableFuture createNotificationSubscription( CreateNotificationSubscriptionRequest createNotificationSubscriptionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, CreateNotificationSubscriptionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("CreateNotificationSubscription") .withMarshaller(new CreateNotificationSubscriptionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(createNotificationSubscriptionRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a user in a Simple AD or Microsoft AD directory. The status of a newly created user is "ACTIVE". New * users can access Amazon WorkDocs. *

* * @param createUserRequest * @return A Java Future containing the result of the CreateUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityAlreadyExistsException The resource already exists.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.CreateUser * @see AWS API * Documentation */ @Override public CompletableFuture createUser(CreateUserRequest createUserRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, CreateUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("CreateUser") .withMarshaller(new CreateUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(createUserRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Deactivates the specified user, which revokes the user's access to Amazon WorkDocs. *

* * @param deactivateUserRequest * @return A Java Future containing the result of the DeactivateUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DeactivateUser * @see AWS API * Documentation */ @Override public CompletableFuture deactivateUser(DeactivateUserRequest deactivateUserRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeactivateUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeactivateUser") .withMarshaller(new DeactivateUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(deactivateUserRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified comment from the document version. *

* * @param deleteCommentRequest * @return A Java Future containing the result of the DeleteComment operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • DocumentLockedForCommentsException This exception is thrown when the document is locked for comments * and user tries to create or delete a comment on that document.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DeleteComment * @see AWS API * Documentation */ @Override public CompletableFuture deleteComment(DeleteCommentRequest deleteCommentRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteCommentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteComment") .withMarshaller(new DeleteCommentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(deleteCommentRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes custom metadata from the specified resource. *

* * @param deleteCustomMetadataRequest * @return A Java Future containing the result of the DeleteCustomMetadata operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DeleteCustomMetadata * @see AWS * API Documentation */ @Override public CompletableFuture deleteCustomMetadata( DeleteCustomMetadataRequest deleteCustomMetadataRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteCustomMetadataResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteCustomMetadata") .withMarshaller(new DeleteCustomMetadataRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(deleteCustomMetadataRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Permanently deletes the specified document and its associated metadata. *

* * @param deleteDocumentRequest * @return A Java Future containing the result of the DeleteDocument operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • ConflictingOperationException Another operation is in progress on the resource that conflicts with * the current operation.
  • *
  • ConcurrentModificationException The resource hierarchy is changing.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DeleteDocument * @see AWS API * Documentation */ @Override public CompletableFuture deleteDocument(DeleteDocumentRequest deleteDocumentRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteDocumentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteDocument") .withMarshaller(new DeleteDocumentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(deleteDocumentRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Permanently deletes the specified folder and its contents. *

* * @param deleteFolderRequest * @return A Java Future containing the result of the DeleteFolder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • ConflictingOperationException Another operation is in progress on the resource that conflicts with * the current operation.
  • *
  • ConcurrentModificationException The resource hierarchy is changing.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DeleteFolder * @see AWS API * Documentation */ @Override public CompletableFuture deleteFolder(DeleteFolderRequest deleteFolderRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteFolderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteFolder").withMarshaller(new DeleteFolderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(deleteFolderRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the contents of the specified folder. *

* * @param deleteFolderContentsRequest * @return A Java Future containing the result of the DeleteFolderContents operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • ConflictingOperationException Another operation is in progress on the resource that conflicts with * the current operation.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DeleteFolderContents * @see AWS * API Documentation */ @Override public CompletableFuture deleteFolderContents( DeleteFolderContentsRequest deleteFolderContentsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteFolderContentsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteFolderContents") .withMarshaller(new DeleteFolderContentsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(deleteFolderContentsRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified list of labels from a resource. *

* * @param deleteLabelsRequest * @return A Java Future containing the result of the DeleteLabels operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DeleteLabels * @see AWS API * Documentation */ @Override public CompletableFuture deleteLabels(DeleteLabelsRequest deleteLabelsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteLabelsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteLabels").withMarshaller(new DeleteLabelsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(deleteLabelsRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified subscription from the specified organization. *

* * @param deleteNotificationSubscriptionRequest * @return A Java Future containing the result of the DeleteNotificationSubscription operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • EntityNotExistsException The resource does not exist.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DeleteNotificationSubscription * @see AWS API Documentation */ @Override public CompletableFuture deleteNotificationSubscription( DeleteNotificationSubscriptionRequest deleteNotificationSubscriptionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DeleteNotificationSubscriptionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DeleteNotificationSubscription") .withMarshaller(new DeleteNotificationSubscriptionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(deleteNotificationSubscriptionRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Deletes the specified user from a Simple AD or Microsoft AD directory. *

* * @param deleteUserRequest * @return A Java Future containing the result of the DeleteUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DeleteUser * @see AWS API * Documentation */ @Override public CompletableFuture deleteUser(DeleteUserRequest deleteUserRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DeleteUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("DeleteUser") .withMarshaller(new DeleteUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(deleteUserRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the user activities in a specified time period. *

* * @param describeActivitiesRequest * @return A Java Future containing the result of the DescribeActivities operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeActivities * @see AWS * API Documentation */ @Override public CompletableFuture describeActivities(DescribeActivitiesRequest describeActivitiesRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeActivitiesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeActivities") .withMarshaller(new DescribeActivitiesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(describeActivitiesRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* List all the comments for the specified document version. *

* * @param describeCommentsRequest * @return A Java Future containing the result of the DescribeComments operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeComments * @see AWS API * Documentation */ @Override public CompletableFuture describeComments(DescribeCommentsRequest describeCommentsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeCommentsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeComments") .withMarshaller(new DescribeCommentsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(describeCommentsRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the document versions for the specified document. *

*

* By default, only active versions are returned. *

* * @param describeDocumentVersionsRequest * @return A Java Future containing the result of the DescribeDocumentVersions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeDocumentVersions * @see AWS API Documentation */ @Override public CompletableFuture describeDocumentVersions( DescribeDocumentVersionsRequest describeDocumentVersionsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeDocumentVersionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeDocumentVersions") .withMarshaller(new DescribeDocumentVersionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(describeDocumentVersionsRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the document versions for the specified document. *

*

* By default, only active versions are returned. *

*
*

* This is a variant of * {@link #describeDocumentVersions(software.amazon.awssdk.services.workdocs.model.DescribeDocumentVersionsRequest)} * 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.workdocs.paginators.DescribeDocumentVersionsPublisher publisher = client.describeDocumentVersionsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.workdocs.paginators.DescribeDocumentVersionsPublisher publisher = client.describeDocumentVersionsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.workdocs.model.DescribeDocumentVersionsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Note: If you prefer to have control on service calls, use the * {@link #describeDocumentVersions(software.amazon.awssdk.services.workdocs.model.DescribeDocumentVersionsRequest)} * operation. *

* * @param describeDocumentVersionsRequest * @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. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeDocumentVersions * @see AWS API Documentation */ public DescribeDocumentVersionsPublisher describeDocumentVersionsPaginator( DescribeDocumentVersionsRequest describeDocumentVersionsRequest) { return new DescribeDocumentVersionsPublisher(this, applyPaginatorUserAgent(describeDocumentVersionsRequest)); } /** *

* Describes the contents of the specified folder, including its documents and subfolders. *

*

* By default, Amazon WorkDocs returns the first 100 active document and folder metadata items. If there are more * results, the response includes a marker that you can use to request the next set of results. You can also request * initialized documents. *

* * @param describeFolderContentsRequest * @return A Java Future containing the result of the DescribeFolderContents operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeFolderContents * @see AWS API Documentation */ @Override public CompletableFuture describeFolderContents( DescribeFolderContentsRequest describeFolderContentsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeFolderContentsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeFolderContents") .withMarshaller(new DescribeFolderContentsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(describeFolderContentsRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the contents of the specified folder, including its documents and subfolders. *

*

* By default, Amazon WorkDocs returns the first 100 active document and folder metadata items. If there are more * results, the response includes a marker that you can use to request the next set of results. You can also request * initialized documents. *

*
*

* This is a variant of * {@link #describeFolderContents(software.amazon.awssdk.services.workdocs.model.DescribeFolderContentsRequest)} * 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.workdocs.paginators.DescribeFolderContentsPublisher publisher = client.describeFolderContentsPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.workdocs.paginators.DescribeFolderContentsPublisher publisher = client.describeFolderContentsPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.workdocs.model.DescribeFolderContentsResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Note: If you prefer to have control on service calls, use the * {@link #describeFolderContents(software.amazon.awssdk.services.workdocs.model.DescribeFolderContentsRequest)} * operation. *

* * @param describeFolderContentsRequest * @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. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeFolderContents * @see AWS API Documentation */ public DescribeFolderContentsPublisher describeFolderContentsPaginator( DescribeFolderContentsRequest describeFolderContentsRequest) { return new DescribeFolderContentsPublisher(this, applyPaginatorUserAgent(describeFolderContentsRequest)); } /** *

* Describes the groups specified by the query. Groups are defined by the underlying Active Directory. *

* * @param describeGroupsRequest * @return A Java Future containing the result of the DescribeGroups operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeGroups * @see AWS API * Documentation */ @Override public CompletableFuture describeGroups(DescribeGroupsRequest describeGroupsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeGroupsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeGroups") .withMarshaller(new DescribeGroupsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(describeGroupsRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Lists the specified notification subscriptions. *

* * @param describeNotificationSubscriptionsRequest * @return A Java Future containing the result of the DescribeNotificationSubscriptions operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • EntityNotExistsException The resource does not exist.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeNotificationSubscriptions * @see AWS API Documentation */ @Override public CompletableFuture describeNotificationSubscriptions( DescribeNotificationSubscriptionsRequest describeNotificationSubscriptionsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory .createResponseHandler(operationMetadata, DescribeNotificationSubscriptionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeNotificationSubscriptions") .withMarshaller(new DescribeNotificationSubscriptionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(describeNotificationSubscriptionsRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the permissions of a specified resource. *

* * @param describeResourcePermissionsRequest * @return A Java Future containing the result of the DescribeResourcePermissions operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeResourcePermissions * @see AWS API Documentation */ @Override public CompletableFuture describeResourcePermissions( DescribeResourcePermissionsRequest describeResourcePermissionsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeResourcePermissionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeResourcePermissions") .withMarshaller(new DescribeResourcePermissionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(describeResourcePermissionsRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the current user's special folders; the RootFolder and the RecycleBin. * RootFolder is the root of user's files and folders and RecycleBin is the root of * recycled items. This is not a valid action for SigV4 (administrative API) clients. *

*

* This action requires an authentication token. To get an authentication token, register an application with Amazon * WorkDocs. For more information, see Authentication and Access * Control for User Applications in the Amazon WorkDocs Developer Guide. *

* * @param describeRootFoldersRequest * @return A Java Future containing the result of the DescribeRootFolders operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeRootFolders * @see AWS * API Documentation */ @Override public CompletableFuture describeRootFolders( DescribeRootFoldersRequest describeRootFoldersRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, DescribeRootFoldersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeRootFolders") .withMarshaller(new DescribeRootFoldersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(describeRootFoldersRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the specified users. You can describe all users or filter the results (for example, by status or * organization). *

*

* By default, Amazon WorkDocs returns the first 24 active or pending users. If there are more results, the response * includes a marker that you can use to request the next set of results. *

* * @param describeUsersRequest * @return A Java Future containing the result of the DescribeUsers operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • RequestedEntityTooLargeException The response is too large to return. The request must include a * filter to reduce the size of the response.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeUsers * @see AWS API * Documentation */ @Override public CompletableFuture describeUsers(DescribeUsersRequest describeUsersRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, DescribeUsersResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("DescribeUsers") .withMarshaller(new DescribeUsersRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(describeUsersRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Describes the specified users. You can describe all users or filter the results (for example, by status or * organization). *

*

* By default, Amazon WorkDocs returns the first 24 active or pending users. If there are more results, the response * includes a marker that you can use to request the next set of results. *

*
*

* This is a variant of {@link #describeUsers(software.amazon.awssdk.services.workdocs.model.DescribeUsersRequest)} * 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.workdocs.paginators.DescribeUsersPublisher publisher = client.describeUsersPaginator(request);
     * CompletableFuture future = publisher.subscribe(res -> { // Do something with the response });
     * future.get();
     * }
     * 
* * 2) Using a custom subscriber * *
     * {@code
     * software.amazon.awssdk.services.workdocs.paginators.DescribeUsersPublisher publisher = client.describeUsersPaginator(request);
     * publisher.subscribe(new Subscriber() {
     * 
     * public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
     * 
     * 
     * public void onNext(software.amazon.awssdk.services.workdocs.model.DescribeUsersResponse response) { //... };
     * });}
     * 
* * As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2. *

* Note: If you prefer to have control on service calls, use the * {@link #describeUsers(software.amazon.awssdk.services.workdocs.model.DescribeUsersRequest)} operation. *

* * @param describeUsersRequest * @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. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • RequestedEntityTooLargeException The response is too large to return. The request must include a * filter to reduce the size of the response.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.DescribeUsers * @see AWS API * Documentation */ public DescribeUsersPublisher describeUsersPaginator(DescribeUsersRequest describeUsersRequest) { return new DescribeUsersPublisher(this, applyPaginatorUserAgent(describeUsersRequest)); } /** *

* Retrieves details of the current user for whom the authentication token was generated. This is not a valid action * for SigV4 (administrative API) clients. *

* * @param getCurrentUserRequest * @return A Java Future containing the result of the GetCurrentUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.GetCurrentUser * @see AWS API * Documentation */ @Override public CompletableFuture getCurrentUser(GetCurrentUserRequest getCurrentUserRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetCurrentUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetCurrentUser") .withMarshaller(new GetCurrentUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(getCurrentUserRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves details of a document. *

* * @param getDocumentRequest * @return A Java Future containing the result of the GetDocument operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • InvalidPasswordException The password is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.GetDocument * @see AWS API * Documentation */ @Override public CompletableFuture getDocument(GetDocumentRequest getDocumentRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetDocumentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetDocument").withMarshaller(new GetDocumentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(getDocumentRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the path information (the hierarchy from the root folder) for the requested document. *

*

* By default, Amazon WorkDocs returns a maximum of 100 levels upwards from the requested document and only includes * the IDs of the parent folders in the path. You can limit the maximum number of levels. You can also request the * names of the parent folders. *

* * @param getDocumentPathRequest * @return A Java Future containing the result of the GetDocumentPath operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.GetDocumentPath * @see AWS API * Documentation */ @Override public CompletableFuture getDocumentPath(GetDocumentPathRequest getDocumentPathRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetDocumentPathResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetDocumentPath") .withMarshaller(new GetDocumentPathRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(getDocumentPathRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves version metadata for the specified document. *

* * @param getDocumentVersionRequest * @return A Java Future containing the result of the GetDocumentVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • InvalidPasswordException The password is invalid.
  • *
  • SdkException Base class for all exceptions that can be thrown by the SDK (both service and client). * Can be used for catch all scenarios.
  • *
  • SdkClientException If any client side error occurs such as an IO related failure, failure to get * credentials, etc.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.GetDocumentVersion * @see AWS * API Documentation */ @Override public CompletableFuture getDocumentVersion(GetDocumentVersionRequest getDocumentVersionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, GetDocumentVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetDocumentVersion") .withMarshaller(new GetDocumentVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(getDocumentVersionRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the metadata of the specified folder. *

* * @param getFolderRequest * @return A Java Future containing the result of the GetFolder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.GetFolder * @see AWS API * Documentation */ @Override public CompletableFuture getFolder(GetFolderRequest getFolderRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetFolderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("GetFolder") .withMarshaller(new GetFolderRequestMarshaller(protocolFactory)).withResponseHandler(responseHandler) .withErrorResponseHandler(errorResponseHandler).withInput(getFolderRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves the path information (the hierarchy from the root folder) for the specified folder. *

*

* By default, Amazon WorkDocs returns a maximum of 100 levels upwards from the requested folder and only includes * the IDs of the parent folders in the path. You can limit the maximum number of levels. You can also request the * parent folder names. *

* * @param getFolderPathRequest * @return A Java Future containing the result of the GetFolderPath operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.GetFolderPath * @see AWS API * Documentation */ @Override public CompletableFuture getFolderPath(GetFolderPathRequest getFolderPathRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetFolderPathResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetFolderPath") .withMarshaller(new GetFolderPathRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(getFolderPathRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Retrieves a collection of resources, including folders and documents. The only CollectionType * supported is SHARED_WITH_ME. *

* * @param getResourcesRequest * @return A Java Future containing the result of the GetResources operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.GetResources * @see AWS API * Documentation */ @Override public CompletableFuture getResources(GetResourcesRequest getResourcesRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, GetResourcesResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("GetResources").withMarshaller(new GetResourcesRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(getResourcesRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Creates a new document object and version object. *

*

* The client specifies the parent folder ID and name of the document to upload. The ID is optionally specified when * creating a new version of an existing document. This is the first step to upload a document. Next, upload the * document to the URL returned from the call, and then call UpdateDocumentVersion. *

*

* To cancel the document upload, call AbortDocumentVersionUpload. *

* * @param initiateDocumentVersionUploadRequest * @return A Java Future containing the result of the InitiateDocumentVersionUpload operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • EntityAlreadyExistsException The resource already exists.
  • *
  • StorageLimitExceededException The storage limit has been exceeded.
  • *
  • StorageLimitWillExceedException The storage limit will be exceeded.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • DraftUploadOutOfSyncException This exception is thrown when a valid checkout ID is not presented on * document version upload calls for a document that has been checked out from Web client.
  • *
  • ResourceAlreadyCheckedOutException The resource is already checked out.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.InitiateDocumentVersionUpload * @see AWS API Documentation */ @Override public CompletableFuture initiateDocumentVersionUpload( InitiateDocumentVersionUploadRequest initiateDocumentVersionUploadRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, InitiateDocumentVersionUploadResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("InitiateDocumentVersionUpload") .withMarshaller(new InitiateDocumentVersionUploadRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(initiateDocumentVersionUploadRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes all the permissions from the specified resource. *

* * @param removeAllResourcePermissionsRequest * @return A Java Future containing the result of the RemoveAllResourcePermissions operation returned by the * service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.RemoveAllResourcePermissions * @see AWS API Documentation */ @Override public CompletableFuture removeAllResourcePermissions( RemoveAllResourcePermissionsRequest removeAllResourcePermissionsRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RemoveAllResourcePermissionsResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RemoveAllResourcePermissions") .withMarshaller(new RemoveAllResourcePermissionsRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(removeAllResourcePermissionsRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Removes the permission for the specified principal from the specified resource. *

* * @param removeResourcePermissionRequest * @return A Java Future containing the result of the RemoveResourcePermission operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.RemoveResourcePermission * @see AWS API Documentation */ @Override public CompletableFuture removeResourcePermission( RemoveResourcePermissionRequest removeResourcePermissionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, RemoveResourcePermissionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("RemoveResourcePermission") .withMarshaller(new RemoveResourcePermissionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(removeResourcePermissionRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the specified attributes of a document. The user must have access to both the document and its parent * folder, if applicable. *

* * @param updateDocumentRequest * @return A Java Future containing the result of the UpdateDocument operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • EntityAlreadyExistsException The resource already exists.
  • *
  • LimitExceededException The maximum of 100,000 folders under the parent folder has been exceeded.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • ConflictingOperationException Another operation is in progress on the resource that conflicts with * the current operation.
  • *
  • ConcurrentModificationException The resource hierarchy is changing.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.UpdateDocument * @see AWS API * Documentation */ @Override public CompletableFuture updateDocument(UpdateDocumentRequest updateDocumentRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateDocumentResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateDocument") .withMarshaller(new UpdateDocumentRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(updateDocumentRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Changes the status of the document version to ACTIVE. *

*

* Amazon WorkDocs also sets its document container to ACTIVE. This is the last step in a document upload, after the * client uploads the document to an S3-presigned URL returned by InitiateDocumentVersionUpload. *

* * @param updateDocumentVersionRequest * @return A Java Future containing the result of the UpdateDocumentVersion operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • ConcurrentModificationException The resource hierarchy is changing.
  • *
  • InvalidOperationException The operation is invalid.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.UpdateDocumentVersion * @see AWS * API Documentation */ @Override public CompletableFuture updateDocumentVersion( UpdateDocumentVersionRequest updateDocumentVersionRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler( operationMetadata, UpdateDocumentVersionResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateDocumentVersion") .withMarshaller(new UpdateDocumentVersionRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(updateDocumentVersionRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the specified attributes of the specified folder. The user must have access to both the folder and its * parent folder, if applicable. *

* * @param updateFolderRequest * @return A Java Future containing the result of the UpdateFolder operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • EntityAlreadyExistsException The resource already exists.
  • *
  • ProhibitedStateException The specified document version is not in the INITIALIZED state.
  • *
  • ConflictingOperationException Another operation is in progress on the resource that conflicts with * the current operation.
  • *
  • ConcurrentModificationException The resource hierarchy is changing.
  • *
  • LimitExceededException The maximum of 100,000 folders under the parent folder has been exceeded.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.UpdateFolder * @see AWS API * Documentation */ @Override public CompletableFuture updateFolder(UpdateFolderRequest updateFolderRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateFolderResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams() .withOperationName("UpdateFolder").withMarshaller(new UpdateFolderRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(updateFolderRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } /** *

* Updates the specified attributes of the specified user, and grants or revokes administrative privileges to the * Amazon WorkDocs site. *

* * @param updateUserRequest * @return A Java Future containing the result of the UpdateUser operation returned by the service.
* The CompletableFuture returned by this method can be completed exceptionally with the following * exceptions. *
    *
  • EntityNotExistsException The resource does not exist.
  • *
  • UnauthorizedOperationException The operation is not permitted.
  • *
  • UnauthorizedResourceAccessException The caller does not have access to perform the action on the * resource.
  • *
  • IllegalUserStateException The user is undergoing transfer of ownership.
  • *
  • FailedDependencyException The AWS Directory Service cannot reach an on-premises instance. Or a * dependency under the control of the organization is failing, such as a connected Active Directory.
  • *
  • ServiceUnavailableException One or more of the dependencies is unavailable.
  • *
  • DeactivatingLastSystemUserException The last user in the organization is being deactivated.
  • *
  • InvalidArgumentException The pagination marker or limit fields are not valid.
  • *
  • 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.
  • *
  • WorkDocsException Base class for all service exceptions. Unknown exceptions will be thrown as an * instance of this type.
  • *
* @sample WorkDocsAsyncClient.UpdateUser * @see AWS API * Documentation */ @Override public CompletableFuture updateUser(UpdateUserRequest updateUserRequest) { try { JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false) .isPayloadJson(true).build(); HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata, UpdateUserResponse::builder); HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory, operationMetadata); CompletableFuture executeFuture = clientHandler .execute(new ClientExecutionParams().withOperationName("UpdateUser") .withMarshaller(new UpdateUserRequestMarshaller(protocolFactory)) .withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler) .withInput(updateUserRequest)); return executeFuture; } catch (Throwable t) { return CompletableFutureUtils.failedFuture(t); } } @Override public void close() { clientHandler.close(); } private > T init(T builder) { return builder .clientConfiguration(clientConfiguration) .defaultServiceExceptionSupplier(WorkDocsException::builder) .protocol(AwsJsonProtocol.REST_JSON) .protocolVersion("1.1") .registerModeledException( ExceptionMetadata.builder().errorCode("FailedDependencyException") .exceptionBuilderSupplier(FailedDependencyException::builder).httpStatusCode(424).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConcurrentModificationException") .exceptionBuilderSupplier(ConcurrentModificationException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidOperationException") .exceptionBuilderSupplier(InvalidOperationException::builder).httpStatusCode(405).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("CustomMetadataLimitExceededException") .exceptionBuilderSupplier(CustomMetadataLimitExceededException::builder).httpStatusCode(429) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnauthorizedResourceAccessException") .exceptionBuilderSupplier(UnauthorizedResourceAccessException::builder).httpStatusCode(404) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TooManySubscriptionsException") .exceptionBuilderSupplier(TooManySubscriptionsException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("EntityAlreadyExistsException") .exceptionBuilderSupplier(EntityAlreadyExistsException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("EntityNotExistsException") .exceptionBuilderSupplier(EntityNotExistsException::builder).httpStatusCode(404).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("DocumentLockedForCommentsException") .exceptionBuilderSupplier(DocumentLockedForCommentsException::builder).httpStatusCode(409) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("StorageLimitExceededException") .exceptionBuilderSupplier(StorageLimitExceededException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("StorageLimitWillExceedException") .exceptionBuilderSupplier(StorageLimitWillExceedException::builder).httpStatusCode(413).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ProhibitedStateException") .exceptionBuilderSupplier(ProhibitedStateException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("LimitExceededException") .exceptionBuilderSupplier(LimitExceededException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("IllegalUserStateException") .exceptionBuilderSupplier(IllegalUserStateException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidArgumentException") .exceptionBuilderSupplier(InvalidArgumentException::builder).httpStatusCode(400).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ConflictingOperationException") .exceptionBuilderSupplier(ConflictingOperationException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidCommentOperationException") .exceptionBuilderSupplier(InvalidCommentOperationException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("InvalidPasswordException") .exceptionBuilderSupplier(InvalidPasswordException::builder).httpStatusCode(401).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("UnauthorizedOperationException") .exceptionBuilderSupplier(UnauthorizedOperationException::builder).httpStatusCode(403).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("TooManyLabelsException") .exceptionBuilderSupplier(TooManyLabelsException::builder).httpStatusCode(429).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("DraftUploadOutOfSyncException") .exceptionBuilderSupplier(DraftUploadOutOfSyncException::builder).httpStatusCode(409).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ResourceAlreadyCheckedOutException") .exceptionBuilderSupplier(ResourceAlreadyCheckedOutException::builder).httpStatusCode(409) .build()) .registerModeledException( ExceptionMetadata.builder().errorCode("RequestedEntityTooLargeException") .exceptionBuilderSupplier(RequestedEntityTooLargeException::builder).httpStatusCode(413).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("ServiceUnavailableException") .exceptionBuilderSupplier(ServiceUnavailableException::builder).httpStatusCode(503).build()) .registerModeledException( ExceptionMetadata.builder().errorCode("DeactivatingLastSystemUserException") .exceptionBuilderSupplier(DeactivatingLastSystemUserException::builder).httpStatusCode(409) .build()); } private T applyPaginatorUserAgent(T request) { Consumer userAgentApplier = b -> b.addApiName(ApiName.builder() .version(VersionInfo.SDK_VERSION).name("PAGINATED").build()); AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration() .map(c -> c.toBuilder().applyMutation(userAgentApplier).build()) .orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build())); return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build(); } private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory, JsonOperationMetadata operationMetadata) { return protocolFactory.createErrorResponseHandler(operationMetadata); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy