75 lines
1.3 KiB
C++
75 lines
1.3 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/cloudtrail/model/Resource.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace CloudTrail
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
Resource::Resource() :
|
|
m_resourceTypeHasBeenSet(false),
|
|
m_resourceNameHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Resource::Resource(JsonView jsonValue) :
|
|
m_resourceTypeHasBeenSet(false),
|
|
m_resourceNameHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
Resource& Resource::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("ResourceType"))
|
|
{
|
|
m_resourceType = jsonValue.GetString("ResourceType");
|
|
|
|
m_resourceTypeHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("ResourceName"))
|
|
{
|
|
m_resourceName = jsonValue.GetString("ResourceName");
|
|
|
|
m_resourceNameHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue Resource::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_resourceTypeHasBeenSet)
|
|
{
|
|
payload.WithString("ResourceType", m_resourceType);
|
|
|
|
}
|
|
|
|
if(m_resourceNameHasBeenSet)
|
|
{
|
|
payload.WithString("ResourceName", m_resourceName);
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace CloudTrail
|
|
} // namespace Aws
|