/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include 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 parametersJsonMap = jsonValue.GetObject("Parameters").GetAllObjects(); for(auto& parametersItem : parametersJsonMap) { Aws::Utils::Array automationParameterValueListJsonList = parametersItem.second.AsArray(); Aws::Vector 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) { Aws::Utils::Array 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