1 /**
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  * SPDX-License-Identifier: Apache-2.0.
4  */
5 
6 #include <aws/sagemaker/model/HyperParameterTuningJobWarmStartType.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 SageMaker
17   {
18     namespace Model
19     {
20       namespace HyperParameterTuningJobWarmStartTypeMapper
21       {
22 
23         static const int IdenticalDataAndAlgorithm_HASH = HashingUtils::HashString("IdenticalDataAndAlgorithm");
24         static const int TransferLearning_HASH = HashingUtils::HashString("TransferLearning");
25 
26 
GetHyperParameterTuningJobWarmStartTypeForName(const Aws::String & name)27         HyperParameterTuningJobWarmStartType GetHyperParameterTuningJobWarmStartTypeForName(const Aws::String& name)
28         {
29           int hashCode = HashingUtils::HashString(name.c_str());
30           if (hashCode == IdenticalDataAndAlgorithm_HASH)
31           {
32             return HyperParameterTuningJobWarmStartType::IdenticalDataAndAlgorithm;
33           }
34           else if (hashCode == TransferLearning_HASH)
35           {
36             return HyperParameterTuningJobWarmStartType::TransferLearning;
37           }
38           EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
39           if(overflowContainer)
40           {
41             overflowContainer->StoreOverflow(hashCode, name);
42             return static_cast<HyperParameterTuningJobWarmStartType>(hashCode);
43           }
44 
45           return HyperParameterTuningJobWarmStartType::NOT_SET;
46         }
47 
GetNameForHyperParameterTuningJobWarmStartType(HyperParameterTuningJobWarmStartType enumValue)48         Aws::String GetNameForHyperParameterTuningJobWarmStartType(HyperParameterTuningJobWarmStartType enumValue)
49         {
50           switch(enumValue)
51           {
52           case HyperParameterTuningJobWarmStartType::IdenticalDataAndAlgorithm:
53             return "IdenticalDataAndAlgorithm";
54           case HyperParameterTuningJobWarmStartType::TransferLearning:
55             return "TransferLearning";
56           default:
57             EnumParseOverflowContainer* overflowContainer = Aws::GetEnumOverflowContainer();
58             if(overflowContainer)
59             {
60               return overflowContainer->RetrieveOverflow(static_cast<int>(enumValue));
61             }
62 
63             return {};
64           }
65         }
66 
67       } // namespace HyperParameterTuningJobWarmStartTypeMapper
68     } // namespace Model
69   } // namespace SageMaker
70 } // namespace Aws
71