63 lines
1.3 KiB
C++
63 lines
1.3 KiB
C++
|
|
/**
|
|||
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|||
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
#include <aws/events/model/PutTargetsRequest.h>
|
|||
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|||
|
|
|
|||
|
|
#include <utility>
|
|||
|
|
|
|||
|
|
using namespace Aws::CloudWatchEvents::Model;
|
|||
|
|
using namespace Aws::Utils::Json;
|
|||
|
|
using namespace Aws::Utils;
|
|||
|
|
|
|||
|
|
PutTargetsRequest::PutTargetsRequest() :
|
|||
|
|
m_ruleHasBeenSet(false),
|
|||
|
|
m_eventBusNameHasBeenSet(false),
|
|||
|
|
m_targetsHasBeenSet(false)
|
|||
|
|
{
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::String PutTargetsRequest::SerializePayload() const
|
|||
|
|
{
|
|||
|
|
JsonValue payload;
|
|||
|
|
|
|||
|
|
if(m_ruleHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("Rule", m_rule);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_eventBusNameHasBeenSet)
|
|||
|
|
{
|
|||
|
|
payload.WithString("EventBusName", m_eventBusName);
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
if(m_targetsHasBeenSet)
|
|||
|
|
{
|
|||
|
|
Array<JsonValue> targetsJsonList(m_targets.size());
|
|||
|
|
for(unsigned targetsIndex = 0; targetsIndex < targetsJsonList.GetLength(); ++targetsIndex)
|
|||
|
|
{
|
|||
|
|
targetsJsonList[targetsIndex].AsObject(m_targets[targetsIndex].Jsonize());
|
|||
|
|
}
|
|||
|
|
payload.WithArray("Targets", std::move(targetsJsonList));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return payload.View().WriteReadable();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
Aws::Http::HeaderValueCollection PutTargetsRequest::GetRequestSpecificHeaders() const
|
|||
|
|
{
|
|||
|
|
Aws::Http::HeaderValueCollection headers;
|
|||
|
|
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AWSEvents.PutTargets"));
|
|||
|
|
return headers;
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
|