/** * 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::IoTWireless; using namespace Aws::IoTWireless::Model; namespace Aws { namespace IoTWireless { template<> AWS_IOTWIRELESS_API ConflictException IoTWirelessError::GetModeledError() { assert(this->GetErrorType() == IoTWirelessErrors::CONFLICT); return ConflictException(this->GetJsonPayload().View()); } template<> AWS_IOTWIRELESS_API ResourceNotFoundException IoTWirelessError::GetModeledError() { assert(this->GetErrorType() == IoTWirelessErrors::RESOURCE_NOT_FOUND); return ResourceNotFoundException(this->GetJsonPayload().View()); } template<> AWS_IOTWIRELESS_API TooManyTagsException IoTWirelessError::GetModeledError() { assert(this->GetErrorType() == IoTWirelessErrors::TOO_MANY_TAGS); return TooManyTagsException(this->GetJsonPayload().View()); } namespace IoTWirelessErrorMapper { static const int CONFLICT_HASH = HashingUtils::HashString("ConflictException"); static const int INTERNAL_SERVER_HASH = HashingUtils::HashString("InternalServerException"); 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(IoTWirelessErrors::CONFLICT), false); } else if (hashCode == INTERNAL_SERVER_HASH) { return AWSError(static_cast(IoTWirelessErrors::INTERNAL_SERVER), false); } else if (hashCode == TOO_MANY_TAGS_HASH) { return AWSError(static_cast(IoTWirelessErrors::TOO_MANY_TAGS), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace IoTWirelessErrorMapper } // namespace IoTWireless } // namespace Aws