/** * 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 Redshift { namespace Model { namespace SortByOrderMapper { static const int ASC_HASH = HashingUtils::HashString("ASC"); static const int DESC_HASH = HashingUtils::HashString("DESC"); SortByOrder GetSortByOrderForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == ASC_HASH) { return SortByOrder::ASC; } else if (hashCode == DESC_HASH) { return SortByOrder::DESC; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return SortByOrder::NOT_SET; } Aws::String GetNameForSortByOrder(SortByOrder enumValue) { switch(enumValue) { case SortByOrder::ASC: return "ASC"; case SortByOrder::DESC: return "DESC"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace SortByOrderMapper } // namespace Model } // namespace Redshift } // namespace Aws