/** * 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 GuardDuty { namespace Model { EcsTaskDetails::EcsTaskDetails() : m_arnHasBeenSet(false), m_definitionArnHasBeenSet(false), m_versionHasBeenSet(false), m_taskCreatedAtHasBeenSet(false), m_startedAtHasBeenSet(false), m_startedByHasBeenSet(false), m_tagsHasBeenSet(false), m_volumesHasBeenSet(false), m_containersHasBeenSet(false), m_groupHasBeenSet(false) { } EcsTaskDetails::EcsTaskDetails(JsonView jsonValue) : m_arnHasBeenSet(false), m_definitionArnHasBeenSet(false), m_versionHasBeenSet(false), m_taskCreatedAtHasBeenSet(false), m_startedAtHasBeenSet(false), m_startedByHasBeenSet(false), m_tagsHasBeenSet(false), m_volumesHasBeenSet(false), m_containersHasBeenSet(false), m_groupHasBeenSet(false) { *this = jsonValue; } EcsTaskDetails& EcsTaskDetails::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("arn")) { m_arn = jsonValue.GetString("arn"); m_arnHasBeenSet = true; } if(jsonValue.ValueExists("definitionArn")) { m_definitionArn = jsonValue.GetString("definitionArn"); m_definitionArnHasBeenSet = true; } if(jsonValue.ValueExists("version")) { m_version = jsonValue.GetString("version"); m_versionHasBeenSet = true; } if(jsonValue.ValueExists("createdAt")) { m_taskCreatedAt = jsonValue.GetDouble("createdAt"); m_taskCreatedAtHasBeenSet = true; } if(jsonValue.ValueExists("startedAt")) { m_startedAt = jsonValue.GetDouble("startedAt"); m_startedAtHasBeenSet = true; } if(jsonValue.ValueExists("startedBy")) { m_startedBy = jsonValue.GetString("startedBy"); m_startedByHasBeenSet = true; } if(jsonValue.ValueExists("tags")) { Aws::Utils::Array tagsJsonList = jsonValue.GetArray("tags"); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { m_tags.push_back(tagsJsonList[tagsIndex].AsObject()); } m_tagsHasBeenSet = true; } if(jsonValue.ValueExists("volumes")) { Aws::Utils::Array volumesJsonList = jsonValue.GetArray("volumes"); for(unsigned volumesIndex = 0; volumesIndex < volumesJsonList.GetLength(); ++volumesIndex) { m_volumes.push_back(volumesJsonList[volumesIndex].AsObject()); } m_volumesHasBeenSet = true; } if(jsonValue.ValueExists("containers")) { Aws::Utils::Array containersJsonList = jsonValue.GetArray("containers"); for(unsigned containersIndex = 0; containersIndex < containersJsonList.GetLength(); ++containersIndex) { m_containers.push_back(containersJsonList[containersIndex].AsObject()); } m_containersHasBeenSet = true; } if(jsonValue.ValueExists("group")) { m_group = jsonValue.GetString("group"); m_groupHasBeenSet = true; } return *this; } JsonValue EcsTaskDetails::Jsonize() const { JsonValue payload; if(m_arnHasBeenSet) { payload.WithString("arn", m_arn); } if(m_definitionArnHasBeenSet) { payload.WithString("definitionArn", m_definitionArn); } if(m_versionHasBeenSet) { payload.WithString("version", m_version); } if(m_taskCreatedAtHasBeenSet) { payload.WithDouble("createdAt", m_taskCreatedAt.SecondsWithMSPrecision()); } if(m_startedAtHasBeenSet) { payload.WithDouble("startedAt", m_startedAt.SecondsWithMSPrecision()); } if(m_startedByHasBeenSet) { payload.WithString("startedBy", m_startedBy); } if(m_tagsHasBeenSet) { Aws::Utils::Array tagsJsonList(m_tags.size()); for(unsigned tagsIndex = 0; tagsIndex < tagsJsonList.GetLength(); ++tagsIndex) { tagsJsonList[tagsIndex].AsObject(m_tags[tagsIndex].Jsonize()); } payload.WithArray("tags", std::move(tagsJsonList)); } if(m_volumesHasBeenSet) { Aws::Utils::Array volumesJsonList(m_volumes.size()); for(unsigned volumesIndex = 0; volumesIndex < volumesJsonList.GetLength(); ++volumesIndex) { volumesJsonList[volumesIndex].AsObject(m_volumes[volumesIndex].Jsonize()); } payload.WithArray("volumes", std::move(volumesJsonList)); } if(m_containersHasBeenSet) { Aws::Utils::Array containersJsonList(m_containers.size()); for(unsigned containersIndex = 0; containersIndex < containersJsonList.GetLength(); ++containersIndex) { containersJsonList[containersIndex].AsObject(m_containers[containersIndex].Jsonize()); } payload.WithArray("containers", std::move(containersJsonList)); } if(m_groupHasBeenSet) { payload.WithString("group", m_group); } return payload; } } // namespace Model } // namespace GuardDuty } // namespace Aws