/** * 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 ManagedBlockchain { namespace Model { namespace NodeStatusMapper { static const int CREATING_HASH = HashingUtils::HashString("CREATING"); static const int AVAILABLE_HASH = HashingUtils::HashString("AVAILABLE"); static const int UNHEALTHY_HASH = HashingUtils::HashString("UNHEALTHY"); static const int CREATE_FAILED_HASH = HashingUtils::HashString("CREATE_FAILED"); static const int UPDATING_HASH = HashingUtils::HashString("UPDATING"); static const int DELETING_HASH = HashingUtils::HashString("DELETING"); static const int DELETED_HASH = HashingUtils::HashString("DELETED"); static const int FAILED_HASH = HashingUtils::HashString("FAILED"); static const int INACCESSIBLE_ENCRYPTION_KEY_HASH = HashingUtils::HashString("INACCESSIBLE_ENCRYPTION_KEY"); NodeStatus GetNodeStatusForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == CREATING_HASH) { return NodeStatus::CREATING; } else if (hashCode == AVAILABLE_HASH) { return NodeStatus::AVAILABLE; } else if (hashCode == UNHEALTHY_HASH) { return NodeStatus::UNHEALTHY; } else if (hashCode == CREATE_FAILED_HASH) { return NodeStatus::CREATE_FAILED; } else if (hashCode == UPDATING_HASH) { return NodeStatus::UPDATING; } else if (hashCode == DELETING_HASH) { return NodeStatus::DELETING; } else if (hashCode == DELETED_HASH) { return NodeStatus::DELETED; } else if (hashCode == FAILED_HASH) { return NodeStatus::FAILED; } else if (hashCode == INACCESSIBLE_ENCRYPTION_KEY_HASH) { return NodeStatus::INACCESSIBLE_ENCRYPTION_KEY; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return NodeStatus::NOT_SET; } Aws::String GetNameForNodeStatus(NodeStatus enumValue) { switch(enumValue) { case NodeStatus::CREATING: return "CREATING"; case NodeStatus::AVAILABLE: return "AVAILABLE"; case NodeStatus::UNHEALTHY: return "UNHEALTHY"; case NodeStatus::CREATE_FAILED: return "CREATE_FAILED"; case NodeStatus::UPDATING: return "UPDATING"; case NodeStatus::DELETING: return "DELETING"; case NodeStatus::DELETED: return "DELETED"; case NodeStatus::FAILED: return "FAILED"; case NodeStatus::INACCESSIBLE_ENCRYPTION_KEY: return "INACCESSIBLE_ENCRYPTION_KEY"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace NodeStatusMapper } // namespace Model } // namespace ManagedBlockchain } // namespace Aws