/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include using namespace Aws::Client; using namespace Aws::Utils; using namespace Aws::FinSpaceData; using namespace Aws::FinSpaceData::Model; namespace Aws { namespace FinSpaceData { template<> AWS_FINSPACEDATA_API ConflictException FinSpaceDataError::GetModeledError() { assert(this->GetErrorType() == FinSpaceDataErrors::CONFLICT); return ConflictException(this->GetJsonPayload().View()); } template<> AWS_FINSPACEDATA_API ResourceNotFoundException FinSpaceDataError::GetModeledError() { assert(this->GetErrorType() == FinSpaceDataErrors::RESOURCE_NOT_FOUND); return ResourceNotFoundException(this->GetJsonPayload().View()); } template<> AWS_FINSPACEDATA_API ValidationException FinSpaceDataError::GetModeledError() { assert(this->GetErrorType() == FinSpaceDataErrors::VALIDATION); return ValidationException(this->GetJsonPayload().View()); } namespace FinSpaceDataErrorMapper { static const int CONFLICT_HASH = HashingUtils::HashString("ConflictException"); static const int INTERNAL_SERVER_HASH = HashingUtils::HashString("InternalServerException"); static const int LIMIT_EXCEEDED_HASH = HashingUtils::HashString("LimitExceededException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == CONFLICT_HASH) { return AWSError(static_cast(FinSpaceDataErrors::CONFLICT), false); } else if (hashCode == INTERNAL_SERVER_HASH) { return AWSError(static_cast(FinSpaceDataErrors::INTERNAL_SERVER), false); } else if (hashCode == LIMIT_EXCEEDED_HASH) { return AWSError(static_cast(FinSpaceDataErrors::LIMIT_EXCEEDED), true); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace FinSpaceDataErrorMapper } // namespace FinSpaceData } // namespace Aws