Method: labels.publish

Publish all draft changes to the Label. Once published, the Label may not return to its draft state. See google.apps.drive.labels.v2.Lifecycle for more information.

Publishing a Label will result in a new published revision. All previous draft revisions will be deleted. Previous published revisions will be kept but are subject to automated deletion as needed.

Once published, some changes are no longer permitted. Generally, any change that would invalidate or cause new restrictions on existing metadata related to the Label will be rejected. For example, the following changes to a Label will be rejected after the Label is published: * The label cannot be directly deleted. It must be disabled first, then deleted. * Field.FieldType cannot be changed. * Changes to Field validation options cannot reject something that was previously accepted. * Reducing the max entries.

HTTP request

POST https://drivelabels.googleapis.com/v2beta/{name=labels/*}:publish

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. Label resource name.

Request body

The request body contains data with the following structure:

JSON representation
{
  "useAdminAccess": boolean,
  "writeControl": {
    object (WriteControl)
  },
  "languageCode": string
}
Fields
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.

writeControl

object (WriteControl)

Provides control over how write requests are executed. Defaults to unset, which means last write wins.

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.

Response body

If successful, the response body contains an instance of Label.

Authorization Scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/drive.labels
  • https://www.googleapis.com/auth/drive.labels.readonly
  • https://www.googleapis.com/auth/drive.admin.labels
  • https://www.googleapis.com/auth/drive.admin.labels.readonly

For more information, see the OAuth 2.0 Overview.