71 lines
2.0 KiB
C++
71 lines
2.0 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/frauddetector/model/ModelVersionStatus.h>
|
|
#include <aws/core/utils/HashingUtils.h>
|
|
#include <aws/core/Globals.h>
|
|
#include <aws/core/utils/EnumParseOverflowContainer.h>
|
|
|
|
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");
|
|
|
|
|
|
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;
|
|
}
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|
if(overflowContainer)
|
|
{
|
|
overflowContainer->StoreOverflow(hashCode, name);
|
|
return static_cast<ModelVersionStatus>(hashCode);
|
|
}
|
|
|
|
return ModelVersionStatus::NOT_SET;
|
|
}
|
|
|
|
Aws::String GetNameForModelVersionStatus(ModelVersionStatus enumValue)
|
|
{
|
|
switch(enumValue)
|
|
{
|
|
case ModelVersionStatus::ACTIVE:
|
|
return "ACTIVE";
|
|
case ModelVersionStatus::INACTIVE:
|
|
return "INACTIVE";
|
|
default:
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|
if(overflowContainer)
|
|
{
|
|
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
|
|
}
|
|
|
|
return {};
|
|
}
|
|
}
|
|
|
|
} // namespace ModelVersionStatusMapper
|
|
} // namespace Model
|
|
} // namespace FraudDetector
|
|
} // namespace Aws
|