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/organizations/model/PolicyTargetSummary.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace Organizations
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
PolicyTargetSummary::PolicyTargetSummary() :
|
|
m_targetIdHasBeenSet(false),
|
|
m_arnHasBeenSet(false),
|
|
m_nameHasBeenSet(false),
|
|
m_type(TargetType::NOT_SET),
|
|
m_typeHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
PolicyTargetSummary::PolicyTargetSummary(JsonView jsonValue) :
|
|
m_targetIdHasBeenSet(false),
|
|
m_arnHasBeenSet(false),
|
|
m_nameHasBeenSet(false),
|
|
m_type(TargetType::NOT_SET),
|
|
m_typeHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
PolicyTargetSummary& PolicyTargetSummary::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("TargetId"))
|
|
{
|
|
m_targetId = jsonValue.GetString("TargetId");
|
|
|
|
m_targetIdHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Arn"))
|
|
{
|
|
m_arn = jsonValue.GetString("Arn");
|
|
|
|
m_arnHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Name"))
|
|
{
|
|
m_name = jsonValue.GetString("Name");
|
|
|
|
m_nameHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Type"))
|
|
{
|
|
m_type = TargetTypeMapper::GetTargetTypeForName(jsonValue.GetString("Type"));
|
|
|
|
m_typeHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue PolicyTargetSummary::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_targetIdHasBeenSet)
|
|
{
|
|
payload.WithString("TargetId", m_targetId);
|
|
|
|
}
|
|
|
|
if(m_arnHasBeenSet)
|
|
{
|
|
payload.WithString("Arn", m_arn);
|
|
|
|
}
|
|
|
|
if(m_nameHasBeenSet)
|
|
{
|
|
payload.WithString("Name", m_name);
|
|
|
|
}
|
|
|
|
if(m_typeHasBeenSet)
|
|
{
|
|
payload.WithString("Type", TargetTypeMapper::GetNameForTargetType(m_type));
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace Organizations
|
|
} // namespace Aws
|