/** * 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 Honeycode { namespace Model { ResultSet::ResultSet() : m_headersHasBeenSet(false), m_rowsHasBeenSet(false) { } ResultSet::ResultSet(JsonView jsonValue) : m_headersHasBeenSet(false), m_rowsHasBeenSet(false) { *this = jsonValue; } ResultSet& ResultSet::operator =(JsonView jsonValue) { if(jsonValue.ValueExists("headers")) { Aws::Utils::Array headersJsonList = jsonValue.GetArray("headers"); for(unsigned headersIndex = 0; headersIndex < headersJsonList.GetLength(); ++headersIndex) { m_headers.push_back(headersJsonList[headersIndex].AsObject()); } m_headersHasBeenSet = true; } if(jsonValue.ValueExists("rows")) { Aws::Utils::Array rowsJsonList = jsonValue.GetArray("rows"); for(unsigned rowsIndex = 0; rowsIndex < rowsJsonList.GetLength(); ++rowsIndex) { m_rows.push_back(rowsJsonList[rowsIndex].AsObject()); } m_rowsHasBeenSet = true; } return *this; } JsonValue ResultSet::Jsonize() const { JsonValue payload; if(m_headersHasBeenSet) { Aws::Utils::Array headersJsonList(m_headers.size()); for(unsigned headersIndex = 0; headersIndex < headersJsonList.GetLength(); ++headersIndex) { headersJsonList[headersIndex].AsObject(m_headers[headersIndex].Jsonize()); } payload.WithArray("headers", std::move(headersJsonList)); } if(m_rowsHasBeenSet) { Aws::Utils::Array rowsJsonList(m_rows.size()); for(unsigned rowsIndex = 0; rowsIndex < rowsJsonList.GetLength(); ++rowsIndex) { rowsJsonList[rowsIndex].AsObject(m_rows[rowsIndex].Jsonize()); } payload.WithArray("rows", std::move(rowsJsonList)); } return payload; } } // namespace Model } // namespace Honeycode } // namespace Aws