75 lines
1.7 KiB
C++
75 lines
1.7 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/accessanalyzer/model/CreateAnalyzerRequest.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::AccessAnalyzer::Model;
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
CreateAnalyzerRequest::CreateAnalyzerRequest() :
|
|
m_analyzerNameHasBeenSet(false),
|
|
m_archiveRulesHasBeenSet(false),
|
|
m_clientToken(Aws::Utils::UUID::RandomUUID()),
|
|
m_clientTokenHasBeenSet(true),
|
|
m_tagsHasBeenSet(false),
|
|
m_type(Type::NOT_SET),
|
|
m_typeHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Aws::String CreateAnalyzerRequest::SerializePayload() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_analyzerNameHasBeenSet)
|
|
{
|
|
payload.WithString("analyzerName", m_analyzerName);
|
|
|
|
}
|
|
|
|
if(m_archiveRulesHasBeenSet)
|
|
{
|
|
Array<JsonValue> archiveRulesJsonList(m_archiveRules.size());
|
|
for(unsigned archiveRulesIndex = 0; archiveRulesIndex < archiveRulesJsonList.GetLength(); ++archiveRulesIndex)
|
|
{
|
|
archiveRulesJsonList[archiveRulesIndex].AsObject(m_archiveRules[archiveRulesIndex].Jsonize());
|
|
}
|
|
payload.WithArray("archiveRules", std::move(archiveRulesJsonList));
|
|
|
|
}
|
|
|
|
if(m_clientTokenHasBeenSet)
|
|
{
|
|
payload.WithString("clientToken", m_clientToken);
|
|
|
|
}
|
|
|
|
if(m_tagsHasBeenSet)
|
|
{
|
|
JsonValue tagsJsonMap;
|
|
for(auto& tagsItem : m_tags)
|
|
{
|
|
tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
|
|
}
|
|
payload.WithObject("tags", std::move(tagsJsonMap));
|
|
|
|
}
|
|
|
|
if(m_typeHasBeenSet)
|
|
{
|
|
payload.WithString("type", TypeMapper::GetNameForType(m_type));
|
|
}
|
|
|
|
return payload.View().WriteReadable();
|
|
}
|
|
|
|
|
|
|
|
|