1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/discovery/model/ImportTaskFilterName.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 ApplicationDiscoveryService
17   {
18     namespace Model
19     {
20       namespace ImportTaskFilterNameMapper
21       {
22 
23         static const int IMPORT_TASK_ID_HASH = HashingUtils::HashString("IMPORT_TASK_ID");
24         static const int STATUS_HASH = HashingUtils::HashString("STATUS");
25         static const int NAME_HASH = HashingUtils::HashString("NAME");
26 
27 
GetImportTaskFilterNameForName(const Aws::String & name)28         ImportTaskFilterName GetImportTaskFilterNameForName(const Aws::String& name)
29         {
30           int hashCode = HashingUtils::HashString(name.c_str());
31           if (hashCode == IMPORT_TASK_ID_HASH)
32           {
33             return ImportTaskFilterName::IMPORT_TASK_ID;
34           }
35           else if (hashCode == STATUS_HASH)
36           {
37             return ImportTaskFilterName::STATUS;
38           }
39           else if (hashCode == NAME_HASH)
40           {
41             return ImportTaskFilterName::NAME;
42           }
43           EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
44           if(overflowContainer)
45           {
46             overflowContainer->StoreOverflow(hashCode, name);
47             return static_cast<ImportTaskFilterName>(hashCode);
48           }
49 
50           return ImportTaskFilterName::NOT_SET;
51         }
52 
GetNameForImportTaskFilterName(ImportTaskFilterName enumValue)53         Aws::String GetNameForImportTaskFilterName(ImportTaskFilterName enumValue)
54         {
55           switch(enumValue)
56           {
57           case ImportTaskFilterName::IMPORT_TASK_ID:
58             return "IMPORT_TASK_ID";
59           case ImportTaskFilterName::STATUS:
60             return "STATUS";
61           case ImportTaskFilterName::NAME:
62             return "NAME";
63           default:
64             EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
65             if(overflowContainer)
66             {
67               return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
68             }
69 
70             return {};
71           }
72         }
73 
74       } // namespace ImportTaskFilterNameMapper
75     } // namespace Model
76   } // namespace ApplicationDiscoveryService
77 } // namespace Aws
78