76 lines
1.5 KiB
C++
76 lines
1.5 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/savingsplans/model/SavingsPlanRateProperty.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace SavingsPlans
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
SavingsPlanRateProperty::SavingsPlanRateProperty() :
|
|
m_name(SavingsPlanRatePropertyKey::NOT_SET),
|
|
m_nameHasBeenSet(false),
|
|
m_valueHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
SavingsPlanRateProperty::SavingsPlanRateProperty(JsonView jsonValue) :
|
|
m_name(SavingsPlanRatePropertyKey::NOT_SET),
|
|
m_nameHasBeenSet(false),
|
|
m_valueHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
SavingsPlanRateProperty& SavingsPlanRateProperty::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("name"))
|
|
{
|
|
m_name = SavingsPlanRatePropertyKeyMapper::GetSavingsPlanRatePropertyKeyForName(jsonValue.GetString("name"));
|
|
|
|
m_nameHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("value"))
|
|
{
|
|
m_value = jsonValue.GetString("value");
|
|
|
|
m_valueHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue SavingsPlanRateProperty::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_nameHasBeenSet)
|
|
{
|
|
payload.WithString("name", SavingsPlanRatePropertyKeyMapper::GetNameForSavingsPlanRatePropertyKey(m_name));
|
|
}
|
|
|
|
if(m_valueHasBeenSet)
|
|
{
|
|
payload.WithString("value", m_value);
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace SavingsPlans
|
|
} // namespace Aws
|