/** * 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 mgn { namespace Model { namespace JobStatusMapper { static const int PENDING_HASH = HashingUtils::HashString("PENDING"); static const int STARTED_HASH = HashingUtils::HashString("STARTED"); static const int COMPLETED_HASH = HashingUtils::HashString("COMPLETED"); JobStatus GetJobStatusForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == PENDING_HASH) { return JobStatus::PENDING; } else if (hashCode == STARTED_HASH) { return JobStatus::STARTED; } else if (hashCode == COMPLETED_HASH) { return JobStatus::COMPLETED; } 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::PENDING: return "PENDING"; case JobStatus::STARTED: return "STARTED"; case JobStatus::COMPLETED: return "COMPLETED"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace JobStatusMapper } // namespace Model } // namespace mgn } // namespace Aws