71 lines
1.9 KiB
C++
71 lines
1.9 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/codeartifact/model/DomainStatus.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 CodeArtifact
|
|||
|
|
{
|
|||
|
|
namespace Model
|
|||
|
|
{
|
|||
|
|
namespace DomainStatusMapper
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
static const int Active_HASH = HashingUtils::HashString("Active");
|
|||
|
|
static const int Deleted_HASH = HashingUtils::HashString("Deleted");
|
|||
|
|
|
|||
|
|
|
|||
|
|
DomainStatus GetDomainStatusForName(const Aws::String& name)
|
|||
|
|
{
|
|||
|
|
int hashCode = HashingUtils::HashString(name.c_str());
|
|||
|
|
if (hashCode == Active_HASH)
|
|||
|
|
{
|
|||
|
|
return DomainStatus::Active;
|
|||
|
|
}
|
|||
|
|
else if (hashCode == Deleted_HASH)
|
|||
|
|
{
|
|||
|
|
return DomainStatus::Deleted;
|
|||
|
|
}
|
|||
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|||
|
|
if(overflowContainer)
|
|||
|
|
{
|
|||
|
|
overflowContainer->StoreOverflow(hashCode, name);
|
|||
|
|
return static_cast<DomainStatus>(hashCode);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return DomainStatus::NOT_SET;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::String GetNameForDomainStatus(DomainStatus enumValue)
|
|||
|
|
{
|
|||
|
|
switch(enumValue)
|
|||
|
|
{
|
|||
|
|
case DomainStatus::Active:
|
|||
|
|
return "Active";
|
|||
|
|
case DomainStatus::Deleted:
|
|||
|
|
return "Deleted";
|
|||
|
|
default:
|
|||
|
|
EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
|
|||
|
|
if(overflowContainer)
|
|||
|
|
{
|
|||
|
|
return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return {};
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace DomainStatusMapper
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace CodeArtifact
|
|||
|
|
} // namespace Aws
|