/** * 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 IoTSecureTunneling { namespace Model { namespace ConnectionStatusMapper { static const int CONNECTED_HASH = HashingUtils::HashString("CONNECTED"); static const int DISCONNECTED_HASH = HashingUtils::HashString("DISCONNECTED"); ConnectionStatus GetConnectionStatusForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == CONNECTED_HASH) { return ConnectionStatus::CONNECTED; } else if (hashCode == DISCONNECTED_HASH) { return ConnectionStatus::DISCONNECTED; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return ConnectionStatus::NOT_SET; } Aws::String GetNameForConnectionStatus(ConnectionStatus enumValue) { switch(enumValue) { case ConnectionStatus::CONNECTED: return "CONNECTED"; case ConnectionStatus::DISCONNECTED: return "DISCONNECTED"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace ConnectionStatusMapper } // namespace Model } // namespace IoTSecureTunneling } // namespace Aws