/** * 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 Chime { namespace Model { namespace CapabilityMapper { static const int Voice_HASH = HashingUtils::HashString("Voice"); static const int SMS_HASH = HashingUtils::HashString("SMS"); Capability GetCapabilityForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == Voice_HASH) { return Capability::Voice; } else if (hashCode == SMS_HASH) { return Capability::SMS; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return Capability::NOT_SET; } Aws::String GetNameForCapability(Capability enumValue) { switch(enumValue) { case Capability::Voice: return "Voice"; case Capability::SMS: return "SMS"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace CapabilityMapper } // namespace Model } // namespace Chime } // namespace Aws