/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include 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) { Aws::Utils::Array 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; }