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/SchemaVersionStatus.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 SchemaVersionStatusMapper 21 { 22 23 static const int AVAILABLE_HASH = HashingUtils::HashString("AVAILABLE"); 24 static const int PENDING_HASH = HashingUtils::HashString("PENDING"); 25 static const int FAILURE_HASH = HashingUtils::HashString("FAILURE"); 26 static const int DELETING_HASH = HashingUtils::HashString("DELETING"); 27 28 GetSchemaVersionStatusForName(const Aws::String & name)29 SchemaVersionStatus GetSchemaVersionStatusForName(const Aws::String& name) 30 { 31 int hashCode = HashingUtils::HashString(name.c_str()); 32 if (hashCode == AVAILABLE_HASH) 33 { 34 return SchemaVersionStatus::AVAILABLE; 35 } 36 else if (hashCode == PENDING_HASH) 37 { 38 return SchemaVersionStatus::PENDING; 39 } 40 else if (hashCode == FAILURE_HASH) 41 { 42 return SchemaVersionStatus::FAILURE; 43 } 44 else if (hashCode == DELETING_HASH) 45 { 46 return SchemaVersionStatus::DELETING; 47 } 48 EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); 49 if(overflowContainer) 50 { 51 overflowContainer->StoreOverflow(hashCode, name); 52 return static_cast<SchemaVersionStatus>(hashCode); 53 } 54 55 return SchemaVersionStatus::NOT_SET; 56 } 57 GetNameForSchemaVersionStatus(SchemaVersionStatus enumValue)58 Aws::String GetNameForSchemaVersionStatus(SchemaVersionStatus enumValue) 59 { 60 switch(enumValue) 61 { 62 case SchemaVersionStatus::AVAILABLE: 63 return "AVAILABLE"; 64 case SchemaVersionStatus::PENDING: 65 return "PENDING"; 66 case SchemaVersionStatus::FAILURE: 67 return "FAILURE"; 68 case SchemaVersionStatus::DELETING: 69 return "DELETING"; 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 SchemaVersionStatusMapper 82 } // namespace Model 83 } // namespace Glue 84 } // namespace Aws 85