/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include using namespace Aws::Client; using namespace Aws::Utils; using namespace Aws::WorkDocs; using namespace Aws::WorkDocs::Model; namespace Aws { namespace WorkDocs { template<> AWS_WORKDOCS_API EntityNotExistsException WorkDocsError::GetModeledError() { assert(this->GetErrorType() == WorkDocsErrors::ENTITY_NOT_EXISTS); return EntityNotExistsException(this->GetJsonPayload().View()); } namespace WorkDocsErrorMapper { static const int ENTITY_ALREADY_EXISTS_HASH = HashingUtils::HashString("EntityAlreadyExistsException"); static const int REQUESTED_ENTITY_TOO_LARGE_HASH = HashingUtils::HashString("RequestedEntityTooLargeException"); static const int TOO_MANY_LABELS_HASH = HashingUtils::HashString("TooManyLabelsException"); static const int DRAFT_UPLOAD_OUT_OF_SYNC_HASH = HashingUtils::HashString("DraftUploadOutOfSyncException"); static const int FAILED_DEPENDENCY_HASH = HashingUtils::HashString("FailedDependencyException"); static const int RESOURCE_ALREADY_CHECKED_OUT_HASH = HashingUtils::HashString("ResourceAlreadyCheckedOutException"); static const int CUSTOM_METADATA_LIMIT_EXCEEDED_HASH = HashingUtils::HashString("CustomMetadataLimitExceededException"); static const int LIMIT_EXCEEDED_HASH = HashingUtils::HashString("LimitExceededException"); static const int PROHIBITED_STATE_HASH = HashingUtils::HashString("ProhibitedStateException"); static const int DOCUMENT_LOCKED_FOR_COMMENTS_HASH = HashingUtils::HashString("DocumentLockedForCommentsException"); static const int CONCURRENT_MODIFICATION_HASH = HashingUtils::HashString("ConcurrentModificationException"); static const int STORAGE_LIMIT_WILL_EXCEED_HASH = HashingUtils::HashString("StorageLimitWillExceedException"); static const int INVALID_COMMENT_OPERATION_HASH = HashingUtils::HashString("InvalidCommentOperationException"); static const int STORAGE_LIMIT_EXCEEDED_HASH = HashingUtils::HashString("StorageLimitExceededException"); static const int UNAUTHORIZED_OPERATION_HASH = HashingUtils::HashString("UnauthorizedOperationException"); static const int TOO_MANY_SUBSCRIPTIONS_HASH = HashingUtils::HashString("TooManySubscriptionsException"); static const int ILLEGAL_USER_STATE_HASH = HashingUtils::HashString("IllegalUserStateException"); static const int DEACTIVATING_LAST_SYSTEM_USER_HASH = HashingUtils::HashString("DeactivatingLastSystemUserException"); static const int UNAUTHORIZED_RESOURCE_ACCESS_HASH = HashingUtils::HashString("UnauthorizedResourceAccessException"); static const int ENTITY_NOT_EXISTS_HASH = HashingUtils::HashString("EntityNotExistsException"); static const int INVALID_PASSWORD_HASH = HashingUtils::HashString("InvalidPasswordException"); static const int INVALID_OPERATION_HASH = HashingUtils::HashString("InvalidOperationException"); static const int CONFLICTING_OPERATION_HASH = HashingUtils::HashString("ConflictingOperationException"); static const int INVALID_ARGUMENT_HASH = HashingUtils::HashString("InvalidArgumentException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == ENTITY_ALREADY_EXISTS_HASH) { return AWSError(static_cast(WorkDocsErrors::ENTITY_ALREADY_EXISTS), false); } else if (hashCode == REQUESTED_ENTITY_TOO_LARGE_HASH) { return AWSError(static_cast(WorkDocsErrors::REQUESTED_ENTITY_TOO_LARGE), false); } else if (hashCode == TOO_MANY_LABELS_HASH) { return AWSError(static_cast(WorkDocsErrors::TOO_MANY_LABELS), false); } else if (hashCode == DRAFT_UPLOAD_OUT_OF_SYNC_HASH) { return AWSError(static_cast(WorkDocsErrors::DRAFT_UPLOAD_OUT_OF_SYNC), false); } else if (hashCode == FAILED_DEPENDENCY_HASH) { return AWSError(static_cast(WorkDocsErrors::FAILED_DEPENDENCY), false); } else if (hashCode == RESOURCE_ALREADY_CHECKED_OUT_HASH) { return AWSError(static_cast(WorkDocsErrors::RESOURCE_ALREADY_CHECKED_OUT), false); } else if (hashCode == CUSTOM_METADATA_LIMIT_EXCEEDED_HASH) { return AWSError(static_cast(WorkDocsErrors::CUSTOM_METADATA_LIMIT_EXCEEDED), false); } else if (hashCode == LIMIT_EXCEEDED_HASH) { return AWSError(static_cast(WorkDocsErrors::LIMIT_EXCEEDED), true); } else if (hashCode == PROHIBITED_STATE_HASH) { return AWSError(static_cast(WorkDocsErrors::PROHIBITED_STATE), false); } else if (hashCode == DOCUMENT_LOCKED_FOR_COMMENTS_HASH) { return AWSError(static_cast(WorkDocsErrors::DOCUMENT_LOCKED_FOR_COMMENTS), false); } else if (hashCode == CONCURRENT_MODIFICATION_HASH) { return AWSError(static_cast(WorkDocsErrors::CONCURRENT_MODIFICATION), false); } else if (hashCode == STORAGE_LIMIT_WILL_EXCEED_HASH) { return AWSError(static_cast(WorkDocsErrors::STORAGE_LIMIT_WILL_EXCEED), false); } else if (hashCode == INVALID_COMMENT_OPERATION_HASH) { return AWSError(static_cast(WorkDocsErrors::INVALID_COMMENT_OPERATION), false); } else if (hashCode == STORAGE_LIMIT_EXCEEDED_HASH) { return AWSError(static_cast(WorkDocsErrors::STORAGE_LIMIT_EXCEEDED), false); } else if (hashCode == UNAUTHORIZED_OPERATION_HASH) { return AWSError(static_cast(WorkDocsErrors::UNAUTHORIZED_OPERATION), false); } else if (hashCode == TOO_MANY_SUBSCRIPTIONS_HASH) { return AWSError(static_cast(WorkDocsErrors::TOO_MANY_SUBSCRIPTIONS), false); } else if (hashCode == ILLEGAL_USER_STATE_HASH) { return AWSError(static_cast(WorkDocsErrors::ILLEGAL_USER_STATE), false); } else if (hashCode == DEACTIVATING_LAST_SYSTEM_USER_HASH) { return AWSError(static_cast(WorkDocsErrors::DEACTIVATING_LAST_SYSTEM_USER), false); } else if (hashCode == UNAUTHORIZED_RESOURCE_ACCESS_HASH) { return AWSError(static_cast(WorkDocsErrors::UNAUTHORIZED_RESOURCE_ACCESS), false); } else if (hashCode == ENTITY_NOT_EXISTS_HASH) { return AWSError(static_cast(WorkDocsErrors::ENTITY_NOT_EXISTS), false); } else if (hashCode == INVALID_PASSWORD_HASH) { return AWSError(static_cast(WorkDocsErrors::INVALID_PASSWORD), false); } else if (hashCode == INVALID_OPERATION_HASH) { return AWSError(static_cast(WorkDocsErrors::INVALID_OPERATION), false); } else if (hashCode == CONFLICTING_OPERATION_HASH) { return AWSError(static_cast(WorkDocsErrors::CONFLICTING_OPERATION), false); } else if (hashCode == INVALID_ARGUMENT_HASH) { return AWSError(static_cast(WorkDocsErrors::INVALID_ARGUMENT), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace WorkDocsErrorMapper } // namespace WorkDocs } // namespace Aws