/** * 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 IoTTwinMaker { namespace Model { namespace StateMapper { static const int CREATING_HASH = HashingUtils::HashString("CREATING"); static const int UPDATING_HASH = HashingUtils::HashString("UPDATING"); static const int DELETING_HASH = HashingUtils::HashString("DELETING"); static const int ACTIVE_HASH = HashingUtils::HashString("ACTIVE"); static const int ERROR__HASH = HashingUtils::HashString("ERROR"); State GetStateForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == CREATING_HASH) { return State::CREATING; } else if (hashCode == UPDATING_HASH) { return State::UPDATING; } else if (hashCode == DELETING_HASH) { return State::DELETING; } else if (hashCode == ACTIVE_HASH) { return State::ACTIVE; } else if (hashCode == ERROR__HASH) { return State::ERROR_; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return State::NOT_SET; } Aws::String GetNameForState(State enumValue) { switch(enumValue) { case State::CREATING: return "CREATING"; case State::UPDATING: return "UPDATING"; case State::DELETING: return "DELETING"; case State::ACTIVE: return "ACTIVE"; case State::ERROR_: return "ERROR"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace StateMapper } // namespace Model } // namespace IoTTwinMaker } // namespace Aws