Method: labels.disable
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Tắt nhãn đã xuất bản. Để biết thêm thông tin, hãy xem bài viết Tắt, bật và xoá nhãn.
Việc vô hiệu hoá nhãn sẽ tạo ra một bản sửa đổi đã xuất bản mới bị vô hiệu hoá dựa trên bản sửa đổi đã xuất bản hiện tại. Nếu có bản sửa đổi nháp, thì một bản sửa đổi nháp mới bị vô hiệu hoá sẽ được tạo dựa trên bản sửa đổi nháp mới nhất. Các bản sửa đổi nháp cũ hơn sẽ bị xoá.
Sau khi tắt, bạn có thể xoá nhãn bằng biểu tượng labels.delete
.
Yêu cầu HTTP
POST https://drivelabels.googleapis.com/v2/{name=labels/*}:disable
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
name |
string
Bắt buộc. Tên tài nguyên nhãn.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"updateMask": string,
"useAdminAccess": boolean,
"writeControl": {
object (WriteControl )
},
"disabledPolicy": {
object (DisabledPolicy )
},
"languageCode": string
} |
Trường |
updateMask |
string (FieldMask format)
Các trường cần được cập nhật. Bạn phải chỉ định ít nhất một trường. disabledPolicy gốc được ngầm hiểu và không được chỉ định. Bạn có thể dùng một * duy nhất làm viết tắt để cập nhật mọi trường.
|
useAdminAccess |
boolean
Đặt thành true để sử dụng thông tin đăng nhập quản trị của người dùng. Máy chủ sẽ xác minh xem người dùng có phải là quản trị viên của nhãn hay không trước khi cho phép truy cập.
|
writeControl |
object (WriteControl )
Cho phép kiểm soát cách thực hiện các yêu cầu ghi. Mặc định là chưa đặt, tức là lượt ghi sau cùng sẽ được chọn.
|
disabledPolicy |
object (DisabledPolicy )
Chính sách bị vô hiệu hoá để sử dụng.
|
languageCode |
string
Mã ngôn ngữ BCP-47 dùng để đánh giá nhãn trường được bản địa hoá. Khi không được chỉ định, các giá trị bằng ngôn ngữ được thiết lập mặc định sẽ được sử dụng.
|
Nội dung phản hồi
Nếu thành công, nội dung phản hồi sẽ chứa một phiên bản của Label
.
Phạm vi uỷ quyền
Yêu cầu một trong các phạm vi OAuth sau:
https://www.googleapis.com/auth/drive.labels
https://www.googleapis.com/auth/drive.admin.labels
Để biết thêm thông tin, hãy xem Hướng dẫn uỷ quyền.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-08-05 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-05 UTC."],[],[],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)."]]