/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include <aws/sagemaker/model/SortBy.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 SageMaker { namespace Model { namespace SortByMapper { static const int Name_HASH = HashingUtils::HashString("Name"); static const int CreationTime_HASH = HashingUtils::HashString("CreationTime"); static const int Status_HASH = HashingUtils::HashString("Status"); SortBy GetSortByForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == Name_HASH) { return SortBy::Name; } else if (hashCode == CreationTime_HASH) { return SortBy::CreationTime; } else if (hashCode == Status_HASH) { return SortBy::Status; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast<SortBy>(hashCode); } return SortBy::NOT_SET; } Aws::String GetNameForSortBy(SortBy enumValue) { switch(enumValue) { case SortBy::Name: return "Name"; case SortBy::CreationTime: return "CreationTime"; case SortBy::Status: return "Status"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue)); } return {}; } } } // namespace SortByMapper } // namespace Model } // namespace SageMaker } // namespace Aws