/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::CloudTrail::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateChannelRequest::CreateChannelRequest() : m_nameHasBeenSet(false), m_sourceHasBeenSet(false), m_destinationsHasBeenSet(false), m_tagsHasBeenSet(false) { } Aws::String CreateChannelRequest::SerializePayload() const { JsonValue payload; if(m_nameHasBeenSet) { payload.WithString("Name", m_name); } if(m_sourceHasBeenSet) { payload.WithString("Source", m_source); } if(m_destinationsHasBeenSet) { Aws::Utils::Array destinationsJsonList(m_destinations.size()); for(unsigned destinationsIndex = 0; destinationsIndex < destinationsJsonList.GetLength(); ++destinationsIndex) { destinationsJsonList[destinationsIndex].AsObject(m_destinations[destinationsIndex].Jsonize()); } payload.WithArray("Destinations", std::move(destinationsJsonList)); } if(m_tagsHasBeenSet) { Aws::Utils::Array tagsJsonList(m_tags.size()); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); } payload.WithArray("Tags", std::move(tagsJsonList)); } return payload.View().WriteReadable(); } Aws::Http::HeaderValueCollection CreateChannelRequest::GetRequestSpecificHeaders() const { Aws::Http::HeaderValueCollection headers; headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.CreateChannel")); return headers; }