1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/awstransfer/model/WorkflowStepType.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 Transfer
17   {
18     namespace Model
19     {
20       namespace WorkflowStepTypeMapper
21       {
22 
23         static const int COPY_HASH = HashingUtils::HashString("COPY");
24         static const int CUSTOM_HASH = HashingUtils::HashString("CUSTOM");
25         static const int TAG_HASH = HashingUtils::HashString("TAG");
26         static const int DELETE__HASH = HashingUtils::HashString("DELETE");
27 
28 
GetWorkflowStepTypeForName(const Aws::String & name)29         WorkflowStepType GetWorkflowStepTypeForName(const Aws::String& name)
30         {
31           int hashCode = HashingUtils::HashString(name.c_str());
32           if (hashCode == COPY_HASH)
33           {
34             return WorkflowStepType::COPY;
35           }
36           else if (hashCode == CUSTOM_HASH)
37           {
38             return WorkflowStepType::CUSTOM;
39           }
40           else if (hashCode == TAG_HASH)
41           {
42             return WorkflowStepType::TAG;
43           }
44           else if (hashCode == DELETE__HASH)
45           {
46             return WorkflowStepType::DELETE_;
47           }
48           EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
49           if(overflowContainer)
50           {
51             overflowContainer->StoreOverflow(hashCode, name);
52             return static_cast<WorkflowStepType>(hashCode);
53           }
54 
55           return WorkflowStepType::NOT_SET;
56         }
57 
GetNameForWorkflowStepType(WorkflowStepType enumValue)58         Aws::String GetNameForWorkflowStepType(WorkflowStepType enumValue)
59         {
60           switch(enumValue)
61           {
62           case WorkflowStepType::COPY:
63             return "COPY";
64           case WorkflowStepType::CUSTOM:
65             return "CUSTOM";
66           case WorkflowStepType::TAG:
67             return "TAG";
68           case WorkflowStepType::DELETE_:
69             return "DELETE";
70           default:
71             EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
72             if(overflowContainer)
73             {
74               return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
75             }
76 
77             return {};
78           }
79         }
80 
81       } // namespace WorkflowStepTypeMapper
82     } // namespace Model
83   } // namespace Transfer
84 } // namespace Aws
85