Method: labels.delta

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

string

Required. The resource name of the Label to update.

Request body

The request body contains data with the following structure:

JSON representation
{
  "writeControl": {
    object (WriteControl)
  },
  "requests": [
    {
      object (Request)
    }
  ],
  "useAdminAccess": boolean,
  "view": enum (LabelView),
  "languageCode": string
}
Fields
writeControl

object (WriteControl)

Provides control over how write requests are executed.

requests[]

object (Request)

A list of updates to apply to the Label. Requests will be applied in the order they are specified.

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.

view

enum (LabelView)

When specified, only certain fields belonging to the indicated view will be returned.

languageCode

string

The BCP-47 language code to use for evaluating localized Field labels when include_label_in_response is true.

Response body

Response for Label update.

If successful, the response body contains data with the following structure:

JSON representation
{
  "responses": [
    {
      object (Response)
    }
  ],
  "updatedLabel": {
    object (Label)
  }
}
Fields
responses[]

object (Response)

The reply of the updates. This maps 1:1 with the updates, although responses to some requests may be empty.

updatedLabel

object (Label)

The label after updates were applied. This is only set if [BatchUpdateLabelResponse2.include_label_in_response] is true and there were no errors.

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 kind can be only one of the following:
  "updateLabel": {
    object (UpdateLabelPropertiesRequest)
  },
  "createField": {
    object (CreateFieldRequest)
  },
  "updateField": {
    object (UpdateFieldPropertiesRequest)
  },
  "updateFieldType": {
    object (UpdateFieldTypeRequest)
  },
  "enableField": {
    object (EnableFieldRequest)
  },
  "disableField": {
    object (DisableFieldRequest)
  },
  "deleteField": {
    object (DeleteFieldRequest)
  },
  "createSelectionChoice": {
    object (CreateSelectionChoiceRequest)
  },
  "updateSelectionChoiceProperties": {
    object (UpdateSelectionChoicePropertiesRequest)
  },
  "enableSelectionChoice": {
    object (EnableSelectionChoiceRequest)
  },
  "disableSelectionChoice": {
    object (DisableSelectionChoiceRequest)
  },
  "deleteSelectionChoice": {
    object (DeleteSelectionChoiceRequest)
  }
  // End of list of possible types for union field kind.
}
Fields
Union field kind. The kind of update. Exactly one Field is required. kind can be only one of the following:
updateLabel

object (UpdateLabelPropertiesRequest)

Updates the Label properties.

createField

object (CreateFieldRequest)

Creates a new Field.

updateField

object (UpdateFieldPropertiesRequest)

Updates basic properties of a Field.

updateFieldType

object (UpdateFieldTypeRequest)

Update Field type and/or type options.

enableField

object (EnableFieldRequest)

Enables the Field.

disableField

object (DisableFieldRequest)

Disables the Field.

deleteField

object (DeleteFieldRequest)

Deletes a Field from the label.

createSelectionChoice

object (CreateSelectionChoiceRequest)

Creates Choice within a Selection field.

updateSelectionChoiceProperties

object (UpdateSelectionChoicePropertiesRequest)

Update a Choice properties within a Selection Field.

enableSelectionChoice

object (EnableSelectionChoiceRequest)

Enable a Choice within a Selection Field.

disableSelectionChoice

object (DisableSelectionChoiceRequest)

Disable a Choice within a Selection Field.

deleteSelectionChoice

object (DeleteSelectionChoiceRequest)

Delete a Choice within a Selection Field.

UpdateLabelPropertiesRequest

Updates basic properties of a Label.

JSON representation
{
  "updateMask": string,
  "properties": {
    object (Properties)
  }
}
Fields
updateMask

string (FieldMask format)

The fields that should be updated. At least one field must be specified. The root label_properties is implied and should not be specified. A single * can be used as short-hand for updating every field.

properties

object (Properties)

Required. Label properties to update.

CreateFieldRequest

Request to create a Field within a Label.

JSON representation
{
  "field": {
    object (Field)
  }
}
Fields
field

object (Field)

Required. Field to create.

UpdateFieldPropertiesRequest

Request to update Field properties.

JSON representation
{
  "updateMask": string,
  "id": string,
  "properties": {
    object (Properties)
  }
}
Fields
updateMask

string (FieldMask format)

The fields that should be updated. At least one field must be specified. The root properties is implied and should not be specified. A single * can be used as short-hand for updating every field.

id

string

Required. The Field to update.

properties

object (Properties)

Required. Basic Field properties.

UpdateFieldTypeRequest

Request to change the type of a Field.

JSON representation
{
  "updateMask": string,
  "id": string,

  // Union field type_options can be only one of the following:
  "textOptions": {
    object (TextOptions)
  },
  "longTextOptions": {
    object (LongTextOptions)
  },
  "integerOptions": {
    object (IntegerOptions)
  },
  "dateOptions": {
    object (DateOptions)
  },
  "selectionOptions": {
    object (SelectionOptions)
  },
  "userOptions": {
    object (UserOptions)
  }
  // End of list of possible types for union field type_options.
}
Fields
updateMask

string (FieldMask format)

The fields that should be updated. At least one field must be specified. The root of type_options is implied and should not be specified. A single * can be used as short-hand for updating every field.

id

string

Required. The Field to update.

Union field type_options.

type_options can be only one of the following:

textOptions

object (TextOptions)

Update field to Text.

longTextOptions

object (LongTextOptions)

Update field to Long Text.

integerOptions

object (IntegerOptions)

Update field to Integer.

dateOptions

object (DateOptions)

Update field to Date.

selectionOptions

object (SelectionOptions)

Update field to Selection.

userOptions

object (UserOptions)

Update field to User.

LongTextOptions

Options the Long Text field type.

JSON representation
{
  "minLength": integer,
  "maxLength": integer
}
Fields
minLength

integer

Output only. The minimum valid length of values for the text field.

maxLength

integer

Output only. The maximum valid length of values for the text field.

EnableFieldRequest

Request to enable the Field.

JSON representation
{
  "id": string
}
Fields
id

string

Required. ID of the Field to enable.

DisableFieldRequest

Request to disable the Field.

JSON representation
{
  "updateMask": string,
  "id": string,
  "disabledPolicy": {
    object (DisabledPolicy)
  }
}
Fields
updateMask

string (FieldMask 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 short-hand for updating every field.

id

string

Required. Key of the Field to disable.

disabledPolicy

object (DisabledPolicy)

Required. Field Disabled Policy.

DeleteFieldRequest

Request to delete the Field.

JSON representation
{
  "id": string
}
Fields
id

string

Required. ID of the Field to delete.

CreateSelectionChoiceRequest

Request to create a Selection Choice.

JSON representation
{
  "fieldId": string,
  "choice": {
    object (Choice)
  }
}
Fields
fieldId

string

Required. The Selection Field in which a Choice will be created.

choice

object (Choice)

Required. The Choice to create.

UpdateSelectionChoicePropertiesRequest

Request to update a Choice properties.

JSON representation
{
  "updateMask": string,
  "fieldId": string,
  "id": string,
  "properties": {
    object (Properties)
  }
}
Fields
updateMask

string (FieldMask format)

The fields that should be updated. At least one field must be specified. The root properties is implied and should not be specified. A single * can be used as short-hand for updating every field.

fieldId

string

Required. The Selection Field to update.

id

string

Required. The Choice to update.

properties

object (Properties)

Required. The Choice properties to update.

EnableSelectionChoiceRequest

Request to enable a Choice.

JSON representation
{
  "fieldId": string,
  "id": string
}
Fields
fieldId

string

Required. The Selection Field in which a Choice will be enabled.

id

string

Required. Choice to enable.

DisableSelectionChoiceRequest

Request to disable a Choice.

JSON representation
{
  "updateMask": string,
  "fieldId": string,
  "id": string,
  "disabledPolicy": {
    object (DisabledPolicy)
  }
}
Fields
updateMask

string (FieldMask 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 short-hand for updating every field.

fieldId

string

Required. The Selection Field in which a Choice will be disabled.

id

string

Required. Choice to disable.

disabledPolicy

object (DisabledPolicy)

Required. The disabled policy to update.

DeleteSelectionChoiceRequest

Request to delete a Choice.

JSON representation
{
  "fieldId": string,
  "id": string
}
Fields
fieldId

string

Required. The Selection Field from which a Choice will be deleted.

id

string

Required. Choice to delete.

Response

A single response from an update.

JSON representation
{

  // Union field response can be only one of the following:
  "updateLabel": {
    object (UpdateLabelPropertiesResponse)
  },
  "createField": {
    object (CreateFieldResponse)
  },
  "updateField": {
    object (UpdateFieldPropertiesResponse)
  },
  "updateFieldType": {
    object (UpdateFieldTypeResponse)
  },
  "enableField": {
    object (EnableFieldResponse)
  },
  "disableField": {
    object (DisableFieldResponse)
  },
  "deleteField": {
    object (DeleteFieldResponse)
  },
  "createSelectionChoice": {
    object (CreateSelectionChoiceResponse)
  },
  "updateSelectionChoiceProperties": {
    object (UpdateSelectionChoicePropertiesResponse)
  },
  "enableSelectionChoice": {
    object (EnableSelectionChoiceResponse)
  },
  "disableSelectionChoice": {
    object (DisableSelectionChoiceResponse)
  },
  "deleteSelectionChoice": {
    object (DeleteSelectionChoiceResponse)
  }
  // End of list of possible types for union field response.
}
Fields
Union field response. The response for the corresponding request. response can be only one of the following:
updateLabel

object (UpdateLabelPropertiesResponse)

Updated basic properties of a Label.

createField

object (CreateFieldResponse)

Creates a new Field.

updateField

object (UpdateFieldPropertiesResponse)

Updates basic properties of a Field.

updateFieldType

object (UpdateFieldTypeResponse)

Update Field type and/or type options.

enableField

object (EnableFieldResponse)

Enables Field.

disableField

object (DisableFieldResponse)

Disables Field.

deleteField

object (DeleteFieldResponse)

Deletes a Field from the label.

createSelectionChoice

object (CreateSelectionChoiceResponse)

Creates a new selection list option to add to a Selection Field.

updateSelectionChoiceProperties

object (UpdateSelectionChoicePropertiesResponse)

Updates a Choice within a Selection Field.

enableSelectionChoice

object (EnableSelectionChoiceResponse)

Enables a Choice within a Selection Field.

disableSelectionChoice

object (DisableSelectionChoiceResponse)

Disables a Choice within a Selection Field.

deleteSelectionChoice

object (DeleteSelectionChoiceResponse)

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

string

The field of the created field. When left blank in a create request, a key will be autogenerated and can be identified here.

priority

integer

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

integer

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

string

The server-generated id of the field.

id

string

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

integer

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.