/** * 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 EC2 { namespace Model { namespace TelemetryStatusMapper { static const int UP_HASH = HashingUtils::HashString("UP"); static const int DOWN_HASH = HashingUtils::HashString("DOWN"); TelemetryStatus GetTelemetryStatusForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == UP_HASH) { return TelemetryStatus::UP; } else if (hashCode == DOWN_HASH) { return TelemetryStatus::DOWN; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return TelemetryStatus::NOT_SET; } Aws::String GetNameForTelemetryStatus(TelemetryStatus enumValue) { switch(enumValue) { case TelemetryStatus::UP: return "UP"; case TelemetryStatus::DOWN: return "DOWN"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace TelemetryStatusMapper } // namespace Model } // namespace EC2 } // namespace Aws