/** * 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 FraudDetector { namespace Model { namespace ModelVersionStatusMapper { static const int ACTIVE_HASH = HashingUtils::HashString("ACTIVE"); static const int INACTIVE_HASH = HashingUtils::HashString("INACTIVE"); static const int TRAINING_CANCELLED_HASH = HashingUtils::HashString("TRAINING_CANCELLED"); ModelVersionStatus GetModelVersionStatusForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == ACTIVE_HASH) { return ModelVersionStatus::ACTIVE; } else if (hashCode == INACTIVE_HASH) { return ModelVersionStatus::INACTIVE; } else if (hashCode == TRAINING_CANCELLED_HASH) { return ModelVersionStatus::TRAINING_CANCELLED; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return ModelVersionStatus::NOT_SET; } Aws::String GetNameForModelVersionStatus(ModelVersionStatus enumValue) { switch(enumValue) { case ModelVersionStatus::ACTIVE: return "ACTIVE"; case ModelVersionStatus::INACTIVE: return "INACTIVE"; case ModelVersionStatus::TRAINING_CANCELLED: return "TRAINING_CANCELLED"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace ModelVersionStatusMapper } // namespace Model } // namespace FraudDetector } // namespace Aws