This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
pxz-hos-client-cpp-module/support/aws-sdk-cpp-master/aws-cpp-sdk-medialive/source/model/CreateChannelRequest.cpp

115 lines
2.8 KiB
C++
Raw Normal View History

/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/medialive/model/CreateChannelRequest.h>
#include <aws/core/utils/json/JsonSerializer.h>
#include <utility>
using namespace Aws::MediaLive::Model;
using namespace Aws::Utils::Json;
using namespace Aws::Utils;
CreateChannelRequest::CreateChannelRequest() :
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_nameHasBeenSet(false),
m_requestId(Aws::Utils::UUID::RandomUUID()),
m_requestIdHasBeenSet(true),
m_roleArnHasBeenSet(false),
m_tagsHasBeenSet(false)
{
}
Aws::String CreateChannelRequest::SerializePayload() const
{
JsonValue payload;
if(m_channelClassHasBeenSet)
{
payload.WithString("channelClass", ChannelClassMapper::GetNameForChannelClass(m_channelClass));
}
if(m_destinationsHasBeenSet)
{
Array<JsonValue> 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)
{
Array<JsonValue> 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_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));
}
return payload.View().WriteReadable();
}