/** * 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::TimestreamQuery; using namespace Aws::TimestreamQuery::Model; namespace Aws { namespace TimestreamQuery { template<> AWS_TIMESTREAMQUERY_API ResourceNotFoundException TimestreamQueryError::GetModeledError() { assert(this->GetErrorType() == TimestreamQueryErrors::RESOURCE_NOT_FOUND); return ResourceNotFoundException(this->GetJsonPayload().View()); } namespace TimestreamQueryErrorMapper { static const int INVALID_ENDPOINT_HASH = HashingUtils::HashString("InvalidEndpointException"); 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 QUERY_EXECUTION_HASH = HashingUtils::HashString("QueryExecutionException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == INVALID_ENDPOINT_HASH) { return AWSError(static_cast(TimestreamQueryErrors::INVALID_ENDPOINT), false); } else if (hashCode == CONFLICT_HASH) { return AWSError(static_cast(TimestreamQueryErrors::CONFLICT), false); } else if (hashCode == SERVICE_QUOTA_EXCEEDED_HASH) { return AWSError(static_cast(TimestreamQueryErrors::SERVICE_QUOTA_EXCEEDED), false); } else if (hashCode == INTERNAL_SERVER_HASH) { return AWSError(static_cast(TimestreamQueryErrors::INTERNAL_SERVER), false); } else if (hashCode == QUERY_EXECUTION_HASH) { return AWSError(static_cast(TimestreamQueryErrors::QUERY_EXECUTION), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace TimestreamQueryErrorMapper } // namespace TimestreamQuery } // namespace Aws