/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::Utils::Json; using namespace Aws::Utils; namespace Aws { namespace SageMaker { namespace Model { CategoricalParameter::CategoricalParameter() : m_nameHasBeenSet(false), m_valueHasBeenSet(false) { } CategoricalParameter::CategoricalParameter(JsonView jsonValue) : m_nameHasBeenSet(false), m_valueHasBeenSet(false) { *this = jsonValue; } CategoricalParameter& CategoricalParameter::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Name")) { m_name = jsonValue.GetString("Name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("Value")) { Aws::Utils::Array valueJsonList = jsonValue.GetArray("Value"); for(unsigned valueIndex = 0; valueIndex < valueJsonList.GetLength(); ++valueIndex) { m_value.push_back(valueJsonList[valueIndex].AsString()); } m_valueHasBeenSet = true; } return *this; } JsonValue CategoricalParameter::Jsonize() const { JsonValue payload; if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_valueHasBeenSet) { Aws::Utils::Array valueJsonList(m_value.size()); for(unsigned valueIndex = 0; valueIndex < valueJsonList.GetLength(); ++valueIndex) { valueJsonList[valueIndex].AsString(m_value[valueIndex]); } payload.WithArray("Value", std::move(valueJsonList)); } return payload; } } // namespace Model } // namespace SageMaker } // namespace Aws