/** * 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 Connect { namespace Model { namespace ParticipantRoleMapper { static const int AGENT_HASH = HashingUtils::HashString("AGENT"); static const int CUSTOMER_HASH = HashingUtils::HashString("CUSTOMER"); static const int SYSTEM_HASH = HashingUtils::HashString("SYSTEM"); static const int CUSTOM_BOT_HASH = HashingUtils::HashString("CUSTOM_BOT"); ParticipantRole GetParticipantRoleForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == AGENT_HASH) { return ParticipantRole::AGENT; } else if (hashCode == CUSTOMER_HASH) { return ParticipantRole::CUSTOMER; } else if (hashCode == SYSTEM_HASH) { return ParticipantRole::SYSTEM; } else if (hashCode == CUSTOM_BOT_HASH) { return ParticipantRole::CUSTOM_BOT; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return ParticipantRole::NOT_SET; } Aws::String GetNameForParticipantRole(ParticipantRole enumValue) { switch(enumValue) { case ParticipantRole::AGENT: return "AGENT"; case ParticipantRole::CUSTOMER: return "CUSTOMER"; case ParticipantRole::SYSTEM: return "SYSTEM"; case ParticipantRole::CUSTOM_BOT: return "CUSTOM_BOT"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace ParticipantRoleMapper } // namespace Model } // namespace Connect } // namespace Aws