/** * 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 MediaTailor { namespace Model { namespace ModeMapper { static const int OFF_HASH = HashingUtils::HashString("OFF"); static const int BEHIND_LIVE_EDGE_HASH = HashingUtils::HashString("BEHIND_LIVE_EDGE"); static const int AFTER_LIVE_EDGE_HASH = HashingUtils::HashString("AFTER_LIVE_EDGE"); Mode GetModeForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == OFF_HASH) { return Mode::OFF; } else if (hashCode == BEHIND_LIVE_EDGE_HASH) { return Mode::BEHIND_LIVE_EDGE; } else if (hashCode == AFTER_LIVE_EDGE_HASH) { return Mode::AFTER_LIVE_EDGE; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return Mode::NOT_SET; } Aws::String GetNameForMode(Mode enumValue) { switch(enumValue) { case Mode::OFF: return "OFF"; case Mode::BEHIND_LIVE_EDGE: return "BEHIND_LIVE_EDGE"; case Mode::AFTER_LIVE_EDGE: return "AFTER_LIVE_EDGE"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace ModeMapper } // namespace Model } // namespace MediaTailor } // namespace Aws