1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/cloudformation/model/StackSetDriftDetectionStatus.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 CloudFormation 17 { 18 namespace Model 19 { 20 namespace StackSetDriftDetectionStatusMapper 21 { 22 23 static const int COMPLETED_HASH = HashingUtils::HashString("COMPLETED"); 24 static const int FAILED_HASH = HashingUtils::HashString("FAILED"); 25 static const int PARTIAL_SUCCESS_HASH = HashingUtils::HashString("PARTIAL_SUCCESS"); 26 static const int IN_PROGRESS_HASH = HashingUtils::HashString("IN_PROGRESS"); 27 static const int STOPPED_HASH = HashingUtils::HashString("STOPPED"); 28 29 GetStackSetDriftDetectionStatusForName(const Aws::String & name)30 StackSetDriftDetectionStatus GetStackSetDriftDetectionStatusForName(const Aws::String& name) 31 { 32 int hashCode = HashingUtils::HashString(name.c_str()); 33 if (hashCode == COMPLETED_HASH) 34 { 35 return StackSetDriftDetectionStatus::COMPLETED; 36 } 37 else if (hashCode == FAILED_HASH) 38 { 39 return StackSetDriftDetectionStatus::FAILED; 40 } 41 else if (hashCode == PARTIAL_SUCCESS_HASH) 42 { 43 return StackSetDriftDetectionStatus::PARTIAL_SUCCESS; 44 } 45 else if (hashCode == IN_PROGRESS_HASH) 46 { 47 return StackSetDriftDetectionStatus::IN_PROGRESS; 48 } 49 else if (hashCode == STOPPED_HASH) 50 { 51 return StackSetDriftDetectionStatus::STOPPED; 52 } 53 EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); 54 if(overflowContainer) 55 { 56 overflowContainer->StoreOverflow(hashCode, name); 57 return static_cast<StackSetDriftDetectionStatus>(hashCode); 58 } 59 60 return StackSetDriftDetectionStatus::NOT_SET; 61 } 62 GetNameForStackSetDriftDetectionStatus(StackSetDriftDetectionStatus enumValue)63 Aws::String GetNameForStackSetDriftDetectionStatus(StackSetDriftDetectionStatus enumValue) 64 { 65 switch(enumValue) 66 { 67 case StackSetDriftDetectionStatus::COMPLETED: 68 return "COMPLETED"; 69 case StackSetDriftDetectionStatus::FAILED: 70 return "FAILED"; 71 case StackSetDriftDetectionStatus::PARTIAL_SUCCESS: 72 return "PARTIAL_SUCCESS"; 73 case StackSetDriftDetectionStatus::IN_PROGRESS: 74 return "IN_PROGRESS"; 75 case StackSetDriftDetectionStatus::STOPPED: 76 return "STOPPED"; 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 StackSetDriftDetectionStatusMapper 89 } // namespace Model 90 } // namespace CloudFormation 91 } // namespace Aws 92