/** * 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 EMR { namespace Model { namespace InstanceGroupStateChangeReasonCodeMapper { static const int INTERNAL_ERROR_HASH = HashingUtils::HashString("INTERNAL_ERROR"); static const int VALIDATION_ERROR_HASH = HashingUtils::HashString("VALIDATION_ERROR"); static const int INSTANCE_FAILURE_HASH = HashingUtils::HashString("INSTANCE_FAILURE"); static const int CLUSTER_TERMINATED_HASH = HashingUtils::HashString("CLUSTER_TERMINATED"); InstanceGroupStateChangeReasonCode GetInstanceGroupStateChangeReasonCodeForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == INTERNAL_ERROR_HASH) { return InstanceGroupStateChangeReasonCode::INTERNAL_ERROR; } else if (hashCode == VALIDATION_ERROR_HASH) { return InstanceGroupStateChangeReasonCode::VALIDATION_ERROR; } else if (hashCode == INSTANCE_FAILURE_HASH) { return InstanceGroupStateChangeReasonCode::INSTANCE_FAILURE; } else if (hashCode == CLUSTER_TERMINATED_HASH) { return InstanceGroupStateChangeReasonCode::CLUSTER_TERMINATED; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return InstanceGroupStateChangeReasonCode::NOT_SET; } Aws::String GetNameForInstanceGroupStateChangeReasonCode(InstanceGroupStateChangeReasonCode enumValue) { switch(enumValue) { case InstanceGroupStateChangeReasonCode::INTERNAL_ERROR: return "INTERNAL_ERROR"; case InstanceGroupStateChangeReasonCode::VALIDATION_ERROR: return "VALIDATION_ERROR"; case InstanceGroupStateChangeReasonCode::INSTANCE_FAILURE: return "INSTANCE_FAILURE"; case InstanceGroupStateChangeReasonCode::CLUSTER_TERMINATED: return "CLUSTER_TERMINATED"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace InstanceGroupStateChangeReasonCodeMapper } // namespace Model } // namespace EMR } // namespace Aws