85 lines
2.4 KiB
C++
85 lines
2.4 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/AWSMigrationHub/model/Status.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 MigrationHub
|
|||
|
|
{
|
|||
|
|
namespace Model
|
|||
|
|
{
|
|||
|
|
namespace StatusMapper
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
static const int NOT_STARTED_HASH = HashingUtils::HashString("NOT_STARTED");
|
|||
|
|
static const int IN_PROGRESS_HASH = HashingUtils::HashString("IN_PROGRESS");
|
|||
|
|
static const int FAILED_HASH = HashingUtils::HashString("FAILED");
|
|||
|
|
static const int COMPLETED_HASH = HashingUtils::HashString("COMPLETED");
|
|||
|
|
|
|||
|
|
|
|||
|
|
Status GetStatusForName(const Aws::String& name)
|
|||
|
|
{
|
|||
|
|
int hashCode = HashingUtils::HashString(name.c_str());
|
|||
|
|
if (hashCode == NOT_STARTED_HASH)
|
|||
|
|
{
|
|||
|
|
return Status::NOT_STARTED;
|
|||
|
|
}
|
|||
|
|
else if (hashCode == IN_PROGRESS_HASH)
|
|||
|
|
{
|
|||
|
|
return Status::IN_PROGRESS;
|
|||
|
|
}
|
|||
|
|
else if (hashCode == FAILED_HASH)
|
|||
|
|
{
|
|||
|
|
return Status::FAILED;
|
|||
|
|
}
|
|||
|
|
else if (hashCode == COMPLETED_HASH)
|
|||
|
|
{
|
|||
|
|
return Status::COMPLETED;
|
|||
|
|
}
|
|||
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|||
|
|
if(overflowContainer)
|
|||
|
|
{
|
|||
|
|
overflowContainer->StoreOverflow(hashCode, name);
|
|||
|
|
return static_cast<Status>(hashCode);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return Status::NOT_SET;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::String GetNameForStatus(Status enumValue)
|
|||
|
|
{
|
|||
|
|
switch(enumValue)
|
|||
|
|
{
|
|||
|
|
case Status::NOT_STARTED:
|
|||
|
|
return "NOT_STARTED";
|
|||
|
|
case Status::IN_PROGRESS:
|
|||
|
|
return "IN_PROGRESS";
|
|||
|
|
case Status::FAILED:
|
|||
|
|
return "FAILED";
|
|||
|
|
case Status::COMPLETED:
|
|||
|
|
return "COMPLETED";
|
|||
|
|
default:
|
|||
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|||
|
|
if(overflowContainer)
|
|||
|
|
{
|
|||
|
|
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return {};
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace StatusMapper
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace MigrationHub
|
|||
|
|
} // namespace Aws
|