/** * 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 SSM { namespace Model { namespace SessionStateMapper { static const int Active_HASH = HashingUtils::HashString("Active"); static const int History_HASH = HashingUtils::HashString("History"); SessionState GetSessionStateForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == Active_HASH) { return SessionState::Active; } else if (hashCode == History_HASH) { return SessionState::History; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return SessionState::NOT_SET; } Aws::String GetNameForSessionState(SessionState enumValue) { switch(enumValue) { case SessionState::Active: return "Active"; case SessionState::History: return "History"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace SessionStateMapper } // namespace Model } // namespace SSM } // namespace Aws