- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- Request
- UpdateLabelPropertiesRequest
- CreateFieldRequest
- UpdateFieldPropertiesRequest
- UpdateFieldTypeRequest
- LongTextOptions
- EnableFieldRequest
- DisableFieldRequest
- DeleteFieldRequest
- CreateSelectionChoiceRequest
- UpdateSelectionChoicePropertiesRequest
- EnableSelectionChoiceRequest
- DisableSelectionChoiceRequest
- DeleteSelectionChoiceRequest
- Response
- UpdateLabelPropertiesResponse
- CreateFieldResponse
- UpdateFieldPropertiesResponse
- UpdateFieldTypeResponse
- EnableFieldResponse
- DisableFieldResponse
- DeleteFieldResponse
- CreateSelectionChoiceResponse
- UpdateSelectionChoicePropertiesResponse
- EnableSelectionChoiceResponse
- DisableSelectionChoiceResponse
- DeleteSelectionChoiceResponse
- Try it!
Updates a single Label by applying a set of update requests resulting in a new draft revision. The batch update is all-or-nothing: If any of the update requests are invalid, no changes are applied. The resulting draft revision must be published before the changes may be used with Drive Items.
HTTP request
POST https://drivelabels.googleapis.com/v2/{name=labels/*}:delta
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
name |
Required. The resource name of the Label to update. |
Request body
The request body contains data with the following structure:
JSON representation |
---|
{ "writeControl": { object ( |
Fields | |
---|---|
writeControl |
Provides control over how write requests are executed. |
requests[] |
A list of updates to apply to the Label. Requests will be applied in the order they are specified. |
useAdminAccess |
Set to |
view |
When specified, only certain fields belonging to the indicated view will be returned. |
languageCode |
The BCP-47 language code to use for evaluating localized Field labels when |
Response body
Response for Label update.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{ "responses": [ { object ( |
Fields | |
---|---|
responses[] |
The reply of the updates. This maps 1:1 with the updates, although responses to some requests may be empty. |
updatedLabel |
The label after updates were applied. This is only set if [BatchUpdateLabelResponse2.include_label_in_response] is |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/drive.labels
https://www.googleapis.com/auth/drive.admin.labels
For more information, see the Authorization guide.
Request
A single kind of update to apply to a Label.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field kind . The kind of update. Exactly one Field is required. kind can be only one of the following: |
|
updateLabel |
Updates the Label properties. |
createField |
Creates a new Field. |
updateField |
Updates basic properties of a Field. |
updateFieldType |
Update Field type and/or type options. |
enableField |
Enables the Field. |
disableField |
Disables the Field. |
deleteField |
Deletes a Field from the label. |
createSelectionChoice |
Creates Choice within a Selection field. |
updateSelectionChoiceProperties |
Update a Choice properties within a Selection Field. |
enableSelectionChoice |
Enable a Choice within a Selection Field. |
disableSelectionChoice |
Disable a Choice within a Selection Field. |
deleteSelectionChoice |
Delete a Choice within a Selection Field. |
UpdateLabelPropertiesRequest
Updates basic properties of a Label.
JSON representation |
---|
{
"updateMask": string,
"properties": {
object ( |
Fields | |
---|---|
updateMask |
The fields that should be updated. At least one field must be specified. The root |
properties |
Required. Label properties to update. |
CreateFieldRequest
Request to create a Field within a Label.
JSON representation |
---|
{
"field": {
object ( |
Fields | |
---|---|
field |
Required. Field to create. |
UpdateFieldPropertiesRequest
Request to update Field properties.
JSON representation |
---|
{
"updateMask": string,
"id": string,
"properties": {
object ( |
Fields | |
---|---|
updateMask |
The fields that should be updated. At least one field must be specified. The root |
id |
Required. The Field to update. |
properties |
Required. Basic Field properties. |
UpdateFieldTypeRequest
Request to change the type of a Field.
JSON representation |
---|
{ "updateMask": string, "id": string, // Union field |
Fields | |
---|---|
updateMask |
The fields that should be updated. At least one field must be specified. The root of |
id |
Required. The Field to update. |
Union field
|
|
textOptions |
Update field to Text. |
longTextOptions |
Update field to Long Text. |
integerOptions |
Update field to Integer. |
dateOptions |
Update field to Date. |
selectionOptions |
Update field to Selection. |
userOptions |
Update field to User. |
LongTextOptions
Options the Long Text field type.
JSON representation |
---|
{ "minLength": integer, "maxLength": integer } |
Fields | |
---|---|
minLength |
Output only. The minimum valid length of values for the text field. |
maxLength |
Output only. The maximum valid length of values for the text field. |
EnableFieldRequest
Request to enable the Field.
JSON representation |
---|
{ "id": string } |
Fields | |
---|---|
id |
Required. ID of the Field to enable. |
DisableFieldRequest
Request to disable the Field.
JSON representation |
---|
{
"updateMask": string,
"id": string,
"disabledPolicy": {
object ( |
Fields | |
---|---|
updateMask |
The fields that should be updated. At least one field must be specified. The root |
id |
Required. Key of the Field to disable. |
disabledPolicy |
Required. Field Disabled Policy. |
DeleteFieldRequest
Request to delete the Field.
JSON representation |
---|
{ "id": string } |
Fields | |
---|---|
id |
Required. ID of the Field to delete. |
CreateSelectionChoiceRequest
Request to create a Selection Choice.
JSON representation |
---|
{
"fieldId": string,
"choice": {
object ( |
Fields | |
---|---|
fieldId |
Required. The Selection Field in which a Choice will be created. |
choice |
Required. The Choice to create. |
UpdateSelectionChoicePropertiesRequest
Request to update a Choice properties.
JSON representation |
---|
{
"updateMask": string,
"fieldId": string,
"id": string,
"properties": {
object ( |
Fields | |
---|---|
updateMask |
The fields that should be updated. At least one field must be specified. The root |
fieldId |
Required. The Selection Field to update. |
id |
Required. The Choice to update. |
properties |
Required. The Choice properties to update. |
EnableSelectionChoiceRequest
Request to enable a Choice.
JSON representation |
---|
{ "fieldId": string, "id": string } |
Fields | |
---|---|
fieldId |
Required. The Selection Field in which a Choice will be enabled. |
id |
Required. Choice to enable. |
DisableSelectionChoiceRequest
Request to disable a Choice.
JSON representation |
---|
{
"updateMask": string,
"fieldId": string,
"id": string,
"disabledPolicy": {
object ( |
Fields | |
---|---|
updateMask |
The fields that should be updated. At least one field must be specified. The root |
fieldId |
Required. The Selection Field in which a Choice will be disabled. |
id |
Required. Choice to disable. |
disabledPolicy |
Required. The disabled policy to update. |
DeleteSelectionChoiceRequest
Request to delete a Choice.
JSON representation |
---|
{ "fieldId": string, "id": string } |
Fields | |
---|---|
fieldId |
Required. The Selection Field from which a Choice will be deleted. |
id |
Required. Choice to delete. |
Response
A single response from an update.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field response . The response for the corresponding request. response can be only one of the following: |
|
updateLabel |
Updated basic properties of a Label. |
createField |
Creates a new Field. |
updateField |
Updates basic properties of a Field. |
updateFieldType |
Update Field type and/or type options. |
enableField |
Enables Field. |
disableField |
Disables Field. |
deleteField |
Deletes a Field from the label. |
createSelectionChoice |
Creates a new selection list option to add to a Selection Field. |
updateSelectionChoiceProperties |
Updates a Choice within a Selection Field. |
enableSelectionChoice |
Enables a Choice within a Selection Field. |
disableSelectionChoice |
Disables a Choice within a Selection Field. |
deleteSelectionChoice |
Deletes a Choice from a Selection Field. |
UpdateLabelPropertiesResponse
This type has no fields.
Response following update to Label properties.
CreateFieldResponse
Response following Field create.
JSON representation |
---|
{ "id": string, "priority": integer } |
Fields | |
---|---|
id |
The field of the created field. When left blank in a create request, a key will be autogenerated and can be identified here. |
priority |
The priority of the created field. The priority may change from what was specified to assure contiguous priorities between fields (1-n). |
UpdateFieldPropertiesResponse
Response following update to Field properties.
JSON representation |
---|
{ "priority": integer } |
Fields | |
---|---|
priority |
The priority of the updated field. The priority may change from what was specified to assure contiguous priorities between fields (1-n). |
UpdateFieldTypeResponse
This type has no fields.
Response following update to Field type.
EnableFieldResponse
This type has no fields.
Response following Field enable.
DisableFieldResponse
This type has no fields.
Response following Field disable.
DeleteFieldResponse
This type has no fields.
Response following Field delete.
CreateSelectionChoiceResponse
Response following Selection Choice create.
JSON representation |
---|
{ "fieldId": string, "id": string } |
Fields | |
---|---|
fieldId |
The server-generated id of the field. |
id |
The server-generated ID of the created choice within the Field |
UpdateSelectionChoicePropertiesResponse
Response following update to Selection Choice properties.
JSON representation |
---|
{ "priority": integer } |
Fields | |
---|---|
priority |
The priority of the updated choice. The priority may change from what was specified to assure contiguous priorities between choices (1-n). |
EnableSelectionChoiceResponse
This type has no fields.
Response following Choice enable.
DisableSelectionChoiceResponse
This type has no fields.
Response following Choice disable.
DeleteSelectionChoiceResponse
This type has no fields.
Response following Choice delete.