Method: labels.disable
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
公開済みのラベルを無効にします。詳細については、ラベルを無効化、有効化、削除するをご覧ください。
ラベルを無効にすると、現在の公開済みリビジョンに基づいて、新しい無効の公開済みリビジョンが作成されます。下書きリビジョンがある場合は、最新の下書きリビジョンに基づいて、新しい無効な下書きリビジョンが作成されます。古い下書きリビジョンは削除されます。
無効にすると、labels.delete
でラベルを削除できます。
HTTP リクエスト
POST https://drivelabels.googleapis.com/v2/{name=labels/*}:disable
この URL は gRPC Transcoding 構文を使用します。
パスパラメータ
パラメータ |
name |
string
必須。ラベル リソース名。
|
リクエストの本文
リクエストの本文には、次の構造のデータが含まれます。
JSON 表現 |
{
"updateMask": string,
"useAdminAccess": boolean,
"writeControl": {
object (WriteControl )
},
"disabledPolicy": {
object (DisabledPolicy )
},
"languageCode": string
} |
フィールド |
updateMask |
string (FieldMask format)
更新するフィールド。少なくとも 1 つのフィールドを指定する必要があります。ルート disabledPolicy は暗黙的に指定されるため、指定しないでください。1 つの * を使用して、すべてのフィールドを更新するショートハンドとして使用できます。
|
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)."]]