/** * 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 CloudFormation { namespace Model { namespace VisibilityMapper { static const int PUBLIC__HASH = HashingUtils::HashString("PUBLIC"); static const int PRIVATE__HASH = HashingUtils::HashString("PRIVATE"); Visibility GetVisibilityForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == PUBLIC__HASH) { return Visibility::PUBLIC_; } else if (hashCode == PRIVATE__HASH) { return Visibility::PRIVATE_; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return Visibility::NOT_SET; } Aws::String GetNameForVisibility(Visibility enumValue) { switch(enumValue) { case Visibility::PUBLIC_: return "PUBLIC"; case Visibility::PRIVATE_: return "PRIVATE"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace VisibilityMapper } // namespace Model } // namespace CloudFormation } // namespace Aws