91 lines
2.0 KiB
C++
91 lines
2.0 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/ssm/model/UpdateDocumentRequest.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::SSM::Model;
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
UpdateDocumentRequest::UpdateDocumentRequest() :
|
|
m_contentHasBeenSet(false),
|
|
m_attachmentsHasBeenSet(false),
|
|
m_nameHasBeenSet(false),
|
|
m_versionNameHasBeenSet(false),
|
|
m_documentVersionHasBeenSet(false),
|
|
m_documentFormat(DocumentFormat::NOT_SET),
|
|
m_documentFormatHasBeenSet(false),
|
|
m_targetTypeHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Aws::String UpdateDocumentRequest::SerializePayload() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_contentHasBeenSet)
|
|
{
|
|
payload.WithString("Content", m_content);
|
|
|
|
}
|
|
|
|
if(m_attachmentsHasBeenSet)
|
|
{
|
|
Array<JsonValue> attachmentsJsonList(m_attachments.size());
|
|
for(unsigned attachmentsIndex = 0; attachmentsIndex < attachmentsJsonList.GetLength(); ++attachmentsIndex)
|
|
{
|
|
attachmentsJsonList[attachmentsIndex].AsObject(m_attachments[attachmentsIndex].Jsonize());
|
|
}
|
|
payload.WithArray("Attachments", std::move(attachmentsJsonList));
|
|
|
|
}
|
|
|
|
if(m_nameHasBeenSet)
|
|
{
|
|
payload.WithString("Name", m_name);
|
|
|
|
}
|
|
|
|
if(m_versionNameHasBeenSet)
|
|
{
|
|
payload.WithString("VersionName", m_versionName);
|
|
|
|
}
|
|
|
|
if(m_documentVersionHasBeenSet)
|
|
{
|
|
payload.WithString("DocumentVersion", m_documentVersion);
|
|
|
|
}
|
|
|
|
if(m_documentFormatHasBeenSet)
|
|
{
|
|
payload.WithString("DocumentFormat", DocumentFormatMapper::GetNameForDocumentFormat(m_documentFormat));
|
|
}
|
|
|
|
if(m_targetTypeHasBeenSet)
|
|
{
|
|
payload.WithString("TargetType", m_targetType);
|
|
|
|
}
|
|
|
|
return payload.View().WriteReadable();
|
|
}
|
|
|
|
Aws::Http::HeaderValueCollection UpdateDocumentRequest::GetRequestSpecificHeaders() const
|
|
{
|
|
Aws::Http::HeaderValueCollection headers;
|
|
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AmazonSSM.UpdateDocument"));
|
|
return headers;
|
|
|
|
}
|
|
|
|
|
|
|
|
|