/** * 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::ElasticBeanstalk; namespace Aws { namespace ElasticBeanstalk { namespace ElasticBeanstalkErrorMapper { static const int ELASTIC_BEANSTALK_SERVICE_HASH = HashingUtils::HashString("ElasticBeanstalkServiceException"); static const int S3_LOCATION_NOT_IN_SERVICE_REGION_HASH = HashingUtils::HashString("S3LocationNotInServiceRegionException"); static const int TOO_MANY_APPLICATIONS_HASH = HashingUtils::HashString("TooManyApplicationsException"); static const int CODE_BUILD_NOT_IN_SERVICE_REGION_HASH = HashingUtils::HashString("CodeBuildNotInServiceRegionException"); static const int PLATFORM_VERSION_STILL_REFERENCED_HASH = HashingUtils::HashString("PlatformVersionStillReferencedException"); static const int TOO_MANY_CONFIGURATION_TEMPLATES_HASH = HashingUtils::HashString("TooManyConfigurationTemplatesException"); static const int MANAGED_ACTION_INVALID_STATE_HASH = HashingUtils::HashString("ManagedActionInvalidStateException"); static const int TOO_MANY_APPLICATION_VERSIONS_HASH = HashingUtils::HashString("TooManyApplicationVersionsException"); static const int OPERATION_IN_PROGRESS_HASH = HashingUtils::HashString("OperationInProgressFailure"); static const int S3_SUBSCRIPTION_REQUIRED_HASH = HashingUtils::HashString("S3SubscriptionRequiredException"); static const int INSUFFICIENT_PRIVILEGES_HASH = HashingUtils::HashString("InsufficientPrivilegesException"); static const int RESOURCE_TYPE_NOT_SUPPORTED_HASH = HashingUtils::HashString("ResourceTypeNotSupportedException"); static const int TOO_MANY_ENVIRONMENTS_HASH = HashingUtils::HashString("TooManyEnvironmentsException"); static const int TOO_MANY_BUCKETS_HASH = HashingUtils::HashString("TooManyBucketsException"); static const int TOO_MANY_TAGS_HASH = HashingUtils::HashString("TooManyTagsException"); static const int SOURCE_BUNDLE_DELETION_HASH = HashingUtils::HashString("SourceBundleDeletionFailure"); static const int TOO_MANY_PLATFORMS_HASH = HashingUtils::HashString("TooManyPlatformsException"); static const int INVALID_REQUEST_HASH = HashingUtils::HashString("InvalidRequestException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == ELASTIC_BEANSTALK_SERVICE_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::ELASTIC_BEANSTALK_SERVICE), false); } else if (hashCode == S3_LOCATION_NOT_IN_SERVICE_REGION_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::S3_LOCATION_NOT_IN_SERVICE_REGION), false); } else if (hashCode == TOO_MANY_APPLICATIONS_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::TOO_MANY_APPLICATIONS), false); } else if (hashCode == CODE_BUILD_NOT_IN_SERVICE_REGION_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::CODE_BUILD_NOT_IN_SERVICE_REGION), false); } else if (hashCode == PLATFORM_VERSION_STILL_REFERENCED_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::PLATFORM_VERSION_STILL_REFERENCED), false); } else if (hashCode == TOO_MANY_CONFIGURATION_TEMPLATES_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::TOO_MANY_CONFIGURATION_TEMPLATES), false); } else if (hashCode == MANAGED_ACTION_INVALID_STATE_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::MANAGED_ACTION_INVALID_STATE), false); } else if (hashCode == TOO_MANY_APPLICATION_VERSIONS_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::TOO_MANY_APPLICATION_VERSIONS), false); } else if (hashCode == OPERATION_IN_PROGRESS_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::OPERATION_IN_PROGRESS), false); } else if (hashCode == S3_SUBSCRIPTION_REQUIRED_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::S3_SUBSCRIPTION_REQUIRED), false); } else if (hashCode == INSUFFICIENT_PRIVILEGES_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::INSUFFICIENT_PRIVILEGES), false); } else if (hashCode == RESOURCE_TYPE_NOT_SUPPORTED_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::RESOURCE_TYPE_NOT_SUPPORTED), false); } else if (hashCode == TOO_MANY_ENVIRONMENTS_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::TOO_MANY_ENVIRONMENTS), false); } else if (hashCode == TOO_MANY_BUCKETS_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::TOO_MANY_BUCKETS), false); } else if (hashCode == TOO_MANY_TAGS_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::TOO_MANY_TAGS), false); } else if (hashCode == SOURCE_BUNDLE_DELETION_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::SOURCE_BUNDLE_DELETION), false); } else if (hashCode == TOO_MANY_PLATFORMS_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::TOO_MANY_PLATFORMS), false); } else if (hashCode == INVALID_REQUEST_HASH) { return AWSError(static_cast(ElasticBeanstalkErrors::INVALID_REQUEST), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace ElasticBeanstalkErrorMapper } // namespace ElasticBeanstalk } // namespace Aws