/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #include #include #include #include #include #include #include using namespace Aws::Honeycode::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; BatchCreateTableRowsResult::BatchCreateTableRowsResult() : m_workbookCursor(0) { } BatchCreateTableRowsResult::BatchCreateTableRowsResult(const Aws::AmazonWebServiceResult& result) : m_workbookCursor(0) { *this = result; } BatchCreateTableRowsResult& BatchCreateTableRowsResult::operator =(const Aws::AmazonWebServiceResult& result) { JsonView jsonValue = result.GetPayload().View(); if(jsonValue.ValueExists("workbookCursor")) { m_workbookCursor = jsonValue.GetInt64("workbookCursor"); } if(jsonValue.ValueExists("createdRows")) { Aws::Map createdRowsJsonMap = jsonValue.GetObject("createdRows").GetAllObjects(); for(auto& createdRowsItem : createdRowsJsonMap) { m_createdRows[createdRowsItem.first] = createdRowsItem.second.AsString(); } } if(jsonValue.ValueExists("failedBatchItems")) { Aws::Utils::Array failedBatchItemsJsonList = jsonValue.GetArray("failedBatchItems"); for(unsigned failedBatchItemsIndex = 0; failedBatchItemsIndex < failedBatchItemsJsonList.GetLength(); ++failedBatchItemsIndex) { m_failedBatchItems.push_back(failedBatchItemsJsonList[failedBatchItemsIndex].AsObject()); } } const auto& headers = result.GetHeaderValueCollection(); const auto& requestIdIter = headers.find("x-amzn-requestid"); if(requestIdIter != headers.end()) { m_requestId = requestIdIter->second; } return *this; }