75 lines
1.2 KiB
C++
75 lines
1.2 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/iot/model/Policy.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace IoT
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
Policy::Policy() :
|
|
m_policyNameHasBeenSet(false),
|
|
m_policyArnHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Policy::Policy(JsonView jsonValue) :
|
|
m_policyNameHasBeenSet(false),
|
|
m_policyArnHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
Policy& Policy::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("policyName"))
|
|
{
|
|
m_policyName = jsonValue.GetString("policyName");
|
|
|
|
m_policyNameHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("policyArn"))
|
|
{
|
|
m_policyArn = jsonValue.GetString("policyArn");
|
|
|
|
m_policyArnHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue Policy::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_policyNameHasBeenSet)
|
|
{
|
|
payload.WithString("policyName", m_policyName);
|
|
|
|
}
|
|
|
|
if(m_policyArnHasBeenSet)
|
|
{
|
|
payload.WithString("policyArn", m_policyArn);
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace IoT
|
|
} // namespace Aws
|