117 lines
3.1 KiB
C++
117 lines
3.1 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/compute-optimizer/model/AutoScalingGroupRecommendationOption.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace ComputeOptimizer
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
AutoScalingGroupRecommendationOption::AutoScalingGroupRecommendationOption() :
|
|
m_configurationHasBeenSet(false),
|
|
m_projectedUtilizationMetricsHasBeenSet(false),
|
|
m_performanceRisk(0.0),
|
|
m_performanceRiskHasBeenSet(false),
|
|
m_rank(0),
|
|
m_rankHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
AutoScalingGroupRecommendationOption::AutoScalingGroupRecommendationOption(JsonView jsonValue) :
|
|
m_configurationHasBeenSet(false),
|
|
m_projectedUtilizationMetricsHasBeenSet(false),
|
|
m_performanceRisk(0.0),
|
|
m_performanceRiskHasBeenSet(false),
|
|
m_rank(0),
|
|
m_rankHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
AutoScalingGroupRecommendationOption& AutoScalingGroupRecommendationOption::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("configuration"))
|
|
{
|
|
m_configuration = jsonValue.GetObject("configuration");
|
|
|
|
m_configurationHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("projectedUtilizationMetrics"))
|
|
{
|
|
Array<JsonView> projectedUtilizationMetricsJsonList = jsonValue.GetArray("projectedUtilizationMetrics");
|
|
for(unsigned projectedUtilizationMetricsIndex = 0; projectedUtilizationMetricsIndex < projectedUtilizationMetricsJsonList.GetLength(); ++projectedUtilizationMetricsIndex)
|
|
{
|
|
m_projectedUtilizationMetrics.push_back(projectedUtilizationMetricsJsonList[projectedUtilizationMetricsIndex].AsObject());
|
|
}
|
|
m_projectedUtilizationMetricsHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("performanceRisk"))
|
|
{
|
|
m_performanceRisk = jsonValue.GetDouble("performanceRisk");
|
|
|
|
m_performanceRiskHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("rank"))
|
|
{
|
|
m_rank = jsonValue.GetInteger("rank");
|
|
|
|
m_rankHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue AutoScalingGroupRecommendationOption::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_configurationHasBeenSet)
|
|
{
|
|
payload.WithObject("configuration", m_configuration.Jsonize());
|
|
|
|
}
|
|
|
|
if(m_projectedUtilizationMetricsHasBeenSet)
|
|
{
|
|
Array<JsonValue> projectedUtilizationMetricsJsonList(m_projectedUtilizationMetrics.size());
|
|
for(unsigned projectedUtilizationMetricsIndex = 0; projectedUtilizationMetricsIndex < projectedUtilizationMetricsJsonList.GetLength(); ++projectedUtilizationMetricsIndex)
|
|
{
|
|
projectedUtilizationMetricsJsonList[projectedUtilizationMetricsIndex].AsObject(m_projectedUtilizationMetrics[projectedUtilizationMetricsIndex].Jsonize());
|
|
}
|
|
payload.WithArray("projectedUtilizationMetrics", std::move(projectedUtilizationMetricsJsonList));
|
|
|
|
}
|
|
|
|
if(m_performanceRiskHasBeenSet)
|
|
{
|
|
payload.WithDouble("performanceRisk", m_performanceRisk);
|
|
|
|
}
|
|
|
|
if(m_rankHasBeenSet)
|
|
{
|
|
payload.WithInteger("rank", m_rank);
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace ComputeOptimizer
|
|
} // namespace Aws
|