/** * 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 MediaPackage { namespace Model { namespace OriginationMapper { static const int ALLOW_HASH = HashingUtils::HashString("ALLOW"); static const int DENY_HASH = HashingUtils::HashString("DENY"); Origination GetOriginationForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == ALLOW_HASH) { return Origination::ALLOW; } else if (hashCode == DENY_HASH) { return Origination::DENY; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return Origination::NOT_SET; } Aws::String GetNameForOrigination(Origination enumValue) { switch(enumValue) { case Origination::ALLOW: return "ALLOW"; case Origination::DENY: return "DENY"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace OriginationMapper } // namespace Model } // namespace MediaPackage } // namespace Aws