use of com.google.api.services.sheets.v4.model.BatchUpdateSpreadsheetResponse in project OpenRefine by OpenRefine.
the class SpreadsheetSerializer method sendBatch.
private void sendBatch(List<RowData> rows) {
List<Request> requests = prepareBatch(rows);
// FIXME: We have a 10MB cap on the request size, but I'm not sure we've got a good
// way to quickly tell how big our request is. Just reduce row count for now.
BatchUpdateSpreadsheetRequest requestBody = new BatchUpdateSpreadsheetRequest();
requestBody.setIncludeSpreadsheetInResponse(false);
requestBody.setRequests(requests);
Sheets.Spreadsheets.BatchUpdate request;
try {
logger.debug("spreadsheetId: " + spreadsheetId);
// logger.debug("requestBody:" + requestBody.toString());
request = service.spreadsheets().batchUpdate(spreadsheetId, requestBody);
BatchUpdateSpreadsheetResponse response = request.execute();
logger.debug("response:" + response.toPrettyString());
} catch (IOException e) {
exceptions.add(e);
} finally {
requestBody.clear();
requests.clear();
rows.clear();
}
}
Aggregations