/** * 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 SSMIncidents { namespace Model { namespace SortOrderMapper { static const int ASCENDING_HASH = HashingUtils::HashString("ASCENDING"); static const int DESCENDING_HASH = HashingUtils::HashString("DESCENDING"); SortOrder GetSortOrderForName(const Aws::String& name) { int hashCode = HashingUtils::HashString(name.c_str()); if (hashCode == ASCENDING_HASH) { return SortOrder::ASCENDING; } else if (hashCode == DESCENDING_HASH) { return SortOrder::DESCENDING; } EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { overflowContainer->StoreOverflow(hashCode, name); return static_cast(hashCode); } return SortOrder::NOT_SET; } Aws::String GetNameForSortOrder(SortOrder enumValue) { switch(enumValue) { case SortOrder::ASCENDING: return "ASCENDING"; case SortOrder::DESCENDING: return "DESCENDING"; default: EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); if(overflowContainer) { return overflowContainer->RetrieveOverflow(static_cast(enumValue)); } return {}; } } } // namespace SortOrderMapper } // namespace Model } // namespace SSMIncidents } // namespace Aws