/** * 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 ImportStatusMapper { static const int PENDING_HASH = HashingUtils::HashString("PENDING"); static const int STARTED_HASH = HashingUtils::HashString("STARTED"); static const int FAILED_HASH = HashingUtils::HashString("FAILED"); static const int SUCCEEDED_HASH = HashingUtils::HashString("SUCCEEDED"); ImportStatus GetImportStatusForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == PENDING_HASH) { return ImportStatus::PENDING; } else if (hashCode == STARTED_HASH) { return ImportStatus::STARTED; } else if (hashCode == FAILED_HASH) { return ImportStatus::FAILED; } else if (hashCode == SUCCEEDED_HASH) { return ImportStatus::SUCCEEDED; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return ImportStatus::NOT_SET; } Aws::String GetNameForImportStatus(ImportStatus enumValue) { switch(enumValue) { case ImportStatus::PENDING: return "PENDING"; case ImportStatus::STARTED: return "STARTED"; case ImportStatus::FAILED: return "FAILED"; case ImportStatus::SUCCEEDED: return "SUCCEEDED"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace ImportStatusMapper } // namespace Model } // namespace mgn } // namespace Aws