- HTTP 请求
- 路径参数
- 请求正文
- 响应正文
- 授权范围
- 请求
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- UpdateLabelPropertiesRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- CreateFieldRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- UpdateFieldPropertiesRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- UpdateFieldTypeRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- LongTextOptions
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- EnableFieldRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- DisableFieldRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- DeleteFieldRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- CreateSelectionChoiceRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- UpdateSelectionChoicePropertiesRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- EnableSelectionChoiceRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- DisableSelectionChoiceRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- DeleteSelectionChoiceRequest
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- 响应
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- UpdateLabelPropertiesResponse
- CreateFieldResponse
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- UpdateFieldPropertiesResponse
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- UpdateFieldTypeResponse
- EnableFieldResponse
- DisableFieldResponse
- DeleteFieldResponse
- CreateSelectionChoiceResponse
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- UpdateSelectionChoicePropertiesResponse
<ph type="x-smartling-placeholder">
- </ph>
- JSON 表示法
- EnableSelectionChoiceResponse
- DisableSelectionChoiceResponse
- DeleteSelectionChoiceResponse
- 试试看!
通过应用一组更新请求来更新单个标签,从而生成新的草稿修订版本。批量更新不做任何规定:如果任何更新请求无效,则系统不会应用任何更改。必须先发布生成的草稿修订版本,然后才能将这些更改用于云端硬盘内容。
HTTP 请求
POST https://drivelabels.googleapis.com/v2/{name=labels/*}:delta
网址采用 gRPC 转码语法。
路径参数
参数 | |
---|---|
name |
必需。要更新的标签的资源名称。 |
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
---|
{ "writeControl": { object ( |
字段 | |
---|---|
writeControl |
控制执行写入请求的方式。 |
requests[] |
要应用于标签的更新列表。请求将按照指定顺序进行应用。 |
useAdminAccess |
设置为 |
view |
指定后,系统只会返回属于指定视图的特定字段。 |
languageCode |
BCP-47 语言代码,用于在 |
响应正文
如果成功,响应正文将包含结构如下的数据:
对标签更新的响应。
JSON 表示法 |
---|
{ "responses": [ { object ( |
字段 | |
---|---|
responses[] |
对更新的回复。这映射为 1:1 的更新,但对某些请求的响应可能为空。 |
updatedLabel |
应用更新后的标签。仅当 [BatchUpdateLabelResponse2.include_label_in_response] 为 |
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/drive.labels
https://www.googleapis.com/auth/drive.admin.labels
有关详情,请参阅授权指南。
请求
要应用于标签的一种更新。
JSON 表示法 |
---|
{ // Union field |
字段 | |
---|---|
联合字段 kind 。更新的类型。仅需要一个字段。kind 只能是下列其中一项: |
|
updateLabel |
更新标签属性。 |
createField |
创建新字段。 |
updateField |
更新字段的基本属性。 |
updateFieldType |
更新了字段类型和/或类型选项。 |
enableField |
启用字段。 |
disableField |
停用字段。 |
deleteField |
从标签中删除字段。 |
createSelectionChoice |
在“选择”字段中创建选项。 |
updateSelectionChoiceProperties |
更新选择字段中的“选项”属性。 |
enableSelectionChoice |
启用选择字段中的选项。 |
disableSelectionChoice |
停用选择字段中的选项。 |
deleteSelectionChoice |
删除选择字段中的选项。 |
UpdateLabelPropertiesRequest
更新标签的基本属性。
JSON 表示法 |
---|
{
"updateMask": string,
"properties": {
object ( |
字段 | |
---|---|
updateMask |
应更新的字段。必须至少指定一个字段。根 |
properties |
必需。要更新的标签属性。 |
CreateFieldRequest
请求在标签内创建字段。
JSON 表示法 |
---|
{
"field": {
object ( |
字段 | |
---|---|
field |
必需。要创建的字段。 |
UpdateFieldPropertiesRequest
请求更新字段属性。
JSON 表示法 |
---|
{
"updateMask": string,
"id": string,
"properties": {
object ( |
字段 | |
---|---|
updateMask |
应更新的字段。必须至少指定一个字段。根 |
id |
必需。要更新的字段。 |
properties |
必需。基本字段属性。 |
UpdateFieldTypeRequest
请求更改字段类型。
JSON 表示法 |
---|
{ "updateMask": string, "id": string, // Union field |
字段 | |
---|---|
updateMask |
应更新的字段。必须至少指定一个字段。 |
id |
必需。要更新的字段。 |
联合字段
|
|
textOptions |
将字段更新为“文本”。 |
longTextOptions |
将字段更新为长文本。 |
integerOptions |
将字段更新为整数。 |
dateOptions |
将字段更新为日期。 |
selectionOptions |
将字段更新为“已选择”。 |
userOptions |
将字段更新为“用户”。 |
LongTextOptions
用于选择“Long Text”字段类型的选项。
JSON 表示法 |
---|
{ "minLength": integer, "maxLength": integer } |
字段 | |
---|---|
minLength |
仅限输出。文本字段值的最小有效长度。 |
maxLength |
仅限输出。文本字段的值的最大有效长度。 |
EnableFieldRequest
请求启用字段。
JSON 表示法 |
---|
{ "id": string } |
字段 | |
---|---|
id |
必需。要启用的字段的 ID。 |
DisableFieldRequest
请求停用字段。
JSON 表示法 |
---|
{
"updateMask": string,
"id": string,
"disabledPolicy": {
object ( |
字段 | |
---|---|
updateMask |
应更新的字段。必须至少指定一个字段。根 |
id |
必需。要停用的字段的键。 |
disabledPolicy |
必需。字段停用政策。 |
DeleteFieldRequest
请求删除字段。
JSON 表示法 |
---|
{ "id": string } |
字段 | |
---|---|
id |
必需。要删除的字段的 ID。 |
CreateSelectionChoiceRequest
请求创建选择选项。
JSON 表示法 |
---|
{
"fieldId": string,
"choice": {
object ( |
字段 | |
---|---|
fieldId |
必需。将在其中创建选项的选择字段。 |
choice |
必需。要创建的选择。 |
UpdateSelectionChoicePropertiesRequest
请求更新 Choice 属性。
JSON 表示法 |
---|
{
"updateMask": string,
"fieldId": string,
"id": string,
"properties": {
object ( |
字段 | |
---|---|
updateMask |
应更新的字段。必须至少指定一个字段。根 |
fieldId |
必需。要更新的选择字段。 |
id |
必需。要更新的选择。 |
properties |
必需。要更新的 Choice 属性。 |
EnableSelectionChoiceRequest
请求启用某个选项。
JSON 表示法 |
---|
{ "fieldId": string, "id": string } |
字段 | |
---|---|
fieldId |
必需。将会启用选项的选择字段。 |
id |
必需。选择启用的选项。 |
DisableSelectionChoiceRequest
请求停用某个选项。
JSON 表示法 |
---|
{
"updateMask": string,
"fieldId": string,
"id": string,
"disabledPolicy": {
object ( |
字段 | |
---|---|
updateMask |
应更新的字段。必须至少指定一个字段。根 |
fieldId |
必需。将停用选项的选择字段。 |
id |
必需。停用选项。 |
disabledPolicy |
必需。要更新的已停用政策。 |
DeleteSelectionChoiceRequest
请求删除选项。
JSON 表示法 |
---|
{ "fieldId": string, "id": string } |
字段 | |
---|---|
fieldId |
必需。要从中删除选项的选择字段。 |
id |
必需。删除选项。 |
响应
来自更新的单个响应。
JSON 表示法 |
---|
{ // Union field |
字段 | |
---|---|
联合字段 response 。相应请求的响应。response 只能是下列其中一项: |
|
updateLabel |
更新了标签的基本属性。 |
createField |
创建新字段。 |
updateField |
更新字段的基本属性。 |
updateFieldType |
更新了字段类型和/或类型选项。 |
enableField |
启用字段。 |
disableField |
停用字段。 |
deleteField |
从标签中删除字段。 |
createSelectionChoice |
创建新的选择列表选项,以添加到选择字段。 |
updateSelectionChoiceProperties |
更新选择字段中的选项。 |
enableSelectionChoice |
启用选择字段中的选项。 |
disableSelectionChoice |
停用选择字段中的选项。 |
deleteSelectionChoice |
从选择字段中删除选项。 |
UpdateLabelPropertiesResponse
对标签属性更新后的响应。
CreateFieldResponse
字段创建后的响应。
JSON 表示法 |
---|
{ "id": string, "priority": integer } |
字段 | |
---|---|
id |
所创建字段的字段。如果在创建请求中留空,系统会自动生成一个键,并可在此识别键。 |
priority |
所创建字段的优先级。优先级可能会与指定的优先级不同,以确保字段之间的优先级保持一致 (1-n)。 |
UpdateFieldPropertiesResponse
对字段属性更新后的响应。
JSON 表示法 |
---|
{ "priority": integer } |
字段 | |
---|---|
priority |
已更新字段的优先级。优先级可能会与指定的优先级不同,以确保字段之间的优先级保持一致 (1-n)。 |
UpdateFieldTypeResponse
对字段类型更新后的响应。
EnableFieldResponse
字段启用后面的响应。
DisableFieldResponse
字段后面的响应。
DeleteFieldResponse
删除字段后的响应。
CreateSelectionChoiceResponse
创建选择选项之后的回复。
JSON 表示法 |
---|
{ "fieldId": string, "id": string } |
字段 | |
---|---|
fieldId |
服务器生成的字段 ID。 |
id |
由服务器生成的 字段内所创建选项的 ID |
UpdateSelectionChoicePropertiesResponse
对“选择选项”属性更新后的响应。
JSON 表示法 |
---|
{ "priority": integer } |
字段 | |
---|---|
priority |
已更新选项的优先级。优先级可能会与指定的优先级不同,以确保选项之间的优先级连续 (1-n)。 |
EnableSelectionChoiceResponse
启用跟随选择的响应。
DisableSelectionChoiceResponse
停用跟随选项的响应。
DeleteSelectionChoiceResponse
删除选项后的响应。