/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include using namespace Aws::Utils; namespace Aws { namespace ResourceGroups { namespace Model { namespace QueryErrorCodeMapper { static const int CLOUDFORMATION_STACK_INACTIVE_HASH = HashingUtils::HashString("CLOUDFORMATION_STACK_INACTIVE"); static const int CLOUDFORMATION_STACK_NOT_EXISTING_HASH = HashingUtils::HashString("CLOUDFORMATION_STACK_NOT_EXISTING"); static const int CLOUDFORMATION_STACK_UNASSUMABLE_ROLE_HASH = HashingUtils::HashString("CLOUDFORMATION_STACK_UNASSUMABLE_ROLE"); QueryErrorCode GetQueryErrorCodeForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == CLOUDFORMATION_STACK_INACTIVE_HASH) { return QueryErrorCode::CLOUDFORMATION_STACK_INACTIVE; } else if (hashCode == CLOUDFORMATION_STACK_NOT_EXISTING_HASH) { return QueryErrorCode::CLOUDFORMATION_STACK_NOT_EXISTING; } else if (hashCode == CLOUDFORMATION_STACK_UNASSUMABLE_ROLE_HASH) { return QueryErrorCode::CLOUDFORMATION_STACK_UNASSUMABLE_ROLE; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return QueryErrorCode::NOT_SET; } Aws::String GetNameForQueryErrorCode(QueryErrorCode enumValue) { switch(enumValue) { case QueryErrorCode::CLOUDFORMATION_STACK_INACTIVE: return "CLOUDFORMATION_STACK_INACTIVE"; case QueryErrorCode::CLOUDFORMATION_STACK_NOT_EXISTING: return "CLOUDFORMATION_STACK_NOT_EXISTING"; case QueryErrorCode::CLOUDFORMATION_STACK_UNASSUMABLE_ROLE: return "CLOUDFORMATION_STACK_UNASSUMABLE_ROLE"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace QueryErrorCodeMapper } // namespace Model } // namespace ResourceGroups } // namespace Aws