76 lines
1.7 KiB
C++
76 lines
1.7 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/application-autoscaling/model/PredefinedMetricSpecification.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace ApplicationAutoScaling
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
PredefinedMetricSpecification::PredefinedMetricSpecification() :
|
|
m_predefinedMetricType(MetricType::NOT_SET),
|
|
m_predefinedMetricTypeHasBeenSet(false),
|
|
m_resourceLabelHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
PredefinedMetricSpecification::PredefinedMetricSpecification(JsonView jsonValue) :
|
|
m_predefinedMetricType(MetricType::NOT_SET),
|
|
m_predefinedMetricTypeHasBeenSet(false),
|
|
m_resourceLabelHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
PredefinedMetricSpecification& PredefinedMetricSpecification::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("PredefinedMetricType"))
|
|
{
|
|
m_predefinedMetricType = MetricTypeMapper::GetMetricTypeForName(jsonValue.GetString("PredefinedMetricType"));
|
|
|
|
m_predefinedMetricTypeHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("ResourceLabel"))
|
|
{
|
|
m_resourceLabel = jsonValue.GetString("ResourceLabel");
|
|
|
|
m_resourceLabelHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue PredefinedMetricSpecification::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_predefinedMetricTypeHasBeenSet)
|
|
{
|
|
payload.WithString("PredefinedMetricType", MetricTypeMapper::GetNameForMetricType(m_predefinedMetricType));
|
|
}
|
|
|
|
if(m_resourceLabelHasBeenSet)
|
|
{
|
|
payload.WithString("ResourceLabel", m_resourceLabel);
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace ApplicationAutoScaling
|
|
} // namespace Aws
|