Method: labels.disable
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
停用已发布的标签。如需了解详情,请参阅停用、启用和删除标签。
停用标签后,系统会根据当前已发布的修订版本生成新的已停用的已发布修订版本。如果存在草稿修订版本,系统会根据最新的草稿修订版本创建一个新的已停用的草稿修订版本。旧的草稿修订版本将被删除。
停用后,您可以使用 labels.delete
删除标签。
HTTP 请求
POST https://drivelabels.googleapis.com/v2/{name=labels/*}:disable
网址采用 gRPC 转码语法。
路径参数
参数 |
name |
string
必需。标签资源名称。
|
请求正文
请求正文中包含结构如下的数据:
JSON 表示法 |
{
"updateMask": string,
"useAdminAccess": boolean,
"writeControl": {
object (WriteControl )
},
"disabledPolicy": {
object (DisabledPolicy )
},
"languageCode": string
} |
字段 |
updateMask |
string (FieldMask format)
应更新的字段。必须至少指定一个字段。根 disabledPolicy 是隐含的,不应指定。单个 * 可用作更新每个字段的简写形式。
|
useAdminAccess |
boolean
设置为 true 以使用用户的管理员凭据。服务器会先验证用户是否是相应标签的管理员,然后再允许用户访问。
|
writeControl |
object (WriteControl )
提供对写入请求执行方式的控制。默认值为未设置,表示最后写入的内容会生效。
|
disabledPolicy |
object (DisabledPolicy )
要使用的已停用的政策。
|
languageCode |
string
用于评估本地化字段标签的 BCP-47 语言代码。如果未指定,则使用默认配置语言中的值。
|
响应正文
如果成功,则响应正文包含一个 Label
实例。
授权范围
需要以下 OAuth 范围之一:
https://www.googleapis.com/auth/drive.labels
https://www.googleapis.com/auth/drive.admin.labels
如需了解详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-05。
[null,null,["最后更新时间 (UTC):2025-08-05。"],[],[],null,["# Method: labels.disable\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nDisable a published label. For more information, see [Disable, enable, and delete a label](https://developers.google.com/workspace/drive/labels/guides/disable-delete-label).\n\nDisabling a label will result in a new disabled published revision based on the current published revision. If there's a draft revision, a new disabled draft revision will be created based on the latest draft revision. Older draft revisions will be deleted.\n\nOnce disabled, a label may be deleted with `labels.delete`.\n\n### HTTP request\n\n`POST https://drivelabels.googleapis.com/v2/{name=labels/*}:disable`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|--------|-----------------------------------------|\n| `name` | `string` Required. Label resource name. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"updateMask\": string, \"useAdminAccess\": boolean, \"writeControl\": { object (/workspace/drive/labels/reference/rest/v2/WriteControl) }, \"disabledPolicy\": { object (/workspace/drive/labels/reference/rest/v2/labels#DisabledPolicy) }, \"languageCode\": string } ``` |\n\n| Fields ||\n|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `updateMask` | `string (`[FieldMask](https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask)` format)` The fields that should be updated. At least one field must be specified. The root `disabledPolicy` is implied and should not be specified. A single `*` can be used as a short-hand for updating every field. |\n| `useAdminAccess` | `boolean` Set to `true` in order to use the user's admin credentials. The server will verify the user is an admin for the label before allowing access. |\n| `writeControl` | `object (`[WriteControl](/workspace/drive/labels/reference/rest/v2/WriteControl)`)` Provides control over how write requests are executed. Defaults to unset, which means the last write wins. |\n| `disabledPolicy` | `object (`[DisabledPolicy](/workspace/drive/labels/reference/rest/v2/labels#DisabledPolicy)`)` Disabled policy to use. |\n| `languageCode` | `string` The BCP-47 language code to use for evaluating localized field labels. When not specified, values in the default configured language will be used. |\n\n### Response body\n\nIf successful, the response body contains an instance of [Label](/workspace/drive/labels/reference/rest/v2/labels#Label).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/drive.labels`\n- `\n https://www.googleapis.com/auth/drive.admin.labels`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]