1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/lexv2-models/model/ExportSortAttribute.h>
7 #include <aws/core/utils/HashingUtils.h>
8 #include <aws/core/Globals.h>
9 #include <aws/core/utils/EnumParseOverflowContainer.h>
10 
11 using namespace Aws::Utils;
12 
13 
14 namespace Aws
15 {
16   namespace LexModelsV2
17   {
18     namespace Model
19     {
20       namespace ExportSortAttributeMapper
21       {
22 
23         static const int LastUpdatedDateTime_HASH = HashingUtils::HashString("LastUpdatedDateTime");
24 
25 
GetExportSortAttributeForName(const Aws::String & name)26         ExportSortAttribute GetExportSortAttributeForName(const Aws::String& name)
27         {
28           int hashCode = HashingUtils::HashString(name.c_str());
29           if (hashCode == LastUpdatedDateTime_HASH)
30           {
31             return ExportSortAttribute::LastUpdatedDateTime;
32           }
33           EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
34           if(overflowContainer)
35           {
36             overflowContainer->StoreOverflow(hashCode, name);
37             return static_cast<ExportSortAttribute>(hashCode);
38           }
39 
40           return ExportSortAttribute::NOT_SET;
41         }
42 
GetNameForExportSortAttribute(ExportSortAttribute enumValue)43         Aws::String GetNameForExportSortAttribute(ExportSortAttribute enumValue)
44         {
45           switch(enumValue)
46           {
47           case ExportSortAttribute::LastUpdatedDateTime:
48             return "LastUpdatedDateTime";
49           default:
50             EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
51             if(overflowContainer)
52             {
53               return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
54             }
55 
56             return {};
57           }
58         }
59 
60       } // namespace ExportSortAttributeMapper
61     } // namespace Model
62   } // namespace LexModelsV2
63 } // namespace Aws
64