/** * 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 Glue { namespace Model { WorkflowGraph::WorkflowGraph() : m_nodesHasBeenSet(false), m_edgesHasBeenSet(false) { } WorkflowGraph::WorkflowGraph(JsonView jsonValue) : m_nodesHasBeenSet(false), m_edgesHasBeenSet(false) { *this = jsonValue; } WorkflowGraph& WorkflowGraph::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("Nodes")) { Aws::Utils::Array nodesJsonList = jsonValue.GetArray("Nodes"); for(unsigned nodesIndex = 0; nodesIndex < nodesJsonList.GetLength(); ++nodesIndex) { m_nodes.push_back(nodesJsonList[nodesIndex].AsObject()); } m_nodesHasBeenSet = true; } if(jsonValue.ValueExists("Edges")) { Aws::Utils::Array edgesJsonList = jsonValue.GetArray("Edges"); for(unsigned edgesIndex = 0; edgesIndex < edgesJsonList.GetLength(); ++edgesIndex) { m_edges.push_back(edgesJsonList[edgesIndex].AsObject()); } m_edgesHasBeenSet = true; } return *this; } JsonValue WorkflowGraph::Jsonize() const { JsonValue payload; if(m_nodesHasBeenSet) { Aws::Utils::Array nodesJsonList(m_nodes.size()); for(unsigned nodesIndex = 0; nodesIndex < nodesJsonList.GetLength(); ++nodesIndex) { nodesJsonList[nodesIndex].AsObject(m_nodes[nodesIndex].Jsonize()); } payload.WithArray("Nodes", std::move(nodesJsonList)); } if(m_edgesHasBeenSet) { Aws::Utils::Array edgesJsonList(m_edges.size()); for(unsigned edgesIndex = 0; edgesIndex < edgesJsonList.GetLength(); ++edgesIndex) { edgesJsonList[edgesIndex].AsObject(m_edges[edgesIndex].Jsonize()); } payload.WithArray("Edges", std::move(edgesJsonList)); } return payload; } } // namespace Model } // namespace Glue } // namespace Aws