1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/lexv2-models/model/BotLocaleStatus.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 LexModelsV2 17 { 18 namespace Model 19 { 20 namespace BotLocaleStatusMapper 21 { 22 23 static const int Creating_HASH = HashingUtils::HashString("Creating"); 24 static const int Building_HASH = HashingUtils::HashString("Building"); 25 static const int Built_HASH = HashingUtils::HashString("Built"); 26 static const int ReadyExpressTesting_HASH = HashingUtils::HashString("ReadyExpressTesting"); 27 static const int Failed_HASH = HashingUtils::HashString("Failed"); 28 static const int Deleting_HASH = HashingUtils::HashString("Deleting"); 29 static const int NotBuilt_HASH = HashingUtils::HashString("NotBuilt"); 30 static const int Importing_HASH = HashingUtils::HashString("Importing"); 31 32 GetBotLocaleStatusForName(const Aws::String & name)33 BotLocaleStatus GetBotLocaleStatusForName(const Aws::String& name) 34 { 35 int hashCode = HashingUtils::HashString(name.c_str()); 36 if (hashCode == Creating_HASH) 37 { 38 return BotLocaleStatus::Creating; 39 } 40 else if (hashCode == Building_HASH) 41 { 42 return BotLocaleStatus::Building; 43 } 44 else if (hashCode == Built_HASH) 45 { 46 return BotLocaleStatus::Built; 47 } 48 else if (hashCode == ReadyExpressTesting_HASH) 49 { 50 return BotLocaleStatus::ReadyExpressTesting; 51 } 52 else if (hashCode == Failed_HASH) 53 { 54 return BotLocaleStatus::Failed; 55 } 56 else if (hashCode == Deleting_HASH) 57 { 58 return BotLocaleStatus::Deleting; 59 } 60 else if (hashCode == NotBuilt_HASH) 61 { 62 return BotLocaleStatus::NotBuilt; 63 } 64 else if (hashCode == Importing_HASH) 65 { 66 return BotLocaleStatus::Importing; 67 } 68 EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); 69 if(overflowContainer) 70 { 71 overflowContainer->StoreOverflow(hashCode, name); 72 return static_cast<BotLocaleStatus>(hashCode); 73 } 74 75 return BotLocaleStatus::NOT_SET; 76 } 77 GetNameForBotLocaleStatus(BotLocaleStatus enumValue)78 Aws::String GetNameForBotLocaleStatus(BotLocaleStatus enumValue) 79 { 80 switch(enumValue) 81 { 82 case BotLocaleStatus::Creating: 83 return "Creating"; 84 case BotLocaleStatus::Building: 85 return "Building"; 86 case BotLocaleStatus::Built: 87 return "Built"; 88 case BotLocaleStatus::ReadyExpressTesting: 89 return "ReadyExpressTesting"; 90 case BotLocaleStatus::Failed: 91 return "Failed"; 92 case BotLocaleStatus::Deleting: 93 return "Deleting"; 94 case BotLocaleStatus::NotBuilt: 95 return "NotBuilt"; 96 case BotLocaleStatus::Importing: 97 return "Importing"; 98 default: 99 EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); 100 if(overflowContainer) 101 { 102 return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue)); 103 } 104 105 return {}; 106 } 107 } 108 109 } // namespace BotLocaleStatusMapper 110 } // namespace Model 111 } // namespace LexModelsV2 112 } // namespace Aws 113