106 lines
1.9 KiB
C++
106 lines
1.9 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/ecs/model/Attribute.h>
|
|||
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::Utils::Json;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
namespace Aws
|
|||
|
|
{
|
|||
|
|
namespace ECS
|
|||
|
|
{
|
|||
|
|
namespace Model
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
Attribute::Attribute() :
|
|||
|
|
m_nameHasBeenSet(false),
|
|||
|
|
m_valueHasBeenSet(false),
|
|||
|
|
m_targetType(TargetType::NOT_SET),
|
|||
|
|
m_targetTypeHasBeenSet(false),
|
|||
|
|
m_targetIdHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Attribute::Attribute(JsonView jsonValue) :
|
|||
|
|
m_nameHasBeenSet(false),
|
|||
|
|
m_valueHasBeenSet(false),
|
|||
|
|
m_targetType(TargetType::NOT_SET),
|
|||
|
|
m_targetTypeHasBeenSet(false),
|
|||
|
|
m_targetIdHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
*this = jsonValue;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Attribute& Attribute::operator =(JsonView jsonValue)
|
|||
|
|
{
|
|||
|
|
if(jsonValue.ValueExists("name"))
|
|||
|
|
{
|
|||
|
|
m_name = jsonValue.GetString("name");
|
|||
|
|
|
|||
|
|
m_nameHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("value"))
|
|||
|
|
{
|
|||
|
|
m_value = jsonValue.GetString("value");
|
|||
|
|
|
|||
|
|
m_valueHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("targetType"))
|
|||
|
|
{
|
|||
|
|
m_targetType = TargetTypeMapper::GetTargetTypeForName(jsonValue.GetString("targetType"));
|
|||
|
|
|
|||
|
|
m_targetTypeHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(jsonValue.ValueExists("targetId"))
|
|||
|
|
{
|
|||
|
|
m_targetId = jsonValue.GetString("targetId");
|
|||
|
|
|
|||
|
|
m_targetIdHasBeenSet = true;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return *this;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
JsonValue Attribute::Jsonize() const
|
|||
|
|
{
|
|||
|
|
JsonValue payload;
|
|||
|
|
|
|||
|
|
if(m_nameHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("name", m_name);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_valueHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("value", m_value);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_targetTypeHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("targetType", TargetTypeMapper::GetNameForTargetType(m_targetType));
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_targetIdHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("targetId", m_targetId);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return payload;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
} // namespace Model
|
|||
|
|
} // namespace ECS
|
|||
|
|
} // namespace Aws
|