sheets (v4)
PREREQUISITE: Read ../gws-shared/SKILL.md for auth, global flags, and security rules. If missing, run gws generate-skills to create it.
CODEBLOCK0
Helper Commands
Read values from a spreadsheet |
API Resources
spreadsheets
- batchUpdate — Applies one or more updates to the spreadsheet. Each request is validated before being applied. If any request is not valid then the entire request will fail and nothing will be applied. Some requests have replies to give you some information about how they are applied. The replies will mirror the requests. For example, if you applied 4 updates and the 3rd one had a reply, then the response will have 2 empty replies, the actual reply, and another empty reply, in that order.
- create — Creates a spreadsheet, returning the newly created spreadsheet.
- get — Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. By default, data within grids is not returned. You can include grid data in one of 2 ways: Specify a field mask listing your desired fields using the fields URL parameter in HTTP Set the includeGridData URL parameter to true.
- getByDataFilter — Returns the spreadsheet at the given ID. The caller must specify the spreadsheet ID. For more information, see Read, write, and search metadata. This method differs from GetSpreadsheet in that it allows selecting which subsets of spreadsheet data to return by specifying a dataFilters parameter. Multiple DataFilters can be specified.
- developerMetadata — Operations on the 'developerMetadata' resource
- sheets — Operations on the 'sheets' resource
- values — Operations on the 'values' resource
Discovering Commands
Before calling any API method, inspect it:
CODEBLOCK1
Use gws schema output to build your --params and --json flags.
sheets (v4)
前置条件: 请阅读 ../gws-shared/SKILL.md 了解认证、全局标志和安全规则。如果该文件缺失,请运行 gws generate-skills 创建。
bash
gws sheets <资源> <方法> [标志]
辅助命令
从电子表格读取值 |
API 资源
spreadsheets
- batchUpdate — 对电子表格应用一个或多个更新。每个请求在应用前都会经过验证。如果任何请求无效,则整个请求将失败,且不会应用任何更新。部分请求会返回回复,提供关于如何应用更新的信息。回复的顺序与请求顺序一致。例如,如果你应用了4个更新,且第3个更新有回复,则响应将按顺序包含2个空回复、实际回复和另一个空回复。
- create — 创建一个电子表格,并返回新创建的电子表格。
- get — 返回指定ID的电子表格。调用者必须指定电子表格ID。默认情况下,不返回网格内的数据。你可以通过以下两种方式之一包含网格数据: 在HTTP中使用fields URL参数指定字段掩码,列出所需字段 将includeGridData URL参数设置为true。
- getByDataFilter — 返回指定ID的电子表格。调用者必须指定电子表格ID。更多信息请参见读取、写入和搜索元数据。此方法与GetSpreadsheet的不同之处在于,它允许通过指定dataFilters参数来选择返回电子表格数据的哪些子集。可以指定多个DataFilter。
- developerMetadata — 对developerMetadata资源的操作
- sheets — 对sheets资源的操作
- values — 对values资源的操作
发现命令
在调用任何API方法之前,请先检查该方法:
bash
浏览资源和方法
gws sheets --help
检查方法的必需参数、类型和默认值
gws schema sheets.<资源>.<方法>
使用 gws schema 的输出来构建你的 --params 和 --json 标志。