/** * 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::MigrationHubConfig; using namespace Aws::MigrationHubConfig::Model; namespace Aws { namespace MigrationHubConfig { template<> AWS_MIGRATIONHUBCONFIG_API ThrottlingException MigrationHubConfigError::GetModeledError() { assert(this->GetErrorType() == MigrationHubConfigErrors::THROTTLING); return ThrottlingException(this->GetJsonPayload().View()); } namespace MigrationHubConfigErrorMapper { static const int DRY_RUN_OPERATION_HASH = HashingUtils::HashString("DryRunOperation"); static const int INVALID_INPUT_HASH = HashingUtils::HashString("InvalidInputException"); AWSError GetErrorForName(const char* errorName) { int hashCode = HashingUtils::HashString(errorName); if (hashCode == DRY_RUN_OPERATION_HASH) { return AWSError(static_cast(MigrationHubConfigErrors::DRY_RUN_OPERATION), false); } else if (hashCode == INVALID_INPUT_HASH) { return AWSError(static_cast(MigrationHubConfigErrors::INVALID_INPUT), false); } return AWSError(CoreErrors::UNKNOWN, false); } } // namespace MigrationHubConfigErrorMapper } // namespace MigrationHubConfig } // namespace Aws