1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/glue/model/BlueprintStatus.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 Glue 17 { 18 namespace Model 19 { 20 namespace BlueprintStatusMapper 21 { 22 23 static const int CREATING_HASH = HashingUtils::HashString("CREATING"); 24 static const int ACTIVE_HASH = HashingUtils::HashString("ACTIVE"); 25 static const int UPDATING_HASH = HashingUtils::HashString("UPDATING"); 26 static const int FAILED_HASH = HashingUtils::HashString("FAILED"); 27 28 GetBlueprintStatusForName(const Aws::String & name)29 BlueprintStatus GetBlueprintStatusForName(const Aws::String& name) 30 { 31 int hashCode = HashingUtils::HashString(name.c_str()); 32 if (hashCode == CREATING_HASH) 33 { 34 return BlueprintStatus::CREATING; 35 } 36 else if (hashCode == ACTIVE_HASH) 37 { 38 return BlueprintStatus::ACTIVE; 39 } 40 else if (hashCode == UPDATING_HASH) 41 { 42 return BlueprintStatus::UPDATING; 43 } 44 else if (hashCode == FAILED_HASH) 45 { 46 return BlueprintStatus::FAILED; 47 } 48 EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); 49 if(overflowContainer) 50 { 51 overflowContainer->StoreOverflow(hashCode, name); 52 return static_cast<BlueprintStatus>(hashCode); 53 } 54 55 return BlueprintStatus::NOT_SET; 56 } 57 GetNameForBlueprintStatus(BlueprintStatus enumValue)58 Aws::String GetNameForBlueprintStatus(BlueprintStatus enumValue) 59 { 60 switch(enumValue) 61 { 62 case BlueprintStatus::CREATING: 63 return "CREATING"; 64 case BlueprintStatus::ACTIVE: 65 return "ACTIVE"; 66 case BlueprintStatus::UPDATING: 67 return "UPDATING"; 68 case BlueprintStatus::FAILED: 69 return "FAILED"; 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 BlueprintStatusMapper 82 } // namespace Model 83 } // namespace Glue 84 } // namespace Aws 85