/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include using namespace Aws::Utils; namespace Aws { namespace EntityResolution { namespace Model { namespace JobStatusMapper { static const int RUNNING_HASH = HashingUtils::HashString("RUNNING"); static const int SUCCEEDED_HASH = HashingUtils::HashString("SUCCEEDED"); static const int FAILED_HASH = HashingUtils::HashString("FAILED"); static const int QUEUED_HASH = HashingUtils::HashString("QUEUED"); JobStatus GetJobStatusForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == RUNNING_HASH) { return JobStatus::RUNNING; } else if (hashCode == SUCCEEDED_HASH) { return JobStatus::SUCCEEDED; } else if (hashCode == FAILED_HASH) { return JobStatus::FAILED; } else if (hashCode == QUEUED_HASH) { return JobStatus::QUEUED; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return JobStatus::NOT_SET; } Aws::String GetNameForJobStatus(JobStatus enumValue) { switch(enumValue) { case JobStatus::RUNNING: return "RUNNING"; case JobStatus::SUCCEEDED: return "SUCCEEDED"; case JobStatus::FAILED: return "FAILED"; case JobStatus::QUEUED: return "QUEUED"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace JobStatusMapper } // namespace Model } // namespace EntityResolution } // namespace Aws