78 lines
2.1 KiB
C++
78 lines
2.1 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/datapipeline/model/TaskStatus.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 DataPipeline
|
|||
|
|
{
|
|||
|
|
namespace Model
|
|||
|
|
{
|
|||
|
|
namespace TaskStatusMapper
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
static const int FINISHED_HASH = HashingUtils::HashString("FINISHED");
|
|||
|
|
static const int FAILED_HASH = HashingUtils::HashString("FAILED");
|
|||
|
|
static const int FALSE_HASH = HashingUtils::HashString("FALSE");
|
|||
|
|
|
|||
|
|
|
|||
|
|
TaskStatus GetTaskStatusForName(const Aws::String& name)
|
|||
|
|
{
|
|||
|
|
int hashCode = HashingUtils::HashString(name.c_str());
|
|||
|
|
if (hashCode == FINISHED_HASH)
|
|||
|
|
{
|
|||
|
|
return TaskStatus::FINISHED;
|
|||
|
|
}
|
|||
|
|
else if (hashCode == FAILED_HASH)
|
|||
|
|
{
|
|||
|
|
return TaskStatus::FAILED;
|
|||
|
|
}
|
|||
|
|
else if (hashCode == FALSE_HASH)
|
|||
|
|
{
|
|||
|
|
return TaskStatus::FALSE;
|
|||
|
|
}
|
|||
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|||
|
|
if(overflowContainer)
|
|||
|
|
{
|
|||
|
|
overflowContainer->StoreOverflow(hashCode, name);
|
|||
|
|
return static_cast<TaskStatus>(hashCode);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return TaskStatus::NOT_SET;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::String GetNameForTaskStatus(TaskStatus enumValue)
|
|||
|
|
{
|
|||
|
|
switch(enumValue)
|
|||
|
|
{
|
|||
|
|
case TaskStatus::FINISHED:
|
|||
|
|
return "FINISHED";
|
|||
|
|
case TaskStatus::FAILED:
|
|||
|
|
return "FAILED";
|
|||
|
|
case TaskStatus::FALSE:
|
|||
|
|
return "FALSE";
|
|||
|
|
default:
|
|||
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|||
|
|
if(overflowContainer)
|
|||
|
|
{
|
|||
|
|
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return {};
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace TaskStatusMapper
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace DataPipeline
|
|||
|
|
} // namespace Aws
|