158 lines
4.0 KiB
C++
158 lines
4.0 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/ssm/model/UpdateAssociationRequest.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::SSM::Model;
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
UpdateAssociationRequest::UpdateAssociationRequest() :
|
|
m_associationIdHasBeenSet(false),
|
|
m_parametersHasBeenSet(false),
|
|
m_documentVersionHasBeenSet(false),
|
|
m_scheduleExpressionHasBeenSet(false),
|
|
m_outputLocationHasBeenSet(false),
|
|
m_nameHasBeenSet(false),
|
|
m_targetsHasBeenSet(false),
|
|
m_associationNameHasBeenSet(false),
|
|
m_associationVersionHasBeenSet(false),
|
|
m_automationTargetParameterNameHasBeenSet(false),
|
|
m_maxErrorsHasBeenSet(false),
|
|
m_maxConcurrencyHasBeenSet(false),
|
|
m_complianceSeverity(AssociationComplianceSeverity::NOT_SET),
|
|
m_complianceSeverityHasBeenSet(false),
|
|
m_syncCompliance(AssociationSyncCompliance::NOT_SET),
|
|
m_syncComplianceHasBeenSet(false),
|
|
m_applyOnlyAtCronInterval(false),
|
|
m_applyOnlyAtCronIntervalHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
Aws::String UpdateAssociationRequest::SerializePayload() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_associationIdHasBeenSet)
|
|
{
|
|
payload.WithString("AssociationId", m_associationId);
|
|
|
|
}
|
|
|
|
if(m_parametersHasBeenSet)
|
|
{
|
|
JsonValue parametersJsonMap;
|
|
for(auto& parametersItem : m_parameters)
|
|
{
|
|
Array<JsonValue> parameterValueListJsonList(parametersItem.second.size());
|
|
for(unsigned parameterValueListIndex = 0; parameterValueListIndex < parameterValueListJsonList.GetLength(); ++parameterValueListIndex)
|
|
{
|
|
parameterValueListJsonList[parameterValueListIndex].AsString(parametersItem.second[parameterValueListIndex]);
|
|
}
|
|
parametersJsonMap.WithArray(parametersItem.first, std::move(parameterValueListJsonList));
|
|
}
|
|
payload.WithObject("Parameters", std::move(parametersJsonMap));
|
|
|
|
}
|
|
|
|
if(m_documentVersionHasBeenSet)
|
|
{
|
|
payload.WithString("DocumentVersion", m_documentVersion);
|
|
|
|
}
|
|
|
|
if(m_scheduleExpressionHasBeenSet)
|
|
{
|
|
payload.WithString("ScheduleExpression", m_scheduleExpression);
|
|
|
|
}
|
|
|
|
if(m_outputLocationHasBeenSet)
|
|
{
|
|
payload.WithObject("OutputLocation", m_outputLocation.Jsonize());
|
|
|
|
}
|
|
|
|
if(m_nameHasBeenSet)
|
|
{
|
|
payload.WithString("Name", m_name);
|
|
|
|
}
|
|
|
|
if(m_targetsHasBeenSet)
|
|
{
|
|
Array<JsonValue> 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));
|
|
|
|
}
|
|
|
|
if(m_associationNameHasBeenSet)
|
|
{
|
|
payload.WithString("AssociationName", m_associationName);
|
|
|
|
}
|
|
|
|
if(m_associationVersionHasBeenSet)
|
|
{
|
|
payload.WithString("AssociationVersion", m_associationVersion);
|
|
|
|
}
|
|
|
|
if(m_automationTargetParameterNameHasBeenSet)
|
|
{
|
|
payload.WithString("AutomationTargetParameterName", m_automationTargetParameterName);
|
|
|
|
}
|
|
|
|
if(m_maxErrorsHasBeenSet)
|
|
{
|
|
payload.WithString("MaxErrors", m_maxErrors);
|
|
|
|
}
|
|
|
|
if(m_maxConcurrencyHasBeenSet)
|
|
{
|
|
payload.WithString("MaxConcurrency", m_maxConcurrency);
|
|
|
|
}
|
|
|
|
if(m_complianceSeverityHasBeenSet)
|
|
{
|
|
payload.WithString("ComplianceSeverity", AssociationComplianceSeverityMapper::GetNameForAssociationComplianceSeverity(m_complianceSeverity));
|
|
}
|
|
|
|
if(m_syncComplianceHasBeenSet)
|
|
{
|
|
payload.WithString("SyncCompliance", AssociationSyncComplianceMapper::GetNameForAssociationSyncCompliance(m_syncCompliance));
|
|
}
|
|
|
|
if(m_applyOnlyAtCronIntervalHasBeenSet)
|
|
{
|
|
payload.WithBool("ApplyOnlyAtCronInterval", m_applyOnlyAtCronInterval);
|
|
|
|
}
|
|
|
|
return payload.View().WriteReadable();
|
|
}
|
|
|
|
Aws::Http::HeaderValueCollection UpdateAssociationRequest::GetRequestSpecificHeaders() const
|
|
{
|
|
Aws::Http::HeaderValueCollection headers;
|
|
headers.insert(Aws::Http::HeaderValuePair("X-Amz-Target", "AmazonSSM.UpdateAssociation"));
|
|
return headers;
|
|
|
|
}
|
|
|
|
|
|
|
|
|