
software.amazon.awssdk.services.workdocs.DefaultWorkDocsClient 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.function.Consumer;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
import software.amazon.awssdk.awscore.exception.AwsServiceException;
import software.amazon.awssdk.core.ApiName;
import software.amazon.awssdk.core.client.config.SdkClientConfiguration;
import software.amazon.awssdk.core.client.handler.ClientExecutionParams;
import software.amazon.awssdk.core.client.handler.SyncClientHandler;
import software.amazon.awssdk.core.exception.SdkClientException;
import software.amazon.awssdk.core.http.HttpResponseHandler;
import software.amazon.awssdk.core.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.DescribeDocumentVersionsIterable;
import software.amazon.awssdk.services.workdocs.paginators.DescribeFolderContentsIterable;
import software.amazon.awssdk.services.workdocs.paginators.DescribeUsersIterable;
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;
/**
* Internal implementation of {@link WorkDocsClient}.
*
* @see WorkDocsClient#builder()
*/
@Generated("software.amazon.awssdk:codegen")
@SdkInternalApi
final class DefaultWorkDocsClient implements WorkDocsClient {
private final SyncClientHandler clientHandler;
private final AwsJsonProtocolFactory protocolFactory;
private final SdkClientConfiguration clientConfiguration;
protected DefaultWorkDocsClient(SdkClientConfiguration clientConfiguration) {
this.clientHandler = new AwsSyncClientHandler(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 Result of the AbortDocumentVersionUpload operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.AbortDocumentVersionUpload
* @see AWS API Documentation
*/
@Override
public AbortDocumentVersionUploadResponse abortDocumentVersionUpload(
AbortDocumentVersionUploadRequest abortDocumentVersionUploadRequest) throws EntityNotExistsException,
ProhibitedStateException, UnauthorizedOperationException, UnauthorizedResourceAccessException,
FailedDependencyException, ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AbortDocumentVersionUploadResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("AbortDocumentVersionUpload").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(abortDocumentVersionUploadRequest)
.withMarshaller(new AbortDocumentVersionUploadRequestMarshaller(protocolFactory)));
}
/**
*
* Activates the specified user. Only active users can access Amazon WorkDocs.
*
*
* @param activateUserRequest
* @return Result of the ActivateUser operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.ActivateUser
* @see AWS API
* Documentation
*/
@Override
public ActivateUserResponse activateUser(ActivateUserRequest activateUserRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
ActivateUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("ActivateUser").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(activateUserRequest)
.withMarshaller(new ActivateUserRequestMarshaller(protocolFactory)));
}
/**
*
* 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 Result of the AddResourcePermissions operation returned by the service.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.AddResourcePermissions
* @see AWS API Documentation
*/
@Override
public AddResourcePermissionsResponse addResourcePermissions(AddResourcePermissionsRequest addResourcePermissionsRequest)
throws UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, AddResourcePermissionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("AddResourcePermissions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(addResourcePermissionsRequest)
.withMarshaller(new AddResourcePermissionsRequestMarshaller(protocolFactory)));
}
/**
*
* Adds a new comment to the specified document version.
*
*
* @param createCommentRequest
* @return Result of the CreateComment operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws DocumentLockedForCommentsException
* This exception is thrown when the document is locked for comments and user tries to create or delete a
* comment on that document.
* @throws InvalidCommentOperationException
* The requested operation is not allowed on the specified comment object.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.CreateComment
* @see AWS API
* Documentation
*/
@Override
public CreateCommentResponse createComment(CreateCommentRequest createCommentRequest) throws EntityNotExistsException,
ProhibitedStateException, UnauthorizedOperationException, UnauthorizedResourceAccessException,
FailedDependencyException, ServiceUnavailableException, DocumentLockedForCommentsException,
InvalidCommentOperationException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateCommentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateComment").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createCommentRequest)
.withMarshaller(new CreateCommentRequestMarshaller(protocolFactory)));
}
/**
*
* Adds one or more custom properties to the specified resource (a folder, document, or version).
*
*
* @param createCustomMetadataRequest
* @return Result of the CreateCustomMetadata operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws CustomMetadataLimitExceededException
* The limit has been reached on the number of custom properties for the specified resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.CreateCustomMetadata
* @see AWS
* API Documentation
*/
@Override
public CreateCustomMetadataResponse createCustomMetadata(CreateCustomMetadataRequest createCustomMetadataRequest)
throws EntityNotExistsException, UnauthorizedOperationException, UnauthorizedResourceAccessException,
ProhibitedStateException, CustomMetadataLimitExceededException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateCustomMetadataResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateCustomMetadata").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createCustomMetadataRequest)
.withMarshaller(new CreateCustomMetadataRequestMarshaller(protocolFactory)));
}
/**
*
* Creates a folder with the specified name and parent folder.
*
*
* @param createFolderRequest
* @return Result of the CreateFolder operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws EntityAlreadyExistsException
* The resource already exists.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws ConflictingOperationException
* Another operation is in progress on the resource that conflicts with the current operation.
* @throws LimitExceededException
* The maximum of 100,000 folders under the parent folder has been exceeded.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.CreateFolder
* @see AWS API
* Documentation
*/
@Override
public CreateFolderResponse createFolder(CreateFolderRequest createFolderRequest) throws EntityNotExistsException,
EntityAlreadyExistsException, ProhibitedStateException, ConflictingOperationException, LimitExceededException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateFolderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateFolder").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createFolderRequest)
.withMarshaller(new CreateFolderRequestMarshaller(protocolFactory)));
}
/**
*
* Adds the specified list of labels to the given resource (a document or folder)
*
*
* @param createLabelsRequest
* @return Result of the CreateLabels operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws TooManyLabelsException
* The limit has been reached on the number of labels for the specified resource.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.CreateLabels
* @see AWS API
* Documentation
*/
@Override
public CreateLabelsResponse createLabels(CreateLabelsRequest createLabelsRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, TooManyLabelsException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateLabelsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateLabels").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createLabelsRequest)
.withMarshaller(new CreateLabelsRequestMarshaller(protocolFactory)));
}
/**
*
* 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 Result of the CreateNotificationSubscription operation returned by the service.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws TooManySubscriptionsException
* You've reached the limit on the number of subscriptions for the WorkDocs instance.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.CreateNotificationSubscription
* @see AWS API Documentation
*/
@Override
public CreateNotificationSubscriptionResponse createNotificationSubscription(
CreateNotificationSubscriptionRequest createNotificationSubscriptionRequest)
throws UnauthorizedResourceAccessException, TooManySubscriptionsException, ServiceUnavailableException,
AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, CreateNotificationSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("CreateNotificationSubscription").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createNotificationSubscriptionRequest)
.withMarshaller(new CreateNotificationSubscriptionRequestMarshaller(protocolFactory)));
}
/**
*
* 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 Result of the CreateUser operation returned by the service.
* @throws EntityAlreadyExistsException
* The resource already exists.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.CreateUser
* @see AWS API
* Documentation
*/
@Override
public CreateUserResponse createUser(CreateUserRequest createUserRequest) throws EntityAlreadyExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
CreateUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("CreateUser").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(createUserRequest)
.withMarshaller(new CreateUserRequestMarshaller(protocolFactory)));
}
/**
*
* Deactivates the specified user, which revokes the user's access to Amazon WorkDocs.
*
*
* @param deactivateUserRequest
* @return Result of the DeactivateUser operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DeactivateUser
* @see AWS API
* Documentation
*/
@Override
public DeactivateUserResponse deactivateUser(DeactivateUserRequest deactivateUserRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeactivateUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeactivateUser").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deactivateUserRequest)
.withMarshaller(new DeactivateUserRequestMarshaller(protocolFactory)));
}
/**
*
* Deletes the specified comment from the document version.
*
*
* @param deleteCommentRequest
* @return Result of the DeleteComment operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws DocumentLockedForCommentsException
* This exception is thrown when the document is locked for comments and user tries to create or delete a
* comment on that document.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DeleteComment
* @see AWS API
* Documentation
*/
@Override
public DeleteCommentResponse deleteComment(DeleteCommentRequest deleteCommentRequest) throws EntityNotExistsException,
ProhibitedStateException, UnauthorizedOperationException, UnauthorizedResourceAccessException,
FailedDependencyException, ServiceUnavailableException, DocumentLockedForCommentsException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteCommentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteComment").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteCommentRequest)
.withMarshaller(new DeleteCommentRequestMarshaller(protocolFactory)));
}
/**
*
* Deletes custom metadata from the specified resource.
*
*
* @param deleteCustomMetadataRequest
* @return Result of the DeleteCustomMetadata operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DeleteCustomMetadata
* @see AWS
* API Documentation
*/
@Override
public DeleteCustomMetadataResponse deleteCustomMetadata(DeleteCustomMetadataRequest deleteCustomMetadataRequest)
throws EntityNotExistsException, UnauthorizedOperationException, UnauthorizedResourceAccessException,
ProhibitedStateException, FailedDependencyException, ServiceUnavailableException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteCustomMetadataResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteCustomMetadata").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteCustomMetadataRequest)
.withMarshaller(new DeleteCustomMetadataRequestMarshaller(protocolFactory)));
}
/**
*
* Permanently deletes the specified document and its associated metadata.
*
*
* @param deleteDocumentRequest
* @return Result of the DeleteDocument operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws ConflictingOperationException
* Another operation is in progress on the resource that conflicts with the current operation.
* @throws ConcurrentModificationException
* The resource hierarchy is changing.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DeleteDocument
* @see AWS API
* Documentation
*/
@Override
public DeleteDocumentResponse deleteDocument(DeleteDocumentRequest deleteDocumentRequest) throws EntityNotExistsException,
ProhibitedStateException, ConflictingOperationException, ConcurrentModificationException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteDocumentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteDocument").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteDocumentRequest)
.withMarshaller(new DeleteDocumentRequestMarshaller(protocolFactory)));
}
/**
*
* Permanently deletes the specified folder and its contents.
*
*
* @param deleteFolderRequest
* @return Result of the DeleteFolder operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws ConflictingOperationException
* Another operation is in progress on the resource that conflicts with the current operation.
* @throws ConcurrentModificationException
* The resource hierarchy is changing.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DeleteFolder
* @see AWS API
* Documentation
*/
@Override
public DeleteFolderResponse deleteFolder(DeleteFolderRequest deleteFolderRequest) throws EntityNotExistsException,
ProhibitedStateException, ConflictingOperationException, ConcurrentModificationException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteFolderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteFolder").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteFolderRequest)
.withMarshaller(new DeleteFolderRequestMarshaller(protocolFactory)));
}
/**
*
* Deletes the contents of the specified folder.
*
*
* @param deleteFolderContentsRequest
* @return Result of the DeleteFolderContents operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws ConflictingOperationException
* Another operation is in progress on the resource that conflicts with the current operation.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DeleteFolderContents
* @see AWS
* API Documentation
*/
@Override
public DeleteFolderContentsResponse deleteFolderContents(DeleteFolderContentsRequest deleteFolderContentsRequest)
throws EntityNotExistsException, ProhibitedStateException, ConflictingOperationException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteFolderContentsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteFolderContents").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteFolderContentsRequest)
.withMarshaller(new DeleteFolderContentsRequestMarshaller(protocolFactory)));
}
/**
*
* Deletes the specified list of labels from a resource.
*
*
* @param deleteLabelsRequest
* @return Result of the DeleteLabels operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DeleteLabels
* @see AWS API
* Documentation
*/
@Override
public DeleteLabelsResponse deleteLabels(DeleteLabelsRequest deleteLabelsRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteLabelsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteLabels").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteLabelsRequest)
.withMarshaller(new DeleteLabelsRequestMarshaller(protocolFactory)));
}
/**
*
* Deletes the specified subscription from the specified organization.
*
*
* @param deleteNotificationSubscriptionRequest
* @return Result of the DeleteNotificationSubscription operation returned by the service.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DeleteNotificationSubscription
* @see AWS API Documentation
*/
@Override
public DeleteNotificationSubscriptionResponse deleteNotificationSubscription(
DeleteNotificationSubscriptionRequest deleteNotificationSubscriptionRequest)
throws UnauthorizedResourceAccessException, EntityNotExistsException, ServiceUnavailableException,
ProhibitedStateException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DeleteNotificationSubscriptionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DeleteNotificationSubscription").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteNotificationSubscriptionRequest)
.withMarshaller(new DeleteNotificationSubscriptionRequestMarshaller(protocolFactory)));
}
/**
*
* Deletes the specified user from a Simple AD or Microsoft AD directory.
*
*
* @param deleteUserRequest
* @return Result of the DeleteUser operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DeleteUser
* @see AWS API
* Documentation
*/
@Override
public DeleteUserResponse deleteUser(DeleteUserRequest deleteUserRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DeleteUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DeleteUser").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(deleteUserRequest)
.withMarshaller(new DeleteUserRequestMarshaller(protocolFactory)));
}
/**
*
* Describes the user activities in a specified time period.
*
*
* @param describeActivitiesRequest
* @return Result of the DescribeActivities operation returned by the service.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeActivities
* @see AWS
* API Documentation
*/
@Override
public DescribeActivitiesResponse describeActivities(DescribeActivitiesRequest describeActivitiesRequest)
throws UnauthorizedOperationException, UnauthorizedResourceAccessException, InvalidArgumentException,
FailedDependencyException, ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeActivitiesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeActivities").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeActivitiesRequest)
.withMarshaller(new DescribeActivitiesRequestMarshaller(protocolFactory)));
}
/**
*
* List all the comments for the specified document version.
*
*
* @param describeCommentsRequest
* @return Result of the DescribeComments operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeComments
* @see AWS API
* Documentation
*/
@Override
public DescribeCommentsResponse describeComments(DescribeCommentsRequest describeCommentsRequest)
throws EntityNotExistsException, ProhibitedStateException, UnauthorizedOperationException,
UnauthorizedResourceAccessException, FailedDependencyException, ServiceUnavailableException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeCommentsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeComments").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeCommentsRequest)
.withMarshaller(new DescribeCommentsRequestMarshaller(protocolFactory)));
}
/**
*
* Retrieves the document versions for the specified document.
*
*
* By default, only active versions are returned.
*
*
* @param describeDocumentVersionsRequest
* @return Result of the DescribeDocumentVersions operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeDocumentVersions
* @see AWS API Documentation
*/
@Override
public DescribeDocumentVersionsResponse describeDocumentVersions(
DescribeDocumentVersionsRequest describeDocumentVersionsRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, InvalidArgumentException,
FailedDependencyException, ServiceUnavailableException, ProhibitedStateException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeDocumentVersionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeDocumentVersions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeDocumentVersionsRequest)
.withMarshaller(new DescribeDocumentVersionsRequestMarshaller(protocolFactory)));
}
/**
*
* 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 iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.workdocs.paginators.DescribeDocumentVersionsIterable responses = client.describeDocumentVersionsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.workdocs.paginators.DescribeDocumentVersionsIterable responses = client
* .describeDocumentVersionsPaginator(request);
* for (software.amazon.awssdk.services.workdocs.model.DescribeDocumentVersionsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.workdocs.paginators.DescribeDocumentVersionsIterable responses = client.describeDocumentVersionsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 iterable that can be used to iterate through all the response pages.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeDocumentVersions
* @see AWS API Documentation
*/
@Override
public DescribeDocumentVersionsIterable describeDocumentVersionsPaginator(
DescribeDocumentVersionsRequest describeDocumentVersionsRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, InvalidArgumentException,
FailedDependencyException, ServiceUnavailableException, ProhibitedStateException, AwsServiceException,
SdkClientException, WorkDocsException {
return new DescribeDocumentVersionsIterable(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 Result of the DescribeFolderContents operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeFolderContents
* @see AWS API Documentation
*/
@Override
public DescribeFolderContentsResponse describeFolderContents(DescribeFolderContentsRequest describeFolderContentsRequest)
throws EntityNotExistsException, UnauthorizedResourceAccessException, InvalidArgumentException,
FailedDependencyException, ServiceUnavailableException, ProhibitedStateException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeFolderContentsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeFolderContents").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeFolderContentsRequest)
.withMarshaller(new DescribeFolderContentsRequestMarshaller(protocolFactory)));
}
/**
*
* 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 iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.workdocs.paginators.DescribeFolderContentsIterable responses = client.describeFolderContentsPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.workdocs.paginators.DescribeFolderContentsIterable responses = client
* .describeFolderContentsPaginator(request);
* for (software.amazon.awssdk.services.workdocs.model.DescribeFolderContentsResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.workdocs.paginators.DescribeFolderContentsIterable responses = client.describeFolderContentsPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 iterable that can be used to iterate through all the response pages.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeFolderContents
* @see AWS API Documentation
*/
@Override
public DescribeFolderContentsIterable describeFolderContentsPaginator(
DescribeFolderContentsRequest describeFolderContentsRequest) throws EntityNotExistsException,
UnauthorizedResourceAccessException, InvalidArgumentException, FailedDependencyException,
ServiceUnavailableException, ProhibitedStateException, AwsServiceException, SdkClientException, WorkDocsException {
return new DescribeFolderContentsIterable(this, applyPaginatorUserAgent(describeFolderContentsRequest));
}
/**
*
* Describes the groups specified by the query. Groups are defined by the underlying Active Directory.
*
*
* @param describeGroupsRequest
* @return Result of the DescribeGroups operation returned by the service.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeGroups
* @see AWS API
* Documentation
*/
@Override
public DescribeGroupsResponse describeGroups(DescribeGroupsRequest describeGroupsRequest)
throws UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeGroupsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeGroups").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeGroupsRequest)
.withMarshaller(new DescribeGroupsRequestMarshaller(protocolFactory)));
}
/**
*
* Lists the specified notification subscriptions.
*
*
* @param describeNotificationSubscriptionsRequest
* @return Result of the DescribeNotificationSubscriptions operation returned by the service.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeNotificationSubscriptions
* @see AWS API Documentation
*/
@Override
public DescribeNotificationSubscriptionsResponse describeNotificationSubscriptions(
DescribeNotificationSubscriptionsRequest describeNotificationSubscriptionsRequest)
throws UnauthorizedResourceAccessException, EntityNotExistsException, ServiceUnavailableException,
AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeNotificationSubscriptionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeNotificationSubscriptions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeNotificationSubscriptionsRequest)
.withMarshaller(new DescribeNotificationSubscriptionsRequestMarshaller(protocolFactory)));
}
/**
*
* Describes the permissions of a specified resource.
*
*
* @param describeResourcePermissionsRequest
* @return Result of the DescribeResourcePermissions operation returned by the service.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeResourcePermissions
* @see AWS API Documentation
*/
@Override
public DescribeResourcePermissionsResponse describeResourcePermissions(
DescribeResourcePermissionsRequest describeResourcePermissionsRequest) throws UnauthorizedOperationException,
UnauthorizedResourceAccessException, FailedDependencyException, ServiceUnavailableException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeResourcePermissionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("DescribeResourcePermissions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeResourcePermissionsRequest)
.withMarshaller(new DescribeResourcePermissionsRequestMarshaller(protocolFactory)));
}
/**
*
* 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 Result of the DescribeRootFolders operation returned by the service.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeRootFolders
* @see AWS
* API Documentation
*/
@Override
public DescribeRootFoldersResponse describeRootFolders(DescribeRootFoldersRequest describeRootFoldersRequest)
throws UnauthorizedOperationException, UnauthorizedResourceAccessException, InvalidArgumentException,
FailedDependencyException, ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, DescribeRootFoldersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeRootFolders").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeRootFoldersRequest)
.withMarshaller(new DescribeRootFoldersRequestMarshaller(protocolFactory)));
}
/**
*
* 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 Result of the DescribeUsers operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws RequestedEntityTooLargeException
* The response is too large to return. The request must include a filter to reduce the size of the
* response.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeUsers
* @see AWS API
* Documentation
*/
@Override
public DescribeUsersResponse describeUsers(DescribeUsersRequest describeUsersRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, InvalidArgumentException, RequestedEntityTooLargeException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
DescribeUsersResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("DescribeUsers").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(describeUsersRequest)
.withMarshaller(new DescribeUsersRequestMarshaller(protocolFactory)));
}
/**
*
* 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 iterable that can be used to iterate through all the pages. SDK will
* internally handle making service calls for you.
*
*
* When this operation is called, a custom iterable is returned but no service calls are made yet. So there is no
* guarantee that the request is valid. As you iterate through the iterable, SDK will start lazily loading response
* pages by making service calls until there are no pages left or your iteration stops. If there are errors in your
* request, you will see the failures only after you start iterating through the iterable.
*
*
*
* The following are few ways to iterate through the response pages:
*
* 1) Using a Stream
*
*
* {@code
* software.amazon.awssdk.services.workdocs.paginators.DescribeUsersIterable responses = client.describeUsersPaginator(request);
* responses.stream().forEach(....);
* }
*
*
* 2) Using For loop
*
*
* {
* @code
* software.amazon.awssdk.services.workdocs.paginators.DescribeUsersIterable responses = client.describeUsersPaginator(request);
* for (software.amazon.awssdk.services.workdocs.model.DescribeUsersResponse response : responses) {
* // do something;
* }
* }
*
*
* 3) Use iterator directly
*
*
* {@code
* software.amazon.awssdk.services.workdocs.paginators.DescribeUsersIterable responses = client.describeUsersPaginator(request);
* responses.iterator().forEachRemaining(....);
* }
*
*
* 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 iterable that can be used to iterate through all the response pages.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws RequestedEntityTooLargeException
* The response is too large to return. The request must include a filter to reduce the size of the
* response.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.DescribeUsers
* @see AWS API
* Documentation
*/
@Override
public DescribeUsersIterable describeUsersPaginator(DescribeUsersRequest describeUsersRequest)
throws EntityNotExistsException, UnauthorizedOperationException, UnauthorizedResourceAccessException,
FailedDependencyException, ServiceUnavailableException, InvalidArgumentException, RequestedEntityTooLargeException,
AwsServiceException, SdkClientException, WorkDocsException {
return new DescribeUsersIterable(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 Result of the GetCurrentUser operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.GetCurrentUser
* @see AWS API
* Documentation
*/
@Override
public GetCurrentUserResponse getCurrentUser(GetCurrentUserRequest getCurrentUserRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetCurrentUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetCurrentUser").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getCurrentUserRequest)
.withMarshaller(new GetCurrentUserRequestMarshaller(protocolFactory)));
}
/**
*
* Retrieves details of a document.
*
*
* @param getDocumentRequest
* @return Result of the GetDocument operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws InvalidPasswordException
* The password is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.GetDocument
* @see AWS API
* Documentation
*/
@Override
public GetDocumentResponse getDocument(GetDocumentRequest getDocumentRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, InvalidArgumentException,
FailedDependencyException, ServiceUnavailableException, InvalidPasswordException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetDocumentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetDocument").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getDocumentRequest)
.withMarshaller(new GetDocumentRequestMarshaller(protocolFactory)));
}
/**
*
* 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 Result of the GetDocumentPath operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.GetDocumentPath
* @see AWS API
* Documentation
*/
@Override
public GetDocumentPathResponse getDocumentPath(GetDocumentPathRequest getDocumentPathRequest)
throws EntityNotExistsException, UnauthorizedOperationException, UnauthorizedResourceAccessException,
FailedDependencyException, ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetDocumentPathResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetDocumentPath").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getDocumentPathRequest)
.withMarshaller(new GetDocumentPathRequestMarshaller(protocolFactory)));
}
/**
*
* Retrieves version metadata for the specified document.
*
*
* @param getDocumentVersionRequest
* @return Result of the GetDocumentVersion operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws InvalidPasswordException
* The password is invalid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.GetDocumentVersion
* @see AWS
* API Documentation
*/
@Override
public GetDocumentVersionResponse getDocumentVersion(GetDocumentVersionRequest getDocumentVersionRequest)
throws EntityNotExistsException, UnauthorizedOperationException, UnauthorizedResourceAccessException,
FailedDependencyException, ServiceUnavailableException, ProhibitedStateException, InvalidPasswordException,
AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, GetDocumentVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetDocumentVersion").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getDocumentVersionRequest)
.withMarshaller(new GetDocumentVersionRequestMarshaller(protocolFactory)));
}
/**
*
* Retrieves the metadata of the specified folder.
*
*
* @param getFolderRequest
* @return Result of the GetFolder operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.GetFolder
* @see AWS API
* Documentation
*/
@Override
public GetFolderResponse getFolder(GetFolderRequest getFolderRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, InvalidArgumentException,
FailedDependencyException, ServiceUnavailableException, ProhibitedStateException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetFolderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetFolder").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getFolderRequest)
.withMarshaller(new GetFolderRequestMarshaller(protocolFactory)));
}
/**
*
* 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 Result of the GetFolderPath operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.GetFolderPath
* @see AWS API
* Documentation
*/
@Override
public GetFolderPathResponse getFolderPath(GetFolderPathRequest getFolderPathRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, FailedDependencyException,
ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetFolderPathResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetFolderPath").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getFolderPathRequest)
.withMarshaller(new GetFolderPathRequestMarshaller(protocolFactory)));
}
/**
*
* Retrieves a collection of resources, including folders and documents. The only CollectionType
* supported is SHARED_WITH_ME
.
*
*
* @param getResourcesRequest
* @return Result of the GetResources operation returned by the service.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.GetResources
* @see AWS API
* Documentation
*/
@Override
public GetResourcesResponse getResources(GetResourcesRequest getResourcesRequest) throws UnauthorizedResourceAccessException,
UnauthorizedOperationException, InvalidArgumentException, FailedDependencyException, ServiceUnavailableException,
AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
GetResourcesResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("GetResources").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(getResourcesRequest)
.withMarshaller(new GetResourcesRequestMarshaller(protocolFactory)));
}
/**
*
* 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 Result of the InitiateDocumentVersionUpload operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws EntityAlreadyExistsException
* The resource already exists.
* @throws StorageLimitExceededException
* The storage limit has been exceeded.
* @throws StorageLimitWillExceedException
* The storage limit will be exceeded.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws 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.
* @throws ResourceAlreadyCheckedOutException
* The resource is already checked out.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.InitiateDocumentVersionUpload
* @see AWS API Documentation
*/
@Override
public InitiateDocumentVersionUploadResponse initiateDocumentVersionUpload(
InitiateDocumentVersionUploadRequest initiateDocumentVersionUploadRequest) throws EntityNotExistsException,
EntityAlreadyExistsException, StorageLimitExceededException, StorageLimitWillExceedException,
ProhibitedStateException, UnauthorizedOperationException, UnauthorizedResourceAccessException,
FailedDependencyException, ServiceUnavailableException, DraftUploadOutOfSyncException,
ResourceAlreadyCheckedOutException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, InitiateDocumentVersionUploadResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("InitiateDocumentVersionUpload").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(initiateDocumentVersionUploadRequest)
.withMarshaller(new InitiateDocumentVersionUploadRequestMarshaller(protocolFactory)));
}
/**
*
* Removes all the permissions from the specified resource.
*
*
* @param removeAllResourcePermissionsRequest
* @return Result of the RemoveAllResourcePermissions operation returned by the service.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.RemoveAllResourcePermissions
* @see AWS API Documentation
*/
@Override
public RemoveAllResourcePermissionsResponse removeAllResourcePermissions(
RemoveAllResourcePermissionsRequest removeAllResourcePermissionsRequest) throws UnauthorizedOperationException,
UnauthorizedResourceAccessException, FailedDependencyException, ServiceUnavailableException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, RemoveAllResourcePermissionsResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("RemoveAllResourcePermissions").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(removeAllResourcePermissionsRequest)
.withMarshaller(new RemoveAllResourcePermissionsRequestMarshaller(protocolFactory)));
}
/**
*
* Removes the permission for the specified principal from the specified resource.
*
*
* @param removeResourcePermissionRequest
* @return Result of the RemoveResourcePermission operation returned by the service.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.RemoveResourcePermission
* @see AWS API Documentation
*/
@Override
public RemoveResourcePermissionResponse removeResourcePermission(
RemoveResourcePermissionRequest removeResourcePermissionRequest) throws UnauthorizedOperationException,
UnauthorizedResourceAccessException, FailedDependencyException, ServiceUnavailableException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, RemoveResourcePermissionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler
.execute(new ClientExecutionParams()
.withOperationName("RemoveResourcePermission").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(removeResourcePermissionRequest)
.withMarshaller(new RemoveResourcePermissionRequestMarshaller(protocolFactory)));
}
/**
*
* 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 Result of the UpdateDocument operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws EntityAlreadyExistsException
* The resource already exists.
* @throws LimitExceededException
* The maximum of 100,000 folders under the parent folder has been exceeded.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws ConflictingOperationException
* Another operation is in progress on the resource that conflicts with the current operation.
* @throws ConcurrentModificationException
* The resource hierarchy is changing.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.UpdateDocument
* @see AWS API
* Documentation
*/
@Override
public UpdateDocumentResponse updateDocument(UpdateDocumentRequest updateDocumentRequest) throws EntityNotExistsException,
EntityAlreadyExistsException, LimitExceededException, ProhibitedStateException, ConflictingOperationException,
ConcurrentModificationException, UnauthorizedOperationException, UnauthorizedResourceAccessException,
FailedDependencyException, ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateDocumentResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateDocument").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateDocumentRequest)
.withMarshaller(new UpdateDocumentRequestMarshaller(protocolFactory)));
}
/**
*
* 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 Result of the UpdateDocumentVersion operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws ConcurrentModificationException
* The resource hierarchy is changing.
* @throws InvalidOperationException
* The operation is invalid.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.UpdateDocumentVersion
* @see AWS
* API Documentation
*/
@Override
public UpdateDocumentVersionResponse updateDocumentVersion(UpdateDocumentVersionRequest updateDocumentVersionRequest)
throws EntityNotExistsException, ProhibitedStateException, ConcurrentModificationException,
InvalidOperationException, UnauthorizedOperationException, UnauthorizedResourceAccessException,
FailedDependencyException, ServiceUnavailableException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(
operationMetadata, UpdateDocumentVersionResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateDocumentVersion").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateDocumentVersionRequest)
.withMarshaller(new UpdateDocumentVersionRequestMarshaller(protocolFactory)));
}
/**
*
* 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 Result of the UpdateFolder operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws EntityAlreadyExistsException
* The resource already exists.
* @throws ProhibitedStateException
* The specified document version is not in the INITIALIZED state.
* @throws ConflictingOperationException
* Another operation is in progress on the resource that conflicts with the current operation.
* @throws ConcurrentModificationException
* The resource hierarchy is changing.
* @throws LimitExceededException
* The maximum of 100,000 folders under the parent folder has been exceeded.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.UpdateFolder
* @see AWS API
* Documentation
*/
@Override
public UpdateFolderResponse updateFolder(UpdateFolderRequest updateFolderRequest) throws EntityNotExistsException,
EntityAlreadyExistsException, ProhibitedStateException, ConflictingOperationException,
ConcurrentModificationException, LimitExceededException, UnauthorizedOperationException,
UnauthorizedResourceAccessException, FailedDependencyException, ServiceUnavailableException, AwsServiceException,
SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateFolderResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateFolder").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateFolderRequest)
.withMarshaller(new UpdateFolderRequestMarshaller(protocolFactory)));
}
/**
*
* Updates the specified attributes of the specified user, and grants or revokes administrative privileges to the
* Amazon WorkDocs site.
*
*
* @param updateUserRequest
* @return Result of the UpdateUser operation returned by the service.
* @throws EntityNotExistsException
* The resource does not exist.
* @throws UnauthorizedOperationException
* The operation is not permitted.
* @throws UnauthorizedResourceAccessException
* The caller does not have access to perform the action on the resource.
* @throws IllegalUserStateException
* The user is undergoing transfer of ownership.
* @throws 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.
* @throws ServiceUnavailableException
* One or more of the dependencies is unavailable.
* @throws DeactivatingLastSystemUserException
* The last user in the organization is being deactivated.
* @throws InvalidArgumentException
* The pagination marker or limit fields are not valid.
* @throws SdkException
* Base class for all exceptions that can be thrown by the SDK (both service and client). Can be used for
* catch all scenarios.
* @throws SdkClientException
* If any client side error occurs such as an IO related failure, failure to get credentials, etc.
* @throws WorkDocsException
* Base class for all service exceptions. Unknown exceptions will be thrown as an instance of this type.
* @sample WorkDocsClient.UpdateUser
* @see AWS API
* Documentation
*/
@Override
public UpdateUserResponse updateUser(UpdateUserRequest updateUserRequest) throws EntityNotExistsException,
UnauthorizedOperationException, UnauthorizedResourceAccessException, IllegalUserStateException,
FailedDependencyException, ServiceUnavailableException, DeactivatingLastSystemUserException,
InvalidArgumentException, AwsServiceException, SdkClientException, WorkDocsException {
JsonOperationMetadata operationMetadata = JsonOperationMetadata.builder().hasStreamingSuccessResponse(false)
.isPayloadJson(true).build();
HttpResponseHandler responseHandler = protocolFactory.createResponseHandler(operationMetadata,
UpdateUserResponse::builder);
HttpResponseHandler errorResponseHandler = createErrorResponseHandler(protocolFactory,
operationMetadata);
return clientHandler.execute(new ClientExecutionParams()
.withOperationName("UpdateUser").withResponseHandler(responseHandler)
.withErrorResponseHandler(errorResponseHandler).withInput(updateUserRequest)
.withMarshaller(new UpdateUserRequestMarshaller(protocolFactory)));
}
private HttpResponseHandler createErrorResponseHandler(BaseAwsJsonProtocolFactory protocolFactory,
JsonOperationMetadata operationMetadata) {
return protocolFactory.createErrorResponseHandler(operationMetadata);
}
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());
}
@Override
public void close() {
clientHandler.close();
}
private T applyPaginatorUserAgent(T request) {
Consumer userAgentApplier = b -> b.addApiName(ApiName.builder()
.version(VersionInfo.SDK_VERSION).name("PAGINATED").build());
AwsRequestOverrideConfiguration overrideConfiguration = request.overrideConfiguration()
.map(c -> c.toBuilder().applyMutation(userAgentApplier).build())
.orElse((AwsRequestOverrideConfiguration.builder().applyMutation(userAgentApplier).build()));
return (T) request.toBuilder().overrideConfiguration(overrideConfiguration).build();
}
}