/** * 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::Rekognition; using namespace Aws::Rekognition::Model; namespace Aws { namespace Rekognition { template<> AWS_REKOGNITION_API HumanLoopQuotaExceededException RekognitionError::GetModeledError() { assert(this->GetErrorType() == RekognitionErrors::HUMAN_LOOP_QUOTA_EXCEEDED); return HumanLoopQuotaExceededException(this->GetJsonPayload().View()); } namespace RekognitionErrorMapper { static const int CONFLICT_HASH = HashingUtils::HashString("ConflictException"); static const int IMAGE_TOO_LARGE_HASH = HashingUtils::HashString("ImageTooLargeException"); static const int RESOURCE_NOT_READY_HASH = HashingUtils::HashString("ResourceNotReadyException"); static const int RESOURCE_ALREADY_EXISTS_HASH = HashingUtils::HashString("ResourceAlreadyExistsException"); static const int IDEMPOTENT_PARAMETER_MISMATCH_HASH = HashingUtils::HashString("IdempotentParameterMismatchException"); static const int LIMIT_EXCEEDED_HASH = HashingUtils::HashString("LimitExceededException"); static const int INVALID_POLICY_REVISION_ID_HASH = HashingUtils::HashString("InvalidPolicyRevisionIdException"); static const int INVALID_PAGINATION_TOKEN_HASH = HashingUtils::HashString("InvalidPaginationTokenException"); static const int SESSION_NOT_FOUND_HASH = HashingUtils::HashString("SessionNotFoundException"); static const int MALFORMED_POLICY_DOCUMENT_HASH = HashingUtils::HashString("MalformedPolicyDocumentException"); static const int SERVICE_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("ServiceQuotaExceededException"); static const int INVALID_PARAMETER_HASH = HashingUtils::HashString("InvalidParameterException"); static const int PROVISIONED_THROUGHPUT_EXCEEDED_HASH = HashingUtils::HashString("ProvisionedThroughputExceededException"); static const int RESOURCE_IN_USE_HASH = HashingUtils::HashString("ResourceInUseException"); static const int VIDEO_TOO_LARGE_HASH = HashingUtils::HashString("VideoTooLargeException"); static const int INVALID_S3_OBJECT_HASH = HashingUtils::HashString("InvalidS3ObjectException"); static const int INVALID_IMAGE_FORMAT_HASH = HashingUtils::HashString("InvalidImageFormatException"); static const int HUMAN_LOOP_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("HumanLoopQuotaExceededException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == CONFLICT_HASH) { return AWSError(static_cast(RekognitionErrors::CONFLICT), false); } else if (hashCode == IMAGE_TOO_LARGE_HASH) { return AWSError(static_cast(RekognitionErrors::IMAGE_TOO_LARGE), false); } else if (hashCode == RESOURCE_NOT_READY_HASH) { return AWSError(static_cast(RekognitionErrors::RESOURCE_NOT_READY), false); } else if (hashCode == RESOURCE_ALREADY_EXISTS_HASH) { return AWSError(static_cast(RekognitionErrors::RESOURCE_ALREADY_EXISTS), false); } else if (hashCode == IDEMPOTENT_PARAMETER_MISMATCH_HASH) { return AWSError(static_cast(RekognitionErrors::IDEMPOTENT_PARAMETER_MISMATCH), false); } else if (hashCode == LIMIT_EXCEEDED_HASH) { return AWSError(static_cast(RekognitionErrors::LIMIT_EXCEEDED), true); } else if (hashCode == INVALID_POLICY_REVISION_ID_HASH) { return AWSError(static_cast(RekognitionErrors::INVALID_POLICY_REVISION_ID), false); } else if (hashCode == INVALID_PAGINATION_TOKEN_HASH) { return AWSError(static_cast(RekognitionErrors::INVALID_PAGINATION_TOKEN), false); } else if (hashCode == SESSION_NOT_FOUND_HASH) { return AWSError(static_cast(RekognitionErrors::SESSION_NOT_FOUND), false); } else if (hashCode == MALFORMED_POLICY_DOCUMENT_HASH) { return AWSError(static_cast(RekognitionErrors::MALFORMED_POLICY_DOCUMENT), false); } else if (hashCode == SERVICE_QUOTA_EXCEEDED_HASH) { return AWSError(static_cast(RekognitionErrors::SERVICE_QUOTA_EXCEEDED), false); } else if (hashCode == INVALID_PARAMETER_HASH) { return AWSError(static_cast(RekognitionErrors::INVALID_PARAMETER), false); } else if (hashCode == PROVISIONED_THROUGHPUT_EXCEEDED_HASH) { return AWSError(static_cast(RekognitionErrors::PROVISIONED_THROUGHPUT_EXCEEDED), true); } else if (hashCode == RESOURCE_IN_USE_HASH) { return AWSError(static_cast(RekognitionErrors::RESOURCE_IN_USE), false); } else if (hashCode == VIDEO_TOO_LARGE_HASH) { return AWSError(static_cast(RekognitionErrors::VIDEO_TOO_LARGE), false); } else if (hashCode == INVALID_S3_OBJECT_HASH) { return AWSError(static_cast(RekognitionErrors::INVALID_S3_OBJECT), false); } else if (hashCode == INVALID_IMAGE_FORMAT_HASH) { return AWSError(static_cast(RekognitionErrors::INVALID_IMAGE_FORMAT), false); } else if (hashCode == HUMAN_LOOP_QUOTA_EXCEEDED_HASH) { return AWSError(static_cast(RekognitionErrors::HUMAN_LOOP_QUOTA_EXCEEDED), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace RekognitionErrorMapper } // namespace Rekognition } // namespace Aws