drivelabels

package
v0.293.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: BSD-3-Clause Imports: 18 Imported by: 4

Documentation

Overview

Package drivelabels provides access to the Drive Labels API.

For product documentation, see: https://developers.google.com/workspace/drive/labels

Library status

These client libraries are officially supported by Google. However, this library is considered complete and is in maintenance mode. This means that we will address critical bugs and security issues but will not add any new features.

When possible, we recommend using our newer [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go) that are still actively being worked and iterated on.

Creating a client

Usage example:

import "google.golang.org/api/drivelabels/v2"
...
ctx := context.Background()
drivelabelsService, err := drivelabels.NewService(ctx)

In this example, Google Application Default Credentials are used for authentication. For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.

Other authentication options

By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use google.golang.org/api/option.WithScopes:

drivelabelsService, err := drivelabels.NewService(ctx, option.WithScopes(drivelabels.DriveLabelsReadonlyScope))

To use an API key for authentication (note: some APIs do not support API keys), use google.golang.org/api/option.WithAPIKey:

drivelabelsService, err := drivelabels.NewService(ctx, option.WithAPIKey("AIza..."))

To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow, use google.golang.org/api/option.WithTokenSource:

config := &oauth2.Config{...}
// ...
token, err := config.Exchange(ctx, ...)
drivelabelsService, err := drivelabels.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))

See google.golang.org/api/option.ClientOption for details on options.

Index

Constants

View Source
const (
	// See, edit, create, and delete all Google Drive labels in your organization,
	// and see your organization's label-related admin policies
	DriveAdminLabelsScope = "https://www.googleapis.com/auth/drive.admin.labels"

	// See all Google Drive labels and label-related admin policies in your
	// organization
	DriveAdminLabelsReadonlyScope = "https://www.googleapis.com/auth/drive.admin.labels.readonly"

	// See, edit, create, and delete your Google Drive labels
	DriveLabelsScope = "https://www.googleapis.com/auth/drive.labels"

	// See your Google Drive labels
	DriveLabelsReadonlyScope = "https://www.googleapis.com/auth/drive.labels.readonly"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoogleAppsDriveLabelsV2BadgeColors

type GoogleAppsDriveLabelsV2BadgeColors struct {
	// BackgroundColor: Output only. Badge background that pairs with the
	// foreground.
	BackgroundColor *GoogleTypeColor `json:"backgroundColor,omitempty"`
	// ForegroundColor: Output only. Badge foreground that pairs with the
	// background.
	ForegroundColor *GoogleTypeColor `json:"foregroundColor,omitempty"`
	// SoloColor: Output only. Color that can be used for text without a
	// background.
	SoloColor *GoogleTypeColor `json:"soloColor,omitempty"`
	// ForceSendFields is a list of field names (e.g. "BackgroundColor") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "BackgroundColor") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2BadgeColors: The color derived from BadgeConfig and changed to the closest recommended supported color.

func (GoogleAppsDriveLabelsV2BadgeColors) MarshalJSON

func (s GoogleAppsDriveLabelsV2BadgeColors) MarshalJSON() ([]byte, error)

type GoogleAppsDriveLabelsV2BadgeConfig

type GoogleAppsDriveLabelsV2BadgeConfig struct {
	// Color: The color of the badge. When not specified, no badge is rendered. The
	// background, foreground, and solo (light and dark mode) colors set here are
	// changed in the Drive UI into the closest recommended supported color.
	Color *GoogleTypeColor `json:"color,omitempty"`
	// PriorityOverride: Override the default global priority of this badge. When
	// set to 0, the default priority heuristic is used.
	PriorityOverride int64 `json:"priorityOverride,omitempty,string"`
	// ForceSendFields is a list of field names (e.g. "Color") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Color") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2BadgeConfig: Badge status of the label.

func (GoogleAppsDriveLabelsV2BadgeConfig) MarshalJSON

func (s GoogleAppsDriveLabelsV2BadgeConfig) MarshalJSON() ([]byte, error)

type GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest added in v0.112.0

type GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest struct {
	// Requests: Required. The request message specifying the resources to update.
	Requests []*GoogleAppsDriveLabelsV2DeleteLabelPermissionRequest `json:"requests,omitempty"`
	// UseAdminAccess: 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. If this is set, the `use_admin_access` field in the
	// `DeleteLabelPermissionRequest` messages must either be empty or match this
	// field.
	UseAdminAccess bool `json:"useAdminAccess,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Requests") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Requests") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest: Deletes one or more label permissions.

func (GoogleAppsDriveLabelsV2BatchDeleteLabelPermissionsRequest) MarshalJSON added in v0.112.0

type GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest added in v0.112.0

type GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest struct {
	// Requests: Required. The request message specifying the resources to update.
	Requests []*GoogleAppsDriveLabelsV2UpdateLabelPermissionRequest `json:"requests,omitempty"`
	// UseAdminAccess: 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. If this is set, the `use_admin_access` field in the
	// `UpdateLabelPermissionRequest` messages must either be empty or match this
	// field.
	UseAdminAccess bool `json:"useAdminAccess,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Requests") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Requests") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest: Updates one or more label permissions.

func (GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsRequest) MarshalJSON added in v0.112.0

type GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse added in v0.112.0

type GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse struct {
	// Permissions: Required. Permissions updated.
	Permissions []*GoogleAppsDriveLabelsV2LabelPermission `json:"permissions,omitempty"`

	// ServerResponse contains the HTTP response code and headers from the server.
	googleapi.ServerResponse `json:"-"`
	// ForceSendFields is a list of field names (e.g. "Permissions") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Permissions") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse: Response for updating one or more label permissions.

func (GoogleAppsDriveLabelsV2BatchUpdateLabelPermissionsResponse) MarshalJSON added in v0.112.0

type GoogleAppsDriveLabelsV2DateLimits added in v0.112.0

type GoogleAppsDriveLabelsV2DateLimits struct {
	// MaxValue: Maximum value for the date field type.
	MaxValue *GoogleTypeDate `json:"maxValue,omitempty"`
	// MinValue: Minimum value for the date field type.
	MinValue *GoogleTypeDate `json:"minValue,omitempty"`
	// ForceSendFields is a list of field names (e.g. "MaxValue") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "MaxValue") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2DateLimits: Limits for date field type.

func (GoogleAppsDriveLabelsV2DateLimits) MarshalJSON added in v0.112.0

func (s GoogleAppsDriveLabelsV2DateLimits) MarshalJSON() ([]byte, error)

type GoogleAppsDriveLabelsV2DeleteLabelPermissionRequest added in v0.112.0

type GoogleAppsDriveLabelsV2DeleteLabelPermissionRequest struct {
	// Name: Required. Label permission resource name.
	Name string `json:"name,omitempty"`
	// UseAdminAccess: 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.
	UseAdminAccess bool `json:"useAdminAccess,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Name") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Name") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2DeleteLabelPermissionRequest: Deletes a label permission. Permissions affect the label resource as a whole, aren't revisioned, and don't require publishing.

func (GoogleAppsDriveLabelsV2DeleteLabelPermissionRequest) MarshalJSON added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest struct {
	// LanguageCode: The BCP-47 language code to use for evaluating localized field
	// labels when `include_label_in_response` is `true`.
	LanguageCode string `json:"languageCode,omitempty"`
	// Requests: A list of updates to apply to the label. Requests will be applied
	// in the order they are specified.
	Requests []*GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestRequest `json:"requests,omitempty"`
	// UseAdminAccess: 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.
	UseAdminAccess bool `json:"useAdminAccess,omitempty"`
	// View: When specified, only certain fields belonging to the indicated view
	// will be returned.
	//
	// Possible values:
	//   "LABEL_VIEW_BASIC" - Implies the field mask:
	// `name,id,revision_id,label_type,properties.*`
	//   "LABEL_VIEW_FULL" - All possible fields.
	View string `json:"view,omitempty"`
	// WriteControl: Provides control over how write requests are executed.
	WriteControl *GoogleAppsDriveLabelsV2WriteControl `json:"writeControl,omitempty"`
	// ForceSendFields is a list of field names (e.g. "LanguageCode") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "LanguageCode") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest: The set of requests for updating aspects of a label. If any request isn't valid, no requests will be applied.

func (GoogleAppsDriveLabelsV2DeltaUpdateLabelRequest) MarshalJSON added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateFieldRequest added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateFieldRequest struct {
	// Field: Required. Field to create.
	Field *GoogleAppsDriveLabelsV2Field `json:"field,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Field") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Field") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateFieldRequest: Request to create a field within a label.

func (GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateFieldRequest) MarshalJSON added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateSelectionChoiceRequest added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateSelectionChoiceRequest struct {
	// Choice: Required. The choice to create.
	Choice *GoogleAppsDriveLabelsV2FieldSelectionOptionsChoice `json:"choice,omitempty"`
	// FieldId: Required. The selection field in which a choice will be created.
	FieldId string `json:"fieldId,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Choice") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Choice") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateSelectionChoiceRequest: Request to create a selection choice.

func (GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestCreateSelectionChoiceRequest) MarshalJSON added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteFieldRequest added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteFieldRequest struct {
	// Id: Required. ID of the field to delete.
	Id string `json:"id,omitempty"`
	// ForceSendFields is a list of field names (e.g. "Id") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "Id") to include in API requests
	// with the JSON null value. By default, fields with empty values are omitted
	// from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteFieldRequest: Request to delete the field.

func (GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteFieldRequest) MarshalJSON added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteSelectionChoiceRequest added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteSelectionChoiceRequest struct {
	// FieldId: Required. The selection field from which a choice will be deleted.
	FieldId string `json:"fieldId,omitempty"`
	// Id: Required. Choice to delete.
	Id string `json:"id,omitempty"`
	// ForceSendFields is a list of field names (e.g. "FieldId") to unconditionally
	// include in API requests. By default, fields with empty or default values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "FieldId") to include in API
	// requests with the JSON null value. By default, fields with empty values are
	// omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteSelectionChoiceRequest: Request to delete a choice.

func (GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDeleteSelectionChoiceRequest) MarshalJSON added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableFieldRequest added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableFieldRequest struct {
	// DisabledPolicy: Required. Field disabled policy.
	DisabledPolicy *GoogleAppsDriveLabelsV2LifecycleDisabledPolicy `json:"disabledPolicy,omitempty"`
	// Id: Required. Key of the field to disable.
	Id string `json:"id,omitempty"`
	// UpdateMask: The fields that should be updated. At least one field must be
	// specified. The root `disabled_policy` is implied and should not be
	// specified. A single `*` can be used as a short-hand for updating every
	// field.
	UpdateMask string `json:"updateMask,omitempty"`
	// ForceSendFields is a list of field names (e.g. "DisabledPolicy") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "DisabledPolicy") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableFieldRequest: Request to disable the field.

func (GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableFieldRequest) MarshalJSON added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableSelectionChoiceRequest added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableSelectionChoiceRequest struct {
	// DisabledPolicy: Required. The disabled policy to update.
	DisabledPolicy *GoogleAppsDriveLabelsV2LifecycleDisabledPolicy `json:"disabledPolicy,omitempty"`
	// FieldId: Required. The selection field in which a choice will be disabled.
	FieldId string `json:"fieldId,omitempty"`
	// Id: Required. Choice to disable.
	Id string `json:"id,omitempty"`
	// UpdateMask: The fields that should be updated. At least one field must be
	// specified. The root `disabled_policy` is implied and should not be
	// specified. A single `*` can be used as a short-hand for updating every
	// field.
	UpdateMask string `json:"updateMask,omitempty"`
	// ForceSendFields is a list of field names (e.g. "DisabledPolicy") to
	// unconditionally include in API requests. By default, fields with empty or
	// default values are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
	// details.
	ForceSendFields []string `json:"-"`
	// NullFields is a list of field names (e.g. "DisabledPolicy") to include in
	// API requests with the JSON null value. By default, fields with empty values
	// are omitted from API requests. See
	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
	NullFields []string `json:"-"`
}

GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableSelectionChoiceRequest: Request to disable a choice.

func (GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestDisableSelectionChoiceRequest) MarshalJSON added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableFieldRequest added in v0.112.0

type GoogleAppsDriveLabelsV2DeltaUpdateLabelRequestEnableFieldRequest struct {
	// Id: Required. ID of the field to enable.
	Id