/** * 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 NetworkManager { namespace Model { namespace ConnectionStateMapper { static const int PENDING_HASH = HashingUtils::HashString("PENDING"); static const int AVAILABLE_HASH = HashingUtils::HashString("AVAILABLE"); static const int DELETING_HASH = HashingUtils::HashString("DELETING"); static const int UPDATING_HASH = HashingUtils::HashString("UPDATING"); ConnectionState GetConnectionStateForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == PENDING_HASH) { return ConnectionState::PENDING; } else if (hashCode == AVAILABLE_HASH) { return ConnectionState::AVAILABLE; } else if (hashCode == DELETING_HASH) { return ConnectionState::DELETING; } else if (hashCode == UPDATING_HASH) { return ConnectionState::UPDATING; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return ConnectionState::NOT_SET; } Aws::String GetNameForConnectionState(ConnectionState enumValue) { switch(enumValue) { case ConnectionState::PENDING: return "PENDING"; case ConnectionState::AVAILABLE: return "AVAILABLE"; case ConnectionState::DELETING: return "DELETING"; case ConnectionState::UPDATING: return "UPDATING"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace ConnectionStateMapper } // namespace Model } // namespace NetworkManager } // namespace Aws