/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Client; using namespace Aws::Utils; using namespace Aws::AppIntegrationsService; namespace Aws { namespace AppIntegrationsService { namespace AppIntegrationsServiceErrorMapper { static const int INTERNAL_SERVICE_HASH = HashingUtils::HashString("InternalServiceError"); static const int DUPLICATE_RESOURCE_HASH = HashingUtils::HashString("DuplicateResourceException"); static const int RESOURCE_QUOTA_EXCEEDED_HASH = HashingUtils::HashString("ResourceQuotaExceededException"); static const int INVALID_REQUEST_HASH = HashingUtils::HashString("InvalidRequestException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == INTERNAL_SERVICE_HASH) { return AWSError(static_cast(AppIntegrationsServiceErrors::INTERNAL_SERVICE), false); } else if (hashCode == DUPLICATE_RESOURCE_HASH) { return AWSError(static_cast(AppIntegrationsServiceErrors::DUPLICATE_RESOURCE), false); } else if (hashCode == RESOURCE_QUOTA_EXCEEDED_HASH) { return AWSError(static_cast(AppIntegrationsServiceErrors::RESOURCE_QUOTA_EXCEEDED), false); } else if (hashCode == INVALID_REQUEST_HASH) { return AWSError(static_cast(AppIntegrationsServiceErrors::INVALID_REQUEST), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace AppIntegrationsServiceErrorMapper } // namespace AppIntegrationsService } // namespace Aws