95 lines
2.9 KiB
C++
95 lines
2.9 KiB
C++
/**
|
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
* SPDX-License-Identifier: Apache-2.0.
|
|
*/
|
|
|
|
#include <aws/ssm/model/MaintenanceWindowAutomationParameters.h>
|
|
#include <aws/core/utils/json/JsonSerializer.h>
|
|
|
|
#include <utility>
|
|
|
|
using namespace Aws::Utils::Json;
|
|
using namespace Aws::Utils;
|
|
|
|
namespace Aws
|
|
{
|
|
namespace SSM
|
|
{
|
|
namespace Model
|
|
{
|
|
|
|
MaintenanceWindowAutomationParameters::MaintenanceWindowAutomationParameters() :
|
|
m_documentVersionHasBeenSet(false),
|
|
m_parametersHasBeenSet(false)
|
|
{
|
|
}
|
|
|
|
MaintenanceWindowAutomationParameters::MaintenanceWindowAutomationParameters(JsonView jsonValue) :
|
|
m_documentVersionHasBeenSet(false),
|
|
m_parametersHasBeenSet(false)
|
|
{
|
|
*this = jsonValue;
|
|
}
|
|
|
|
MaintenanceWindowAutomationParameters& MaintenanceWindowAutomationParameters::operator =(JsonView jsonValue)
|
|
{
|
|
if(jsonValue.ValueExists("DocumentVersion"))
|
|
{
|
|
m_documentVersion = jsonValue.GetString("DocumentVersion");
|
|
|
|
m_documentVersionHasBeenSet = true;
|
|
}
|
|
|
|
if(jsonValue.ValueExists("Parameters"))
|
|
{
|
|
Aws::Map<Aws::String, JsonView> parametersJsonMap = jsonValue.GetObject("Parameters").GetAllObjects();
|
|
for(auto& parametersItem : parametersJsonMap)
|
|
{
|
|
Array<JsonView> automationParameterValueListJsonList = parametersItem.second.AsArray();
|
|
Aws::Vector<Aws::String> automationParameterValueListList;
|
|
automationParameterValueListList.reserve((size_t)automationParameterValueListJsonList.GetLength());
|
|
for(unsigned automationParameterValueListIndex = 0; automationParameterValueListIndex < automationParameterValueListJsonList.GetLength(); ++automationParameterValueListIndex)
|
|
{
|
|
automationParameterValueListList.push_back(automationParameterValueListJsonList[automationParameterValueListIndex].AsString());
|
|
}
|
|
m_parameters[parametersItem.first] = std::move(automationParameterValueListList);
|
|
}
|
|
m_parametersHasBeenSet = true;
|
|
}
|
|
|
|
return *this;
|
|
}
|
|
|
|
JsonValue MaintenanceWindowAutomationParameters::Jsonize() const
|
|
{
|
|
JsonValue payload;
|
|
|
|
if(m_documentVersionHasBeenSet)
|
|
{
|
|
payload.WithString("DocumentVersion", m_documentVersion);
|
|
|
|
}
|
|
|
|
if(m_parametersHasBeenSet)
|
|
{
|
|
JsonValue parametersJsonMap;
|
|
for(auto& parametersItem : m_parameters)
|
|
{
|
|
Array<JsonValue> automationParameterValueListJsonList(parametersItem.second.size());
|
|
for(unsigned automationParameterValueListIndex = 0; automationParameterValueListIndex < automationParameterValueListJsonList.GetLength(); ++automationParameterValueListIndex)
|
|
{
|
|
automationParameterValueListJsonList[automationParameterValueListIndex].AsString(parametersItem.second[automationParameterValueListIndex]);
|
|
}
|
|
parametersJsonMap.WithArray(parametersItem.first, std::move(automationParameterValueListJsonList));
|
|
}
|
|
payload.WithObject("Parameters", std::move(parametersJsonMap));
|
|
|
|
}
|
|
|
|
return payload;
|
|
}
|
|
|
|
} // namespace Model
|
|
} // namespace SSM
|
|
} // namespace Aws
|