71 lines
1.5 KiB
C++
71 lines
1.5 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/guardduty/model/CreateDetectorRequest.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::GuardDuty::Model;
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
CreateDetectorRequest::CreateDetectorRequest() :
|
|
m_enable(false),
|
|
m_enableHasBeenSet(false),
|
|
m_clientToken(Aws::Utils::UUID::RandomUUID()),
|
|
m_clientTokenHasBeenSet(true),
|
|
m_findingPublishingFrequency(FindingPublishingFrequency::NOT_SET),
|
|
m_findingPublishingFrequencyHasBeenSet(false),
|
|
m_dataSourcesHasBeenSet(false),
|
|
m_tagsHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Aws::String CreateDetectorRequest::SerializePayload() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_enableHasBeenSet)
|
|
{
|
|
payload.WithBool("enable", m_enable);
|
|
|
|
}
|
|
|
|
if(m_clientTokenHasBeenSet)
|
|
{
|
|
payload.WithString("clientToken", m_clientToken);
|
|
|
|
}
|
|
|
|
if(m_findingPublishingFrequencyHasBeenSet)
|
|
{
|
|
payload.WithString("findingPublishingFrequency", FindingPublishingFrequencyMapper::GetNameForFindingPublishingFrequency(m_findingPublishingFrequency));
|
|
}
|
|
|
|
if(m_dataSourcesHasBeenSet)
|
|
{
|
|
payload.WithObject("dataSources", m_dataSources.Jsonize());
|
|
|
|
}
|
|
|
|
if(m_tagsHasBeenSet)
|
|
{
|
|
JsonValue tagsJsonMap;
|
|
for(auto& tagsItem : m_tags)
|
|
{
|
|
tagsJsonMap.WithString(tagsItem.first, tagsItem.second);
|
|
}
|
|
payload.WithObject("tags", std::move(tagsJsonMap));
|
|
|
|
}
|
|
|
|
return payload.View().WriteReadable();
|
|
}
|
|
|
|
|
|
|
|
|