Method: labels.disable
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ปิดใช้ป้ายกำกับที่เผยแพร่ ดูข้อมูลเพิ่มเติมได้ที่ปิดใช้ เปิดใช้ และลบป้ายกำกับ
การปิดใช้ป้ายกำกับจะส่งผลให้มีการแก้ไขที่เผยแพร่ใหม่ที่ปิดใช้แล้วโดยอิงตามการแก้ไขที่เผยแพร่ในปัจจุบัน หากมีการแก้ไขฉบับร่าง ระบบจะสร้างการแก้ไขฉบับร่างที่ปิดใช้ใหม่โดยอิงตามการแก้ไขฉบับร่างล่าสุด ระบบจะลบการแก้ไขฉบับร่างที่เก่ากว่า
เมื่อปิดใช้แล้ว คุณจะลบป้ายกำกับได้ด้วย labels.delete
คำขอ HTTP
POST https://drivelabels.googleapis.com/v2/{name=labels/*}:disable
URL ใช้ไวยากรณ์การแปลงรหัส gRPC
พารามิเตอร์เส้นทาง
พารามิเตอร์ |
name |
string
ต้องระบุ ชื่อทรัพยากรของป้ายกำกับ
|
เนื้อความของคำขอ
เนื้อหาของคำขอมีข้อมูลซึ่งมีโครงสร้างดังต่อไปนี้
การแสดง JSON |
{
"updateMask": string,
"useAdminAccess": boolean,
"writeControl": {
object (WriteControl )
},
"disabledPolicy": {
object (DisabledPolicy )
},
"languageCode": string
} |
ช่อง |
updateMask |
string (FieldMask format)
ฟิลด์ที่ควรได้รับการอัปเดต ต้องระบุอย่างน้อย 1 ฟิลด์ ระบบจะถือว่ามีรูท 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 Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-05 UTC
[null,null,["อัปเดตล่าสุด 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)."]]