/** * 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::TimestreamWrite; using namespace Aws::TimestreamWrite::Model; namespace Aws { namespace TimestreamWrite { template<> AWS_TIMESTREAMWRITE_API RejectedRecordsException TimestreamWriteError::GetModeledError() { assert(this->GetErrorType() == TimestreamWriteErrors::REJECTED_RECORDS); return RejectedRecordsException(this->GetJsonPayload().View()); } namespace TimestreamWriteErrorMapper { static const int CONFLICT_HASH = HashingUtils::HashString("ConflictException"); static const int INVALID_ENDPOINT_HASH = HashingUtils::HashString("InvalidEndpointException"); static const int SERVICE_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("ServiceQuotaExceededException"); static const int INTERNAL_SERVER_HASH = HashingUtils::HashString("InternalServerException"); static const int REJECTED_RECORDS_HASH = HashingUtils::HashString("RejectedRecordsException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == CONFLICT_HASH) { return AWSError(static_cast(TimestreamWriteErrors::CONFLICT), false); } else if (hashCode == INVALID_ENDPOINT_HASH) { return AWSError(static_cast(TimestreamWriteErrors::INVALID_ENDPOINT), false); } else if (hashCode == SERVICE_QUOTA_EXCEEDED_HASH) { return AWSError(static_cast(TimestreamWriteErrors::SERVICE_QUOTA_EXCEEDED), false); } else if (hashCode == INTERNAL_SERVER_HASH) { return AWSError(static_cast(TimestreamWriteErrors::INTERNAL_SERVER), false); } else if (hashCode == REJECTED_RECORDS_HASH) { return AWSError(static_cast(TimestreamWriteErrors::REJECTED_RECORDS), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace TimestreamWriteErrorMapper } // namespace TimestreamWrite } // namespace Aws