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
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-05 (世界標準時間)。
[null,null,["上次更新時間: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)."]]