/** * 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 IoTSiteWise { namespace Model { namespace AssetErrorCodeMapper { static const int INTERNAL_FAILURE_HASH = HashingUtils::HashString("INTERNAL_FAILURE"); AssetErrorCode GetAssetErrorCodeForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == INTERNAL_FAILURE_HASH) { return AssetErrorCode::INTERNAL_FAILURE; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return AssetErrorCode::NOT_SET; } Aws::String GetNameForAssetErrorCode(AssetErrorCode enumValue) { switch(enumValue) { case AssetErrorCode::INTERNAL_FAILURE: return "INTERNAL_FAILURE"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace AssetErrorCodeMapper } // namespace Model } // namespace IoTSiteWise } // namespace Aws