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