/** * 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 MigrationHubStrategyRecommendations { namespace Model { AssessmentTarget::AssessmentTarget() : m_condition(Condition::NOT_SET), m_conditionHasBeenSet(false), m_nameHasBeenSet(false), m_valuesHasBeenSet(false) { } AssessmentTarget::AssessmentTarget(JsonView jsonValue) : m_condition(Condition::NOT_SET), m_conditionHasBeenSet(false), m_nameHasBeenSet(false), m_valuesHasBeenSet(false) { *this = jsonValue; } AssessmentTarget& AssessmentTarget::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("condition")) { m_condition = ConditionMapper::GetConditionForName(jsonValue.GetString("condition")); m_conditionHasBeenSet = true; } if(jsonValue.ValueExists("name")) { m_name = jsonValue.GetString("name"); m_nameHasBeenSet = true; } if(jsonValue.ValueExists("values")) { Aws::Utils::Array valuesJsonList = jsonValue.GetArray("values"); for(unsigned valuesIndex = 0; valuesIndex < valuesJsonList.GetLength(); ++valuesIndex) { m_values.push_back(valuesJsonList[valuesIndex].AsString()); } m_valuesHasBeenSet = true; } return *this; } JsonValue AssessmentTarget::Jsonize() const { JsonValue payload; if(m_conditionHasBeenSet) { payload.WithString("condition", ConditionMapper::GetNameForCondition(m_condition)); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_valuesHasBeenSet) { Aws::Utils::Array valuesJsonList(m_values.size()); for(unsigned valuesIndex = 0; valuesIndex < valuesJsonList.GetLength(); ++valuesIndex) { valuesJsonList[valuesIndex].AsString(m_values[valuesIndex]); } payload.WithArray("values", std::move(valuesJsonList)); } return payload; } } // namespace Model } // namespace MigrationHubStrategyRecommendations } // namespace Aws