91 lines
1.9 KiB
C++
91 lines
1.9 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/accessanalyzer/model/AnalyzedResourceSummary.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace AccessAnalyzer
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
AnalyzedResourceSummary::AnalyzedResourceSummary() :
|
|
m_resourceArnHasBeenSet(false),
|
|
m_resourceOwnerAccountHasBeenSet(false),
|
|
m_resourceType(ResourceType::NOT_SET),
|
|
m_resourceTypeHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
AnalyzedResourceSummary::AnalyzedResourceSummary(JsonView jsonValue) :
|
|
m_resourceArnHasBeenSet(false),
|
|
m_resourceOwnerAccountHasBeenSet(false),
|
|
m_resourceType(ResourceType::NOT_SET),
|
|
m_resourceTypeHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
AnalyzedResourceSummary& AnalyzedResourceSummary::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("resourceArn"))
|
|
{
|
|
m_resourceArn = jsonValue.GetString("resourceArn");
|
|
|
|
m_resourceArnHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("resourceOwnerAccount"))
|
|
{
|
|
m_resourceOwnerAccount = jsonValue.GetString("resourceOwnerAccount");
|
|
|
|
m_resourceOwnerAccountHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("resourceType"))
|
|
{
|
|
m_resourceType = ResourceTypeMapper::GetResourceTypeForName(jsonValue.GetString("resourceType"));
|
|
|
|
m_resourceTypeHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue AnalyzedResourceSummary::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_resourceArnHasBeenSet)
|
|
{
|
|
payload.WithString("resourceArn", m_resourceArn);
|
|
|
|
}
|
|
|
|
if(m_resourceOwnerAccountHasBeenSet)
|
|
{
|
|
payload.WithString("resourceOwnerAccount", m_resourceOwnerAccount);
|
|
|
|
}
|
|
|
|
if(m_resourceTypeHasBeenSet)
|
|
{
|
|
payload.WithString("resourceType", ResourceTypeMapper::GetNameForResourceType(m_resourceType));
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace AccessAnalyzer
|
|
} // namespace Aws
|