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