/** * 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 { AssociationExecution::AssociationExecution() : m_associationIdHasBeenSet(false), m_associationVersionHasBeenSet(false), m_executionIdHasBeenSet(false), m_statusHasBeenSet(false), m_detailedStatusHasBeenSet(false), m_createdTimeHasBeenSet(false), m_lastExecutionDateHasBeenSet(false), m_resourceCountByStatusHasBeenSet(false), m_alarmConfigurationHasBeenSet(false), m_triggeredAlarmsHasBeenSet(false) { } AssociationExecution::AssociationExecution(JsonView jsonValue) : m_associationIdHasBeenSet(false), m_associationVersionHasBeenSet(false), m_executionIdHasBeenSet(false), m_statusHasBeenSet(false), m_detailedStatusHasBeenSet(false), m_createdTimeHasBeenSet(false), m_lastExecutionDateHasBeenSet(false), m_resourceCountByStatusHasBeenSet(false), m_alarmConfigurationHasBeenSet(false), m_triggeredAlarmsHasBeenSet(false) { *this = jsonValue; } AssociationExecution& AssociationExecution::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("AssociationId")) { m_associationId = jsonValue.GetString("AssociationId"); m_associationIdHasBeenSet = true; } if(jsonValue.ValueExists("AssociationVersion")) { m_associationVersion = jsonValue.GetString("AssociationVersion"); m_associationVersionHasBeenSet = true; } if(jsonValue.ValueExists("ExecutionId")) { m_executionId = jsonValue.GetString("ExecutionId"); m_executionIdHasBeenSet = true; } if(jsonValue.ValueExists("Status")) { m_status = jsonValue.GetString("Status"); m_statusHasBeenSet = true; } if(jsonValue.ValueExists("DetailedStatus")) { m_detailedStatus = jsonValue.GetString("DetailedStatus"); m_detailedStatusHasBeenSet = true; } if(jsonValue.ValueExists("CreatedTime")) { m_createdTime = jsonValue.GetDouble("CreatedTime"); m_createdTimeHasBeenSet = true; } if(jsonValue.ValueExists("LastExecutionDate")) { m_lastExecutionDate = jsonValue.GetDouble("LastExecutionDate"); m_lastExecutionDateHasBeenSet = true; } if(jsonValue.ValueExists("ResourceCountByStatus")) { m_resourceCountByStatus = jsonValue.GetString("ResourceCountByStatus"); m_resourceCountByStatusHasBeenSet = true; } if(jsonValue.ValueExists("AlarmConfiguration")) { m_alarmConfiguration = jsonValue.GetObject("AlarmConfiguration"); m_alarmConfigurationHasBeenSet = true; } if(jsonValue.ValueExists("TriggeredAlarms")) { Aws::Utils::Array triggeredAlarmsJsonList = jsonValue.GetArray("TriggeredAlarms"); for(unsigned triggeredAlarmsIndex = 0; triggeredAlarmsIndex < triggeredAlarmsJsonList.GetLength(); ++triggeredAlarmsIndex) { m_triggeredAlarms.push_back(triggeredAlarmsJsonList[triggeredAlarmsIndex].AsObject()); } m_triggeredAlarmsHasBeenSet = true; } return *this; } JsonValue AssociationExecution::Jsonize() const { JsonValue payload; if(m_associationIdHasBeenSet) { payload.WithString("AssociationId", m_associationId); } if(m_associationVersionHasBeenSet) { payload.WithString("AssociationVersion", m_associationVersion); } if(m_executionIdHasBeenSet) { payload.WithString("ExecutionId", m_executionId); } if(m_statusHasBeenSet) { payload.WithString("Status", m_status); } if(m_detailedStatusHasBeenSet) { payload.WithString("DetailedStatus", m_detailedStatus); } if(m_createdTimeHasBeenSet) { payload.WithDouble("CreatedTime", m_createdTime.SecondsWithMSPrecision()); } if(m_lastExecutionDateHasBeenSet) { payload.WithDouble("LastExecutionDate", m_lastExecutionDate.SecondsWithMSPrecision()); } if(m_resourceCountByStatusHasBeenSet) { payload.WithString("ResourceCountByStatus", m_resourceCountByStatus); } if(m_alarmConfigurationHasBeenSet) { payload.WithObject("AlarmConfiguration", m_alarmConfiguration.Jsonize()); } if(m_triggeredAlarmsHasBeenSet) { Aws::Utils::Array triggeredAlarmsJsonList(m_triggeredAlarms.size()); for(unsigned triggeredAlarmsIndex = 0; triggeredAlarmsIndex < triggeredAlarmsJsonList.GetLength(); ++triggeredAlarmsIndex) { triggeredAlarmsJsonList[triggeredAlarmsIndex].AsObject(m_triggeredAlarms[triggeredAlarmsIndex].Jsonize()); } payload.WithArray("TriggeredAlarms", std::move(triggeredAlarmsJsonList)); } return payload; } } // namespace Model } // namespace SSM } // namespace Aws