/** * 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 GameSparks { namespace Model { namespace OperationMapper { static const int ADD_HASH = HashingUtils::HashString("ADD"); static const int REMOVE_HASH = HashingUtils::HashString("REMOVE"); static const int REPLACE_HASH = HashingUtils::HashString("REPLACE"); Operation GetOperationForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == ADD_HASH) { return Operation::ADD; } else if (hashCode == REMOVE_HASH) { return Operation::REMOVE; } else if (hashCode == REPLACE_HASH) { return Operation::REPLACE; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return Operation::NOT_SET; } Aws::String GetNameForOperation(Operation enumValue) { switch(enumValue) { case Operation::ADD: return "ADD"; case Operation::REMOVE: return "REMOVE"; case Operation::REPLACE: return "REPLACE"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace OperationMapper } // namespace Model } // namespace GameSparks } // namespace Aws