/** * 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::finspace; using namespace Aws::finspace::Model; namespace Aws { namespace finspace { template<> AWS_FINSPACE_API ConflictException FinspaceError::GetModeledError() { assert(this->GetErrorType() == FinspaceErrors::CONFLICT); return ConflictException(this->GetJsonPayload().View()); } namespace FinspaceErrorMapper { static const int CONFLICT_HASH = HashingUtils::HashString("ConflictException"); static const int SERVICE_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("ServiceQuotaExceededException"); static const int INTERNAL_SERVER_HASH = HashingUtils::HashString("InternalServerException"); static const int RESOURCE_ALREADY_EXISTS_HASH = HashingUtils::HashString("ResourceAlreadyExistsException"); static const int LIMIT_EXCEEDED_HASH = HashingUtils::HashString("LimitExceededException"); static const int INVALID_REQUEST_HASH = HashingUtils::HashString("InvalidRequestException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == CONFLICT_HASH) { return AWSError(static_cast(FinspaceErrors::CONFLICT), false); } else if (hashCode == SERVICE_QUOTA_EXCEEDED_HASH) { return AWSError(static_cast(FinspaceErrors::SERVICE_QUOTA_EXCEEDED), false); } else if (hashCode == INTERNAL_SERVER_HASH) { return AWSError(static_cast(FinspaceErrors::INTERNAL_SERVER), false); } else if (hashCode == RESOURCE_ALREADY_EXISTS_HASH) { return AWSError(static_cast(FinspaceErrors::RESOURCE_ALREADY_EXISTS), false); } else if (hashCode == LIMIT_EXCEEDED_HASH) { return AWSError(static_cast(FinspaceErrors::LIMIT_EXCEEDED), true); } else if (hashCode == INVALID_REQUEST_HASH) { return AWSError(static_cast(FinspaceErrors::INVALID_REQUEST), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace FinspaceErrorMapper } // namespace finspace } // namespace Aws