/** * 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 OpenSearchService { namespace Model { namespace ConnectionModeMapper { static const int DIRECT_HASH = HashingUtils::HashString("DIRECT"); static const int VPC_ENDPOINT_HASH = HashingUtils::HashString("VPC_ENDPOINT"); ConnectionMode GetConnectionModeForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == DIRECT_HASH) { return ConnectionMode::DIRECT; } else if (hashCode == VPC_ENDPOINT_HASH) { return ConnectionMode::VPC_ENDPOINT; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return ConnectionMode::NOT_SET; } Aws::String GetNameForConnectionMode(ConnectionMode enumValue) { switch(enumValue) { case ConnectionMode::DIRECT: return "DIRECT"; case ConnectionMode::VPC_ENDPOINT: return "VPC_ENDPOINT"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace ConnectionModeMapper } // namespace Model } // namespace OpenSearchService } // namespace Aws