text: ﻿/*
  * Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
  *
  * Licensed under the Apache License, Version 2.0 (the "License").
  * You may not use this file except in compliance with the License.
  * A copy of the License is located at
  *
  *  http://aws.amazon.com/apache2.0
  *
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
  
  #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_maxErrorsHasBeenSet(false),
      m_maxConcurrencyHasBeenSet(false),
      m_complianceSeverity(AssociationComplianceSeverity::NOT_SET),
      m_complianceSeverityHasBeenSet(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_maxErrorsHasBeenSet)
    {
     payload.WithString("MaxErrors", m_maxErrors);
  
    }
  
    if(m_maxConcurrencyHasBeenSet)
    {
     payload.WithString("MaxConcurrency", m_maxConcurrency);
  
    }
  
    if(m_complianceSeverityHasBeenSet)
    {
     payload.WithString("ComplianceSeverity", AssociationComplianceSeverityMapper::GetNameForAssociationComplianceSeverity(m_complianceSeverity));
    }
  
    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;
  
  }
  
  
  
  
  