/** * 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::ApplicationInsights; using namespace Aws::ApplicationInsights::Model; namespace Aws { namespace ApplicationInsights { template<> AWS_APPLICATIONINSIGHTS_API TooManyTagsException ApplicationInsightsError::GetModeledError() { assert(this->GetErrorType() == ApplicationInsightsErrors::TOO_MANY_TAGS); return TooManyTagsException(this->GetJsonPayload().View()); } namespace ApplicationInsightsErrorMapper { static const int INTERNAL_SERVER_HASH = HashingUtils::HashString("InternalServerException"); static const int TAGS_ALREADY_EXIST_HASH = HashingUtils::HashString("TagsAlreadyExistException"); static const int TOO_MANY_TAGS_HASH = HashingUtils::HashString("TooManyTagsException"); static const int RESOURCE_IN_USE_HASH = HashingUtils::HashString("ResourceInUseException"); static const int BAD_REQUEST_HASH = HashingUtils::HashString("BadRequestException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == INTERNAL_SERVER_HASH) { return AWSError(static_cast(ApplicationInsightsErrors::INTERNAL_SERVER), false); } else if (hashCode == TAGS_ALREADY_EXIST_HASH) { return AWSError(static_cast(ApplicationInsightsErrors::TAGS_ALREADY_EXIST), false); } else if (hashCode == TOO_MANY_TAGS_HASH) { return AWSError(static_cast(ApplicationInsightsErrors::TOO_MANY_TAGS), false); } else if (hashCode == RESOURCE_IN_USE_HASH) { return AWSError(static_cast(ApplicationInsightsErrors::RESOURCE_IN_USE), false); } else if (hashCode == BAD_REQUEST_HASH) { return AWSError(static_cast(ApplicationInsightsErrors::BAD_REQUEST), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace ApplicationInsightsErrorMapper } // namespace ApplicationInsights } // namespace Aws