如何在 Smartsheet API 2.0 中更新一行单元格

How to update a row of cells in Smartsheet API 2.0

我最近使用 API 1.1 编写了一个自动更新 sheet 的程序,它使用行

smartsheet.rows().updateCells(rowId, cells);

更新 sheet 中的一行单元格。在 2.0 版本中,rows() 已被弃用,但我仍然找不到该行的 2.0 等效项。

updateCells() 已被 updateRows() 取代,可以使用 rowResources() 访问。此处提供了详细的示例代码:http://smartsheet-platform.github.io/api-docs/#update-cell(s)

示例代码:

Row rowA = new Row.UpdateRowBuilder().setCells(cellsB).setRowId(rowId).build();

List<Row> updatedRows = smartsheet.sheetResources().rowResources().updateRows(sheetId, Arrays.asList(rowA));