/** * 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::CostandUsageReportService; namespace Aws { namespace CostandUsageReportService { namespace CostandUsageReportServiceErrorMapper { static const int INTERNAL_ERROR_HASH = HashingUtils::HashString("InternalErrorException"); static const int REPORT_LIMIT_REACHED_HASH = HashingUtils::HashString("ReportLimitReachedException"); static const int DUPLICATE_REPORT_NAME_HASH = HashingUtils::HashString("DuplicateReportNameException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == INTERNAL_ERROR_HASH) { return AWSError(static_cast(CostandUsageReportServiceErrors::INTERNAL_ERROR), false); } else if (hashCode == REPORT_LIMIT_REACHED_HASH) { return AWSError(static_cast(CostandUsageReportServiceErrors::REPORT_LIMIT_REACHED), false); } else if (hashCode == DUPLICATE_REPORT_NAME_HASH) { return AWSError(static_cast(CostandUsageReportServiceErrors::DUPLICATE_REPORT_NAME), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace CostandUsageReportServiceErrorMapper } // namespace CostandUsageReportService } // namespace Aws