1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/dynamodb/model/DestinationStatus.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 DynamoDB
17   {
18     namespace Model
19     {
20       namespace DestinationStatusMapper
21       {
22 
23         static const int ENABLING_HASH = HashingUtils::HashString("ENABLING");
24         static const int ACTIVE_HASH = HashingUtils::HashString("ACTIVE");
25         static const int DISABLING_HASH = HashingUtils::HashString("DISABLING");
26         static const int DISABLED_HASH = HashingUtils::HashString("DISABLED");
27         static const int ENABLE_FAILED_HASH = HashingUtils::HashString("ENABLE_FAILED");
28 
29 
GetDestinationStatusForName(const Aws::String & name)30         DestinationStatus GetDestinationStatusForName(const Aws::String& name)
31         {
32           int hashCode = HashingUtils::HashString(name.c_str());
33           if (hashCode == ENABLING_HASH)
34           {
35             return DestinationStatus::ENABLING;
36           }
37           else if (hashCode == ACTIVE_HASH)
38           {
39             return DestinationStatus::ACTIVE;
40           }
41           else if (hashCode == DISABLING_HASH)
42           {
43             return DestinationStatus::DISABLING;
44           }
45           else if (hashCode == DISABLED_HASH)
46           {
47             return DestinationStatus::DISABLED;
48           }
49           else if (hashCode == ENABLE_FAILED_HASH)
50           {
51             return DestinationStatus::ENABLE_FAILED;
52           }
53           EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
54           if(overflowContainer)
55           {
56             overflowContainer->StoreOverflow(hashCode, name);
57             return static_cast<DestinationStatus>(hashCode);
58           }
59 
60           return DestinationStatus::NOT_SET;
61         }
62 
GetNameForDestinationStatus(DestinationStatus enumValue)63         Aws::String GetNameForDestinationStatus(DestinationStatus enumValue)
64         {
65           switch(enumValue)
66           {
67           case DestinationStatus::ENABLING:
68             return "ENABLING";
69           case DestinationStatus::ACTIVE:
70             return "ACTIVE";
71           case DestinationStatus::DISABLING:
72             return "DISABLING";
73           case DestinationStatus::DISABLED:
74             return "DISABLED";
75           case DestinationStatus::ENABLE_FAILED:
76             return "ENABLE_FAILED";
77           default:
78             EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
79             if(overflowContainer)
80             {
81               return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
82             }
83 
84             return {};
85           }
86         }
87 
88       } // namespace DestinationStatusMapper
89     } // namespace Model
90   } // namespace DynamoDB
91 } // namespace Aws
92