78 lines
2.2 KiB
C++
78 lines
2.2 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/discovery/model/ExportStatus.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 ApplicationDiscoveryService
|
|
{
|
|
namespace Model
|
|
{
|
|
namespace ExportStatusMapper
|
|
{
|
|
|
|
static const int FAILED_HASH = HashingUtils::HashString("FAILED");
|
|
static const int SUCCEEDED_HASH = HashingUtils::HashString("SUCCEEDED");
|
|
static const int IN_PROGRESS_HASH = HashingUtils::HashString("IN_PROGRESS");
|
|
|
|
|
|
ExportStatus GetExportStatusForName(const Aws::String& name)
|
|
{
|
|
int hashCode = HashingUtils::HashString(name.c_str());
|
|
if (hashCode == FAILED_HASH)
|
|
{
|
|
return ExportStatus::FAILED;
|
|
}
|
|
else if (hashCode == SUCCEEDED_HASH)
|
|
{
|
|
return ExportStatus::SUCCEEDED;
|
|
}
|
|
else if (hashCode == IN_PROGRESS_HASH)
|
|
{
|
|
return ExportStatus::IN_PROGRESS;
|
|
}
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|
if(overflowContainer)
|
|
{
|
|
overflowContainer->StoreOverflow(hashCode, name);
|
|
return static_cast<ExportStatus>(hashCode);
|
|
}
|
|
|
|
return ExportStatus::NOT_SET;
|
|
}
|
|
|
|
Aws::String GetNameForExportStatus(ExportStatus enumValue)
|
|
{
|
|
switch(enumValue)
|
|
{
|
|
case ExportStatus::FAILED:
|
|
return "FAILED";
|
|
case ExportStatus::SUCCEEDED:
|
|
return "SUCCEEDED";
|
|
case ExportStatus::IN_PROGRESS:
|
|
return "IN_PROGRESS";
|
|
default:
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|
if(overflowContainer)
|
|
{
|
|
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
|
|
}
|
|
|
|
return {};
|
|
}
|
|
}
|
|
|
|
} // namespace ExportStatusMapper
|
|
} // namespace Model
|
|
} // namespace ApplicationDiscoveryService
|
|
} // namespace Aws
|