/** * 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 IoT { namespace Model { namespace TargetSelectionMapper { static const int CONTINUOUS_HASH = HashingUtils::HashString("CONTINUOUS"); static const int SNAPSHOT_HASH = HashingUtils::HashString("SNAPSHOT"); TargetSelection GetTargetSelectionForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == CONTINUOUS_HASH) { return TargetSelection::CONTINUOUS; } else if (hashCode == SNAPSHOT_HASH) { return TargetSelection::SNAPSHOT; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return TargetSelection::NOT_SET; } Aws::String GetNameForTargetSelection(TargetSelection enumValue) { switch(enumValue) { case TargetSelection::CONTINUOUS: return "CONTINUOUS"; case TargetSelection::SNAPSHOT: return "SNAPSHOT"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace TargetSelectionMapper } // namespace Model } // namespace IoT } // namespace Aws