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