1 /** 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * SPDX-License-Identifier: Apache-2.0. 4 */ 5 6 #include <aws/customer-profiles/model/SourceConnectorType.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 CustomerProfiles 17 { 18 namespace Model 19 { 20 namespace SourceConnectorTypeMapper 21 { 22 23 static const int Salesforce_HASH = HashingUtils::HashString("Salesforce"); 24 static const int Marketo_HASH = HashingUtils::HashString("Marketo"); 25 static const int Zendesk_HASH = HashingUtils::HashString("Zendesk"); 26 static const int Servicenow_HASH = HashingUtils::HashString("Servicenow"); 27 static const int S3_HASH = HashingUtils::HashString("S3"); 28 29 GetSourceConnectorTypeForName(const Aws::String & name)30 SourceConnectorType GetSourceConnectorTypeForName(const Aws::String& name) 31 { 32 int hashCode = HashingUtils::HashString(name.c_str()); 33 if (hashCode == Salesforce_HASH) 34 { 35 return SourceConnectorType::Salesforce; 36 } 37 else if (hashCode == Marketo_HASH) 38 { 39 return SourceConnectorType::Marketo; 40 } 41 else if (hashCode == Zendesk_HASH) 42 { 43 return SourceConnectorType::Zendesk; 44 } 45 else if (hashCode == Servicenow_HASH) 46 { 47 return SourceConnectorType::Servicenow; 48 } 49 else if (hashCode == S3_HASH) 50 { 51 return SourceConnectorType::S3; 52 } 53 EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); 54 if(overflowContainer) 55 { 56 overflowContainer->StoreOverflow(hashCode, name); 57 return static_cast<SourceConnectorType>(hashCode); 58 } 59 60 return SourceConnectorType::NOT_SET; 61 } 62 GetNameForSourceConnectorType(SourceConnectorType enumValue)63 Aws::String GetNameForSourceConnectorType(SourceConnectorType enumValue) 64 { 65 switch(enumValue) 66 { 67 case SourceConnectorType::Salesforce: 68 return "Salesforce"; 69 case SourceConnectorType::Marketo: 70 return "Marketo"; 71 case SourceConnectorType::Zendesk: 72 return "Zendesk"; 73 case SourceConnectorType::Servicenow: 74 return "Servicenow"; 75 case SourceConnectorType::S3: 76 return "S3"; 77 default: 78 EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer(); 79 if(overflowContainer) 80 { 81 return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue)); 82 } 83 84 return {}; 85 } 86 } 87 88 } // namespace SourceConnectorTypeMapper 89 } // namespace Model 90 } // namespace CustomerProfiles 91 } // namespace Aws 92