/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include using namespace Aws::MediaLive::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; CreateChannelRequest::CreateChannelRequest() : m_cdiInputSpecificationHasBeenSet(false), m_channelClass(ChannelClass::NOT_SET), m_channelClassHasBeenSet(false), m_destinationsHasBeenSet(false), m_encoderSettingsHasBeenSet(false), m_inputAttachmentsHasBeenSet(false), m_inputSpecificationHasBeenSet(false), m_logLevel(LogLevel::NOT_SET), m_logLevelHasBeenSet(false), m_maintenanceHasBeenSet(false), m_nameHasBeenSet(false), m_requestId(Aws::Utils::UUID::PseudoRandomUUID()), m_requestIdHasBeenSet(true), m_roleArnHasBeenSet(false), m_tagsHasBeenSet(false), m_vpcHasBeenSet(false) { } Aws::String CreateChannelRequest::SerializePayload() const { JsonValue payload; if(m_cdiInputSpecificationHasBeenSet) { payload.WithObject("cdiInputSpecification", m_cdiInputSpecification.Jsonize()); } if(m_channelClassHasBeenSet) { payload.WithString("channelClass", ChannelClassMapper::GetNameForChannelClass(m_channelClass)); } 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_encoderSettingsHasBeenSet) { payload.WithObject("encoderSettings", m_encoderSettings.Jsonize()); } if(m_inputAttachmentsHasBeenSet) { Aws::Utils::Array inputAttachmentsJsonList(m_inputAttachments.size()); for(unsigned inputAttachmentsIndex = 0; inputAttachmentsIndex < inputAttachmentsJsonList.GetLength(); ++inputAttachmentsIndex) { inputAttachmentsJsonList[inputAttachmentsIndex].AsObject(m_inputAttachments[inputAttachmentsIndex].Jsonize()); } payload.WithArray("inputAttachments", std::move(inputAttachmentsJsonList)); } if(m_inputSpecificationHasBeenSet) { payload.WithObject("inputSpecification", m_inputSpecification.Jsonize()); } if(m_logLevelHasBeenSet) { payload.WithString("logLevel", LogLevelMapper::GetNameForLogLevel(m_logLevel)); } if(m_maintenanceHasBeenSet) { payload.WithObject("maintenance", m_maintenance.Jsonize()); } if(m_nameHasBeenSet) { payload.WithString("name", m_name); } if(m_requestIdHasBeenSet) { payload.WithString("requestId", m_requestId); } if(m_roleArnHasBeenSet) { payload.WithString("roleArn", m_roleArn); } if(m_tagsHasBeenSet) { JsonValue tagsJsonMap; for(auto& tagsItem : m_tags) { tagsJsonMap.WithString(tagsItem.first, tagsItem.second); } payload.WithObject("tags", std::move(tagsJsonMap)); } if(m_vpcHasBeenSet) { payload.WithObject("vpc", m_vpc.Jsonize()); } return payload.View().WriteReadable(); }