/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include using namespace Aws::Client; using namespace Aws::Utils; using namespace Aws::ConnectWisdomService; using namespace Aws::ConnectWisdomService::Model; namespace Aws { namespace ConnectWisdomService { template<> AWS_CONNECTWISDOMSERVICE_API ResourceNotFoundException ConnectWisdomServiceError::GetModeledError() { assert(this->GetErrorType() == ConnectWisdomServiceErrors::RESOURCE_NOT_FOUND); return ResourceNotFoundException(this->GetJsonPayload().View()); } template<> AWS_CONNECTWISDOMSERVICE_API TooManyTagsException ConnectWisdomServiceError::GetModeledError() { assert(this->GetErrorType() == ConnectWisdomServiceErrors::TOO_MANY_TAGS); return TooManyTagsException(this->GetJsonPayload().View()); } namespace ConnectWisdomServiceErrorMapper { static const int CONFLICT_HASH = HashingUtils::HashString("ConflictException"); static const int SERVICE_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("ServiceQuotaExceededException"); static const int PRECONDITION_FAILED_HASH = HashingUtils::HashString("PreconditionFailedException"); static const int TOO_MANY_TAGS_HASH = HashingUtils::HashString("TooManyTagsException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == CONFLICT_HASH) { return AWSError(static_cast(ConnectWisdomServiceErrors::CONFLICT), false); } else if (hashCode == SERVICE_QUOTA_EXCEEDED_HASH) { return AWSError(static_cast(ConnectWisdomServiceErrors::SERVICE_QUOTA_EXCEEDED), false); } else if (hashCode == PRECONDITION_FAILED_HASH) { return AWSError(static_cast(ConnectWisdomServiceErrors::PRECONDITION_FAILED), false); } else if (hashCode == TOO_MANY_TAGS_HASH) { return AWSError(static_cast(ConnectWisdomServiceErrors::TOO_MANY_TAGS), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace ConnectWisdomServiceErrorMapper } // namespace ConnectWisdomService } // namespace Aws