Movatterモバイル変換


[0]ホーム

URL:


drive

package
v0.257.0Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2025 License:BSD-3-ClauseImports:18Imported by:895

Details

Repository

github.com/googleapis/google-api-go-client

Links

Documentation

Overview

Package drive provides access to the Google Drive API.

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

Library status

These client libraries are officially supported by Google. However, thislibrary is considered complete and is in maintenance mode. This meansthat we will address critical bugs and security issues but will not addany 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/drive/v3"...ctx := context.Background()driveService, err := drive.NewService(ctx)

In this example, Google Application Default Credentials are used forauthentication. For information on how to create and obtain ApplicationDefault Credentials, seehttps://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, usegoogle.golang.org/api/option.WithScopes:

driveService, err := drive.NewService(ctx, option.WithScopes(drive.DriveScriptsScope))

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

driveService, err := drive.NewService(ctx, option.WithAPIKey("AIza..."))

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

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

Seegoogle.golang.org/api/option.ClientOption for details on options.

Index

Constants

View Source
const (// See, edit, create, and delete all of your Google Drive filesDriveScope = "https://www.googleapis.com/auth/drive"// See, create, and delete its own configuration data in your Google DriveDriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata"// View your Google Drive appsDriveAppsReadonlyScope = "https://www.googleapis.com/auth/drive.apps.readonly"// See, edit, create, and delete only the specific Google Drive files you use// with this appDriveFileScope = "https://www.googleapis.com/auth/drive.file"// See and download your Google Drive files that were created or edited by// Google Meet.DriveMeetReadonlyScope = "https://www.googleapis.com/auth/drive.meet.readonly"// View and manage metadata of files in your Google DriveDriveMetadataScope = "https://www.googleapis.com/auth/drive.metadata"// See information about your Google Drive filesDriveMetadataReadonlyScope = "https://www.googleapis.com/auth/drive.metadata.readonly"// View the photos, videos and albums in your Google PhotosDrivePhotosReadonlyScope = "https://www.googleapis.com/auth/drive.photos.readonly"// See and download all your Google Drive filesDriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly"// Modify your Google Apps Script scripts' behaviorDriveScriptsScope = "https://www.googleapis.com/auth/drive.scripts")

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

typeAbout

type About struct {// AppInstalled: Whether the user has installed the requesting app.AppInstalledbool `json:"appInstalled,omitempty"`// CanCreateDrives: Whether the user can create shared drives.CanCreateDrivesbool `json:"canCreateDrives,omitempty"`// CanCreateTeamDrives: Deprecated: Use `canCreateDrives` instead.CanCreateTeamDrivesbool `json:"canCreateTeamDrives,omitempty"`// DriveThemes: A list of themes that are supported for shared drives.DriveThemes []*AboutDriveThemes `json:"driveThemes,omitempty"`// ExportFormats: A map of source MIME type to possible targets for all// supported exports.ExportFormats map[string][]string `json:"exportFormats,omitempty"`// FolderColorPalette: The currently supported folder colors as RGB hex// strings.FolderColorPalette []string `json:"folderColorPalette,omitempty"`// ImportFormats: A map of source MIME type to possible targets for all// supported imports.ImportFormats map[string][]string `json:"importFormats,omitempty"`// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#about".Kindstring `json:"kind,omitempty"`// MaxImportSizes: A map of maximum import sizes by MIME type, in bytes.MaxImportSizes map[string]string `json:"maxImportSizes,omitempty"`// MaxUploadSize: The maximum upload size in bytes.MaxUploadSizeint64 `json:"maxUploadSize,omitempty,string"`// StorageQuota: The user's storage quota limits and usage. For users that are// part of an organization with pooled storage, information about the limit and// usage across all services is for the organization, rather than the// individual user. All fields are measured in bytes.StorageQuota *AboutStorageQuota `json:"storageQuota,omitempty"`// TeamDriveThemes: Deprecated: Use `driveThemes` instead.TeamDriveThemes []*AboutTeamDriveThemes `json:"teamDriveThemes,omitempty"`// User: The authenticated user.User *User `json:"user,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "AppInstalled") 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. "AppInstalled") 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:"-"`}

About: Information about the user, the user's Drive, and systemcapabilities.

func (About)MarshalJSON

func (sAbout) MarshalJSON() ([]byte,error)

typeAboutDriveThemesadded inv0.4.0

type AboutDriveThemes struct {// BackgroundImageLink: A link to this theme's background image.BackgroundImageLinkstring `json:"backgroundImageLink,omitempty"`// ColorRgb: The color of this theme as an RGB hex string.ColorRgbstring `json:"colorRgb,omitempty"`// Id: The ID of the theme.Idstring `json:"id,omitempty"`// ForceSendFields is a list of field names (e.g. "BackgroundImageLink") 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. "BackgroundImageLink") 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:"-"`}

func (AboutDriveThemes)MarshalJSONadded inv0.4.0

func (sAboutDriveThemes) MarshalJSON() ([]byte,error)

typeAboutGetCall

type AboutGetCall struct {// contains filtered or unexported fields}

func (*AboutGetCall)Context

func (c *AboutGetCall) Context(ctxcontext.Context) *AboutGetCall

Context sets the context to be used in this call's Do method.

func (*AboutGetCall)Do

func (c *AboutGetCall) Do(opts ...googleapi.CallOption) (*About,error)

Do executes the "drive.about.get" call.Any non-2xx status code is an error. Response headers are in either*About.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*AboutGetCall)Fields

func (c *AboutGetCall) Fields(s ...googleapi.Field) *AboutGetCall

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*AboutGetCall)Header

func (c *AboutGetCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*AboutGetCall)IfNoneMatch

func (c *AboutGetCall) IfNoneMatch(entityTagstring) *AboutGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

typeAboutService

type AboutService struct {// contains filtered or unexported fields}

funcNewAboutService

func NewAboutService(s *Service) *AboutService

func (*AboutService)Get

func (r *AboutService) Get() *AboutGetCall

Get: Gets information about the user, the user's Drive, and systemcapabilities. For more information, see Return user info(https://developers.google.com/workspace/drive/api/guides/user-info).Required: The `fields` parameter must be set. To return the exact fields youneed, see Return specific fields(https://developers.google.com/workspace/drive/api/guides/fields-parameter).

typeAboutStorageQuota

type AboutStorageQuota struct {// Limit: The usage limit, if applicable. This will not be present if the user// has unlimited storage. For users that are part of an organization with// pooled storage, this is the limit for the organization, rather than the// individual user.Limitint64 `json:"limit,omitempty,string"`// Usage: The total usage across all services. For users that are part of an// organization with pooled storage, this is the usage across all services for// the organization, rather than the individual user.Usageint64 `json:"usage,omitempty,string"`// UsageInDrive: The usage by all files in Google Drive.UsageInDriveint64 `json:"usageInDrive,omitempty,string"`// UsageInDriveTrash: The usage by trashed files in Google Drive.UsageInDriveTrashint64 `json:"usageInDriveTrash,omitempty,string"`// ForceSendFields is a list of field names (e.g. "Limit") 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. "Limit") 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:"-"`}

AboutStorageQuota: The user's storage quota limits and usage. For users thatare part of an organization with pooled storage, information about the limitand usage across all services is for the organization, rather than theindividual user. All fields are measured in bytes.

func (AboutStorageQuota)MarshalJSON

func (sAboutStorageQuota) MarshalJSON() ([]byte,error)

typeAboutTeamDriveThemes

type AboutTeamDriveThemes struct {// BackgroundImageLink: Deprecated: Use `driveThemes/backgroundImageLink`// instead.BackgroundImageLinkstring `json:"backgroundImageLink,omitempty"`// ColorRgb: Deprecated: Use `driveThemes/colorRgb` instead.ColorRgbstring `json:"colorRgb,omitempty"`// Id: Deprecated: Use `driveThemes/id` instead.Idstring `json:"id,omitempty"`// ForceSendFields is a list of field names (e.g. "BackgroundImageLink") 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. "BackgroundImageLink") 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:"-"`}

func (AboutTeamDriveThemes)MarshalJSON

func (sAboutTeamDriveThemes) MarshalJSON() ([]byte,error)

typeAccessProposaladded inv0.201.0

type AccessProposal struct {// CreateTime: The creation time.CreateTimestring `json:"createTime,omitempty"`// FileId: The file ID that the proposal for access is on.FileIdstring `json:"fileId,omitempty"`// ProposalId: The ID of the access proposal.ProposalIdstring `json:"proposalId,omitempty"`// RecipientEmailAddress: The email address of the user that will receive// permissions, if accepted.RecipientEmailAddressstring `json:"recipientEmailAddress,omitempty"`// RequestMessage: The message that the requester added to the proposal.RequestMessagestring `json:"requestMessage,omitempty"`// RequesterEmailAddress: The email address of the requesting user.RequesterEmailAddressstring `json:"requesterEmailAddress,omitempty"`// RolesAndViews: A wrapper for the role and view of an access proposal. For// more information, see Roles and permissions// (https://developers.google.com/workspace/drive/api/guides/ref-roles).RolesAndViews []*AccessProposalRoleAndView `json:"rolesAndViews,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "CreateTime") 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. "CreateTime") 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:"-"`}

AccessProposal: Manage outstanding access proposals on a file.

func (AccessProposal)MarshalJSONadded inv0.201.0

func (sAccessProposal) MarshalJSON() ([]byte,error)

typeAccessProposalRoleAndViewadded inv0.201.0

type AccessProposalRoleAndView struct {// Role: The role that was proposed by the requester. The supported values are:// * `writer` * `commenter` * `reader`Rolestring `json:"role,omitempty"`// View: Indicates the view for this access proposal. Only populated for// proposals that belong to a view. Only `published` is supported.Viewstring `json:"view,omitempty"`// ForceSendFields is a list of field names (e.g. "Role") 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. "Role") 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:"-"`}

AccessProposalRoleAndView: A wrapper for the role and view of an accessproposal. For more information, see Roles and permissions(https://developers.google.com/workspace/drive/api/guides/ref-roles).

func (AccessProposalRoleAndView)MarshalJSONadded inv0.201.0

func (sAccessProposalRoleAndView) MarshalJSON() ([]byte,error)

typeAccessproposalsGetCalladded inv0.206.0

type AccessproposalsGetCall struct {// contains filtered or unexported fields}

func (*AccessproposalsGetCall)Contextadded inv0.206.0

Context sets the context to be used in this call's Do method.

func (*AccessproposalsGetCall)Doadded inv0.206.0

Do executes the "drive.accessproposals.get" call.Any non-2xx status code is an error. Response headers are in either*AccessProposal.ServerResponse.Header or (if a response was returned at all)in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*AccessproposalsGetCall)Fieldsadded inv0.206.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*AccessproposalsGetCall)Headeradded inv0.206.0

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*AccessproposalsGetCall)IfNoneMatchadded inv0.206.0

func (c *AccessproposalsGetCall) IfNoneMatch(entityTagstring) *AccessproposalsGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

typeAccessproposalsListCalladded inv0.206.0

type AccessproposalsListCall struct {// contains filtered or unexported fields}

func (*AccessproposalsListCall)Contextadded inv0.206.0

Context sets the context to be used in this call's Do method.

func (*AccessproposalsListCall)Doadded inv0.206.0

Do executes the "drive.accessproposals.list" call.Any non-2xx status code is an error. Response headers are in either*ListAccessProposalsResponse.ServerResponse.Header or (if a response wasreturned at all) in error.(*googleapi.Error).Header. Usegoogleapi.IsNotModified to check whether the returned error was becausehttp.StatusNotModified was returned.

func (*AccessproposalsListCall)Fieldsadded inv0.206.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*AccessproposalsListCall)Headeradded inv0.206.0

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*AccessproposalsListCall)IfNoneMatchadded inv0.206.0

func (c *AccessproposalsListCall) IfNoneMatch(entityTagstring) *AccessproposalsListCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*AccessproposalsListCall)PageSizeadded inv0.206.0

PageSize sets the optional parameter "pageSize": The number of results perpage.

func (*AccessproposalsListCall)PageTokenadded inv0.206.0

PageToken sets the optional parameter "pageToken": The continuation token onthe list of access requests.

func (*AccessproposalsListCall)Pagesadded inv0.206.0

Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.

typeAccessproposalsResolveCalladded inv0.206.0

type AccessproposalsResolveCall struct {// contains filtered or unexported fields}

func (*AccessproposalsResolveCall)Contextadded inv0.206.0

Context sets the context to be used in this call's Do method.

func (*AccessproposalsResolveCall)Doadded inv0.206.0

Do executes the "drive.accessproposals.resolve" call.

func (*AccessproposalsResolveCall)Fieldsadded inv0.206.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*AccessproposalsResolveCall)Headeradded inv0.206.0

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeAccessproposalsServiceadded inv0.206.0

type AccessproposalsService struct {// contains filtered or unexported fields}

funcNewAccessproposalsServiceadded inv0.206.0

func NewAccessproposalsService(s *Service) *AccessproposalsService

func (*AccessproposalsService)Getadded inv0.206.0

Get: Retrieves an access proposal by ID. For more information, see Managepending access proposals(https://developers.google.com/workspace/drive/api/guides/pending-access).

- fileId: The ID of the item the request is on.- proposalId: The ID of the access proposal to resolve.

func (*AccessproposalsService)Listadded inv0.206.0

List: List the access proposals on a file. For more information, see Managepending access proposals(https://developers.google.com/workspace/drive/api/guides/pending-access).Note: Only approvers are able to list access proposals on a file. If theuser isn't an approver, a 403 error is returned.

- fileId: The ID of the item the request is on.

func (*AccessproposalsService)Resolveadded inv0.206.0

func (r *AccessproposalsService) Resolve(fileIdstring, proposalIdstring, resolveaccessproposalrequest *ResolveAccessProposalRequest) *AccessproposalsResolveCall

Resolve: Approves or denies an access proposal. For more information, seeManage pending access proposals(https://developers.google.com/workspace/drive/api/guides/pending-access).

- fileId: The ID of the item the request is on.- proposalId: The ID of the access proposal to resolve.

typeAppadded inv0.159.0

type App struct {// Authorized: Whether the app is authorized to access data on the user's// Drive.Authorizedbool `json:"authorized,omitempty"`// CreateInFolderTemplate: The template URL to create a file with this app in a// given folder. The template contains the {folderId} to be replaced by the// folder ID house the new file.CreateInFolderTemplatestring `json:"createInFolderTemplate,omitempty"`// CreateUrl: The URL to create a file with this app.CreateUrlstring `json:"createUrl,omitempty"`// HasDriveWideScope: Whether the app has Drive-wide scope. An app with// Drive-wide scope can access all files in the user's Drive.HasDriveWideScopebool `json:"hasDriveWideScope,omitempty"`// Icons: The various icons for the app.Icons []*AppIcons `json:"icons,omitempty"`// Id: The ID of the app.Idstring `json:"id,omitempty"`// Installed: Whether the app is installed.Installedbool `json:"installed,omitempty"`// Kind: Output only. Identifies what kind of resource this is. Value: the// fixed string "drive#app".Kindstring `json:"kind,omitempty"`// LongDescription: A long description of the app.LongDescriptionstring `json:"longDescription,omitempty"`// Name: The name of the app.Namestring `json:"name,omitempty"`// ObjectType: The type of object this app creates such as a Chart. If empty,// the app name should be used instead.ObjectTypestring `json:"objectType,omitempty"`// OpenUrlTemplate: The template URL for opening files with this app. The// template contains {ids} or {exportIds} to be replaced by the actual file// IDs. For more information, see Open Files for the full documentation.OpenUrlTemplatestring `json:"openUrlTemplate,omitempty"`// PrimaryFileExtensions: The list of primary file extensions.PrimaryFileExtensions []string `json:"primaryFileExtensions,omitempty"`// PrimaryMimeTypes: The list of primary MIME types.PrimaryMimeTypes []string `json:"primaryMimeTypes,omitempty"`// ProductId: The ID of the product listing for this app.ProductIdstring `json:"productId,omitempty"`// ProductUrl: A link to the product listing for this app.ProductUrlstring `json:"productUrl,omitempty"`// SecondaryFileExtensions: The list of secondary file extensions.SecondaryFileExtensions []string `json:"secondaryFileExtensions,omitempty"`// SecondaryMimeTypes: The list of secondary MIME types.SecondaryMimeTypes []string `json:"secondaryMimeTypes,omitempty"`// ShortDescription: A short description of the app.ShortDescriptionstring `json:"shortDescription,omitempty"`// SupportsCreate: Whether this app supports creating objects.SupportsCreatebool `json:"supportsCreate,omitempty"`// SupportsImport: Whether this app supports importing from Google Docs.SupportsImportbool `json:"supportsImport,omitempty"`// SupportsMultiOpen: Whether this app supports opening more than one file.SupportsMultiOpenbool `json:"supportsMultiOpen,omitempty"`// SupportsOfflineCreate: Whether this app supports creating files when// offline.SupportsOfflineCreatebool `json:"supportsOfflineCreate,omitempty"`// UseByDefault: Whether the app is selected as the default handler for the// types it supports.UseByDefaultbool `json:"useByDefault,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Authorized") 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. "Authorized") 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:"-"`}

App: The `apps` resource provides a list of apps that a user has installed,with information about each app's supported MIME types, file extensions, andother details. Some resource methods (such as `apps.get`) require an`appId`. Use the `apps.list` method to retrieve the ID for an installedapplication.

func (App)MarshalJSONadded inv0.159.0

func (sApp) MarshalJSON() ([]byte,error)

typeAppIconsadded inv0.159.0

type AppIcons struct {// Category: Category of the icon. Allowed values are: * `application` - The// icon for the application. * `document` - The icon for a file associated with// the app. * `documentShared` - The icon for a shared file associated with the// app.Categorystring `json:"category,omitempty"`// IconUrl: URL for the icon.IconUrlstring `json:"iconUrl,omitempty"`// Size: Size of the icon. Represented as the maximum of the width and height.Sizeint64 `json:"size,omitempty"`// ForceSendFields is a list of field names (e.g. "Category") 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. "Category") 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:"-"`}

func (AppIcons)MarshalJSONadded inv0.159.0

func (sAppIcons) MarshalJSON() ([]byte,error)

typeAppListadded inv0.159.0

type AppList struct {// DefaultAppIds: The list of app IDs that the user has specified to use by// default. The list is in reverse-priority order (lowest to highest).DefaultAppIds []string `json:"defaultAppIds,omitempty"`// Items: The list of apps.Items []*App `json:"items,omitempty"`// Kind: Output only. Identifies what kind of resource this is. Value: the// fixed string "drive#appList".Kindstring `json:"kind,omitempty"`// SelfLink: A link back to this list.SelfLinkstring `json:"selfLink,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "DefaultAppIds") 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. "DefaultAppIds") 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:"-"`}

AppList: A list of third-party applications which the user has installed orgiven access to Google Drive.

func (AppList)MarshalJSONadded inv0.159.0

func (sAppList) MarshalJSON() ([]byte,error)

typeAppsGetCalladded inv0.159.0

type AppsGetCall struct {// contains filtered or unexported fields}

func (*AppsGetCall)Contextadded inv0.159.0

func (c *AppsGetCall) Context(ctxcontext.Context) *AppsGetCall

Context sets the context to be used in this call's Do method.

func (*AppsGetCall)Doadded inv0.159.0

func (c *AppsGetCall) Do(opts ...googleapi.CallOption) (*App,error)

Do executes the "drive.apps.get" call.Any non-2xx status code is an error. Response headers are in either*App.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*AppsGetCall)Fieldsadded inv0.159.0

func (c *AppsGetCall) Fields(s ...googleapi.Field) *AppsGetCall

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*AppsGetCall)Headeradded inv0.159.0

func (c *AppsGetCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*AppsGetCall)IfNoneMatchadded inv0.159.0

func (c *AppsGetCall) IfNoneMatch(entityTagstring) *AppsGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

typeAppsListCalladded inv0.159.0

type AppsListCall struct {// contains filtered or unexported fields}

func (*AppsListCall)AppFilterExtensionsadded inv0.159.0

func (c *AppsListCall) AppFilterExtensions(appFilterExtensionsstring) *AppsListCall

AppFilterExtensions sets the optional parameter "appFilterExtensions": Acomma-separated list of file extensions to limit returned results. Allresults within the given app query scope which can open any of the givenfile extensions are included in the response. If `appFilterMimeTypes` areprovided as well, the result is a union of the two resulting app lists.

func (*AppsListCall)AppFilterMimeTypesadded inv0.159.0

func (c *AppsListCall) AppFilterMimeTypes(appFilterMimeTypesstring) *AppsListCall

AppFilterMimeTypes sets the optional parameter "appFilterMimeTypes": Acomma-separated list of file extensions to limit returned results. Allresults within the given app query scope which can open any of the givenMIME types will be included in the response. If `appFilterExtensions` areprovided as well, the result is a union of the two resulting app lists.

func (*AppsListCall)Contextadded inv0.159.0

func (c *AppsListCall) Context(ctxcontext.Context) *AppsListCall

Context sets the context to be used in this call's Do method.

func (*AppsListCall)Doadded inv0.159.0

func (c *AppsListCall) Do(opts ...googleapi.CallOption) (*AppList,error)

Do executes the "drive.apps.list" call.Any non-2xx status code is an error. Response headers are in either*AppList.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*AppsListCall)Fieldsadded inv0.159.0

func (c *AppsListCall) Fields(s ...googleapi.Field) *AppsListCall

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*AppsListCall)Headeradded inv0.159.0

func (c *AppsListCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*AppsListCall)IfNoneMatchadded inv0.159.0

func (c *AppsListCall) IfNoneMatch(entityTagstring) *AppsListCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*AppsListCall)LanguageCodeadded inv0.159.0

func (c *AppsListCall) LanguageCode(languageCodestring) *AppsListCall

LanguageCode sets the optional parameter "languageCode": A language orlocale code, as defined by BCP 47, with some extensions from Unicode's LDMLformat (http://www.unicode.org/reports/tr35/).

typeAppsServiceadded inv0.159.0

type AppsService struct {// contains filtered or unexported fields}

funcNewAppsServiceadded inv0.159.0

func NewAppsService(s *Service) *AppsService

func (*AppsService)Getadded inv0.159.0

func (r *AppsService) Get(appIdstring) *AppsGetCall

Get: Gets a specific app. For more information, see Return user info(https://developers.google.com/workspace/drive/api/guides/user-info).

- appId: The ID of the app.

func (*AppsService)Listadded inv0.159.0

func (r *AppsService) List() *AppsListCall

List: Lists a user's installed apps. For more information, see Return userinfo (https://developers.google.com/workspace/drive/api/guides/user-info).

typeChange

type Change struct {// ChangeType: The type of the change. Possible values are `file` and `drive`.ChangeTypestring `json:"changeType,omitempty"`// Drive: The updated state of the shared drive. Present if the changeType is// drive, the user is still a member of the shared drive, and the shared drive// has not been deleted.Drive *Drive `json:"drive,omitempty"`// DriveId: The ID of the shared drive associated with this change.DriveIdstring `json:"driveId,omitempty"`// File: The updated state of the file. Present if the type is file and the// file has not been removed from this list of changes.File *File `json:"file,omitempty"`// FileId: The ID of the file which has changed.FileIdstring `json:"fileId,omitempty"`// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#change".Kindstring `json:"kind,omitempty"`// Removed: Whether the file or shared drive has been removed from this list of// changes, for example by deletion or loss of access.Removedbool `json:"removed,omitempty"`// TeamDrive: Deprecated: Use `drive` instead.TeamDrive *TeamDrive `json:"teamDrive,omitempty"`// TeamDriveId: Deprecated: Use `driveId` instead.TeamDriveIdstring `json:"teamDriveId,omitempty"`// Time: The time of this change (RFC 3339 date-time).Timestring `json:"time,omitempty"`// Type: Deprecated: Use `changeType` instead.Typestring `json:"type,omitempty"`// ForceSendFields is a list of field names (e.g. "ChangeType") 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. "ChangeType") 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:"-"`}

Change: A change to a file or shared drive.

func (Change)MarshalJSON

func (sChange) MarshalJSON() ([]byte,error)

typeChangeList

type ChangeList struct {// Changes: The list of changes. If nextPageToken is populated, then this list// may be incomplete and an additional page of results should be fetched.Changes []*Change `json:"changes,omitempty"`// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#changeList".Kindstring `json:"kind,omitempty"`// NewStartPageToken: The starting page token for future changes. This will be// present only if the end of the current changes list has been reached. The// page token doesn't expire.NewStartPageTokenstring `json:"newStartPageToken,omitempty"`// NextPageToken: The page token for the next page of changes. This will be// absent if the end of the changes list has been reached. The page token// doesn't expire.NextPageTokenstring `json:"nextPageToken,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Changes") 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. "Changes") 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:"-"`}

ChangeList: A list of changes for a user.

func (ChangeList)MarshalJSON

func (sChangeList) MarshalJSON() ([]byte,error)

typeChangesGetStartPageTokenCall

type ChangesGetStartPageTokenCall struct {// contains filtered or unexported fields}

func (*ChangesGetStartPageTokenCall)Context

Context sets the context to be used in this call's Do method.

func (*ChangesGetStartPageTokenCall)Do

Do executes the "drive.changes.getStartPageToken" call.Any non-2xx status code is an error. Response headers are in either*StartPageToken.ServerResponse.Header or (if a response was returned at all)in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*ChangesGetStartPageTokenCall)DriveIdadded inv0.4.0

DriveId sets the optional parameter "driveId": The ID of the shared drivefor which the starting pageToken for listing future changes from that shareddrive will be returned.

func (*ChangesGetStartPageTokenCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*ChangesGetStartPageTokenCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*ChangesGetStartPageTokenCall)IfNoneMatch

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*ChangesGetStartPageTokenCall)SupportsAllDrivesadded inv0.4.0

func (c *ChangesGetStartPageTokenCall) SupportsAllDrives(supportsAllDrivesbool) *ChangesGetStartPageTokenCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*ChangesGetStartPageTokenCall)SupportsTeamDrives

func (c *ChangesGetStartPageTokenCall) SupportsTeamDrives(supportsTeamDrivesbool) *ChangesGetStartPageTokenCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

func (*ChangesGetStartPageTokenCall)TeamDriveId

TeamDriveId sets the optional parameter "teamDriveId": Deprecated: Use`driveId` instead.

typeChangesListCall

type ChangesListCall struct {// contains filtered or unexported fields}

func (*ChangesListCall)Context

Context sets the context to be used in this call's Do method.

func (*ChangesListCall)Do

Do executes the "drive.changes.list" call.Any non-2xx status code is an error. Response headers are in either*ChangeList.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*ChangesListCall)DriveIdadded inv0.4.0

func (c *ChangesListCall) DriveId(driveIdstring) *ChangesListCall

DriveId sets the optional parameter "driveId": The shared drive from whichchanges will be returned. If specified the change IDs will be reflective ofthe shared drive; use the combined drive ID and change ID as an identifier.

func (*ChangesListCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*ChangesListCall)Header

func (c *ChangesListCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*ChangesListCall)IfNoneMatch

func (c *ChangesListCall) IfNoneMatch(entityTagstring) *ChangesListCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*ChangesListCall)IncludeCorpusRemovals

func (c *ChangesListCall) IncludeCorpusRemovals(includeCorpusRemovalsbool) *ChangesListCall

IncludeCorpusRemovals sets the optional parameter "includeCorpusRemovals":Whether changes should include the file resource if the file is stillaccessible by the user at the time of the request, even when a file wasremoved from the list of changes and there will be no further change entriesfor this file.

func (*ChangesListCall)IncludeItemsFromAllDrivesadded inv0.4.0

func (c *ChangesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrivesbool) *ChangesListCall

IncludeItemsFromAllDrives sets the optional parameter"includeItemsFromAllDrives": Whether both My Drive and shared drive itemsshould be included in results.

func (*ChangesListCall)IncludeLabelsadded inv0.88.0

func (c *ChangesListCall) IncludeLabels(includeLabelsstring) *ChangesListCall

IncludeLabels sets the optional parameter "includeLabels": A comma-separatedlist of IDs of labels to include in the `labelInfo` part of the response.

func (*ChangesListCall)IncludePermissionsForViewadded inv0.31.0

func (c *ChangesListCall) IncludePermissionsForView(includePermissionsForViewstring) *ChangesListCall

IncludePermissionsForView sets the optional parameter"includePermissionsForView": Specifies which additional view's permissionsto include in the response. Only 'published' is supported.

func (*ChangesListCall)IncludeRemoved

func (c *ChangesListCall) IncludeRemoved(includeRemovedbool) *ChangesListCall

IncludeRemoved sets the optional parameter "includeRemoved": Whether toinclude changes indicating that items have been removed from the list ofchanges, for example by deletion or loss of access.

func (*ChangesListCall)IncludeTeamDriveItems

func (c *ChangesListCall) IncludeTeamDriveItems(includeTeamDriveItemsbool) *ChangesListCall

IncludeTeamDriveItems sets the optional parameter "includeTeamDriveItems":Deprecated: Use `includeItemsFromAllDrives` instead.

func (*ChangesListCall)PageSize

func (c *ChangesListCall) PageSize(pageSizeint64) *ChangesListCall

PageSize sets the optional parameter "pageSize": The maximum number ofchanges to return per page.

func (*ChangesListCall)RestrictToMyDrive

func (c *ChangesListCall) RestrictToMyDrive(restrictToMyDrivebool) *ChangesListCall

RestrictToMyDrive sets the optional parameter "restrictToMyDrive": Whetherto restrict the results to changes inside the My Drive hierarchy. This omitschanges to files such as those in the Application Data folder or sharedfiles which have not been added to My Drive.

func (*ChangesListCall)Spaces

func (c *ChangesListCall) Spaces(spacesstring) *ChangesListCall

Spaces sets the optional parameter "spaces": A comma-separated list ofspaces to query within the corpora. Supported values are 'drive' and'appDataFolder'.

func (*ChangesListCall)SupportsAllDrivesadded inv0.4.0

func (c *ChangesListCall) SupportsAllDrives(supportsAllDrivesbool) *ChangesListCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*ChangesListCall)SupportsTeamDrives

func (c *ChangesListCall) SupportsTeamDrives(supportsTeamDrivesbool) *ChangesListCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

func (*ChangesListCall)TeamDriveId

func (c *ChangesListCall) TeamDriveId(teamDriveIdstring) *ChangesListCall

TeamDriveId sets the optional parameter "teamDriveId": Deprecated: Use`driveId` instead.

typeChangesService

type ChangesService struct {// contains filtered or unexported fields}

funcNewChangesService

func NewChangesService(s *Service) *ChangesService

func (*ChangesService)GetStartPageToken

func (r *ChangesService) GetStartPageToken() *ChangesGetStartPageTokenCall

GetStartPageToken: Gets the starting pageToken for listing future changes.For more information, see Retrieve changes(https://developers.google.com/workspace/drive/api/guides/manage-changes).

func (*ChangesService)List

func (r *ChangesService) List(pageTokenstring) *ChangesListCall

List: Lists the changes for a user or shared drive. For more information,see Retrieve changes(https://developers.google.com/workspace/drive/api/guides/manage-changes).

  • pageToken: The token for continuing a previous list request on the nextpage. This should be set to the value of 'nextPageToken' from the previousresponse or to the response from the getStartPageToken method.

func (*ChangesService)Watch

func (r *ChangesService) Watch(pageTokenstring, channel *Channel) *ChangesWatchCall

Watch: Subscribes to changes for a user. For more information, seeNotifications for resource changes(https://developers.google.com/workspace/drive/api/guides/push).

  • pageToken: The token for continuing a previous list request on the nextpage. This should be set to the value of 'nextPageToken' from the previousresponse or to the response from the getStartPageToken method.

typeChangesWatchCall

type ChangesWatchCall struct {// contains filtered or unexported fields}

func (*ChangesWatchCall)Context

Context sets the context to be used in this call's Do method.

func (*ChangesWatchCall)Do

Do executes the "drive.changes.watch" call.Any non-2xx status code is an error. Response headers are in either*Channel.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*ChangesWatchCall)DriveIdadded inv0.4.0

func (c *ChangesWatchCall) DriveId(driveIdstring) *ChangesWatchCall

DriveId sets the optional parameter "driveId": The shared drive from whichchanges will be returned. If specified the change IDs will be reflective ofthe shared drive; use the combined drive ID and change ID as an identifier.

func (*ChangesWatchCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*ChangesWatchCall)Header

func (c *ChangesWatchCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*ChangesWatchCall)IncludeCorpusRemovals

func (c *ChangesWatchCall) IncludeCorpusRemovals(includeCorpusRemovalsbool) *ChangesWatchCall

IncludeCorpusRemovals sets the optional parameter "includeCorpusRemovals":Whether changes should include the file resource if the file is stillaccessible by the user at the time of the request, even when a file wasremoved from the list of changes and there will be no further change entriesfor this file.

func (*ChangesWatchCall)IncludeItemsFromAllDrivesadded inv0.4.0

func (c *ChangesWatchCall) IncludeItemsFromAllDrives(includeItemsFromAllDrivesbool) *ChangesWatchCall

IncludeItemsFromAllDrives sets the optional parameter"includeItemsFromAllDrives": Whether both My Drive and shared drive itemsshould be included in results.

func (*ChangesWatchCall)IncludeLabelsadded inv0.88.0

func (c *ChangesWatchCall) IncludeLabels(includeLabelsstring) *ChangesWatchCall

IncludeLabels sets the optional parameter "includeLabels": A comma-separatedlist of IDs of labels to include in the `labelInfo` part of the response.

func (*ChangesWatchCall)IncludePermissionsForViewadded inv0.31.0

func (c *ChangesWatchCall) IncludePermissionsForView(includePermissionsForViewstring) *ChangesWatchCall

IncludePermissionsForView sets the optional parameter"includePermissionsForView": Specifies which additional view's permissionsto include in the response. Only 'published' is supported.

func (*ChangesWatchCall)IncludeRemoved

func (c *ChangesWatchCall) IncludeRemoved(includeRemovedbool) *ChangesWatchCall

IncludeRemoved sets the optional parameter "includeRemoved": Whether toinclude changes indicating that items have been removed from the list ofchanges, for example by deletion or loss of access.

func (*ChangesWatchCall)IncludeTeamDriveItems

func (c *ChangesWatchCall) IncludeTeamDriveItems(includeTeamDriveItemsbool) *ChangesWatchCall

IncludeTeamDriveItems sets the optional parameter "includeTeamDriveItems":Deprecated: Use `includeItemsFromAllDrives` instead.

func (*ChangesWatchCall)PageSize

func (c *ChangesWatchCall) PageSize(pageSizeint64) *ChangesWatchCall

PageSize sets the optional parameter "pageSize": The maximum number ofchanges to return per page.

func (*ChangesWatchCall)RestrictToMyDrive

func (c *ChangesWatchCall) RestrictToMyDrive(restrictToMyDrivebool) *ChangesWatchCall

RestrictToMyDrive sets the optional parameter "restrictToMyDrive": Whetherto restrict the results to changes inside the My Drive hierarchy. This omitschanges to files such as those in the Application Data folder or sharedfiles which have not been added to My Drive.

func (*ChangesWatchCall)Spaces

func (c *ChangesWatchCall) Spaces(spacesstring) *ChangesWatchCall

Spaces sets the optional parameter "spaces": A comma-separated list ofspaces to query within the corpora. Supported values are 'drive' and'appDataFolder'.

func (*ChangesWatchCall)SupportsAllDrivesadded inv0.4.0

func (c *ChangesWatchCall) SupportsAllDrives(supportsAllDrivesbool) *ChangesWatchCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*ChangesWatchCall)SupportsTeamDrives

func (c *ChangesWatchCall) SupportsTeamDrives(supportsTeamDrivesbool) *ChangesWatchCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

func (*ChangesWatchCall)TeamDriveId

func (c *ChangesWatchCall) TeamDriveId(teamDriveIdstring) *ChangesWatchCall

TeamDriveId sets the optional parameter "teamDriveId": Deprecated: Use`driveId` instead.

typeChannel

type Channel struct {// Address: The address where notifications are delivered for this channel.Addressstring `json:"address,omitempty"`// Expiration: Date and time of notification channel expiration, expressed as a// Unix timestamp, in milliseconds. Optional.Expirationint64 `json:"expiration,omitempty,string"`// Id: A UUID or similar unique string that identifies this channel.Idstring `json:"id,omitempty"`// Kind: Identifies this as a notification channel used to watch for changes to// a resource, which is `api#channel`.Kindstring `json:"kind,omitempty"`// Params: Additional parameters controlling delivery channel behavior.// Optional.Params map[string]string `json:"params,omitempty"`// Payload: A Boolean value to indicate whether payload is wanted. Optional.Payloadbool `json:"payload,omitempty"`// ResourceId: An opaque ID that identifies the resource being watched on this// channel. Stable across different API versions.ResourceIdstring `json:"resourceId,omitempty"`// ResourceUri: A version-specific identifier for the watched resource.ResourceUristring `json:"resourceUri,omitempty"`// Token: An arbitrary string delivered to the target address with each// notification delivered over this channel. Optional.Tokenstring `json:"token,omitempty"`// Type: The type of delivery mechanism used for this channel. Valid values are// "web_hook" or "webhook".Typestring `json:"type,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Address") 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. "Address") 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:"-"`}

Channel: A notification channel used to watch for resource changes.

func (Channel)MarshalJSON

func (sChannel) MarshalJSON() ([]byte,error)

typeChannelsService

type ChannelsService struct {// contains filtered or unexported fields}

funcNewChannelsService

func NewChannelsService(s *Service) *ChannelsService

func (*ChannelsService)Stop

func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall

Stop: Stops watching resources through this channel. For more information,see Notifications for resource changes(https://developers.google.com/workspace/drive/api/guides/push).

typeChannelsStopCall

type ChannelsStopCall struct {// contains filtered or unexported fields}

func (*ChannelsStopCall)Context

Context sets the context to be used in this call's Do method.

func (*ChannelsStopCall)Do

Do executes the "drive.channels.stop" call.

func (*ChannelsStopCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*ChannelsStopCall)Header

func (c *ChannelsStopCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeComment

type Comment struct {// Anchor: A region of the document represented as a JSON string. For details// on defining anchor properties, refer to Manage comments and replies// (https://developers.google.com/workspace/drive/api/v3/manage-comments).Anchorstring `json:"anchor,omitempty"`// AssigneeEmailAddress: Output only. The email address of the user assigned to// this comment. If no user is assigned, the field is unset.AssigneeEmailAddressstring `json:"assigneeEmailAddress,omitempty"`// Author: Output only. The author of the comment. The author's email address// and permission ID will not be populated.Author *User `json:"author,omitempty"`// Content: The plain text content of the comment. This field is used for// setting the content, while `htmlContent` should be displayed.Contentstring `json:"content,omitempty"`// CreatedTime: The time at which the comment was created (RFC 3339 date-time).CreatedTimestring `json:"createdTime,omitempty"`// Deleted: Output only. Whether the comment has been deleted. A deleted// comment has no content.Deletedbool `json:"deleted,omitempty"`// HtmlContent: Output only. The content of the comment with HTML formatting.HtmlContentstring `json:"htmlContent,omitempty"`// Id: Output only. The ID of the comment.Idstring `json:"id,omitempty"`// Kind: Output only. Identifies what kind of resource this is. Value: the// fixed string "drive#comment".Kindstring `json:"kind,omitempty"`// MentionedEmailAddresses: Output only. A list of email addresses for users// mentioned in this comment. If no users are mentioned, the list is empty.MentionedEmailAddresses []string `json:"mentionedEmailAddresses,omitempty"`// ModifiedTime: The last time the comment or any of its replies was modified// (RFC 3339 date-time).ModifiedTimestring `json:"modifiedTime,omitempty"`// QuotedFileContent: The file content to which the comment refers, typically// within the anchor region. For a text file, for example, this would be the// text at the location of the comment.QuotedFileContent *CommentQuotedFileContent `json:"quotedFileContent,omitempty"`// Replies: Output only. The full list of replies to the comment in// chronological order.Replies []*Reply `json:"replies,omitempty"`// Resolved: Output only. Whether the comment has been resolved by one of its// replies.Resolvedbool `json:"resolved,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Anchor") 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. "Anchor") 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:"-"`}

Comment: A comment on a file. Some resource methods (such as`comments.update`) require a `commentId`. Use the `comments.list` method toretrieve the ID for a comment in a file.

func (Comment)MarshalJSON

func (sComment) MarshalJSON() ([]byte,error)

typeCommentList

type CommentList struct {// Comments: The list of comments. If nextPageToken is populated, then this// list may be incomplete and an additional page of results should be fetched.Comments []*Comment `json:"comments,omitempty"`// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#commentList".Kindstring `json:"kind,omitempty"`// NextPageToken: The page token for the next page of comments. This will be// absent if the end of the comments list has been reached. If the token is// rejected for any reason, it should be discarded, and pagination should be// restarted from the first page of results. The page token is typically valid// for several hours. However, if new items are added or removed, your expected// results might differ.NextPageTokenstring `json:"nextPageToken,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Comments") 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. "Comments") 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:"-"`}

CommentList: A list of comments on a file.

func (CommentList)MarshalJSON

func (sCommentList) MarshalJSON() ([]byte,error)

typeCommentQuotedFileContent

type CommentQuotedFileContent struct {// MimeType: The MIME type of the quoted content.MimeTypestring `json:"mimeType,omitempty"`// Value: The quoted content itself. This is interpreted as plain text if set// through the API.Valuestring `json:"value,omitempty"`// ForceSendFields is a list of field names (e.g. "MimeType") 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. "MimeType") 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:"-"`}

CommentQuotedFileContent: The file content to which the comment refers,typically within the anchor region. For a text file, for example, this wouldbe the text at the location of the comment.

func (CommentQuotedFileContent)MarshalJSON

func (sCommentQuotedFileContent) MarshalJSON() ([]byte,error)

typeCommentsCreateCall

type CommentsCreateCall struct {// contains filtered or unexported fields}

func (*CommentsCreateCall)Context

Context sets the context to be used in this call's Do method.

func (*CommentsCreateCall)Do

Do executes the "drive.comments.create" call.Any non-2xx status code is an error. Response headers are in either*Comment.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*CommentsCreateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*CommentsCreateCall)Header

func (c *CommentsCreateCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeCommentsDeleteCall

type CommentsDeleteCall struct {// contains filtered or unexported fields}

func (*CommentsDeleteCall)Context

Context sets the context to be used in this call's Do method.

func (*CommentsDeleteCall)Do

Do executes the "drive.comments.delete" call.

func (*CommentsDeleteCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*CommentsDeleteCall)Header

func (c *CommentsDeleteCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeCommentsGetCall

type CommentsGetCall struct {// contains filtered or unexported fields}

func (*CommentsGetCall)Context

Context sets the context to be used in this call's Do method.

func (*CommentsGetCall)Do

Do executes the "drive.comments.get" call.Any non-2xx status code is an error. Response headers are in either*Comment.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*CommentsGetCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*CommentsGetCall)Header

func (c *CommentsGetCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*CommentsGetCall)IfNoneMatch

func (c *CommentsGetCall) IfNoneMatch(entityTagstring) *CommentsGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*CommentsGetCall)IncludeDeleted

func (c *CommentsGetCall) IncludeDeleted(includeDeletedbool) *CommentsGetCall

IncludeDeleted sets the optional parameter "includeDeleted": Whether toreturn deleted comments. Deleted comments will not include their originalcontent.

typeCommentsListCall

type CommentsListCall struct {// contains filtered or unexported fields}

func (*CommentsListCall)Context

Context sets the context to be used in this call's Do method.

func (*CommentsListCall)Do

Do executes the "drive.comments.list" call.Any non-2xx status code is an error. Response headers are in either*CommentList.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*CommentsListCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*CommentsListCall)Header

func (c *CommentsListCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*CommentsListCall)IfNoneMatch

func (c *CommentsListCall) IfNoneMatch(entityTagstring) *CommentsListCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*CommentsListCall)IncludeDeleted

func (c *CommentsListCall) IncludeDeleted(includeDeletedbool) *CommentsListCall

IncludeDeleted sets the optional parameter "includeDeleted": Whether toinclude deleted comments. Deleted comments will not include their originalcontent.

func (*CommentsListCall)PageSize

func (c *CommentsListCall) PageSize(pageSizeint64) *CommentsListCall

PageSize sets the optional parameter "pageSize": The maximum number ofcomments to return per page.

func (*CommentsListCall)PageToken

func (c *CommentsListCall) PageToken(pageTokenstring) *CommentsListCall

PageToken sets the optional parameter "pageToken": The token for continuinga previous list request on the next page. This should be set to the value of'nextPageToken' from the previous response.

func (*CommentsListCall)Pages

Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.

func (*CommentsListCall)StartModifiedTime

func (c *CommentsListCall) StartModifiedTime(startModifiedTimestring) *CommentsListCall

StartModifiedTime sets the optional parameter "startModifiedTime": Theminimum value of 'modifiedTime' for the result comments (RFC 3339date-time).

typeCommentsService

type CommentsService struct {// contains filtered or unexported fields}

funcNewCommentsService

func NewCommentsService(s *Service) *CommentsService

func (*CommentsService)Create

func (r *CommentsService) Create(fileIdstring, comment *Comment) *CommentsCreateCall

Create: Creates a comment on a file. For more information, see Managecomments and replies(https://developers.google.com/workspace/drive/api/guides/manage-comments).Required: The `fields` parameter must be set. To return the exact fields youneed, see Return specific fields(https://developers.google.com/workspace/drive/api/guides/fields-parameter).

- fileId: The ID of the file.

func (*CommentsService)Delete

func (r *CommentsService) Delete(fileIdstring, commentIdstring) *CommentsDeleteCall

Delete: Deletes a comment. For more information, see Manage comments andreplies(https://developers.google.com/workspace/drive/api/guides/manage-comments).

- commentId: The ID of the comment.- fileId: The ID of the file.

func (*CommentsService)Get

func (r *CommentsService) Get(fileIdstring, commentIdstring) *CommentsGetCall

Get: Gets a comment by ID. For more information, see Manage comments andreplies(https://developers.google.com/workspace/drive/api/guides/manage-comments).Required: The `fields` parameter must be set. To return the exact fields youneed, see Return specific fields(https://developers.google.com/workspace/drive/api/guides/fields-parameter).

- commentId: The ID of the comment.- fileId: The ID of the file.

func (*CommentsService)List

func (r *CommentsService) List(fileIdstring) *CommentsListCall

List: Lists a file's comments. For more information, see Manage comments andreplies(https://developers.google.com/workspace/drive/api/guides/manage-comments).Required: The `fields` parameter must be set. To return the exact fields youneed, see Return specific fields(https://developers.google.com/workspace/drive/api/guides/fields-parameter).

- fileId: The ID of the file.

func (*CommentsService)Update

func (r *CommentsService) Update(fileIdstring, commentIdstring, comment *Comment) *CommentsUpdateCall

Update: Updates a comment with patch semantics. For more information, seeManage comments and replies(https://developers.google.com/workspace/drive/api/guides/manage-comments).Required: The `fields` parameter must be set. To return the exact fields youneed, see Return specific fields(https://developers.google.com/workspace/drive/api/guides/fields-parameter).

- commentId: The ID of the comment.- fileId: The ID of the file.

typeCommentsUpdateCall

type CommentsUpdateCall struct {// contains filtered or unexported fields}

func (*CommentsUpdateCall)Context

Context sets the context to be used in this call's Do method.

func (*CommentsUpdateCall)Do

Do executes the "drive.comments.update" call.Any non-2xx status code is an error. Response headers are in either*Comment.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*CommentsUpdateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*CommentsUpdateCall)Header

func (c *CommentsUpdateCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeContentRestrictionadded inv0.30.0

type ContentRestriction struct {// OwnerRestricted: Whether the content restriction can only be modified or// removed by a user who owns the file. For files in shared drives, any user// with `organizer` capabilities can modify or remove this content restriction.OwnerRestrictedbool `json:"ownerRestricted,omitempty"`// ReadOnly: Whether the content of the file is read-only. If a file is// read-only, a new revision of the file may not be added, comments may not be// added or modified, and the title of the file may not be modified.ReadOnlybool `json:"readOnly,omitempty"`// Reason: Reason for why the content of the file is restricted. This is only// mutable on requests that also set `readOnly=true`.Reasonstring `json:"reason,omitempty"`// RestrictingUser: Output only. The user who set the content restriction. Only// populated if `readOnly=true`.RestrictingUser *User `json:"restrictingUser,omitempty"`// RestrictionTime: The time at which the content restriction was set// (formattedRFC 3339 timestamp). Only populated if readOnly is true.RestrictionTimestring `json:"restrictionTime,omitempty"`// SystemRestricted: Output only. Whether the content restriction was applied// by the system, for example due to an esignature. Users cannot modify or// remove system restricted content restrictions.SystemRestrictedbool `json:"systemRestricted,omitempty"`// Type: Output only. The type of the content restriction. Currently the only// possible value is `globalContentRestriction`.Typestring `json:"type,omitempty"`// ForceSendFields is a list of field names (e.g. "OwnerRestricted") 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. "OwnerRestricted") 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:"-"`}

ContentRestriction: A restriction for accessing the content of the file.

func (ContentRestriction)MarshalJSONadded inv0.30.0

func (sContentRestriction) MarshalJSON() ([]byte,error)

typeDownloadRestrictionadded inv0.224.0

type DownloadRestriction struct {// RestrictedForReaders: Whether download and copy is restricted for readers.RestrictedForReadersbool `json:"restrictedForReaders,omitempty"`// RestrictedForWriters: Whether download and copy is restricted for writers.// If `true`, download is also restricted for readers.RestrictedForWritersbool `json:"restrictedForWriters,omitempty"`// ForceSendFields is a list of field names (e.g. "RestrictedForReaders") 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. "RestrictedForReaders") 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:"-"`}

DownloadRestriction: A restriction for copy and download of the file.

func (DownloadRestriction)MarshalJSONadded inv0.224.0

func (sDownloadRestriction) MarshalJSON() ([]byte,error)

typeDownloadRestrictionsMetadataadded inv0.241.0

type DownloadRestrictionsMetadata struct {// EffectiveDownloadRestrictionWithContext: Output only. The effective download// restriction applied to this file. This considers all restriction settings// and DLP rules.EffectiveDownloadRestrictionWithContext *DownloadRestriction `json:"effectiveDownloadRestrictionWithContext,omitempty"`// ItemDownloadRestriction: The download restriction of the file applied// directly by the owner or organizer. This doesn't take into account shared// drive settings or DLP rules.ItemDownloadRestriction *DownloadRestriction `json:"itemDownloadRestriction,omitempty"`// ForceSendFields is a list of field names (e.g.// "EffectiveDownloadRestrictionWithContext") 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.// "EffectiveDownloadRestrictionWithContext") to include in API requests with// the JSON null value. By default, fields with empty values are omitted from// API requests. Seehttps://pkg.go.dev/google.golang.org/api#hdr-NullFields// for more details.NullFields []string `json:"-"`}

DownloadRestrictionsMetadata: Download restrictions applied to the file.

func (DownloadRestrictionsMetadata)MarshalJSONadded inv0.241.0

func (sDownloadRestrictionsMetadata) MarshalJSON() ([]byte,error)

typeDriveadded inv0.4.0

type Drive struct {// BackgroundImageFile: An image file and cropping parameters from which a// background image for this shared drive is set. This is a write only field;// it can only be set on `drive.drives.update` requests that don't set// `themeId`. When specified, all fields of the `backgroundImageFile` must be// set.BackgroundImageFile *DriveBackgroundImageFile `json:"backgroundImageFile,omitempty"`// BackgroundImageLink: Output only. A short-lived link to this shared drive's// background image.BackgroundImageLinkstring `json:"backgroundImageLink,omitempty"`// Capabilities: Output only. Capabilities the current user has on this shared// drive.Capabilities *DriveCapabilities `json:"capabilities,omitempty"`// ColorRgb: The color of this shared drive as an RGB hex string. It can only// be set on a `drive.drives.update` request that does not set `themeId`.ColorRgbstring `json:"colorRgb,omitempty"`// CreatedTime: The time at which the shared drive was created (RFC 3339// date-time).CreatedTimestring `json:"createdTime,omitempty"`// Hidden: Whether the shared drive is hidden from default view.Hiddenbool `json:"hidden,omitempty"`// Id: Output only. The ID of this shared drive which is also the ID of the top// level folder of this shared drive.Idstring `json:"id,omitempty"`// Kind: Output only. Identifies what kind of resource this is. Value: the// fixed string "drive#drive".Kindstring `json:"kind,omitempty"`// Name: The name of this shared drive.Namestring `json:"name,omitempty"`// OrgUnitId: Output only. The organizational unit of this shared drive. This// field is only populated on `drives.list` responses when the// `useDomainAdminAccess` parameter is set to `true`.OrgUnitIdstring `json:"orgUnitId,omitempty"`// Restrictions: A set of restrictions that apply to this shared drive or items// inside this shared drive. Note that restrictions can't be set when creating// a shared drive. To add a restriction, first create a shared drive and then// use `drives.update` to add restrictions.Restrictions *DriveRestrictions `json:"restrictions,omitempty"`// ThemeId: The ID of the theme from which the background image and color will// be set. The set of possible `driveThemes` can be retrieved from a// `drive.about.get` response. When not specified on a `drive.drives.create`// request, a random theme is chosen from which the background image and color// are set. This is a write-only field; it can only be set on requests that// don't set `colorRgb` or `backgroundImageFile`.ThemeIdstring `json:"themeId,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "BackgroundImageFile") 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. "BackgroundImageFile") 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:"-"`}

Drive: Representation of a shared drive. Some resource methods (such as`drives.update`) require a `driveId`. Use the `drives.list` method toretrieve the ID for a shared drive.

func (Drive)MarshalJSONadded inv0.4.0

func (sDrive) MarshalJSON() ([]byte,error)

typeDriveBackgroundImageFileadded inv0.4.0

type DriveBackgroundImageFile struct {// Id: The ID of an image file in Google Drive to use for the background image.Idstring `json:"id,omitempty"`// Width: The width of the cropped image in the closed range of 0 to 1. This// value represents the width of the cropped image divided by the width of the// entire image. The height is computed by applying a width to height aspect// ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and// 144 pixels high.Widthfloat64 `json:"width,omitempty"`// XCoordinate: The X coordinate of the upper left corner of the cropping area// in the background image. This is a value in the closed range of 0 to 1. This// value represents the horizontal distance from the left side of the entire// image to the left side of the cropping area divided by the width of the// entire image.XCoordinatefloat64 `json:"xCoordinate,omitempty"`// YCoordinate: The Y coordinate of the upper left corner of the cropping area// in the background image. This is a value in the closed range of 0 to 1. This// value represents the vertical distance from the top side of the entire image// to the top side of the cropping area divided by the height of the entire// image.YCoordinatefloat64 `json:"yCoordinate,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:"-"`}

DriveBackgroundImageFile: An image file and cropping parameters from which abackground image for this shared drive is set. This is a write only field;it can only be set on `drive.drives.update` requests that don't set`themeId`. When specified, all fields of the `backgroundImageFile` must beset.

func (DriveBackgroundImageFile)MarshalJSONadded inv0.4.0

func (sDriveBackgroundImageFile) MarshalJSON() ([]byte,error)

func (*DriveBackgroundImageFile)UnmarshalJSONadded inv0.4.0

func (s *DriveBackgroundImageFile) UnmarshalJSON(data []byte)error

typeDriveCapabilitiesadded inv0.4.0

type DriveCapabilities struct {// CanAddChildren: Output only. Whether the current user can add children to// folders in this shared drive.CanAddChildrenbool `json:"canAddChildren,omitempty"`// CanChangeCopyRequiresWriterPermissionRestriction: Output only. Whether the// current user can change the `copyRequiresWriterPermission` restriction of// this shared drive.CanChangeCopyRequiresWriterPermissionRestrictionbool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"`// CanChangeDomainUsersOnlyRestriction: Output only. Whether the current user// can change the `domainUsersOnly` restriction of this shared drive.CanChangeDomainUsersOnlyRestrictionbool `json:"canChangeDomainUsersOnlyRestriction,omitempty"`// CanChangeDownloadRestriction: Output only. Whether the current user can// change organizer-applied download restrictions of this shared drive.CanChangeDownloadRestrictionbool `json:"canChangeDownloadRestriction,omitempty"`// CanChangeDriveBackground: Output only. Whether the current user can change// the background of this shared drive.CanChangeDriveBackgroundbool `json:"canChangeDriveBackground,omitempty"`// CanChangeDriveMembersOnlyRestriction: Output only. Whether the current user// can change the `driveMembersOnly` restriction of this shared drive.CanChangeDriveMembersOnlyRestrictionbool `json:"canChangeDriveMembersOnlyRestriction,omitempty"`// CanChangeSharingFoldersRequiresOrganizerPermissionRestriction: Output only.// Whether the current user can change the// `sharingFoldersRequiresOrganizerPermission` restriction of this shared// drive.CanChangeSharingFoldersRequiresOrganizerPermissionRestrictionbool `json:"canChangeSharingFoldersRequiresOrganizerPermissionRestriction,omitempty"`// CanComment: Output only. Whether the current user can comment on files in// this shared drive.CanCommentbool `json:"canComment,omitempty"`// CanCopy: Output only. Whether the current user can copy files in this shared// drive.CanCopybool `json:"canCopy,omitempty"`// CanDeleteChildren: Output only. Whether the current user can delete children// from folders in this shared drive.CanDeleteChildrenbool `json:"canDeleteChildren,omitempty"`// CanDeleteDrive: Output only. Whether the current user can delete this shared// drive. Attempting to delete the shared drive may still fail if there are// untrashed items inside the shared drive.CanDeleteDrivebool `json:"canDeleteDrive,omitempty"`// CanDownload: Output only. Whether the current user can download files in// this shared drive.CanDownloadbool `json:"canDownload,omitempty"`// CanEdit: Output only. Whether the current user can edit files in this shared// driveCanEditbool `json:"canEdit,omitempty"`// CanListChildren: Output only. Whether the current user can list the children// of folders in this shared drive.CanListChildrenbool `json:"canListChildren,omitempty"`// CanManageMembers: Output only. Whether the current user can add members to// this shared drive or remove them or change their role.CanManageMembersbool `json:"canManageMembers,omitempty"`// CanReadRevisions: Output only. Whether the current user can read the// revisions resource of files in this shared drive.CanReadRevisionsbool `json:"canReadRevisions,omitempty"`// CanRename: Output only. Whether the current user can rename files or folders// in this shared drive.CanRenamebool `json:"canRename,omitempty"`// CanRenameDrive: Output only. Whether the current user can rename this shared// drive.CanRenameDrivebool `json:"canRenameDrive,omitempty"`// CanResetDriveRestrictions: Output only. Whether the current user can reset// the shared drive restrictions to defaults.CanResetDriveRestrictionsbool `json:"canResetDriveRestrictions,omitempty"`// CanShare: Output only. Whether the current user can share files or folders// in this shared drive.CanSharebool `json:"canShare,omitempty"`// CanTrashChildren: Output only. Whether the current user can trash children// from folders in this shared drive.CanTrashChildrenbool `json:"canTrashChildren,omitempty"`// ForceSendFields is a list of field names (e.g. "CanAddChildren") 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. "CanAddChildren") 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:"-"`}

DriveCapabilities: Output only. Capabilities the current user has on thisshared drive.

func (DriveCapabilities)MarshalJSONadded inv0.4.0

func (sDriveCapabilities) MarshalJSON() ([]byte,error)

typeDriveListadded inv0.4.0

type DriveList struct {// Drives: The list of shared drives. If nextPageToken is populated, then this// list may be incomplete and an additional page of results should be fetched.Drives []*Drive `json:"drives,omitempty"`// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#driveList".Kindstring `json:"kind,omitempty"`// NextPageToken: The page token for the next page of shared drives. This will// be absent if the end of the list has been reached. If the token is rejected// for any reason, it should be discarded, and pagination should be restarted// from the first page of results. The page token is typically valid for// several hours. However, if new items are added or removed, your expected// results might differ.NextPageTokenstring `json:"nextPageToken,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Drives") 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. "Drives") 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:"-"`}

DriveList: A list of shared drives.

func (DriveList)MarshalJSONadded inv0.4.0

func (sDriveList) MarshalJSON() ([]byte,error)

typeDriveRestrictionsadded inv0.4.0

type DriveRestrictions struct {// AdminManagedRestrictions: Whether administrative privileges on this shared// drive are required to modify restrictions.AdminManagedRestrictionsbool `json:"adminManagedRestrictions,omitempty"`// CopyRequiresWriterPermission: Whether the options to copy, print, or// download files inside this shared drive, should be disabled for readers and// commenters. When this restriction is set to `true`, it will override the// similarly named field to `true` for any file inside this shared drive.CopyRequiresWriterPermissionbool `json:"copyRequiresWriterPermission,omitempty"`// DomainUsersOnly: Whether access to this shared drive and items inside this// shared drive is restricted to users of the domain to which this shared drive// belongs. This restriction may be overridden by other sharing policies// controlled outside of this shared drive.DomainUsersOnlybool `json:"domainUsersOnly,omitempty"`// DownloadRestriction: Download restrictions applied by shared drive managers.DownloadRestriction *DownloadRestriction `json:"downloadRestriction,omitempty"`// DriveMembersOnly: Whether access to items inside this shared drive is// restricted to its members.DriveMembersOnlybool `json:"driveMembersOnly,omitempty"`// SharingFoldersRequiresOrganizerPermission: If true, only users with the// organizer role can share folders. If false, users with either the organizer// role or the file organizer role can share folders.SharingFoldersRequiresOrganizerPermissionbool `json:"sharingFoldersRequiresOrganizerPermission,omitempty"`// ForceSendFields is a list of field names (e.g. "AdminManagedRestrictions")// 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. "AdminManagedRestrictions") 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:"-"`}

DriveRestrictions: A set of restrictions that apply to this shared drive oritems inside this shared drive. Note that restrictions can't be set whencreating a shared drive. To add a restriction, first create a shared driveand then use `drives.update` to add restrictions.

func (DriveRestrictions)MarshalJSONadded inv0.4.0

func (sDriveRestrictions) MarshalJSON() ([]byte,error)

typeDrivesCreateCalladded inv0.4.0

type DrivesCreateCall struct {// contains filtered or unexported fields}

func (*DrivesCreateCall)Contextadded inv0.4.0

Context sets the context to be used in this call's Do method.

func (*DrivesCreateCall)Doadded inv0.4.0

Do executes the "drive.drives.create" call.Any non-2xx status code is an error. Response headers are in either*Drive.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*DrivesCreateCall)Fieldsadded inv0.4.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*DrivesCreateCall)Headeradded inv0.4.0

func (c *DrivesCreateCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeDrivesDeleteCalladded inv0.4.0

type DrivesDeleteCall struct {// contains filtered or unexported fields}

func (*DrivesDeleteCall)AllowItemDeletionadded inv0.76.0

func (c *DrivesDeleteCall) AllowItemDeletion(allowItemDeletionbool) *DrivesDeleteCall

AllowItemDeletion sets the optional parameter "allowItemDeletion": Whetherany items inside the shared drive should also be deleted. This option isonly supported when `useDomainAdminAccess` is also set to `true`.

func (*DrivesDeleteCall)Contextadded inv0.4.0

Context sets the context to be used in this call's Do method.

func (*DrivesDeleteCall)Doadded inv0.4.0

Do executes the "drive.drives.delete" call.

func (*DrivesDeleteCall)Fieldsadded inv0.4.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*DrivesDeleteCall)Headeradded inv0.4.0

func (c *DrivesDeleteCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*DrivesDeleteCall)UseDomainAdminAccessadded inv0.76.0

func (c *DrivesDeleteCall) UseDomainAdminAccess(useDomainAdminAccessbool) *DrivesDeleteCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator; if set to true, then therequester will be granted access if they are an administrator of the domainto which the shared drive belongs.

typeDrivesGetCalladded inv0.4.0

type DrivesGetCall struct {// contains filtered or unexported fields}

func (*DrivesGetCall)Contextadded inv0.4.0

Context sets the context to be used in this call's Do method.

func (*DrivesGetCall)Doadded inv0.4.0

func (c *DrivesGetCall) Do(opts ...googleapi.CallOption) (*Drive,error)

Do executes the "drive.drives.get" call.Any non-2xx status code is an error. Response headers are in either*Drive.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*DrivesGetCall)Fieldsadded inv0.4.0

func (c *DrivesGetCall) Fields(s ...googleapi.Field) *DrivesGetCall

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*DrivesGetCall)Headeradded inv0.4.0

func (c *DrivesGetCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*DrivesGetCall)IfNoneMatchadded inv0.4.0

func (c *DrivesGetCall) IfNoneMatch(entityTagstring) *DrivesGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*DrivesGetCall)UseDomainAdminAccessadded inv0.4.0

func (c *DrivesGetCall) UseDomainAdminAccess(useDomainAdminAccessbool) *DrivesGetCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator; if set to true, then therequester will be granted access if they are an administrator of the domainto which the shared drive belongs.

typeDrivesHideCalladded inv0.4.0

type DrivesHideCall struct {// contains filtered or unexported fields}

func (*DrivesHideCall)Contextadded inv0.4.0

Context sets the context to be used in this call's Do method.

func (*DrivesHideCall)Doadded inv0.4.0

func (c *DrivesHideCall) Do(opts ...googleapi.CallOption) (*Drive,error)

Do executes the "drive.drives.hide" call.Any non-2xx status code is an error. Response headers are in either*Drive.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*DrivesHideCall)Fieldsadded inv0.4.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*DrivesHideCall)Headeradded inv0.4.0

func (c *DrivesHideCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeDrivesListCalladded inv0.4.0

type DrivesListCall struct {// contains filtered or unexported fields}

func (*DrivesListCall)Contextadded inv0.4.0

Context sets the context to be used in this call's Do method.

func (*DrivesListCall)Doadded inv0.4.0

Do executes the "drive.drives.list" call.Any non-2xx status code is an error. Response headers are in either*DriveList.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*DrivesListCall)Fieldsadded inv0.4.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*DrivesListCall)Headeradded inv0.4.0

func (c *DrivesListCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*DrivesListCall)IfNoneMatchadded inv0.4.0

func (c *DrivesListCall) IfNoneMatch(entityTagstring) *DrivesListCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*DrivesListCall)PageSizeadded inv0.4.0

func (c *DrivesListCall) PageSize(pageSizeint64) *DrivesListCall

PageSize sets the optional parameter "pageSize": Maximum number of shareddrives to return per page.

func (*DrivesListCall)PageTokenadded inv0.4.0

func (c *DrivesListCall) PageToken(pageTokenstring) *DrivesListCall

PageToken sets the optional parameter "pageToken": Page token for shareddrives.

func (*DrivesListCall)Pagesadded inv0.4.0

func (c *DrivesListCall) Pages(ctxcontext.Context, f func(*DriveList)error)error

Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.

func (*DrivesListCall)Qadded inv0.4.0

Q sets the optional parameter "q": Query string for searching shared drives.

func (*DrivesListCall)UseDomainAdminAccessadded inv0.4.0

func (c *DrivesListCall) UseDomainAdminAccess(useDomainAdminAccessbool) *DrivesListCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator; if set to true, then all shareddrives of the domain in which the requester is an administrator arereturned.

typeDrivesServiceadded inv0.4.0

type DrivesService struct {// contains filtered or unexported fields}

funcNewDrivesServiceadded inv0.4.0

func NewDrivesService(s *Service) *DrivesService

func (*DrivesService)Createadded inv0.4.0

func (r *DrivesService) Create(requestIdstring, drive *Drive) *DrivesCreateCall

Create: Creates a shared drive. For more information, see Manage shareddrives(https://developers.google.com/workspace/drive/api/guides/manage-shareddrives).

  • requestId: An ID, such as a random UUID, which uniquely identifies thisuser's request for idempotent creation of a shared drive. A repeatedrequest by the same user and with the same request ID will avoid creatingduplicates by attempting to create the same shared drive. If the shareddrive already exists a 409 error will be returned.

func (*DrivesService)Deleteadded inv0.4.0

func (r *DrivesService) Delete(driveIdstring) *DrivesDeleteCall

Delete: Permanently deletes a shared drive for which the user is an`organizer`. The shared drive cannot contain any untrashed items. For moreinformation, see Manage shared drives(https://developers.google.com/workspace/drive/api/guides/manage-shareddrives).

- driveId: The ID of the shared drive.

func (*DrivesService)Getadded inv0.4.0

func (r *DrivesService) Get(driveIdstring) *DrivesGetCall

Get: Gets a shared drive's metadata by ID. For more information, see Manageshared drives(https://developers.google.com/workspace/drive/api/guides/manage-shareddrives).

- driveId: The ID of the shared drive.

func (*DrivesService)Hideadded inv0.4.0

func (r *DrivesService) Hide(driveIdstring) *DrivesHideCall

Hide: Hides a shared drive from the default view. For more information, seeManage shared drives(https://developers.google.com/workspace/drive/api/guides/manage-shareddrives).

- driveId: The ID of the shared drive.

func (*DrivesService)Listadded inv0.4.0

func (r *DrivesService) List() *DrivesListCall

List: Lists the user's shared drives. This method accepts the `q`parameter, which is a search query combining one or more search terms. Formore information, see the Search for shared drives(/workspace/drive/api/guides/search-shareddrives) guide.

func (*DrivesService)Unhideadded inv0.4.0

func (r *DrivesService) Unhide(driveIdstring) *DrivesUnhideCall

Unhide: Restores a shared drive to the default view. For more information,see Manage shared drives(https://developers.google.com/workspace/drive/api/guides/manage-shareddrives).

- driveId: The ID of the shared drive.

func (*DrivesService)Updateadded inv0.4.0

func (r *DrivesService) Update(driveIdstring, drive *Drive) *DrivesUpdateCall

Update: Updates the metadata for a shared drive. For more information, seeManage shared drives(https://developers.google.com/workspace/drive/api/guides/manage-shareddrives).

- driveId: The ID of the shared drive.

typeDrivesUnhideCalladded inv0.4.0

type DrivesUnhideCall struct {// contains filtered or unexported fields}

func (*DrivesUnhideCall)Contextadded inv0.4.0

Context sets the context to be used in this call's Do method.

func (*DrivesUnhideCall)Doadded inv0.4.0

Do executes the "drive.drives.unhide" call.Any non-2xx status code is an error. Response headers are in either*Drive.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*DrivesUnhideCall)Fieldsadded inv0.4.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*DrivesUnhideCall)Headeradded inv0.4.0

func (c *DrivesUnhideCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeDrivesUpdateCalladded inv0.4.0

type DrivesUpdateCall struct {// contains filtered or unexported fields}

func (*DrivesUpdateCall)Contextadded inv0.4.0

Context sets the context to be used in this call's Do method.

func (*DrivesUpdateCall)Doadded inv0.4.0

Do executes the "drive.drives.update" call.Any non-2xx status code is an error. Response headers are in either*Drive.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*DrivesUpdateCall)Fieldsadded inv0.4.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*DrivesUpdateCall)Headeradded inv0.4.0

func (c *DrivesUpdateCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*DrivesUpdateCall)UseDomainAdminAccessadded inv0.4.0

func (c *DrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccessbool) *DrivesUpdateCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator; if set to true, then therequester will be granted access if they are an administrator of the domainto which the shared drive belongs.

typeFile

type File struct {// AppProperties: A collection of arbitrary key-value pairs which are private// to the requesting app.// Entries with null values are cleared in update and copy requests. These// properties can only be retrieved using an authenticated request. An// authenticated request uses an access token obtained with a OAuth 2 client// ID. You cannot use an API key to retrieve private properties.AppProperties map[string]string `json:"appProperties,omitempty"`// Capabilities: Output only. Capabilities the current user has on this file.// Each capability corresponds to a fine-grained action that a user may take.// For more information, see Understand file capabilities// (https://developers.google.com/workspace/drive/api/guides/manage-sharing#capabilities).Capabilities *FileCapabilities `json:"capabilities,omitempty"`// ContentHints: Additional information about the content of the file. These// fields are never populated in responses.ContentHints *FileContentHints `json:"contentHints,omitempty"`// ContentRestrictions: Restrictions for accessing the content of the file.// Only populated if such a restriction exists.ContentRestrictions []*ContentRestriction `json:"contentRestrictions,omitempty"`// CopyRequiresWriterPermission: Whether the options to copy, print, or// download this file should be disabled for readers and commenters.CopyRequiresWriterPermissionbool `json:"copyRequiresWriterPermission,omitempty"`// CreatedTime: The time at which the file was created (RFC 3339 date-time).CreatedTimestring `json:"createdTime,omitempty"`// Description: A short description of the file.Descriptionstring `json:"description,omitempty"`// DownloadRestrictions: Download restrictions applied on the file.DownloadRestrictions *DownloadRestrictionsMetadata `json:"downloadRestrictions,omitempty"`// DriveId: Output only. ID of the shared drive the file resides in. Only// populated for items in shared drives.DriveIdstring `json:"driveId,omitempty"`// ExplicitlyTrashed: Output only. Whether the file has been explicitly// trashed, as opposed to recursively trashed from a parent folder.ExplicitlyTrashedbool `json:"explicitlyTrashed,omitempty"`// ExportLinks: Output only. Links for exporting Docs Editors files to specific// formats.ExportLinks map[string]string `json:"exportLinks,omitempty"`// FileExtension: Output only. The final component of `fullFileExtension`. This// is only available for files with binary content in Google Drive.FileExtensionstring `json:"fileExtension,omitempty"`// FolderColorRgb: The color for a folder or a shortcut to a folder as an RGB// hex string. The supported colors are published in the `folderColorPalette`// field of the `about` (/workspace/drive/api/reference/rest/v3/about)// resource. If an unsupported color is specified, the closest color in the// palette is used instead.FolderColorRgbstring `json:"folderColorRgb,omitempty"`// FullFileExtension: Output only. The full file extension extracted from the// `name` field. May contain multiple concatenated extensions, such as// "tar.gz". This is only available for files with binary content in Google// Drive. This is automatically updated when the `name` field changes, however// it's not cleared if the new name doesn't contain a valid extension.FullFileExtensionstring `json:"fullFileExtension,omitempty"`// HasAugmentedPermissions: Output only. Whether there are permissions directly// on this file. This field is only populated for items in shared drives.HasAugmentedPermissionsbool `json:"hasAugmentedPermissions,omitempty"`// HasThumbnail: Output only. Whether this file has a thumbnail. This doesn't// indicate whether the requesting app has access to the thumbnail. To check// access, look for the presence of the thumbnailLink field.HasThumbnailbool `json:"hasThumbnail,omitempty"`// HeadRevisionId: Output only. The ID of the file's head revision. This is// currently only available for files with binary content in Google Drive.HeadRevisionIdstring `json:"headRevisionId,omitempty"`// IconLink: Output only. A static, unauthenticated link to the file's icon.IconLinkstring `json:"iconLink,omitempty"`// Id: The ID of the file.Idstring `json:"id,omitempty"`// ImageMediaMetadata: Output only. Additional metadata about image media, if// available.ImageMediaMetadata *FileImageMediaMetadata `json:"imageMediaMetadata,omitempty"`// InheritedPermissionsDisabled: Whether this file has inherited permissions// disabled. Inherited permissions are enabled by default.InheritedPermissionsDisabledbool `json:"inheritedPermissionsDisabled,omitempty"`// IsAppAuthorized: Output only. Whether the file was created or opened by the// requesting app.IsAppAuthorizedbool `json:"isAppAuthorized,omitempty"`// Kind: Output only. Identifies what kind of resource this is. Value: the// fixed string "drive#file".Kindstring `json:"kind,omitempty"`// LabelInfo: Output only. An overview of the labels on the file.LabelInfo *FileLabelInfo `json:"labelInfo,omitempty"`// LastModifyingUser: Output only. The last user to modify the file. This field// is only populated when the last modification was performed by a signed-in// user.LastModifyingUser *User `json:"lastModifyingUser,omitempty"`// LinkShareMetadata: Contains details about the link URLs that clients are// using to refer to this item.LinkShareMetadata *FileLinkShareMetadata `json:"linkShareMetadata,omitempty"`// Md5Checksum: Output only. The MD5 checksum for the content of the file. This// is only applicable to files with binary content in Google Drive.Md5Checksumstring `json:"md5Checksum,omitempty"`// MimeType: The MIME type of the file. Google Drive attempts to automatically// detect an appropriate value from uploaded content, if no value is provided.// The value cannot be changed unless a new revision is uploaded. If a file is// created with a Google Doc MIME type, the uploaded content is imported, if// possible. The supported import formats are published in the `about`// (/workspace/drive/api/reference/rest/v3/about) resource.MimeTypestring `json:"mimeType,omitempty"`// ModifiedByMe: Output only. Whether the file has been modified by this user.ModifiedByMebool `json:"modifiedByMe,omitempty"`// ModifiedByMeTime: The last time the file was modified by the user (RFC 3339// date-time).ModifiedByMeTimestring `json:"modifiedByMeTime,omitempty"`// ModifiedTime: he last time the file was modified by anyone (RFC 3339// date-time). Note that setting modifiedTime will also update modifiedByMeTime// for the user.ModifiedTimestring `json:"modifiedTime,omitempty"`// Name: The name of the file. This isn't necessarily unique within a folder.// Note that for immutable items such as the top-level folders of shared// drives, the My Drive root folder, and the Application Data folder, the name// is constant.Namestring `json:"name,omitempty"`// OriginalFilename: The original filename of the uploaded content if// available, or else the original value of the `name` field. This is only// available for files with binary content in Google Drive.OriginalFilenamestring `json:"originalFilename,omitempty"`// OwnedByMe: Output only. Whether the user owns the file. Not populated for// items in shared drives.OwnedByMebool `json:"ownedByMe,omitempty"`// Owners: Output only. The owner of this file. Only certain legacy files may// have more than one owner. This field isn't populated for items in shared// drives.Owners []*User `json:"owners,omitempty"`// Parents: The ID of the parent folder containing the file. A file can only// have one parent folder; specifying multiple parents isn't supported. If not// specified as part of a create request, the file is placed directly in the// user's My Drive folder. If not specified as part of a copy request, the file// inherits any discoverable parent of the source file. Update requests must// use the `addParents` and `removeParents` parameters to modify the parents// list.Parents []string `json:"parents,omitempty"`// PermissionIds: Output only. List of permission IDs for users with access to// this file.PermissionIds []string `json:"permissionIds,omitempty"`// Permissions: Output only. The full list of permissions for the file. This is// only available if the requesting user can share the file. Not populated for// items in shared drives.Permissions []*Permission `json:"permissions,omitempty"`// Properties: A collection of arbitrary key-value pairs which are visible to// all apps.// Entries with null values are cleared in update and copy requests.Properties map[string]string `json:"properties,omitempty"`// QuotaBytesUsed: Output only. The number of storage quota bytes used by the// file. This includes the head revision as well as previous revisions with// `keepForever` enabled.QuotaBytesUsedint64 `json:"quotaBytesUsed,omitempty,string"`// ResourceKey: Output only. A key needed to access the item via a shared link.ResourceKeystring `json:"resourceKey,omitempty"`// Sha1Checksum: Output only. The SHA1 checksum associated with this file, if// available. This field is only populated for files with content stored in// Google Drive; it's not populated for Docs Editors or shortcut files.Sha1Checksumstring `json:"sha1Checksum,omitempty"`// Sha256Checksum: Output only. The SHA256 checksum associated with this file,// if available. This field is only populated for files with content stored in// Google Drive; it's not populated for Docs Editors or shortcut files.Sha256Checksumstring `json:"sha256Checksum,omitempty"`// Shared: Output only. Whether the file has been shared. Not populated for// items in shared drives.Sharedbool `json:"shared,omitempty"`// SharedWithMeTime: The time at which the file was shared with the user, if// applicable (RFC 3339 date-time).SharedWithMeTimestring `json:"sharedWithMeTime,omitempty"`// SharingUser: Output only. The user who shared the file with the requesting// user, if applicable.SharingUser *User `json:"sharingUser,omitempty"`// ShortcutDetails: Shortcut file details. Only populated for shortcut files,// which have the mimeType field set to `application/vnd.google-apps.shortcut`.// Can only be set on `files.create` requests.ShortcutDetails *FileShortcutDetails `json:"shortcutDetails,omitempty"`// Size: Output only. Size in bytes of blobs and Google Workspace editor files.// Won't be populated for files that have no size, like shortcuts and folders.Sizeint64 `json:"size,omitempty,string"`// Spaces: Output only. The list of spaces which contain the file. The// currently supported values are `drive`, `appDataFolder`, and `photos`.Spaces []string `json:"spaces,omitempty"`// Starred: Whether the user has starred the file.Starredbool `json:"starred,omitempty"`// TeamDriveId: Deprecated: Output only. Use `driveId` instead.TeamDriveIdstring `json:"teamDriveId,omitempty"`// ThumbnailLink: Output only. A short-lived link to the file's thumbnail, if// available. Typically lasts on the order of hours. Not intended for direct// usage on web applications due to Cross-Origin Resource Sharing (CORS)// (https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) policies. Consider// using a proxy server. Only populated when the requesting app can access the// file's content. If the file isn't shared publicly, the URL returned in// `files.thumbnailLink` must be fetched using a credentialed request.ThumbnailLinkstring `json:"thumbnailLink,omitempty"`// ThumbnailVersion: Output only. The thumbnail version for use in thumbnail// cache invalidation.ThumbnailVersionint64 `json:"thumbnailVersion,omitempty,string"`// Trashed: Whether the file has been trashed, either explicitly or from a// trashed parent folder. Only the owner may trash a file, and other users// cannot see files in the owner's trash.Trashedbool `json:"trashed,omitempty"`// TrashedTime: The time that the item was trashed (RFC 3339 date-time). Only// populated for items in shared drives.TrashedTimestring `json:"trashedTime,omitempty"`// TrashingUser: Output only. If the file has been explicitly trashed, the user// who trashed it. Only populated for items in shared drives.TrashingUser *User `json:"trashingUser,omitempty"`// Version: Output only. A monotonically increasing version number for the// file. This reflects every change made to the file on the server, even those// not visible to the user.Versionint64 `json:"version,omitempty,string"`// VideoMediaMetadata: Output only. Additional metadata about video media. This// may not be available immediately upon upload.VideoMediaMetadata *FileVideoMediaMetadata `json:"videoMediaMetadata,omitempty"`// ViewedByMe: Output only. Whether the file has been viewed by this user.ViewedByMebool `json:"viewedByMe,omitempty"`// ViewedByMeTime: The last time the file was viewed by the user (RFC 3339// date-time).ViewedByMeTimestring `json:"viewedByMeTime,omitempty"`// ViewersCanCopyContent: Deprecated: Use `copyRequiresWriterPermission`// instead.ViewersCanCopyContentbool `json:"viewersCanCopyContent,omitempty"`// WebContentLink: Output only. A link for downloading the content of the file// in a browser. This is only available for files with binary content in Google// Drive.WebContentLinkstring `json:"webContentLink,omitempty"`// WebViewLink: Output only. A link for opening the file in a relevant Google// editor or viewer in a browser.WebViewLinkstring `json:"webViewLink,omitempty"`// WritersCanShare: Whether users with only `writer` permission can modify the// file's permissions. Not populated for items in shared drives.WritersCanSharebool `json:"writersCanShare,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "AppProperties") 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. "AppProperties") 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:"-"`}

File: The metadata for a file. Some resource methods (such as`files.update`) require a `fileId`. Use the `files.list` method to retrievethe ID for a file.

func (File)MarshalJSON

func (sFile) MarshalJSON() ([]byte,error)

typeFileCapabilities

type FileCapabilities struct {// CanAcceptOwnership: Output only. Whether the current user is the pending// owner of the file. Not populated for shared drive files.CanAcceptOwnershipbool `json:"canAcceptOwnership,omitempty"`// CanAddChildren: Output only. Whether the current user can add children to// this folder. This is always `false` when the item isn't a folder.CanAddChildrenbool `json:"canAddChildren,omitempty"`// CanAddFolderFromAnotherDrive: Output only. Whether the current user can add// a folder from another drive (different shared drive or My Drive) to this// folder. This is `false` when the item isn't a folder. Only populated for// items in shared drives.CanAddFolderFromAnotherDrivebool `json:"canAddFolderFromAnotherDrive,omitempty"`// CanAddMyDriveParent: Output only. Whether the current user can add a parent// for the item without removing an existing parent in the same request. Not// populated for shared drive files.CanAddMyDriveParentbool `json:"canAddMyDriveParent,omitempty"`// CanChangeCopyRequiresWriterPermission: Output only. Whether the current user// can change the `copyRequiresWriterPermission` restriction of this file.CanChangeCopyRequiresWriterPermissionbool `json:"canChangeCopyRequiresWriterPermission,omitempty"`// CanChangeItemDownloadRestriction: Output only. Whether the current user can// change the owner or organizer-applied download restrictions of the file.CanChangeItemDownloadRestrictionbool `json:"canChangeItemDownloadRestriction,omitempty"`// CanChangeSecurityUpdateEnabled: Output only. Whether the current user can// change the `securityUpdateEnabled` field on link share metadata.CanChangeSecurityUpdateEnabledbool `json:"canChangeSecurityUpdateEnabled,omitempty"`// CanChangeViewersCanCopyContent: Deprecated: Output only.CanChangeViewersCanCopyContentbool `json:"canChangeViewersCanCopyContent,omitempty"`// CanComment: Output only. Whether the current user can comment on this file.CanCommentbool `json:"canComment,omitempty"`// CanCopy: Output only. Whether the current user can copy this file. For an// item in a shared drive, whether the current user can copy non-folder// descendants of this item, or this item if it's not a folder.CanCopybool `json:"canCopy,omitempty"`// CanDelete: Output only. Whether the current user can delete this file.CanDeletebool `json:"canDelete,omitempty"`// CanDeleteChildren: Output only. Whether the current user can delete children// of this folder. This is `false` when the item isn't a folder. Only populated// for items in shared drives.CanDeleteChildrenbool `json:"canDeleteChildren,omitempty"`// CanDisableInheritedPermissions: Whether a user can disable inherited// permissions.CanDisableInheritedPermissionsbool `json:"canDisableInheritedPermissions,omitempty"`// CanDownload: Output only. Whether the current user can download this file.CanDownloadbool `json:"canDownload,omitempty"`// CanEdit: Output only. Whether the current user can edit this file. Other// factors may limit the type of changes a user can make to a file. For// example, see `canChangeCopyRequiresWriterPermission` or `canModifyContent`.CanEditbool `json:"canEdit,omitempty"`// CanEnableInheritedPermissions: Whether a user can re-enable inherited// permissions.CanEnableInheritedPermissionsbool `json:"canEnableInheritedPermissions,omitempty"`// CanListChildren: Output only. Whether the current user can list the children// of this folder. This is always `false` when the item isn't a folder.CanListChildrenbool `json:"canListChildren,omitempty"`// CanModifyContent: Output only. Whether the current user can modify the// content of this file.CanModifyContentbool `json:"canModifyContent,omitempty"`// CanModifyContentRestriction: Deprecated: Output only. Use one of// `canModifyEditorContentRestriction`, `canModifyOwnerContentRestriction`, or// `canRemoveContentRestriction`.CanModifyContentRestrictionbool `json:"canModifyContentRestriction,omitempty"`// CanModifyEditorContentRestriction: Output only. Whether the current user can// add or modify content restrictions on the file which are editor restricted.CanModifyEditorContentRestrictionbool `json:"canModifyEditorContentRestriction,omitempty"`// CanModifyLabels: Output only. Whether the current user can modify the labels// on the file.CanModifyLabelsbool `json:"canModifyLabels,omitempty"`// CanModifyOwnerContentRestriction: Output only. Whether the current user can// add or modify content restrictions which are owner restricted.CanModifyOwnerContentRestrictionbool `json:"canModifyOwnerContentRestriction,omitempty"`// CanMoveChildrenOutOfDrive: Output only. Whether the current user can move// children of this folder outside of the shared drive. This is `false` when// the item isn't a folder. Only populated for items in shared drives.CanMoveChildrenOutOfDrivebool `json:"canMoveChildrenOutOfDrive,omitempty"`// CanMoveChildrenOutOfTeamDrive: Deprecated: Output only. Use// `canMoveChildrenOutOfDrive` instead.CanMoveChildrenOutOfTeamDrivebool `json:"canMoveChildrenOutOfTeamDrive,omitempty"`// CanMoveChildrenWithinDrive: Output only. Whether the current user can move// children of this folder within this drive. This is `false` when the item// isn't a folder. Note that a request to move the child may still fail// depending on the current user's access to the child and to the destination// folder.CanMoveChildrenWithinDrivebool `json:"canMoveChildrenWithinDrive,omitempty"`// CanMoveChildrenWithinTeamDrive: Deprecated: Output only. Use// `canMoveChildrenWithinDrive` instead.CanMoveChildrenWithinTeamDrivebool `json:"canMoveChildrenWithinTeamDrive,omitempty"`// CanMoveItemIntoTeamDrive: Deprecated: Output only. Use// `canMoveItemOutOfDrive` instead.CanMoveItemIntoTeamDrivebool `json:"canMoveItemIntoTeamDrive,omitempty"`// CanMoveItemOutOfDrive: Output only. Whether the current user can move this// item outside of this drive by changing its parent. Note that a request to// change the parent of the item may still fail depending on the new parent// that's being added.CanMoveItemOutOfDrivebool `json:"canMoveItemOutOfDrive,omitempty"`// CanMoveItemOutOfTeamDrive: Deprecated: Output only. Use// `canMoveItemOutOfDrive` instead.CanMoveItemOutOfTeamDrivebool `json:"canMoveItemOutOfTeamDrive,omitempty"`// CanMoveItemWithinDrive: Output only. Whether the current user can move this// item within this drive. Note that a request to change the parent of the item// may still fail depending on the new parent that's being added and the parent// that is being removed.CanMoveItemWithinDrivebool `json:"canMoveItemWithinDrive,omitempty"`// CanMoveItemWithinTeamDrive: Deprecated: Output only. Use// `canMoveItemWithinDrive` instead.CanMoveItemWithinTeamDrivebool `json:"canMoveItemWithinTeamDrive,omitempty"`// CanMoveTeamDriveItem: Deprecated: Output only. Use `canMoveItemWithinDrive`// or `canMoveItemOutOfDrive` instead.CanMoveTeamDriveItembool `json:"canMoveTeamDriveItem,omitempty"`// CanReadDrive: Output only. Whether the current user can read the shared// drive to which this file belongs. Only populated for items in shared drives.CanReadDrivebool `json:"canReadDrive,omitempty"`// CanReadLabels: Output only. Whether the current user can read the labels on// the file.CanReadLabelsbool `json:"canReadLabels,omitempty"`// CanReadRevisions: Output only. Whether the current user can read the// revisions resource of this file. For a shared drive item, whether revisions// of non-folder descendants of this item, or this item if it's not a folder,// can be read.CanReadRevisionsbool `json:"canReadRevisions,omitempty"`// CanReadTeamDrive: Deprecated: Output only. Use `canReadDrive` instead.CanReadTeamDrivebool `json:"canReadTeamDrive,omitempty"`// CanRemoveChildren: Output only. Whether the current user can remove children// from this folder. This is always `false` when the item isn't a folder. For a// folder in a shared drive, use `canDeleteChildren` or `canTrashChildren`// instead.CanRemoveChildrenbool `json:"canRemoveChildren,omitempty"`// CanRemoveContentRestriction: Output only. Whether there's a content// restriction on the file that can be removed by the current user.CanRemoveContentRestrictionbool `json:"canRemoveContentRestriction,omitempty"`// CanRemoveMyDriveParent: Output only. Whether the current user can remove a// parent from the item without adding another parent in the same request. Not// populated for shared drive files.CanRemoveMyDriveParentbool `json:"canRemoveMyDriveParent,omitempty"`// CanRename: Output only. Whether the current user can rename this file.CanRenamebool `json:"canRename,omitempty"`// CanShare: Output only. Whether the current user can modify the sharing// settings for this file.CanSharebool `json:"canShare,omitempty"`// CanTrash: Output only. Whether the current user can move this file to trash.CanTrashbool `json:"canTrash,omitempty"`// CanTrashChildren: Output only. Whether the current user can trash children// of this folder. This is `false` when the item isn't a folder. Only populated// for items in shared drives.CanTrashChildrenbool `json:"canTrashChildren,omitempty"`// CanUntrash: Output only. Whether the current user can restore this file from// trash.CanUntrashbool `json:"canUntrash,omitempty"`// ForceSendFields is a list of field names (e.g. "CanAcceptOwnership") 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. "CanAcceptOwnership") 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:"-"`}

FileCapabilities: Output only. Capabilities the current user has on thisfile. Each capability corresponds to a fine-grained action that a user maytake. For more information, see Understand file capabilities(https://developers.google.com/workspace/drive/api/guides/manage-sharing#capabilities).

func (FileCapabilities)MarshalJSON

func (sFileCapabilities) MarshalJSON() ([]byte,error)

typeFileContentHints

type FileContentHints struct {// IndexableText: Text to be indexed for the file to improve fullText queries.// This is limited to 128 KB in length and may contain HTML elements.IndexableTextstring `json:"indexableText,omitempty"`// Thumbnail: A thumbnail for the file. This will only be used if Google Drive// cannot generate a standard thumbnail.Thumbnail *FileContentHintsThumbnail `json:"thumbnail,omitempty"`// ForceSendFields is a list of field names (e.g. "IndexableText") 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. "IndexableText") 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:"-"`}

FileContentHints: Additional information about the content of the file.These fields are never populated in responses.

func (FileContentHints)MarshalJSON

func (sFileContentHints) MarshalJSON() ([]byte,error)

typeFileContentHintsThumbnail

type FileContentHintsThumbnail struct {// Image: The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5// (https://datatracker.ietf.org/doc/html/rfc4648#section-5)).Imagestring `json:"image,omitempty"`// MimeType: The MIME type of the thumbnail.MimeTypestring `json:"mimeType,omitempty"`// ForceSendFields is a list of field names (e.g. "Image") 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. "Image") 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:"-"`}

FileContentHintsThumbnail: A thumbnail for the file. This will only be usedif Google Drive cannot generate a standard thumbnail.

func (FileContentHintsThumbnail)MarshalJSON

func (sFileContentHintsThumbnail) MarshalJSON() ([]byte,error)

typeFileImageMediaMetadata

type FileImageMediaMetadata struct {// Aperture: Output only. The aperture used to create the photo (f-number).Aperturefloat64 `json:"aperture,omitempty"`// CameraMake: Output only. The make of the camera used to create the photo.CameraMakestring `json:"cameraMake,omitempty"`// CameraModel: Output only. The model of the camera used to create the photo.CameraModelstring `json:"cameraModel,omitempty"`// ColorSpace: Output only. The color space of the photo.ColorSpacestring `json:"colorSpace,omitempty"`// ExposureBias: Output only. The exposure bias of the photo (APEX value).ExposureBiasfloat64 `json:"exposureBias,omitempty"`// ExposureMode: Output only. The exposure mode used to create the photo.ExposureModestring `json:"exposureMode,omitempty"`// ExposureTime: Output only. The length of the exposure, in seconds.ExposureTimefloat64 `json:"exposureTime,omitempty"`// FlashUsed: Output only. Whether a flash was used to create the photo.FlashUsedbool `json:"flashUsed,omitempty"`// FocalLength: Output only. The focal length used to create the photo, in// millimeters.FocalLengthfloat64 `json:"focalLength,omitempty"`// Height: Output only. The height of the image in pixels.Heightint64 `json:"height,omitempty"`// IsoSpeed: Output only. The ISO speed used to create the photo.IsoSpeedint64 `json:"isoSpeed,omitempty"`// Lens: Output only. The lens used to create the photo.Lensstring `json:"lens,omitempty"`// Location: Output only. Geographic location information stored in the image.Location *FileImageMediaMetadataLocation `json:"location,omitempty"`// MaxApertureValue: Output only. The smallest f-number of the lens at the// focal length used to create the photo (APEX value).MaxApertureValuefloat64 `json:"maxApertureValue,omitempty"`// MeteringMode: Output only. The metering mode used to create the photo.MeteringModestring `json:"meteringMode,omitempty"`// Rotation: Output only. The number of clockwise 90 degree rotations applied// from the image's original orientation.Rotationint64 `json:"rotation,omitempty"`// Sensor: Output only. The type of sensor used to create the photo.Sensorstring `json:"sensor,omitempty"`// SubjectDistance: Output only. The distance to the subject of the photo, in// meters.SubjectDistanceint64 `json:"subjectDistance,omitempty"`// Time: Output only. The date and time the photo was taken (EXIF DateTime).Timestring `json:"time,omitempty"`// WhiteBalance: Output only. The white balance mode used to create the photo.WhiteBalancestring `json:"whiteBalance,omitempty"`// Width: Output only. The width of the image in pixels.Widthint64 `json:"width,omitempty"`// ForceSendFields is a list of field names (e.g. "Aperture") 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. "Aperture") 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:"-"`}

FileImageMediaMetadata: Output only. Additional metadata about image media,if available.

func (FileImageMediaMetadata)MarshalJSON

func (sFileImageMediaMetadata) MarshalJSON() ([]byte,error)

func (*FileImageMediaMetadata)UnmarshalJSON

func (s *FileImageMediaMetadata) UnmarshalJSON(data []byte)error

typeFileImageMediaMetadataLocation

type FileImageMediaMetadataLocation struct {// Altitude: Output only. The altitude stored in the image.Altitudefloat64 `json:"altitude,omitempty"`// Latitude: Output only. The latitude stored in the image.Latitudefloat64 `json:"latitude,omitempty"`// Longitude: Output only. The longitude stored in the image.Longitudefloat64 `json:"longitude,omitempty"`// ForceSendFields is a list of field names (e.g. "Altitude") 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. "Altitude") 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:"-"`}

FileImageMediaMetadataLocation: Output only. Geographic location informationstored in the image.

func (FileImageMediaMetadataLocation)MarshalJSON

func (sFileImageMediaMetadataLocation) MarshalJSON() ([]byte,error)

func (*FileImageMediaMetadataLocation)UnmarshalJSON

func (s *FileImageMediaMetadataLocation) UnmarshalJSON(data []byte)error

typeFileLabelInfoadded inv0.88.0

type FileLabelInfo struct {// Labels: Output only. The set of labels on the file as requested by the label// IDs in the `includeLabels` parameter. By default, no labels are returned.Labels []*Label `json:"labels,omitempty"`// ForceSendFields is a list of field names (e.g. "Labels") 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. "Labels") 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:"-"`}

FileLabelInfo: Output only. An overview of the labels on the file.

func (FileLabelInfo)MarshalJSONadded inv0.88.0

func (sFileLabelInfo) MarshalJSON() ([]byte,error)

typeFileLinkShareMetadataadded inv0.49.0

type FileLinkShareMetadata struct {// SecurityUpdateEligible: Output only. Whether the file is eligible for// security update.SecurityUpdateEligiblebool `json:"securityUpdateEligible,omitempty"`// SecurityUpdateEnabled: Output only. Whether the security update is enabled// for this file.SecurityUpdateEnabledbool `json:"securityUpdateEnabled,omitempty"`// ForceSendFields is a list of field names (e.g. "SecurityUpdateEligible") 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. "SecurityUpdateEligible") 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:"-"`}

FileLinkShareMetadata: Contains details about the link URLs that clients areusing to refer to this item.

func (FileLinkShareMetadata)MarshalJSONadded inv0.49.0

func (sFileLinkShareMetadata) MarshalJSON() ([]byte,error)

typeFileList

type FileList struct {// Files: The list of files. If `nextPageToken` is populated, then this list// may be incomplete and an additional page of results should be fetched.Files []*File `json:"files,omitempty"`// IncompleteSearch: Whether the search process was incomplete. If true, then// some search results might be missing, since all documents were not searched.// This can occur when searching multiple drives with the `allDrives` corpora,// but all corpora couldn't be searched. When this happens, it's suggested that// clients narrow their query by choosing a different corpus such as `user` or// `drive`.IncompleteSearchbool `json:"incompleteSearch,omitempty"`// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#fileList".Kindstring `json:"kind,omitempty"`// NextPageToken: The page token for the next page of files. This will be// absent if the end of the files list has been reached. If the token is// rejected for any reason, it should be discarded, and pagination should be// restarted from the first page of results. The page token is typically valid// for several hours. However, if new items are added or removed, your expected// results might differ.NextPageTokenstring `json:"nextPageToken,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Files") 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. "Files") 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:"-"`}

FileList: A list of files.

func (FileList)MarshalJSON

func (sFileList) MarshalJSON() ([]byte,error)

typeFileShortcutDetailsadded inv0.22.0

type FileShortcutDetails struct {// TargetId: The ID of the file that this shortcut points to. Can only be set// on `files.create` requests.TargetIdstring `json:"targetId,omitempty"`// TargetMimeType: Output only. The MIME type of the file that this shortcut// points to. The value of this field is a snapshot of the target's MIME type,// captured when the shortcut is created.TargetMimeTypestring `json:"targetMimeType,omitempty"`// TargetResourceKey: Output only. The `resourceKey` for the target file.TargetResourceKeystring `json:"targetResourceKey,omitempty"`// ForceSendFields is a list of field names (e.g. "TargetId") 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. "TargetId") 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:"-"`}

FileShortcutDetails: Shortcut file details. Only populated for shortcutfiles, which have the mimeType field set to`application/vnd.google-apps.shortcut`. Can only be set on `files.create`requests.

func (FileShortcutDetails)MarshalJSONadded inv0.22.0

func (sFileShortcutDetails) MarshalJSON() ([]byte,error)

typeFileVideoMediaMetadata

type FileVideoMediaMetadata struct {// DurationMillis: Output only. The duration of the video in milliseconds.DurationMillisint64 `json:"durationMillis,omitempty,string"`// Height: Output only. The height of the video in pixels.Heightint64 `json:"height,omitempty"`// Width: Output only. The width of the video in pixels.Widthint64 `json:"width,omitempty"`// ForceSendFields is a list of field names (e.g. "DurationMillis") 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. "DurationMillis") 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:"-"`}

FileVideoMediaMetadata: Output only. Additional metadata about video media.This may not be available immediately upon upload.

func (FileVideoMediaMetadata)MarshalJSON

func (sFileVideoMediaMetadata) MarshalJSON() ([]byte,error)

typeFilesCopyCall

type FilesCopyCall struct {// contains filtered or unexported fields}

func (*FilesCopyCall)Context

Context sets the context to be used in this call's Do method.

func (*FilesCopyCall)Do

func (c *FilesCopyCall) Do(opts ...googleapi.CallOption) (*File,error)

Do executes the "drive.files.copy" call.Any non-2xx status code is an error. Response headers are in either*File.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*FilesCopyCall)EnforceSingleParentadded inv0.21.0

func (c *FilesCopyCall) EnforceSingleParent(enforceSingleParentbool) *FilesCopyCall

EnforceSingleParent sets the optional parameter "enforceSingleParent":Deprecated: Copying files into multiple folders is no longer supported. Useshortcuts instead.

func (*FilesCopyCall)Fields

func (c *FilesCopyCall) Fields(s ...googleapi.Field) *FilesCopyCall

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesCopyCall)Header

func (c *FilesCopyCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*FilesCopyCall)IgnoreDefaultVisibility

func (c *FilesCopyCall) IgnoreDefaultVisibility(ignoreDefaultVisibilitybool) *FilesCopyCall

IgnoreDefaultVisibility sets the optional parameter"ignoreDefaultVisibility": Whether to ignore the domain's default visibilitysettings for the created file. Domain administrators can choose to make alluploaded files visible to the domain by default; this parameter bypassesthat behavior for the request. Permissions are still inherited from parentfolders.

func (*FilesCopyCall)IncludeLabelsadded inv0.88.0

func (c *FilesCopyCall) IncludeLabels(includeLabelsstring) *FilesCopyCall

IncludeLabels sets the optional parameter "includeLabels": A comma-separatedlist of IDs of labels to include in the `labelInfo` part of the response.

func (*FilesCopyCall)IncludePermissionsForViewadded inv0.31.0

func (c *FilesCopyCall) IncludePermissionsForView(includePermissionsForViewstring) *FilesCopyCall

IncludePermissionsForView sets the optional parameter"includePermissionsForView": Specifies which additional view's permissionsto include in the response. Only `published` is supported.

func (*FilesCopyCall)KeepRevisionForever

func (c *FilesCopyCall) KeepRevisionForever(keepRevisionForeverbool) *FilesCopyCall

KeepRevisionForever sets the optional parameter "keepRevisionForever":Whether to set the `keepForever` field in the new head revision. This isonly applicable to files with binary content in Google Drive. Only 200revisions for the file can be kept forever. If the limit is reached, trydeleting pinned revisions.

func (*FilesCopyCall)OcrLanguage

func (c *FilesCopyCall) OcrLanguage(ocrLanguagestring) *FilesCopyCall

OcrLanguage sets the optional parameter "ocrLanguage": A language hint forOCR processing during image import (ISO 639-1 code).

func (*FilesCopyCall)SupportsAllDrivesadded inv0.4.0

func (c *FilesCopyCall) SupportsAllDrives(supportsAllDrivesbool) *FilesCopyCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*FilesCopyCall)SupportsTeamDrives

func (c *FilesCopyCall) SupportsTeamDrives(supportsTeamDrivesbool) *FilesCopyCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

typeFilesCreateCall

type FilesCreateCall struct {// contains filtered or unexported fields}

func (*FilesCreateCall)Context

Context sets the context to be used in this call's Do method.This context will supersede any context previously provided to theResumableMedia method.

func (*FilesCreateCall)Do

func (c *FilesCreateCall) Do(opts ...googleapi.CallOption) (*File,error)

Do executes the "drive.files.create" call.Any non-2xx status code is an error. Response headers are in either*File.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*FilesCreateCall)EnforceSingleParentadded inv0.21.0

func (c *FilesCreateCall) EnforceSingleParent(enforceSingleParentbool) *FilesCreateCall

EnforceSingleParent sets the optional parameter "enforceSingleParent":Deprecated: Creating files in multiple folders is no longer supported.

func (*FilesCreateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesCreateCall)Header

func (c *FilesCreateCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*FilesCreateCall)IgnoreDefaultVisibility

func (c *FilesCreateCall) IgnoreDefaultVisibility(ignoreDefaultVisibilitybool) *FilesCreateCall

IgnoreDefaultVisibility sets the optional parameter"ignoreDefaultVisibility": Whether to ignore the domain's default visibilitysettings for the created file. Domain administrators can choose to make alluploaded files visible to the domain by default; this parameter bypassesthat behavior for the request. Permissions are still inherited from parentfolders.

func (*FilesCreateCall)IncludeLabelsadded inv0.88.0

func (c *FilesCreateCall) IncludeLabels(includeLabelsstring) *FilesCreateCall

IncludeLabels sets the optional parameter "includeLabels": A comma-separatedlist of IDs of labels to include in the `labelInfo` part of the response.

func (*FilesCreateCall)IncludePermissionsForViewadded inv0.31.0

func (c *FilesCreateCall) IncludePermissionsForView(includePermissionsForViewstring) *FilesCreateCall

IncludePermissionsForView sets the optional parameter"includePermissionsForView": Specifies which additional view's permissionsto include in the response. Only `published` is supported.

func (*FilesCreateCall)KeepRevisionForever

func (c *FilesCreateCall) KeepRevisionForever(keepRevisionForeverbool) *FilesCreateCall

KeepRevisionForever sets the optional parameter "keepRevisionForever":Whether to set the `keepForever` field in the new head revision. This isonly applicable to files with binary content in Google Drive. Only 200revisions for the file can be kept forever. If the limit is reached, trydeleting pinned revisions.

func (*FilesCreateCall)Media

Media specifies the media to upload in one or more chunks. The chunk sizemay be controlled by supplying a MediaOption generated bygoogleapi.ChunkSize. The chunk size defaults togoogleapi.DefaultUploadChunkSize.The Content-Type header used in the uploadrequest will be determined by sniffing the contents of r, unless aMediaOption generated by googleapi.ContentType is supplied.At most one of Media and ResumableMedia may be set.

func (*FilesCreateCall)OcrLanguage

func (c *FilesCreateCall) OcrLanguage(ocrLanguagestring) *FilesCreateCall

OcrLanguage sets the optional parameter "ocrLanguage": A language hint forOCR processing during image import (ISO 639-1 code).

func (*FilesCreateCall)ProgressUpdater

ProgressUpdater provides a callback function that will be called after everychunk. It should be a low-latency function in order to not slow down theupload operation. This should only be called when using ResumableMedia (asopposed to Media).

func (*FilesCreateCall)ResumableMediadeprecated

func (c *FilesCreateCall) ResumableMedia(ctxcontext.Context, rio.ReaderAt, sizeint64, mediaTypestring) *FilesCreateCall

ResumableMedia specifies the media to upload in chunks and can be canceledwith ctx.

Deprecated: use Media instead.

At most one of Media and ResumableMedia may be set. mediaType identifies theMIME media type of the upload, such as "image/png". If mediaType is "", itwill be auto-detected. The provided ctx will supersede any contextpreviously provided to the Context method.

func (*FilesCreateCall)SupportsAllDrivesadded inv0.4.0

func (c *FilesCreateCall) SupportsAllDrives(supportsAllDrivesbool) *FilesCreateCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*FilesCreateCall)SupportsTeamDrives

func (c *FilesCreateCall) SupportsTeamDrives(supportsTeamDrivesbool) *FilesCreateCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

func (*FilesCreateCall)UseContentAsIndexableText

func (c *FilesCreateCall) UseContentAsIndexableText(useContentAsIndexableTextbool) *FilesCreateCall

UseContentAsIndexableText sets the optional parameter"useContentAsIndexableText": Whether to use the uploaded content asindexable text.

typeFilesDeleteCall

type FilesDeleteCall struct {// contains filtered or unexported fields}

func (*FilesDeleteCall)Context

Context sets the context to be used in this call's Do method.

func (*FilesDeleteCall)Do

Do executes the "drive.files.delete" call.

func (*FilesDeleteCall)EnforceSingleParentadded inv0.31.0

func (c *FilesDeleteCall) EnforceSingleParent(enforceSingleParentbool) *FilesDeleteCall

EnforceSingleParent sets the optional parameter "enforceSingleParent":Deprecated: If an item isn't in a shared drive and its last parent isdeleted but the item itself isn't, the item will be placed under its owner'sroot.

func (*FilesDeleteCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesDeleteCall)Header

func (c *FilesDeleteCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*FilesDeleteCall)SupportsAllDrivesadded inv0.4.0

func (c *FilesDeleteCall) SupportsAllDrives(supportsAllDrivesbool) *FilesDeleteCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*FilesDeleteCall)SupportsTeamDrives

func (c *FilesDeleteCall) SupportsTeamDrives(supportsTeamDrivesbool) *FilesDeleteCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

typeFilesDownloadCalladded inv0.197.0

type FilesDownloadCall struct {// contains filtered or unexported fields}

func (*FilesDownloadCall)Contextadded inv0.197.0

Context sets the context to be used in this call's Do method.

func (*FilesDownloadCall)Doadded inv0.197.0

Do executes the "drive.files.download" call.Any non-2xx status code is an error. Response headers are in either*Operation.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*FilesDownloadCall)Fieldsadded inv0.197.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesDownloadCall)Headeradded inv0.197.0

func (c *FilesDownloadCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*FilesDownloadCall)MimeTypeadded inv0.197.0

func (c *FilesDownloadCall) MimeType(mimeTypestring) *FilesDownloadCall

MimeType sets the optional parameter "mimeType": The MIME type the fileshould be downloaded as. This field can only be set when downloading GoogleWorkspace documents. For a list of supported MIME types, see Export MIMEtypes for Google Workspace documents(/workspace/drive/api/guides/ref-export-formats). If not set, a GoogleWorkspace document is downloaded with a default MIME type. The default MIMEtype might change in the future.

func (*FilesDownloadCall)RevisionIdadded inv0.197.0

func (c *FilesDownloadCall) RevisionId(revisionIdstring) *FilesDownloadCall

RevisionId sets the optional parameter "revisionId": The revision ID of thefile to download. This field can only be set when downloading blob files,Google Docs, and Google Sheets. Returns `INVALID_ARGUMENT` if downloading aspecific revision on the file is unsupported.

typeFilesEmptyTrashCall

type FilesEmptyTrashCall struct {// contains filtered or unexported fields}

func (*FilesEmptyTrashCall)Context

Context sets the context to be used in this call's Do method.

func (*FilesEmptyTrashCall)Do

Do executes the "drive.files.emptyTrash" call.

func (*FilesEmptyTrashCall)DriveIdadded inv0.120.0

DriveId sets the optional parameter "driveId": If set, empties the trash ofthe provided shared drive.

func (*FilesEmptyTrashCall)EnforceSingleParentadded inv0.31.0

func (c *FilesEmptyTrashCall) EnforceSingleParent(enforceSingleParentbool) *FilesEmptyTrashCall

EnforceSingleParent sets the optional parameter "enforceSingleParent":Deprecated: If an item isn't in a shared drive and its last parent isdeleted but the item itself isn't, the item will be placed under its owner'sroot.

func (*FilesEmptyTrashCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesEmptyTrashCall)Header

func (c *FilesEmptyTrashCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeFilesExportCall

type FilesExportCall struct {// contains filtered or unexported fields}

func (*FilesExportCall)Context

Context sets the context to be used in this call's Do and Download methods.

func (*FilesExportCall)Do

Do executes the "drive.files.export" call.

func (*FilesExportCall)Download

func (c *FilesExportCall) Download(opts ...googleapi.CallOption) (*http.Response,error)

Download fetches the API endpoint's "media" value, instead of the normalAPI response value. If the returned error is nil, the Response is guaranteed tohave a 2xx status code. Callers must close the Response.Body as usual.

func (*FilesExportCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesExportCall)Header

func (c *FilesExportCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*FilesExportCall)IfNoneMatch

func (c *FilesExportCall) IfNoneMatch(entityTagstring) *FilesExportCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

typeFilesGenerateIdsCall

type FilesGenerateIdsCall struct {// contains filtered or unexported fields}

func (*FilesGenerateIdsCall)Context

Context sets the context to be used in this call's Do method.

func (*FilesGenerateIdsCall)Count

Count sets the optional parameter "count": The number of IDs to return.

func (*FilesGenerateIdsCall)Do

Do executes the "drive.files.generateIds" call.Any non-2xx status code is an error. Response headers are in either*GeneratedIds.ServerResponse.Header or (if a response was returned at all)in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*FilesGenerateIdsCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesGenerateIdsCall)Header

func (c *FilesGenerateIdsCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*FilesGenerateIdsCall)IfNoneMatch

func (c *FilesGenerateIdsCall) IfNoneMatch(entityTagstring) *FilesGenerateIdsCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*FilesGenerateIdsCall)Space

Space sets the optional parameter "space": The space in which the IDs can beused to create files. Supported values are `drive` and `appDataFolder`.(Default: `drive`.) For more information, see File organization(https://developers.google.com/workspace/drive/api/guides/about-files#file-organization).

func (*FilesGenerateIdsCall)Typeadded inv0.47.0

Type sets the optional parameter "type": The type of items which the IDs canbe used for. Supported values are `files` and `shortcuts`. Note that`shortcuts` are only supported in the `drive` `space`. (Default: `files`.)For more information, see File organization(https://developers.google.com/workspace/drive/api/guides/about-files#file-organization).

typeFilesGetCall

type FilesGetCall struct {// contains filtered or unexported fields}

func (*FilesGetCall)AcknowledgeAbuse

func (c *FilesGetCall) AcknowledgeAbuse(acknowledgeAbusebool) *FilesGetCall

AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": Whether theuser is acknowledging the risk of downloading known malware or other abusivefiles. This is only applicable when the `alt` parameter is set to `media`and the user is the owner of the file or an organizer of the shared drive inwhich the file resides.

func (*FilesGetCall)Context

func (c *FilesGetCall) Context(ctxcontext.Context) *FilesGetCall

Context sets the context to be used in this call's Do and Download methods.

func (*FilesGetCall)Do

func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File,error)

Do executes the "drive.files.get" call.Any non-2xx status code is an error. Response headers are in either*File.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*FilesGetCall)Download

func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response,error)

Download fetches the API endpoint's "media" value, instead of the normalAPI response value. If the returned error is nil, the Response is guaranteed tohave a 2xx status code. Callers must close the Response.Body as usual.

func (*FilesGetCall)Fields

func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesGetCall)Header

func (c *FilesGetCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*FilesGetCall)IfNoneMatch

func (c *FilesGetCall) IfNoneMatch(entityTagstring) *FilesGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*FilesGetCall)IncludeLabelsadded inv0.88.0

func (c *FilesGetCall) IncludeLabels(includeLabelsstring) *FilesGetCall

IncludeLabels sets the optional parameter "includeLabels": A comma-separatedlist of IDs of labels to include in the `labelInfo` part of the response.

func (*FilesGetCall)IncludePermissionsForViewadded inv0.31.0

func (c *FilesGetCall) IncludePermissionsForView(includePermissionsForViewstring) *FilesGetCall

IncludePermissionsForView sets the optional parameter"includePermissionsForView": Specifies which additional view's permissionsto include in the response. Only `published` is supported.

func (*FilesGetCall)SupportsAllDrivesadded inv0.4.0

func (c *FilesGetCall) SupportsAllDrives(supportsAllDrivesbool) *FilesGetCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*FilesGetCall)SupportsTeamDrives

func (c *FilesGetCall) SupportsTeamDrives(supportsTeamDrivesbool) *FilesGetCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

typeFilesListCall

type FilesListCall struct {// contains filtered or unexported fields}

func (*FilesListCall)Context

Context sets the context to be used in this call's Do method.

func (*FilesListCall)Corpora

func (c *FilesListCall) Corpora(corporastring) *FilesListCall

Corpora sets the optional parameter "corpora": Bodies of items (files ordocuments) to which the query applies. Supported bodies are: * `user` *`domain` * `drive` * `allDrives` Prefer `user` or `drive` to `allDrives` forefficiency. By default, corpora is set to `user`. However, this can changedepending on the filter set through the `q` parameter. For more information,see File organization(https://developers.google.com/workspace/drive/api/guides/about-files#file-organization).

func (*FilesListCall)Corpus

func (c *FilesListCall) Corpus(corpusstring) *FilesListCall

Corpus sets the optional parameter "corpus": Deprecated: The source of filesto list. Use `corpora` instead.

Possible values:

"domain" - Files shared to the user's domain."user" - Files owned by or shared to the user.

func (*FilesListCall)Do

Do executes the "drive.files.list" call.Any non-2xx status code is an error. Response headers are in either*FileList.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*FilesListCall)DriveIdadded inv0.4.0

func (c *FilesListCall) DriveId(driveIdstring) *FilesListCall

DriveId sets the optional parameter "driveId": ID of the shared drive tosearch.

func (*FilesListCall)Fields

func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesListCall)Header

func (c *FilesListCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*FilesListCall)IfNoneMatch

func (c *FilesListCall) IfNoneMatch(entityTagstring) *FilesListCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*FilesListCall)IncludeItemsFromAllDrivesadded inv0.4.0

func (c *FilesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrivesbool) *FilesListCall

IncludeItemsFromAllDrives sets the optional parameter"includeItemsFromAllDrives": Whether both My Drive and shared drive itemsshould be included in results.

func (*FilesListCall)IncludeLabelsadded inv0.88.0

func (c *FilesListCall) IncludeLabels(includeLabelsstring) *FilesListCall

IncludeLabels sets the optional parameter "includeLabels": A comma-separatedlist of IDs of labels to include in the `labelInfo` part of the response.

func (*FilesListCall)IncludePermissionsForViewadded inv0.31.0

func (c *FilesListCall) IncludePermissionsForView(includePermissionsForViewstring) *FilesListCall

IncludePermissionsForView sets the optional parameter"includePermissionsForView": Specifies which additional view's permissionsto include in the response. Only `published` is supported.

func (*FilesListCall)IncludeTeamDriveItems

func (c *FilesListCall) IncludeTeamDriveItems(includeTeamDriveItemsbool) *FilesListCall

IncludeTeamDriveItems sets the optional parameter "includeTeamDriveItems":Deprecated: Use `includeItemsFromAllDrives` instead.

func (*FilesListCall)OrderBy

func (c *FilesListCall) OrderBy(orderBystring) *FilesListCall

OrderBy sets the optional parameter "orderBy": A comma-separated list ofsort keys. Valid keys are: * `createdTime`: When the file was created. *`folder`: The folder ID. This field is sorted using alphabetical ordering. *`modifiedByMeTime`: The last time the file was modified by the user. *`modifiedTime`: The last time the file was modified by anyone. * `name`: Thename of the file. This field is sorted using alphabetical ordering, so 1,12, 2, 22. * `name_natural`: The name of the file. This field is sortedusing natural sort ordering, so 1, 2, 12, 22. * `quotaBytesUsed`: The numberof storage quota bytes used by the file. * `recency`: The most recenttimestamp from the file's date-time fields. * `sharedWithMeTime`: When thefile was shared with the user, if applicable. * `starred`: Whether the userhas starred the file. * `viewedByMeTime`: The last time the file was viewedby the user. Each key sorts ascending by default, but can be reversed withthe `desc` modifier. Example usage: `?orderBy=folder,modifiedTimedesc,name`.

func (*FilesListCall)PageSize

func (c *FilesListCall) PageSize(pageSizeint64) *FilesListCall

PageSize sets the optional parameter "pageSize": The maximum number of filesto return per page. Partial or empty result pages are possible even beforethe end of the files list has been reached.

func (*FilesListCall)PageToken

func (c *FilesListCall) PageToken(pageTokenstring) *FilesListCall

PageToken sets the optional parameter "pageToken": The token for continuinga previous list request on the next page. This should be set to the value of`nextPageToken` from the previous response.

func (*FilesListCall)Pages

func (c *FilesListCall) Pages(ctxcontext.Context, f func(*FileList)error)error

Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.

func (*FilesListCall)Q

Q sets the optional parameter "q": A query for filtering the file results.For supported syntax, see Search for files and folders(/workspace/drive/api/guides/search-files).

func (*FilesListCall)Spaces

func (c *FilesListCall) Spaces(spacesstring) *FilesListCall

Spaces sets the optional parameter "spaces": A comma-separated list ofspaces to query within the corpora. Supported values are `drive` and`appDataFolder`. For more information, see File organization(https://developers.google.com/workspace/drive/api/guides/about-files#file-organization).

func (*FilesListCall)SupportsAllDrivesadded inv0.4.0

func (c *FilesListCall) SupportsAllDrives(supportsAllDrivesbool) *FilesListCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*FilesListCall)SupportsTeamDrives

func (c *FilesListCall) SupportsTeamDrives(supportsTeamDrivesbool) *FilesListCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

func (*FilesListCall)TeamDriveId

func (c *FilesListCall) TeamDriveId(teamDriveIdstring) *FilesListCall

TeamDriveId sets the optional parameter "teamDriveId": Deprecated: Use`driveId` instead.

typeFilesListLabelsCalladded inv0.88.0

type FilesListLabelsCall struct {// contains filtered or unexported fields}

func (*FilesListLabelsCall)Contextadded inv0.88.0

Context sets the context to be used in this call's Do method.

func (*FilesListLabelsCall)Doadded inv0.88.0

Do executes the "drive.files.listLabels" call.Any non-2xx status code is an error. Response headers are in either*LabelList.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*FilesListLabelsCall)Fieldsadded inv0.88.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesListLabelsCall)Headeradded inv0.88.0

func (c *FilesListLabelsCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*FilesListLabelsCall)IfNoneMatchadded inv0.88.0

func (c *FilesListLabelsCall) IfNoneMatch(entityTagstring) *FilesListLabelsCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*FilesListLabelsCall)MaxResultsadded inv0.88.0

func (c *FilesListLabelsCall) MaxResults(maxResultsint64) *FilesListLabelsCall

MaxResults sets the optional parameter "maxResults": The maximum number oflabels to return per page. When not set, defaults to 100.

func (*FilesListLabelsCall)PageTokenadded inv0.88.0

func (c *FilesListLabelsCall) PageToken(pageTokenstring) *FilesListLabelsCall

PageToken sets the optional parameter "pageToken": The token for continuinga previous list request on the next page. This should be set to the value of`nextPageToken` from the previous response.

func (*FilesListLabelsCall)Pagesadded inv0.88.0

Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.

typeFilesModifyLabelsCalladded inv0.88.0

type FilesModifyLabelsCall struct {// contains filtered or unexported fields}

func (*FilesModifyLabelsCall)Contextadded inv0.88.0

Context sets the context to be used in this call's Do method.

func (*FilesModifyLabelsCall)Doadded inv0.88.0

Do executes the "drive.files.modifyLabels" call.Any non-2xx status code is an error. Response headers are in either*ModifyLabelsResponse.ServerResponse.Header or (if a response was returnedat all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified tocheck whether the returned error was because http.StatusNotModified wasreturned.

func (*FilesModifyLabelsCall)Fieldsadded inv0.88.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesModifyLabelsCall)Headeradded inv0.88.0

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeFilesService

type FilesService struct {// contains filtered or unexported fields}

funcNewFilesService

func NewFilesService(s *Service) *FilesService

func (*FilesService)Copy

func (r *FilesService) Copy(fileIdstring, file *File) *FilesCopyCall

Copy: Creates a copy of a file and applies any requested updates with patchsemantics. For more information, see Create and manage files(https://developers.google.com/workspace/drive/api/guides/create-file).

- fileId: The ID of the file.

func (*FilesService)Create

func (r *FilesService) Create(file *File) *FilesCreateCall

Create: Creates a file. For more information, see Create and manage files(/workspace/drive/api/guides/create-file). This method supports an */upload*URI and accepts uploaded media with the following characteristics: -*Maximum file size:* 5,120 GB - *Accepted Media MIME types:* `*/*` (Specifya valid MIME type, rather than the literal `*/*` value. The literal `*/*` isonly used to indicate that any valid MIME type can be uploaded. For moreinformation, see Google Workspace and Google Drive supported MIME types(/workspace/drive/api/guides/mime-types).) For more information on uploadingfiles, see Upload file data (/workspace/drive/api/guides/manage-uploads).Apps creating shortcuts with the `create` method must specify the MIME type`application/vnd.google-apps.shortcut`. Apps should specify a file extensionin the `name` property when inserting files with the API. For example, anoperation to insert a JPEG file should specify something like "name":"cat.jpg" in the metadata. Subsequent `GET` requests include the read-only`fileExtension` property populated with the extension originally specifiedin the `name` property. When a Google Drive user requests to download afile, or when the file is downloaded through the sync client, Drive builds afull filename (with extension) based on the name. In cases where theextension is missing, Drive attempts to determine the extension based on thefile's MIME type.

func (*FilesService)Delete

func (r *FilesService) Delete(fileIdstring) *FilesDeleteCall

Delete: Permanently deletes a file owned by the user without moving it tothe trash. For more information, see Trash or delete files and folders(https://developers.google.com/workspace/drive/api/guides/delete). If thefile belongs to a shared drive, the user must be an `organizer` on theparent folder. If the target is a folder, all descendants owned by the userare also deleted.

- fileId: The ID of the file.

func (*FilesService)Downloadadded inv0.197.0

func (r *FilesService) Download(fileIdstring) *FilesDownloadCall

Download: Downloads the content of a file. For more information, seeDownload and export files(https://developers.google.com/workspace/drive/api/guides/manage-downloads).Operations are valid for 24 hours from the time of creation.

- fileId: The ID of the file to download.

func (*FilesService)EmptyTrash

func (r *FilesService) EmptyTrash() *FilesEmptyTrashCall

EmptyTrash: Permanently deletes all of the user's trashed files. For moreinformation, see Trash or delete files and folders(https://developers.google.com/workspace/drive/api/guides/delete).

func (*FilesService)Export

func (r *FilesService) Export(fileIdstring, mimeTypestring) *FilesExportCall

Export: Exports a Google Workspace document to the requested MIME type andreturns exported byte content. For more information, see Download and exportfiles(https://developers.google.com/workspace/drive/api/guides/manage-downloads).Note that the exported content is limited to 10 MB.

  • fileId: The ID of the file.
  • mimeType: The MIME type of the format requested for this export. For alist of supported MIME types, see Export MIME types for Google Workspacedocuments (/workspace/drive/api/guides/ref-export-formats).

func (*FilesService)GenerateIds

func (r *FilesService) GenerateIds() *FilesGenerateIdsCall

GenerateIds: Generates a set of file IDs which can be provided in create orcopy requests. For more information, see Create and manage files(https://developers.google.com/workspace/drive/api/guides/create-file).

func (*FilesService)Get

func (r *FilesService) Get(fileIdstring) *FilesGetCall

Get: Gets a file's metadata or content by ID. For more information, seeSearch for files and folders (/workspace/drive/api/guides/search-files). Ifyou provide the URL parameter `alt=media`, then the response includes thefile contents in the response body. Downloading content with `alt=media`only works if the file is stored in Drive. To download Google Docs, Sheets,and Slides use `files.export`(/workspace/drive/api/reference/rest/v3/files/export) instead. For moreinformation, see Download and export files(/workspace/drive/api/guides/manage-downloads).

- fileId: The ID of the file.

func (*FilesService)List

func (r *FilesService) List() *FilesListCall

List: Lists the user's files. For more information, see Search for filesand folders (/workspace/drive/api/guides/search-files). This method acceptsthe `q` parameter, which is a search query combining one or more searchterms. This method returns *all* files by default, including trashed files.If you don't want trashed files to appear in the list, use the`trashed=false` query parameter to remove trashed files from the results.

func (*FilesService)ListLabelsadded inv0.88.0

func (r *FilesService) ListLabels(fileIdstring) *FilesListLabelsCall

ListLabels: Lists the labels on a file. For more information, see Listlabels on a file(https://developers.google.com/workspace/drive/api/guides/list-labels).

- fileId: The ID for the file.

func (*FilesService)ModifyLabelsadded inv0.88.0

func (r *FilesService) ModifyLabels(fileIdstring, modifylabelsrequest *ModifyLabelsRequest) *FilesModifyLabelsCall

ModifyLabels: Modifies the set of labels applied to a file. For moreinformation, see Set a label field on a file(https://developers.google.com/workspace/drive/api/guides/set-label).Returns a list of the labels that were added or modified.

- fileId: The ID of the file to which the labels belong.

func (*FilesService)Update

func (r *FilesService) Update(fileIdstring, file *File) *FilesUpdateCall

Update: Updates a file's metadata, content, or both. When calling thismethod, only populate fields in the request that you want to modify. Whenupdating fields, some fields might be changed automatically, such as`modifiedDate`. This method supports patch semantics. This method supportsan */upload* URI and accepts uploaded media with the followingcharacteristics: - *Maximum file size:* 5,120 GB - *Accepted Media MIMEtypes:* `*/*` (Specify a valid MIME type, rather than the literal `*/*`value. The literal `*/*` is only used to indicate that any valid MIME typecan be uploaded. For more information, see Google Workspace and Google Drivesupported MIME types (/workspace/drive/api/guides/mime-types).) For moreinformation on uploading files, see Upload file data(/workspace/drive/api/guides/manage-uploads).

- fileId: The ID of the file.

func (*FilesService)Watch

func (r *FilesService) Watch(fileIdstring, channel *Channel) *FilesWatchCall

Watch: Subscribes to changes to a file. For more information, seeNotifications for resource changes(https://developers.google.com/workspace/drive/api/guides/push).

- fileId: The ID of the file.

typeFilesUpdateCall

type FilesUpdateCall struct {// contains filtered or unexported fields}

func (*FilesUpdateCall)AddParents

func (c *FilesUpdateCall) AddParents(addParentsstring) *FilesUpdateCall

AddParents sets the optional parameter "addParents": A comma-separated listof parent IDs to add.

func (*FilesUpdateCall)Context

Context sets the context to be used in this call's Do method.This context will supersede any context previously provided to theResumableMedia method.

func (*FilesUpdateCall)Do

func (c *FilesUpdateCall) Do(opts ...googleapi.CallOption) (*File,error)

Do executes the "drive.files.update" call.Any non-2xx status code is an error. Response headers are in either*File.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*FilesUpdateCall)EnforceSingleParentadded inv0.21.0

func (c *FilesUpdateCall) EnforceSingleParent(enforceSingleParentbool) *FilesUpdateCall

EnforceSingleParent sets the optional parameter "enforceSingleParent":Deprecated: Adding files to multiple folders is no longer supported. Useshortcuts instead.

func (*FilesUpdateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesUpdateCall)Header

func (c *FilesUpdateCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*FilesUpdateCall)IncludeLabelsadded inv0.88.0

func (c *FilesUpdateCall) IncludeLabels(includeLabelsstring) *FilesUpdateCall

IncludeLabels sets the optional parameter "includeLabels": A comma-separatedlist of IDs of labels to include in the `labelInfo` part of the response.

func (*FilesUpdateCall)IncludePermissionsForViewadded inv0.31.0

func (c *FilesUpdateCall) IncludePermissionsForView(includePermissionsForViewstring) *FilesUpdateCall

IncludePermissionsForView sets the optional parameter"includePermissionsForView": Specifies which additional view's permissionsto include in the response. Only `published` is supported.

func (*FilesUpdateCall)KeepRevisionForever

func (c *FilesUpdateCall) KeepRevisionForever(keepRevisionForeverbool) *FilesUpdateCall

KeepRevisionForever sets the optional parameter "keepRevisionForever":Whether to set the `keepForever` field in the new head revision. This isonly applicable to files with binary content in Google Drive. Only 200revisions for the file can be kept forever. If the limit is reached, trydeleting pinned revisions.

func (*FilesUpdateCall)Media

Media specifies the media to upload in one or more chunks. The chunk sizemay be controlled by supplying a MediaOption generated bygoogleapi.ChunkSize. The chunk size defaults togoogleapi.DefaultUploadChunkSize.The Content-Type header used in the uploadrequest will be determined by sniffing the contents of r, unless aMediaOption generated by googleapi.ContentType is supplied.At most one of Media and ResumableMedia may be set.

func (*FilesUpdateCall)OcrLanguage

func (c *FilesUpdateCall) OcrLanguage(ocrLanguagestring) *FilesUpdateCall

OcrLanguage sets the optional parameter "ocrLanguage": A language hint forOCR processing during image import (ISO 639-1 code).

func (*FilesUpdateCall)ProgressUpdater

ProgressUpdater provides a callback function that will be called after everychunk. It should be a low-latency function in order to not slow down theupload operation. This should only be called when using ResumableMedia (asopposed to Media).

func (*FilesUpdateCall)RemoveParents

func (c *FilesUpdateCall) RemoveParents(removeParentsstring) *FilesUpdateCall

RemoveParents sets the optional parameter "removeParents": A comma-separatedlist of parent IDs to remove.

func (*FilesUpdateCall)ResumableMediadeprecated

func (c *FilesUpdateCall) ResumableMedia(ctxcontext.Context, rio.ReaderAt, sizeint64, mediaTypestring) *FilesUpdateCall

ResumableMedia specifies the media to upload in chunks and can be canceledwith ctx.

Deprecated: use Media instead.

At most one of Media and ResumableMedia may be set. mediaType identifies theMIME media type of the upload, such as "image/png". If mediaType is "", itwill be auto-detected. The provided ctx will supersede any contextpreviously provided to the Context method.

func (*FilesUpdateCall)SupportsAllDrivesadded inv0.4.0

func (c *FilesUpdateCall) SupportsAllDrives(supportsAllDrivesbool) *FilesUpdateCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*FilesUpdateCall)SupportsTeamDrives

func (c *FilesUpdateCall) SupportsTeamDrives(supportsTeamDrivesbool) *FilesUpdateCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

func (*FilesUpdateCall)UseContentAsIndexableText

func (c *FilesUpdateCall) UseContentAsIndexableText(useContentAsIndexableTextbool) *FilesUpdateCall

UseContentAsIndexableText sets the optional parameter"useContentAsIndexableText": Whether to use the uploaded content asindexable text.

typeFilesWatchCall

type FilesWatchCall struct {// contains filtered or unexported fields}

func (*FilesWatchCall)AcknowledgeAbuse

func (c *FilesWatchCall) AcknowledgeAbuse(acknowledgeAbusebool) *FilesWatchCall

AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": Whether theuser is acknowledging the risk of downloading known malware or other abusivefiles. This is only applicable when the `alt` parameter is set to `media`and the user is the owner of the file or an organizer of the shared drive inwhich the file resides.

func (*FilesWatchCall)Context

Context sets the context to be used in this call's Do method.

func (*FilesWatchCall)Do

Do executes the "drive.files.watch" call.Any non-2xx status code is an error. Response headers are in either*Channel.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*FilesWatchCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*FilesWatchCall)Header

func (c *FilesWatchCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*FilesWatchCall)IncludeLabelsadded inv0.88.0

func (c *FilesWatchCall) IncludeLabels(includeLabelsstring) *FilesWatchCall

IncludeLabels sets the optional parameter "includeLabels": A comma-separatedlist of IDs of labels to include in the `labelInfo` part of the response.

func (*FilesWatchCall)IncludePermissionsForViewadded inv0.31.0

func (c *FilesWatchCall) IncludePermissionsForView(includePermissionsForViewstring) *FilesWatchCall

IncludePermissionsForView sets the optional parameter"includePermissionsForView": Specifies which additional view's permissionsto include in the response. Only `published` is supported.

func (*FilesWatchCall)SupportsAllDrivesadded inv0.4.0

func (c *FilesWatchCall) SupportsAllDrives(supportsAllDrivesbool) *FilesWatchCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*FilesWatchCall)SupportsTeamDrives

func (c *FilesWatchCall) SupportsTeamDrives(supportsTeamDrivesbool) *FilesWatchCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

typeGeneratedIds

type GeneratedIds struct {// Ids: The IDs generated for the requesting user in the specified space.Ids []string `json:"ids,omitempty"`// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#generatedIds".Kindstring `json:"kind,omitempty"`// Space: The type of file that can be created with these IDs.Spacestring `json:"space,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Ids") 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. "Ids") 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:"-"`}

GeneratedIds: A list of generated file IDs which can be provided in createrequests.

func (GeneratedIds)MarshalJSON

func (sGeneratedIds) MarshalJSON() ([]byte,error)

typeLabeladded inv0.88.0

type Label struct {// Fields: A map of the fields on the label, keyed by the field's ID.Fields map[string]LabelField `json:"fields,omitempty"`// Id: The ID of the label.Idstring `json:"id,omitempty"`// Kind: This is always drive#labelKindstring `json:"kind,omitempty"`// RevisionId: The revision ID of the label.RevisionIdstring `json:"revisionId,omitempty"`// ForceSendFields is a list of field names (e.g. "Fields") 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. "Fields") 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:"-"`}

Label: Representation of label and label fields.

func (Label)MarshalJSONadded inv0.88.0

func (sLabel) MarshalJSON() ([]byte,error)

typeLabelFieldadded inv0.88.0

type LabelField struct {// DateString: Only present if valueType is dateString.RFC 3339 formatted// date: YYYY-MM-DD.DateString []string `json:"dateString,omitempty"`// Id: The identifier of this label field.Idstring `json:"id,omitempty"`// Integer: Only present if `valueType` is `integer`.Integergoogleapi.Int64s `json:"integer,omitempty"`// Kind: This is always drive#labelField.Kindstring `json:"kind,omitempty"`// Selection: Only present if `valueType` is `selection`Selection []string `json:"selection,omitempty"`// Text: Only present if `valueType` is `text`.Text []string `json:"text,omitempty"`// User: Only present if `valueType` is `user`.User []*User `json:"user,omitempty"`// ValueType: The field type. While new values may be supported in the future,// the following are currently allowed: * `dateString` * `integer` *// `selection` * `text` * `user`ValueTypestring `json:"valueType,omitempty"`// ForceSendFields is a list of field names (e.g. "DateString") 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. "DateString") 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:"-"`}

LabelField: Representation of field, which is a typed key-value pair.

func (LabelField)MarshalJSONadded inv0.88.0

func (sLabelField) MarshalJSON() ([]byte,error)

typeLabelFieldModificationadded inv0.88.0

type LabelFieldModification struct {// FieldId: The ID of the field to be modified.FieldIdstring `json:"fieldId,omitempty"`// Kind: This is always "drive#labelFieldModification".Kindstring `json:"kind,omitempty"`// SetDateValues: Replaces the value of a dateString Field with these new// values. The string must be in theRFC 3339 full-date format: YYYY-MM-DD.SetDateValues []string `json:"setDateValues,omitempty"`// SetIntegerValues: Replaces the value of an `integer` field with these new// values.SetIntegerValuesgoogleapi.Int64s `json:"setIntegerValues,omitempty"`// SetSelectionValues: Replaces a `selection` field with these new values.SetSelectionValues []string `json:"setSelectionValues,omitempty"`// SetTextValues: Sets the value of a `text` field.SetTextValues []string `json:"setTextValues,omitempty"`// SetUserValues: Replaces a `user` field with these new values. The values// must be a valid email addresses.SetUserValues []string `json:"setUserValues,omitempty"`// UnsetValues: Unsets the values for this field.UnsetValuesbool `json:"unsetValues,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:"-"`}

LabelFieldModification: A modification to a label's field.

func (LabelFieldModification)MarshalJSONadded inv0.88.0

func (sLabelFieldModification) MarshalJSON() ([]byte,error)

typeLabelListadded inv0.88.0

type LabelList struct {// Kind: This is always "drive#labelList".Kindstring `json:"kind,omitempty"`// Labels: The list of labels.Labels []*Label `json:"labels,omitempty"`// NextPageToken: The page token for the next page of labels. This field will// be absent if the end of the list has been reached. If the token is rejected// for any reason, it should be discarded, and pagination should be restarted// from the first page of results. The page token is typically valid for// several hours. However, if new items are added or removed, your expected// results might differ.NextPageTokenstring `json:"nextPageToken,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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:"-"`}

LabelList: A list of labels applied to a file.

func (LabelList)MarshalJSONadded inv0.88.0

func (sLabelList) MarshalJSON() ([]byte,error)

typeLabelModificationadded inv0.88.0

type LabelModification struct {// FieldModifications: The list of modifications to this label's fields.FieldModifications []*LabelFieldModification `json:"fieldModifications,omitempty"`// Kind: This is always "drive#labelModification".Kindstring `json:"kind,omitempty"`// LabelId: The ID of the label to modify.LabelIdstring `json:"labelId,omitempty"`// RemoveLabel: If true, the label will be removed from the file.RemoveLabelbool `json:"removeLabel,omitempty"`// ForceSendFields is a list of field names (e.g. "FieldModifications") 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. "FieldModifications") 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:"-"`}

LabelModification: A modification to a label on a file. A`LabelModification` can be used to apply a label to a file, update anexisting label on a file, or remove a label from a file.

func (LabelModification)MarshalJSONadded inv0.88.0

func (sLabelModification) MarshalJSON() ([]byte,error)

typeListAccessProposalsResponseadded inv0.201.0

type ListAccessProposalsResponse struct {// AccessProposals: The list of access proposals. This field is only populated// in Drive API v3.AccessProposals []*AccessProposal `json:"accessProposals,omitempty"`// NextPageToken: The continuation token for the next page of results. This// will be absent if the end of the results list has been reached. If the token// is rejected for any reason, it should be discarded, and pagination should be// restarted from the first page of results.NextPageTokenstring `json:"nextPageToken,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "AccessProposals") 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. "AccessProposals") 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:"-"`}

ListAccessProposalsResponse: The response to an access proposal listrequest.

func (ListAccessProposalsResponse)MarshalJSONadded inv0.201.0

func (sListAccessProposalsResponse) MarshalJSON() ([]byte,error)

typeModifyLabelsRequestadded inv0.88.0

type ModifyLabelsRequest struct {// Kind: This is always "drive#modifyLabelsRequest".Kindstring `json:"kind,omitempty"`// LabelModifications: The list of modifications to apply to the labels on the// file.LabelModifications []*LabelModification `json:"labelModifications,omitempty"`// ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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:"-"`}

ModifyLabelsRequest: A request to modify the set of labels on a file. Thisrequest may contain many modifications that will either all succeed or allfail atomically.

func (ModifyLabelsRequest)MarshalJSONadded inv0.88.0

func (sModifyLabelsRequest) MarshalJSON() ([]byte,error)

typeModifyLabelsResponseadded inv0.88.0

type ModifyLabelsResponse struct {// Kind: This is always "drive#modifyLabelsResponse".Kindstring `json:"kind,omitempty"`// ModifiedLabels: The list of labels which were added or updated by the// request.ModifiedLabels []*Label `json:"modifiedLabels,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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:"-"`}

ModifyLabelsResponse: Response to a `ModifyLabels` request. This containsonly those labels which were added or updated by the request.

func (ModifyLabelsResponse)MarshalJSONadded inv0.88.0

func (sModifyLabelsResponse) MarshalJSON() ([]byte,error)

typeOperationadded inv0.197.0

type Operation struct {// Done: If the value is `false`, it means the operation is still in progress.// If `true`, the operation is completed, and either `error` or `response` is// available.Donebool `json:"done,omitempty"`// Error: The error result of the operation in case of failure or cancellation.Error *Status `json:"error,omitempty"`// Metadata: Service-specific metadata associated with the operation. It// typically contains progress information and common metadata such as create// time. Some services might not provide such metadata. Any method that returns// a long-running operation should document the metadata type, if any.Metadatagoogleapi.RawMessage `json:"metadata,omitempty"`// Name: The server-assigned name, which is only unique within the same service// that originally returns it. If you use the default HTTP mapping, the `name`// should be a resource name ending with `operations/{unique_id}`.Namestring `json:"name,omitempty"`// Response: The normal, successful response of the operation. If the original// method returns no data on success, such as `Delete`, the response is// `google.protobuf.Empty`. If the original method is standard// `Get`/`Create`/`Update`, the response should be the resource. For other// methods, the response should have the type `XxxResponse`, where `Xxx` is the// original method name. For example, if the original method name is// `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.Responsegoogleapi.RawMessage `json:"response,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Done") 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. "Done") 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:"-"`}

Operation: This resource represents a long-running operation that is theresult of a network API call.

func (Operation)MarshalJSONadded inv0.197.0

func (sOperation) MarshalJSON() ([]byte,error)

typeOperationsGetCalladded inv0.197.0

type OperationsGetCall struct {// contains filtered or unexported fields}

func (*OperationsGetCall)Contextadded inv0.197.0

Context sets the context to be used in this call's Do method.

func (*OperationsGetCall)Doadded inv0.197.0

Do executes the "drive.operations.get" call.Any non-2xx status code is an error. Response headers are in either*Operation.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*OperationsGetCall)Fieldsadded inv0.197.0

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*OperationsGetCall)Headeradded inv0.197.0

func (c *OperationsGetCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*OperationsGetCall)IfNoneMatchadded inv0.197.0

func (c *OperationsGetCall) IfNoneMatch(entityTagstring) *OperationsGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

typeOperationsServiceadded inv0.197.0

type OperationsService struct {// contains filtered or unexported fields}

funcNewOperationsServiceadded inv0.197.0

func NewOperationsService(s *Service) *OperationsService

func (*OperationsService)Getadded inv0.197.0

Get: Gets the latest state of a long-running operation. Clients can use thismethod to poll the operation result at intervals as recommended by the APIservice.

- name: The name of the operation resource.

typePermission

type Permission struct {// AllowFileDiscovery: Whether the permission allows the file to be discovered// through search. This is only applicable for permissions of type `domain` or// `anyone`.AllowFileDiscoverybool `json:"allowFileDiscovery,omitempty"`// Deleted: Output only. Whether the account associated with this permission// has been deleted. This field only pertains to permissions of type `user` or// `group`.Deletedbool `json:"deleted,omitempty"`// DisplayName: Output only. The "pretty" name of the value of the permission.// The following is a list of examples for each type of permission: * `user` -// User's full name, as defined for their Google Account, such as "Dana A." *// `group` - Name of the Google Group, such as "The Company Administrators." *// `domain` - String domain name, such as "cymbalgroup.com." * `anyone` - No// `displayName` is present.DisplayNamestring `json:"displayName,omitempty"`// Domain: The domain to which this permission refers.Domainstring `json:"domain,omitempty"`// EmailAddress: The email address of the user or group to which this// permission refers.EmailAddressstring `json:"emailAddress,omitempty"`// ExpirationTime: The time at which this permission will expire (RFC 3339// date-time). Expiration times have the following restrictions: - They can// only be set on user and group permissions - The time must be in the future -// The time cannot be more than a year in the futureExpirationTimestring `json:"expirationTime,omitempty"`// Id: Output only. The ID of this permission. This is a unique identifier for// the grantee, and is published in the User resource// (https://developers.google.com/workspace/drive/api/reference/rest/v3/User)// as `permissionId`. IDs should be treated as opaque values.Idstring `json:"id,omitempty"`// InheritedPermissionsDisabled: When `true`, only organizers, owners, and// users with permissions added directly on the item can access it.InheritedPermissionsDisabledbool `json:"inheritedPermissionsDisabled,omitempty"`// Kind: Output only. Identifies what kind of resource this is. Value: the// fixed string "drive#permission".Kindstring `json:"kind,omitempty"`// PendingOwner: Whether the account associated with this permission is a// pending owner. Only populated for permissions of type `user` for files that// aren't in a shared drive.PendingOwnerbool `json:"pendingOwner,omitempty"`// PermissionDetails: Output only. Details of whether the permissions on this// item are inherited or are directly on this item.PermissionDetails []*PermissionPermissionDetails `json:"permissionDetails,omitempty"`// PhotoLink: Output only. A link to the user's profile photo, if available.PhotoLinkstring `json:"photoLink,omitempty"`// Role: The role granted by this permission. Supported values include: *// `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` * `reader`// For more information, see Roles and permissions// (https://developers.google.com/workspace/drive/api/guides/ref-roles).Rolestring `json:"role,omitempty"`// TeamDrivePermissionDetails: Output only. Deprecated: Output only. Use// `permissionDetails` instead.TeamDrivePermissionDetails []*PermissionTeamDrivePermissionDetails `json:"teamDrivePermissionDetails,omitempty"`// Type: The type of the grantee. Supported values include: * `user` * `group`// * `domain` * `anyone` When creating a permission, if `type` is `user` or// `group`, you must provide an `emailAddress` for the user or group. If `type`// is `domain`, you must provide a `domain`. If `type` is `anyone`, no extra// information is required.Typestring `json:"type,omitempty"`// View: Indicates the view for this permission. Only populated for permissions// that belong to a view. The only supported values are `published` and// `metadata`: * `published`: The permission's role is `publishedReader`. *// `metadata`: The item is only visible to the `metadata` view because the item// has limited access and the scope has at least read access to the parent. The// `metadata` view is only supported on folders. For more information, see// Views// (https://developers.google.com/workspace/drive/api/guides/ref-roles#views).Viewstring `json:"view,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "AllowFileDiscovery") 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. "AllowFileDiscovery") 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:"-"`}

Permission: A permission for a file. A permission grants a user, group,domain, or the world access to a file or a folder hierarchy. For moreinformation, see Share files, folders, and drives(https://developers.google.com/workspace/drive/api/guides/manage-sharing).By default, permission requests only return a subset of fields. Permission`kind`, `ID`, `type`, and `role` are always returned. To retrieve specificfields, see Return specific fields(https://developers.google.com/workspace/drive/api/guides/fields-parameter).Some resource methods (such as `permissions.update`) require a`permissionId`. Use the `permissions.list` method to retrieve the ID for afile, folder, or shared drive.

func (Permission)MarshalJSON

func (sPermission) MarshalJSON() ([]byte,error)

typePermissionList

type PermissionList struct {// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#permissionList".Kindstring `json:"kind,omitempty"`// NextPageToken: The page token for the next page of permissions. This field// will be absent if the end of the permissions list has been reached. If the// token is rejected for any reason, it should be discarded, and pagination// should be restarted from the first page of results. The page token is// typically valid for several hours. However, if new items are added or// removed, your expected results might differ.NextPageTokenstring `json:"nextPageToken,omitempty"`// Permissions: The list of permissions. If `nextPageToken` is populated, then// this list may be incomplete and an additional page of results should be// fetched.Permissions []*Permission `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. "Kind") 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. "Kind") 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:"-"`}

PermissionList: A list of permissions for a file.

func (PermissionList)MarshalJSON

func (sPermissionList) MarshalJSON() ([]byte,error)

typePermissionPermissionDetailsadded inv0.4.0

type PermissionPermissionDetails struct {// Inherited: Output only. Whether this permission is inherited. This field is// always populated. This is an output-only field.Inheritedbool `json:"inherited,omitempty"`// InheritedFrom: Output only. The ID of the item from which this permission is// inherited. This is only populated for items in shared drives.InheritedFromstring `json:"inheritedFrom,omitempty"`// PermissionType: Output only. The permission type for this user. Supported// values include: * `file` * `member`PermissionTypestring `json:"permissionType,omitempty"`// Role: Output only. The primary role for this user. Supported values include:// * `owner` * `organizer` * `fileOrganizer` * `writer` * `commenter` *// `reader` For more information, see Roles and permissions// (https://developers.google.com/workspace/drive/api/guides/ref-roles).Rolestring `json:"role,omitempty"`// ForceSendFields is a list of field names (e.g. "Inherited") 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. "Inherited") 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:"-"`}

func (PermissionPermissionDetails)MarshalJSONadded inv0.4.0

func (sPermissionPermissionDetails) MarshalJSON() ([]byte,error)

typePermissionTeamDrivePermissionDetails

type PermissionTeamDrivePermissionDetails struct {// Inherited: Deprecated: Output only. Use `permissionDetails/inherited`// instead.Inheritedbool `json:"inherited,omitempty"`// InheritedFrom: Deprecated: Output only. Use// `permissionDetails/inheritedFrom` instead.InheritedFromstring `json:"inheritedFrom,omitempty"`// Role: Deprecated: Output only. Use `permissionDetails/role` instead.Rolestring `json:"role,omitempty"`// TeamDrivePermissionType: Deprecated: Output only. Use// `permissionDetails/permissionType` instead.TeamDrivePermissionTypestring `json:"teamDrivePermissionType,omitempty"`// ForceSendFields is a list of field names (e.g. "Inherited") 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. "Inherited") 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:"-"`}

func (PermissionTeamDrivePermissionDetails)MarshalJSON

typePermissionsCreateCall

type PermissionsCreateCall struct {// contains filtered or unexported fields}

func (*PermissionsCreateCall)Context

Context sets the context to be used in this call's Do method.

func (*PermissionsCreateCall)Do

Do executes the "drive.permissions.create" call.Any non-2xx status code is an error. Response headers are in either*Permission.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*PermissionsCreateCall)EmailMessage

func (c *PermissionsCreateCall) EmailMessage(emailMessagestring) *PermissionsCreateCall

EmailMessage sets the optional parameter "emailMessage": A plain text custommessage to include in the notification email.

func (*PermissionsCreateCall)EnforceExpansiveAccessadded inv0.233.0

func (c *PermissionsCreateCall) EnforceExpansiveAccess(enforceExpansiveAccessbool) *PermissionsCreateCall

EnforceExpansiveAccess sets the optional parameter "enforceExpansiveAccess":Whether the request should enforce expansive access rules.

func (*PermissionsCreateCall)EnforceSingleParentadded inv0.21.0

func (c *PermissionsCreateCall) EnforceSingleParent(enforceSingleParentbool) *PermissionsCreateCall

EnforceSingleParent sets the optional parameter "enforceSingleParent":Deprecated: See `moveToNewOwnersRoot` for details.

func (*PermissionsCreateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*PermissionsCreateCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*PermissionsCreateCall)MoveToNewOwnersRootadded inv0.21.0

func (c *PermissionsCreateCall) MoveToNewOwnersRoot(moveToNewOwnersRootbool) *PermissionsCreateCall

MoveToNewOwnersRoot sets the optional parameter "moveToNewOwnersRoot": Thisparameter only takes effect if the item isn't in a shared drive and therequest is attempting to transfer the ownership of the item. If set to`true`, the item is moved to the new owner's My Drive root folder and allprior parents removed. If set to `false`, parents aren't changed.

func (*PermissionsCreateCall)SendNotificationEmail

func (c *PermissionsCreateCall) SendNotificationEmail(sendNotificationEmailbool) *PermissionsCreateCall

SendNotificationEmail sets the optional parameter "sendNotificationEmail":Whether to send a notification email when sharing to users or groups. Thisdefaults to `true` for users and groups, and is not allowed for otherrequests. It must not be disabled for ownership transfers.

func (*PermissionsCreateCall)SupportsAllDrivesadded inv0.4.0

func (c *PermissionsCreateCall) SupportsAllDrives(supportsAllDrivesbool) *PermissionsCreateCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*PermissionsCreateCall)SupportsTeamDrives

func (c *PermissionsCreateCall) SupportsTeamDrives(supportsTeamDrivesbool) *PermissionsCreateCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

func (*PermissionsCreateCall)TransferOwnership

func (c *PermissionsCreateCall) TransferOwnership(transferOwnershipbool) *PermissionsCreateCall

TransferOwnership sets the optional parameter "transferOwnership": Whetherto transfer ownership to the specified user and downgrade the current ownerto a writer. This parameter is required as an acknowledgement of the sideeffect. For more information, see Transfer file ownership(https://developers.google.com/workspace/drive/api/guides/transfer-file).

func (*PermissionsCreateCall)UseDomainAdminAccess

func (c *PermissionsCreateCall) UseDomainAdminAccess(useDomainAdminAccessbool) *PermissionsCreateCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator. If set to `true`, and if thefollowing additional conditions are met, the requester is granted access: 1.The file ID parameter refers to a shared drive. 2. The requester is anadministrator of the domain to which the shared drive belongs. For moreinformation, see Manage shared drives as domain administrators(https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).

typePermissionsDeleteCall

type PermissionsDeleteCall struct {// contains filtered or unexported fields}

func (*PermissionsDeleteCall)Context

Context sets the context to be used in this call's Do method.

func (*PermissionsDeleteCall)Do

Do executes the "drive.permissions.delete" call.

func (*PermissionsDeleteCall)EnforceExpansiveAccessadded inv0.223.0

func (c *PermissionsDeleteCall) EnforceExpansiveAccess(enforceExpansiveAccessbool) *PermissionsDeleteCall

EnforceExpansiveAccess sets the optional parameter "enforceExpansiveAccess":Whether the request should enforce expansive access rules.

func (*PermissionsDeleteCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*PermissionsDeleteCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*PermissionsDeleteCall)SupportsAllDrivesadded inv0.4.0

func (c *PermissionsDeleteCall) SupportsAllDrives(supportsAllDrivesbool) *PermissionsDeleteCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*PermissionsDeleteCall)SupportsTeamDrives

func (c *PermissionsDeleteCall) SupportsTeamDrives(supportsTeamDrivesbool) *PermissionsDeleteCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

func (*PermissionsDeleteCall)UseDomainAdminAccess

func (c *PermissionsDeleteCall) UseDomainAdminAccess(useDomainAdminAccessbool) *PermissionsDeleteCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator. If set to `true`, and if thefollowing additional conditions are met, the requester is granted access: 1.The file ID parameter refers to a shared drive. 2. The requester is anadministrator of the domain to which the shared drive belongs. For moreinformation, see Manage shared drives as domain administrators(https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).

typePermissionsGetCall

type PermissionsGetCall struct {// contains filtered or unexported fields}

func (*PermissionsGetCall)Context

Context sets the context to be used in this call's Do method.

func (*PermissionsGetCall)Do

Do executes the "drive.permissions.get" call.Any non-2xx status code is an error. Response headers are in either*Permission.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*PermissionsGetCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*PermissionsGetCall)Header

func (c *PermissionsGetCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*PermissionsGetCall)IfNoneMatch

func (c *PermissionsGetCall) IfNoneMatch(entityTagstring) *PermissionsGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*PermissionsGetCall)SupportsAllDrivesadded inv0.4.0

func (c *PermissionsGetCall) SupportsAllDrives(supportsAllDrivesbool) *PermissionsGetCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*PermissionsGetCall)SupportsTeamDrives

func (c *PermissionsGetCall) SupportsTeamDrives(supportsTeamDrivesbool) *PermissionsGetCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

func (*PermissionsGetCall)UseDomainAdminAccess

func (c *PermissionsGetCall) UseDomainAdminAccess(useDomainAdminAccessbool) *PermissionsGetCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator. If set to `true`, and if thefollowing additional conditions are met, the requester is granted access: 1.The file ID parameter refers to a shared drive. 2. The requester is anadministrator of the domain to which the shared drive belongs. For moreinformation, see Manage shared drives as domain administrators(https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).

typePermissionsListCall

type PermissionsListCall struct {// contains filtered or unexported fields}

func (*PermissionsListCall)Context

Context sets the context to be used in this call's Do method.

func (*PermissionsListCall)Do

Do executes the "drive.permissions.list" call.Any non-2xx status code is an error. Response headers are in either*PermissionList.ServerResponse.Header or (if a response was returned at all)in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*PermissionsListCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*PermissionsListCall)Header

func (c *PermissionsListCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*PermissionsListCall)IfNoneMatch

func (c *PermissionsListCall) IfNoneMatch(entityTagstring) *PermissionsListCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*PermissionsListCall)IncludePermissionsForViewadded inv0.31.0

func (c *PermissionsListCall) IncludePermissionsForView(includePermissionsForViewstring) *PermissionsListCall

IncludePermissionsForView sets the optional parameter"includePermissionsForView": Specifies which additional view's permissionsto include in the response. Only `published` is supported.

func (*PermissionsListCall)PageSize

func (c *PermissionsListCall) PageSize(pageSizeint64) *PermissionsListCall

PageSize sets the optional parameter "pageSize": The maximum number ofpermissions to return per page. When not set for files in a shared drive, atmost 100 results will be returned. When not set for files that are not in ashared drive, the entire list will be returned.

func (*PermissionsListCall)PageToken

func (c *PermissionsListCall) PageToken(pageTokenstring) *PermissionsListCall

PageToken sets the optional parameter "pageToken": The token for continuinga previous list request on the next page. This should be set to the value of`nextPageToken` from the previous response.

func (*PermissionsListCall)Pages

Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.

func (*PermissionsListCall)SupportsAllDrivesadded inv0.4.0

func (c *PermissionsListCall) SupportsAllDrives(supportsAllDrivesbool) *PermissionsListCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*PermissionsListCall)SupportsTeamDrives

func (c *PermissionsListCall) SupportsTeamDrives(supportsTeamDrivesbool) *PermissionsListCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

func (*PermissionsListCall)UseDomainAdminAccess

func (c *PermissionsListCall) UseDomainAdminAccess(useDomainAdminAccessbool) *PermissionsListCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator. If set to `true`, and if thefollowing additional conditions are met, the requester is granted access: 1.The file ID parameter refers to a shared drive. 2. The requester is anadministrator of the domain to which the shared drive belongs. For moreinformation, see Manage shared drives as domain administrators(https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).

typePermissionsService

type PermissionsService struct {// contains filtered or unexported fields}

funcNewPermissionsService

func NewPermissionsService(s *Service) *PermissionsService

func (*PermissionsService)Create

func (r *PermissionsService) Create(fileIdstring, permission *Permission) *PermissionsCreateCall

Create: Creates a permission for a file or shared drive. For moreinformation, see Share files, folders, and drives(https://developers.google.com/workspace/drive/api/guides/manage-sharing).**Warning:** Concurrent permissions operations on the same file aren'tsupported; only the last update is applied.

- fileId: The ID of the file or shared drive.

func (*PermissionsService)Delete

func (r *PermissionsService) Delete(fileIdstring, permissionIdstring) *PermissionsDeleteCall

Delete: Deletes a permission. For more information, see Share files,folders, and drives(https://developers.google.com/workspace/drive/api/guides/manage-sharing).**Warning:** Concurrent permissions operations on the same file aren'tsupported; only the last update is applied.

- fileId: The ID of the file or shared drive.- permissionId: The ID of the permission.

func (*PermissionsService)Get

func (r *PermissionsService) Get(fileIdstring, permissionIdstring) *PermissionsGetCall

Get: Gets a permission by ID. For more information, see Share files,folders, and drives(https://developers.google.com/workspace/drive/api/guides/manage-sharing).

- fileId: The ID of the file.- permissionId: The ID of the permission.

func (*PermissionsService)List

List: Lists a file's or shared drive's permissions. For more information,see Share files, folders, and drives(https://developers.google.com/workspace/drive/api/guides/manage-sharing).

- fileId: The ID of the file or shared drive.

func (*PermissionsService)Update

func (r *PermissionsService) Update(fileIdstring, permissionIdstring, permission *Permission) *PermissionsUpdateCall

Update: Updates a permission with patch semantics. For more information, seeShare files, folders, and drives(https://developers.google.com/workspace/drive/api/guides/manage-sharing).**Warning:** Concurrent permissions operations on the same file aren'tsupported; only the last update is applied.

- fileId: The ID of the file or shared drive.- permissionId: The ID of the permission.

typePermissionsUpdateCall

type PermissionsUpdateCall struct {// contains filtered or unexported fields}

func (*PermissionsUpdateCall)Context

Context sets the context to be used in this call's Do method.

func (*PermissionsUpdateCall)Do

Do executes the "drive.permissions.update" call.Any non-2xx status code is an error. Response headers are in either*Permission.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*PermissionsUpdateCall)EnforceExpansiveAccessadded inv0.223.0

func (c *PermissionsUpdateCall) EnforceExpansiveAccess(enforceExpansiveAccessbool) *PermissionsUpdateCall

EnforceExpansiveAccess sets the optional parameter "enforceExpansiveAccess":Whether the request should enforce expansive access rules.

func (*PermissionsUpdateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*PermissionsUpdateCall)Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*PermissionsUpdateCall)RemoveExpiration

func (c *PermissionsUpdateCall) RemoveExpiration(removeExpirationbool) *PermissionsUpdateCall

RemoveExpiration sets the optional parameter "removeExpiration": Whether toremove the expiration date.

func (*PermissionsUpdateCall)SupportsAllDrivesadded inv0.4.0

func (c *PermissionsUpdateCall) SupportsAllDrives(supportsAllDrivesbool) *PermissionsUpdateCall

SupportsAllDrives sets the optional parameter "supportsAllDrives": Whetherthe requesting application supports both My Drives and shared drives.

func (*PermissionsUpdateCall)SupportsTeamDrives

func (c *PermissionsUpdateCall) SupportsTeamDrives(supportsTeamDrivesbool) *PermissionsUpdateCall

SupportsTeamDrives sets the optional parameter "supportsTeamDrives":Deprecated: Use `supportsAllDrives` instead.

func (*PermissionsUpdateCall)TransferOwnership

func (c *PermissionsUpdateCall) TransferOwnership(transferOwnershipbool) *PermissionsUpdateCall

TransferOwnership sets the optional parameter "transferOwnership": Whetherto transfer ownership to the specified user and downgrade the current ownerto a writer. This parameter is required as an acknowledgement of the sideeffect. For more information, see Transfer file ownership(https://developers.google.com//workspace/drive/api/guides/transfer-file).

func (*PermissionsUpdateCall)UseDomainAdminAccess

func (c *PermissionsUpdateCall) UseDomainAdminAccess(useDomainAdminAccessbool) *PermissionsUpdateCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator. If set to `true`, and if thefollowing additional conditions are met, the requester is granted access: 1.The file ID parameter refers to a shared drive. 2. The requester is anadministrator of the domain to which the shared drive belongs. For moreinformation, see Manage shared drives as domain administrators(https://developers.google.com/workspace/drive/api/guides/manage-shareddrives#manage-administrators).

typeRepliesCreateCall

type RepliesCreateCall struct {// contains filtered or unexported fields}

func (*RepliesCreateCall)Context

Context sets the context to be used in this call's Do method.

func (*RepliesCreateCall)Do

Do executes the "drive.replies.create" call.Any non-2xx status code is an error. Response headers are in either*Reply.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*RepliesCreateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*RepliesCreateCall)Header

func (c *RepliesCreateCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeRepliesDeleteCall

type RepliesDeleteCall struct {// contains filtered or unexported fields}

func (*RepliesDeleteCall)Context

Context sets the context to be used in this call's Do method.

func (*RepliesDeleteCall)Do

Do executes the "drive.replies.delete" call.

func (*RepliesDeleteCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*RepliesDeleteCall)Header

func (c *RepliesDeleteCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeRepliesGetCall

type RepliesGetCall struct {// contains filtered or unexported fields}

func (*RepliesGetCall)Context

Context sets the context to be used in this call's Do method.

func (*RepliesGetCall)Do

func (c *RepliesGetCall) Do(opts ...googleapi.CallOption) (*Reply,error)

Do executes the "drive.replies.get" call.Any non-2xx status code is an error. Response headers are in either*Reply.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*RepliesGetCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*RepliesGetCall)Header

func (c *RepliesGetCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*RepliesGetCall)IfNoneMatch

func (c *RepliesGetCall) IfNoneMatch(entityTagstring) *RepliesGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*RepliesGetCall)IncludeDeleted

func (c *RepliesGetCall) IncludeDeleted(includeDeletedbool) *RepliesGetCall

IncludeDeleted sets the optional parameter "includeDeleted": Whether toreturn deleted replies. Deleted replies will not include their originalcontent.

typeRepliesListCall

type RepliesListCall struct {// contains filtered or unexported fields}

func (*RepliesListCall)Context

Context sets the context to be used in this call's Do method.

func (*RepliesListCall)Do

Do executes the "drive.replies.list" call.Any non-2xx status code is an error. Response headers are in either*ReplyList.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*RepliesListCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*RepliesListCall)Header

func (c *RepliesListCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*RepliesListCall)IfNoneMatch

func (c *RepliesListCall) IfNoneMatch(entityTagstring) *RepliesListCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*RepliesListCall)IncludeDeleted

func (c *RepliesListCall) IncludeDeleted(includeDeletedbool) *RepliesListCall

IncludeDeleted sets the optional parameter "includeDeleted": Whether toinclude deleted replies. Deleted replies will not include their originalcontent.

func (*RepliesListCall)PageSize

func (c *RepliesListCall) PageSize(pageSizeint64) *RepliesListCall

PageSize sets the optional parameter "pageSize": The maximum number ofreplies to return per page.

func (*RepliesListCall)PageToken

func (c *RepliesListCall) PageToken(pageTokenstring) *RepliesListCall

PageToken sets the optional parameter "pageToken": The token for continuinga previous list request on the next page. This should be set to the value of'nextPageToken' from the previous response.

func (*RepliesListCall)Pages

func (c *RepliesListCall) Pages(ctxcontext.Context, f func(*ReplyList)error)error

Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.

typeRepliesService

type RepliesService struct {// contains filtered or unexported fields}

funcNewRepliesService

func NewRepliesService(s *Service) *RepliesService

func (*RepliesService)Create

func (r *RepliesService) Create(fileIdstring, commentIdstring, reply *Reply) *RepliesCreateCall

Create: Creates a reply to a comment.

- commentId: The ID of the comment.- fileId: The ID of the file.

func (*RepliesService)Delete

func (r *RepliesService) Delete(fileIdstring, commentIdstring, replyIdstring) *RepliesDeleteCall

Delete: Deletes a reply.

- commentId: The ID of the comment.- fileId: The ID of the file.- replyId: The ID of the reply.

func (*RepliesService)Get

func (r *RepliesService) Get(fileIdstring, commentIdstring, replyIdstring) *RepliesGetCall

Get: Gets a reply by ID.

- commentId: The ID of the comment.- fileId: The ID of the file.- replyId: The ID of the reply.

func (*RepliesService)List

func (r *RepliesService) List(fileIdstring, commentIdstring) *RepliesListCall

List: Lists a comment's replies.

- commentId: The ID of the comment.- fileId: The ID of the file.

func (*RepliesService)Update

func (r *RepliesService) Update(fileIdstring, commentIdstring, replyIdstring, reply *Reply) *RepliesUpdateCall

Update: Updates a reply with patch semantics.

- commentId: The ID of the comment.- fileId: The ID of the file.- replyId: The ID of the reply.

typeRepliesUpdateCall

type RepliesUpdateCall struct {// contains filtered or unexported fields}

func (*RepliesUpdateCall)Context

Context sets the context to be used in this call's Do method.

func (*RepliesUpdateCall)Do

Do executes the "drive.replies.update" call.Any non-2xx status code is an error. Response headers are in either*Reply.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*RepliesUpdateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*RepliesUpdateCall)Header

func (c *RepliesUpdateCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeReply

type Reply struct {// Action: The action the reply performed to the parent comment. Valid values// are: * `resolve` * `reopen`Actionstring `json:"action,omitempty"`// AssigneeEmailAddress: Output only. The email address of the user assigned to// this comment. If no user is assigned, the field is unset.AssigneeEmailAddressstring `json:"assigneeEmailAddress,omitempty"`// Author: Output only. The author of the reply. The author's email address and// permission ID will not be populated.Author *User `json:"author,omitempty"`// Content: The plain text content of the reply. This field is used for setting// the content, while `htmlContent` should be displayed. This is required on// creates if no `action` is specified.Contentstring `json:"content,omitempty"`// CreatedTime: The time at which the reply was created (RFC 3339 date-time).CreatedTimestring `json:"createdTime,omitempty"`// Deleted: Output only. Whether the reply has been deleted. A deleted reply// has no content.Deletedbool `json:"deleted,omitempty"`// HtmlContent: Output only. The content of the reply with HTML formatting.HtmlContentstring `json:"htmlContent,omitempty"`// Id: Output only. The ID of the reply.Idstring `json:"id,omitempty"`// Kind: Output only. Identifies what kind of resource this is. Value: the// fixed string "drive#reply".Kindstring `json:"kind,omitempty"`// MentionedEmailAddresses: Output only. A list of email addresses for users// mentioned in this comment. If no users are mentioned, the list is empty.MentionedEmailAddresses []string `json:"mentionedEmailAddresses,omitempty"`// ModifiedTime: The last time the reply was modified (RFC 3339 date-time).ModifiedTimestring `json:"modifiedTime,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Action") 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. "Action") 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:"-"`}

Reply: A reply to a comment on a file. Some resource methods (such as`replies.update`) require a `replyId`. Use the `replies.list` method toretrieve the ID for a reply.

func (Reply)MarshalJSON

func (sReply) MarshalJSON() ([]byte,error)

typeReplyList

type ReplyList struct {// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#replyList".Kindstring `json:"kind,omitempty"`// NextPageToken: The page token for the next page of replies. This will be// absent if the end of the replies list has been reached. If the token is// rejected for any reason, it should be discarded, and pagination should be// restarted from the first page of results. The page token is typically valid// for several hours. However, if new items are added or removed, your expected// results might differ.NextPageTokenstring `json:"nextPageToken,omitempty"`// Replies: The list of replies. If nextPageToken is populated, then this list// may be incomplete and an additional page of results should be fetched.Replies []*Reply `json:"replies,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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:"-"`}

ReplyList: A list of replies to a comment on a file.

func (ReplyList)MarshalJSON

func (sReplyList) MarshalJSON() ([]byte,error)

typeResolveAccessProposalRequestadded inv0.206.0

type ResolveAccessProposalRequest struct {// Action: Required. The action to take on the access proposal.//// Possible values://   "ACTION_UNSPECIFIED" - Unspecified action//   "ACCEPT" - The user accepts the access proposal. Note: If this action is// used, the `role` field must have at least one value.//   "DENY" - The user denies the access proposal.Actionstring `json:"action,omitempty"`// Role: Optional. The roles that the approver has allowed, if any. For more// information, see Roles and permissions// (https://developers.google.com/workspace/drive/api/guides/ref-roles). Note:// This field is required for the `ACCEPT` action.Role []string `json:"role,omitempty"`// SendNotification: Optional. Whether to send an email to the requester when// the access proposal is denied or accepted.SendNotificationbool `json:"sendNotification,omitempty"`// View: Optional. Indicates the view for this access proposal. This should// only be set when the proposal belongs to a view. Only `published` is// supported.Viewstring `json:"view,omitempty"`// ForceSendFields is a list of field names (e.g. "Action") 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. "Action") 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:"-"`}

ResolveAccessProposalRequest: Request message for resolving anAccessProposal on a file.

func (ResolveAccessProposalRequest)MarshalJSONadded inv0.206.0

func (sResolveAccessProposalRequest) MarshalJSON() ([]byte,error)

typeRevision

type Revision struct {// ExportLinks: Output only. Links for exporting Docs Editors files to specific// formats.ExportLinks map[string]string `json:"exportLinks,omitempty"`// Id: Output only. The ID of the revision.Idstring `json:"id,omitempty"`// KeepForever: Whether to keep this revision forever, even if it is no longer// the head revision. If not set, the revision will be automatically purged 30// days after newer content is uploaded. This can be set on a maximum of 200// revisions for a file. This field is only applicable to files with binary// content in Drive.KeepForeverbool `json:"keepForever,omitempty"`// Kind: Output only. Identifies what kind of resource this is. Value: the// fixed string "drive#revision".Kindstring `json:"kind,omitempty"`// LastModifyingUser: Output only. The last user to modify this revision. This// field is only populated when the last modification was performed by a// signed-in user.LastModifyingUser *User `json:"lastModifyingUser,omitempty"`// Md5Checksum: Output only. The MD5 checksum of the revision's content. This// is only applicable to files with binary content in Drive.Md5Checksumstring `json:"md5Checksum,omitempty"`// MimeType: Output only. The MIME type of the revision.MimeTypestring `json:"mimeType,omitempty"`// ModifiedTime: The last time the revision was modified (RFC 3339 date-time).ModifiedTimestring `json:"modifiedTime,omitempty"`// OriginalFilename: Output only. The original filename used to create this// revision. This is only applicable to files with binary content in Drive.OriginalFilenamestring `json:"originalFilename,omitempty"`// PublishAuto: Whether subsequent revisions will be automatically republished.// This is only applicable to Docs Editors files.PublishAutobool `json:"publishAuto,omitempty"`// Published: Whether this revision is published. This is only applicable to// Docs Editors files.Publishedbool `json:"published,omitempty"`// PublishedLink: Output only. A link to the published revision. This is only// populated for Docs Editors files.PublishedLinkstring `json:"publishedLink,omitempty"`// PublishedOutsideDomain: Whether this revision is published outside the// domain. This is only applicable to Docs Editors files.PublishedOutsideDomainbool `json:"publishedOutsideDomain,omitempty"`// Size: Output only. The size of the revision's content in bytes. This is only// applicable to files with binary content in Drive.Sizeint64 `json:"size,omitempty,string"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "ExportLinks") 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. "ExportLinks") 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:"-"`}

Revision: The metadata for a revision to a file. Some resource methods (suchas `revisions.update`) require a `revisionId`. Use the `revisions.list`method to retrieve the ID for a revision.

func (Revision)MarshalJSON

func (sRevision) MarshalJSON() ([]byte,error)

typeRevisionList

type RevisionList struct {// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#revisionList".Kindstring `json:"kind,omitempty"`// NextPageToken: The page token for the next page of revisions. This will be// absent if the end of the revisions list has been reached. If the token is// rejected for any reason, it should be discarded, and pagination should be// restarted from the first page of results. The page token is typically valid// for several hours. However, if new items are added or removed, your expected// results might differ.NextPageTokenstring `json:"nextPageToken,omitempty"`// Revisions: The list of revisions. If nextPageToken is populated, then this// list may be incomplete and an additional page of results should be fetched.Revisions []*Revision `json:"revisions,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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:"-"`}

RevisionList: A list of revisions of a file.

func (RevisionList)MarshalJSON

func (sRevisionList) MarshalJSON() ([]byte,error)

typeRevisionsDeleteCall

type RevisionsDeleteCall struct {// contains filtered or unexported fields}

func (*RevisionsDeleteCall)Context

Context sets the context to be used in this call's Do method.

func (*RevisionsDeleteCall)Do

Do executes the "drive.revisions.delete" call.

func (*RevisionsDeleteCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*RevisionsDeleteCall)Header

func (c *RevisionsDeleteCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeRevisionsGetCall

type RevisionsGetCall struct {// contains filtered or unexported fields}

func (*RevisionsGetCall)AcknowledgeAbuse

func (c *RevisionsGetCall) AcknowledgeAbuse(acknowledgeAbusebool) *RevisionsGetCall

AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": Whether theuser is acknowledging the risk of downloading known malware or other abusivefiles. This is only applicable when the `alt` parameter is set to `media`and the user is the owner of the file or an organizer of the shared drive inwhich the file resides.

func (*RevisionsGetCall)Context

Context sets the context to be used in this call's Do and Download methods.

func (*RevisionsGetCall)Do

Do executes the "drive.revisions.get" call.Any non-2xx status code is an error. Response headers are in either*Revision.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*RevisionsGetCall)Download

func (c *RevisionsGetCall) Download(opts ...googleapi.CallOption) (*http.Response,error)

Download fetches the API endpoint's "media" value, instead of the normalAPI response value. If the returned error is nil, the Response is guaranteed tohave a 2xx status code. Callers must close the Response.Body as usual.

func (*RevisionsGetCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*RevisionsGetCall)Header

func (c *RevisionsGetCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*RevisionsGetCall)IfNoneMatch

func (c *RevisionsGetCall) IfNoneMatch(entityTagstring) *RevisionsGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

typeRevisionsListCall

type RevisionsListCall struct {// contains filtered or unexported fields}

func (*RevisionsListCall)Context

Context sets the context to be used in this call's Do method.

func (*RevisionsListCall)Do

Do executes the "drive.revisions.list" call.Any non-2xx status code is an error. Response headers are in either*RevisionList.ServerResponse.Header or (if a response was returned at all)in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*RevisionsListCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*RevisionsListCall)Header

func (c *RevisionsListCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*RevisionsListCall)IfNoneMatch

func (c *RevisionsListCall) IfNoneMatch(entityTagstring) *RevisionsListCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*RevisionsListCall)PageSize

func (c *RevisionsListCall) PageSize(pageSizeint64) *RevisionsListCall

PageSize sets the optional parameter "pageSize": The maximum number ofrevisions to return per page.

func (*RevisionsListCall)PageToken

func (c *RevisionsListCall) PageToken(pageTokenstring) *RevisionsListCall

PageToken sets the optional parameter "pageToken": The token for continuinga previous list request on the next page. This should be set to the value of'nextPageToken' from the previous response.

func (*RevisionsListCall)Pages

Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.

typeRevisionsService

type RevisionsService struct {// contains filtered or unexported fields}

funcNewRevisionsService

func NewRevisionsService(s *Service) *RevisionsService

func (*RevisionsService)Delete

func (r *RevisionsService) Delete(fileIdstring, revisionIdstring) *RevisionsDeleteCall

Delete: Permanently deletes a file version. You can only delete revisionsfor files with binary content in Google Drive, like images or videos.Revisions for other files, like Google Docs or Sheets, and the lastremaining file version can't be deleted. For more information, see Managefile revisions(https://developers.google.com/drive/api/guides/manage-revisions).

- fileId: The ID of the file.- revisionId: The ID of the revision.

func (*RevisionsService)Get

func (r *RevisionsService) Get(fileIdstring, revisionIdstring) *RevisionsGetCall

Get: Gets a revision's metadata or content by ID. For more information, seeManage file revisions(https://developers.google.com/workspace/drive/api/guides/manage-revisions).

- fileId: The ID of the file.- revisionId: The ID of the revision.

func (*RevisionsService)List

List: Lists a file's revisions. For more information, see Manage filerevisions(https://developers.google.com/workspace/drive/api/guides/manage-revisions).**Important:** The list of revisions returned by this method might beincomplete for files with a large revision history, including frequentlyedited Google Docs, Sheets, and Slides. Older revisions might be omittedfrom the response, meaning the first revision returned may not be the oldestexisting revision. The revision history visible in the Workspace editor userinterface might be more complete than the list returned by the API.

- fileId: The ID of the file.

func (*RevisionsService)Update

func (r *RevisionsService) Update(fileIdstring, revisionIdstring, revision *Revision) *RevisionsUpdateCall

Update: Updates a revision with patch semantics. For more information, seeManage file revisions(https://developers.google.com/workspace/drive/api/guides/manage-revisions).

- fileId: The ID of the file.- revisionId: The ID of the revision.

typeRevisionsUpdateCall

type RevisionsUpdateCall struct {// contains filtered or unexported fields}

func (*RevisionsUpdateCall)Context

Context sets the context to be used in this call's Do method.

func (*RevisionsUpdateCall)Do

Do executes the "drive.revisions.update" call.Any non-2xx status code is an error. Response headers are in either*Revision.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*RevisionsUpdateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*RevisionsUpdateCall)Header

func (c *RevisionsUpdateCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeService

type Service struct {BasePathstring// API endpoint base URLUserAgentstring// optional additional User-Agent fragmentAbout *AboutServiceAccessproposals *AccessproposalsServiceApps *AppsServiceChanges *ChangesServiceChannels *ChannelsServiceComments *CommentsServiceDrives *DrivesServiceFiles *FilesServiceOperations *OperationsServicePermissions *PermissionsServiceReplies *RepliesServiceRevisions *RevisionsServiceTeamdrives *TeamdrivesService// contains filtered or unexported fields}

funcNewdeprecated

func New(client *http.Client) (*Service,error)

New creates a new Service. It uses the provided http.Client for requests.

Deprecated: please use NewService instead.To provide a custom HTTP client, use option.WithHTTPClient.If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.

funcNewServiceadded inv0.3.0

func NewService(ctxcontext.Context, opts ...option.ClientOption) (*Service,error)

NewService creates a new Service.

typeStartPageToken

type StartPageToken struct {// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#startPageToken".Kindstring `json:"kind,omitempty"`// StartPageToken: The starting page token for listing future changes. The page// token doesn't expire.StartPageTokenstring `json:"startPageToken,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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:"-"`}

func (StartPageToken)MarshalJSON

func (sStartPageToken) MarshalJSON() ([]byte,error)

typeStatusadded inv0.197.0

type Status struct {// Code: The status code, which should be an enum value of google.rpc.Code.Codeint64 `json:"code,omitempty"`// Details: A list of messages that carry the error details. There is a common// set of message types for APIs to use.Details []googleapi.RawMessage `json:"details,omitempty"`// Message: A developer-facing error message, which should be in English. Any// user-facing error message should be localized and sent in the// google.rpc.Status.details field, or localized by the client.Messagestring `json:"message,omitempty"`// ForceSendFields is a list of field names (e.g. "Code") 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. "Code") 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:"-"`}

Status: The `Status` type defines a logical error model that is suitable fordifferent programming environments, including REST APIs and RPC APIs. It isused by gRPC (https://github.com/grpc). Each `Status` message contains threepieces of data: error code, error message, and error details. You can findout more about this error model and how to work with it in the API DesignGuide (https://cloud.google.com/apis/design/errors).

func (Status)MarshalJSONadded inv0.197.0

func (sStatus) MarshalJSON() ([]byte,error)

typeTeamDrive

type TeamDrive struct {// BackgroundImageFile: An image file and cropping parameters from which a// background image for this Team Drive is set. This is a write only field; it// can only be set on `drive.teamdrives.update` requests that don't set// `themeId`. When specified, all fields of the `backgroundImageFile` must be// set.BackgroundImageFile *TeamDriveBackgroundImageFile `json:"backgroundImageFile,omitempty"`// BackgroundImageLink: A short-lived link to this Team Drive's background// image.BackgroundImageLinkstring `json:"backgroundImageLink,omitempty"`// Capabilities: Capabilities the current user has on this Team Drive.Capabilities *TeamDriveCapabilities `json:"capabilities,omitempty"`// ColorRgb: The color of this Team Drive as an RGB hex string. It can only be// set on a `drive.teamdrives.update` request that does not set `themeId`.ColorRgbstring `json:"colorRgb,omitempty"`// CreatedTime: The time at which the Team Drive was created (RFC 3339// date-time).CreatedTimestring `json:"createdTime,omitempty"`// Id: The ID of this Team Drive which is also the ID of the top level folder// of this Team Drive.Idstring `json:"id,omitempty"`// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#teamDrive".Kindstring `json:"kind,omitempty"`// Name: The name of this Team Drive.Namestring `json:"name,omitempty"`// OrgUnitId: The organizational unit of this shared drive. This field is only// populated on `drives.list` responses when the `useDomainAdminAccess`// parameter is set to `true`.OrgUnitIdstring `json:"orgUnitId,omitempty"`// Restrictions: A set of restrictions that apply to this Team Drive or items// inside this Team Drive.Restrictions *TeamDriveRestrictions `json:"restrictions,omitempty"`// ThemeId: The ID of the theme from which the background image and color will// be set. The set of possible `teamDriveThemes` can be retrieved from a// `drive.about.get` response. When not specified on a// `drive.teamdrives.create` request, a random theme is chosen from which the// background image and color are set. This is a write-only field; it can only// be set on requests that don't set `colorRgb` or `backgroundImageFile`.ThemeIdstring `json:"themeId,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "BackgroundImageFile") 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. "BackgroundImageFile") 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:"-"`}

TeamDrive: Deprecated: use the drive collection instead.

func (TeamDrive)MarshalJSON

func (sTeamDrive) MarshalJSON() ([]byte,error)

typeTeamDriveBackgroundImageFile

type TeamDriveBackgroundImageFile struct {// Id: The ID of an image file in Drive to use for the background image.Idstring `json:"id,omitempty"`// Width: The width of the cropped image in the closed range of 0 to 1. This// value represents the width of the cropped image divided by the width of the// entire image. The height is computed by applying a width to height aspect// ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and// 144 pixels high.Widthfloat64 `json:"width,omitempty"`// XCoordinate: The X coordinate of the upper left corner of the cropping area// in the background image. This is a value in the closed range of 0 to 1. This// value represents the horizontal distance from the left side of the entire// image to the left side of the cropping area divided by the width of the// entire image.XCoordinatefloat64 `json:"xCoordinate,omitempty"`// YCoordinate: The Y coordinate of the upper left corner of the cropping area// in the background image. This is a value in the closed range of 0 to 1. This// value represents the vertical distance from the top side of the entire image// to the top side of the cropping area divided by the height of the entire// image.YCoordinatefloat64 `json:"yCoordinate,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:"-"`}

TeamDriveBackgroundImageFile: An image file and cropping parameters fromwhich a background image for this Team Drive is set. This is a write onlyfield; it can only be set on `drive.teamdrives.update` requests that don'tset `themeId`. When specified, all fields of the `backgroundImageFile` mustbe set.

func (TeamDriveBackgroundImageFile)MarshalJSON

func (sTeamDriveBackgroundImageFile) MarshalJSON() ([]byte,error)

func (*TeamDriveBackgroundImageFile)UnmarshalJSON

func (s *TeamDriveBackgroundImageFile) UnmarshalJSON(data []byte)error

typeTeamDriveCapabilities

type TeamDriveCapabilities struct {// CanAddChildren: Whether the current user can add children to folders in this// Team Drive.CanAddChildrenbool `json:"canAddChildren,omitempty"`// CanChangeCopyRequiresWriterPermissionRestriction: Whether the current user// can change the `copyRequiresWriterPermission` restriction of this Team// Drive.CanChangeCopyRequiresWriterPermissionRestrictionbool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"`// CanChangeDomainUsersOnlyRestriction: Whether the current user can change the// `domainUsersOnly` restriction of this Team Drive.CanChangeDomainUsersOnlyRestrictionbool `json:"canChangeDomainUsersOnlyRestriction,omitempty"`// CanChangeDownloadRestriction: Whether the current user can change// organizer-applied download restrictions of this shared drive.CanChangeDownloadRestrictionbool `json:"canChangeDownloadRestriction,omitempty"`// CanChangeSharingFoldersRequiresOrganizerPermissionRestriction: Whether the// current user can change the `sharingFoldersRequiresOrganizerPermission`// restriction of this Team Drive.CanChangeSharingFoldersRequiresOrganizerPermissionRestrictionbool `json:"canChangeSharingFoldersRequiresOrganizerPermissionRestriction,omitempty"`// CanChangeTeamDriveBackground: Whether the current user can change the// background of this Team Drive.CanChangeTeamDriveBackgroundbool `json:"canChangeTeamDriveBackground,omitempty"`// CanChangeTeamMembersOnlyRestriction: Whether the current user can change the// `teamMembersOnly` restriction of this Team Drive.CanChangeTeamMembersOnlyRestrictionbool `json:"canChangeTeamMembersOnlyRestriction,omitempty"`// CanComment: Whether the current user can comment on files in this Team// Drive.CanCommentbool `json:"canComment,omitempty"`// CanCopy: Whether the current user can copy files in this Team Drive.CanCopybool `json:"canCopy,omitempty"`// CanDeleteChildren: Whether the current user can delete children from folders// in this Team Drive.CanDeleteChildrenbool `json:"canDeleteChildren,omitempty"`// CanDeleteTeamDrive: Whether the current user can delete this Team Drive.// Attempting to delete the Team Drive may still fail if there are untrashed// items inside the Team Drive.CanDeleteTeamDrivebool `json:"canDeleteTeamDrive,omitempty"`// CanDownload: Whether the current user can download files in this Team Drive.CanDownloadbool `json:"canDownload,omitempty"`// CanEdit: Whether the current user can edit files in this Team DriveCanEditbool `json:"canEdit,omitempty"`// CanListChildren: Whether the current user can list the children of folders// in this Team Drive.CanListChildrenbool `json:"canListChildren,omitempty"`// CanManageMembers: Whether the current user can add members to this Team// Drive or remove them or change their role.CanManageMembersbool `json:"canManageMembers,omitempty"`// CanReadRevisions: Whether the current user can read the revisions resource// of files in this Team Drive.CanReadRevisionsbool `json:"canReadRevisions,omitempty"`// CanRemoveChildren: Deprecated: Use `canDeleteChildren` or `canTrashChildren`// instead.CanRemoveChildrenbool `json:"canRemoveChildren,omitempty"`// CanRename: Whether the current user can rename files or folders in this Team// Drive.CanRenamebool `json:"canRename,omitempty"`// CanRenameTeamDrive: Whether the current user can rename this Team Drive.CanRenameTeamDrivebool `json:"canRenameTeamDrive,omitempty"`// CanResetTeamDriveRestrictions: Whether the current user can reset the Team// Drive restrictions to defaults.CanResetTeamDriveRestrictionsbool `json:"canResetTeamDriveRestrictions,omitempty"`// CanShare: Whether the current user can share files or folders in this Team// Drive.CanSharebool `json:"canShare,omitempty"`// CanTrashChildren: Whether the current user can trash children from folders// in this Team Drive.CanTrashChildrenbool `json:"canTrashChildren,omitempty"`// ForceSendFields is a list of field names (e.g. "CanAddChildren") 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. "CanAddChildren") 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:"-"`}

TeamDriveCapabilities: Capabilities the current user has on this Team Drive.

func (TeamDriveCapabilities)MarshalJSON

func (sTeamDriveCapabilities) MarshalJSON() ([]byte,error)

typeTeamDriveList

type TeamDriveList struct {// Kind: Identifies what kind of resource this is. Value: the fixed string// "drive#teamDriveList".Kindstring `json:"kind,omitempty"`// NextPageToken: The page token for the next page of Team Drives. This will be// absent if the end of the Team Drives list has been reached. If the token is// rejected for any reason, it should be discarded, and pagination should be// restarted from the first page of results. The page token is typically valid// for several hours. However, if new items are added or removed, your expected// results might differ.NextPageTokenstring `json:"nextPageToken,omitempty"`// TeamDrives: The list of Team Drives. If nextPageToken is populated, then// this list may be incomplete and an additional page of results should be// fetched.TeamDrives []*TeamDrive `json:"teamDrives,omitempty"`// ServerResponse contains the HTTP response code and headers from the server.googleapi.ServerResponse `json:"-"`// ForceSendFields is a list of field names (e.g. "Kind") 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. "Kind") 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:"-"`}

TeamDriveList: A list of Team Drives.

func (TeamDriveList)MarshalJSON

func (sTeamDriveList) MarshalJSON() ([]byte,error)

typeTeamDriveRestrictions

type TeamDriveRestrictions struct {// AdminManagedRestrictions: Whether administrative privileges on this Team// Drive are required to modify restrictions.AdminManagedRestrictionsbool `json:"adminManagedRestrictions,omitempty"`// CopyRequiresWriterPermission: Whether the options to copy, print, or// download files inside this Team Drive, should be disabled for readers and// commenters. When this restriction is set to `true`, it will override the// similarly named field to `true` for any file inside this Team Drive.CopyRequiresWriterPermissionbool `json:"copyRequiresWriterPermission,omitempty"`// DomainUsersOnly: Whether access to this Team Drive and items inside this// Team Drive is restricted to users of the domain to which this Team Drive// belongs. This restriction may be overridden by other sharing policies// controlled outside of this Team Drive.DomainUsersOnlybool `json:"domainUsersOnly,omitempty"`// DownloadRestriction: Download restrictions applied by shared drive managers.DownloadRestriction *DownloadRestriction `json:"downloadRestriction,omitempty"`// SharingFoldersRequiresOrganizerPermission: If true, only users with the// organizer role can share folders. If false, users with either the organizer// role or the file organizer role can share folders.SharingFoldersRequiresOrganizerPermissionbool `json:"sharingFoldersRequiresOrganizerPermission,omitempty"`// TeamMembersOnly: Whether access to items inside this Team Drive is// restricted to members of this Team Drive.TeamMembersOnlybool `json:"teamMembersOnly,omitempty"`// ForceSendFields is a list of field names (e.g. "AdminManagedRestrictions")// 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. "AdminManagedRestrictions") 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:"-"`}

TeamDriveRestrictions: A set of restrictions that apply to this Team Driveor items inside this Team Drive.

func (TeamDriveRestrictions)MarshalJSON

func (sTeamDriveRestrictions) MarshalJSON() ([]byte,error)

typeTeamdrivesCreateCall

type TeamdrivesCreateCall struct {// contains filtered or unexported fields}

func (*TeamdrivesCreateCall)Context

Context sets the context to be used in this call's Do method.

func (*TeamdrivesCreateCall)Do

Do executes the "drive.teamdrives.create" call.Any non-2xx status code is an error. Response headers are in either*TeamDrive.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*TeamdrivesCreateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*TeamdrivesCreateCall)Header

func (c *TeamdrivesCreateCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeTeamdrivesDeleteCall

type TeamdrivesDeleteCall struct {// contains filtered or unexported fields}

func (*TeamdrivesDeleteCall)Context

Context sets the context to be used in this call's Do method.

func (*TeamdrivesDeleteCall)Do

Do executes the "drive.teamdrives.delete" call.

func (*TeamdrivesDeleteCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*TeamdrivesDeleteCall)Header

func (c *TeamdrivesDeleteCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

typeTeamdrivesGetCall

type TeamdrivesGetCall struct {// contains filtered or unexported fields}

func (*TeamdrivesGetCall)Context

Context sets the context to be used in this call's Do method.

func (*TeamdrivesGetCall)Do

Do executes the "drive.teamdrives.get" call.Any non-2xx status code is an error. Response headers are in either*TeamDrive.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*TeamdrivesGetCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*TeamdrivesGetCall)Header

func (c *TeamdrivesGetCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*TeamdrivesGetCall)IfNoneMatch

func (c *TeamdrivesGetCall) IfNoneMatch(entityTagstring) *TeamdrivesGetCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*TeamdrivesGetCall)UseDomainAdminAccess

func (c *TeamdrivesGetCall) UseDomainAdminAccess(useDomainAdminAccessbool) *TeamdrivesGetCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator; if set to true, then therequester will be granted access if they are an administrator of the domainto which the Team Drive belongs.

typeTeamdrivesListCall

type TeamdrivesListCall struct {// contains filtered or unexported fields}

func (*TeamdrivesListCall)Context

Context sets the context to be used in this call's Do method.

func (*TeamdrivesListCall)Do

Do executes the "drive.teamdrives.list" call.Any non-2xx status code is an error. Response headers are in either*TeamDriveList.ServerResponse.Header or (if a response was returned at all)in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*TeamdrivesListCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*TeamdrivesListCall)Header

func (c *TeamdrivesListCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*TeamdrivesListCall)IfNoneMatch

func (c *TeamdrivesListCall) IfNoneMatch(entityTagstring) *TeamdrivesListCall

IfNoneMatch sets an optional parameter which makes the operation fail if theobject's ETag matches the given value. This is useful for getting updatesonly after the object has changed since the last request.

func (*TeamdrivesListCall)PageSize

func (c *TeamdrivesListCall) PageSize(pageSizeint64) *TeamdrivesListCall

PageSize sets the optional parameter "pageSize": Maximum number of TeamDrives to return.

func (*TeamdrivesListCall)PageToken

func (c *TeamdrivesListCall) PageToken(pageTokenstring) *TeamdrivesListCall

PageToken sets the optional parameter "pageToken": Page token for TeamDrives.

func (*TeamdrivesListCall)Pages

Pages invokes f for each page of results.A non-nil error returned from f will halt the iteration.The provided context supersedes any context provided to the Context method.

func (*TeamdrivesListCall)Q

Q sets the optional parameter "q": Query string for searching Team Drives.

func (*TeamdrivesListCall)UseDomainAdminAccess

func (c *TeamdrivesListCall) UseDomainAdminAccess(useDomainAdminAccessbool) *TeamdrivesListCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator; if set to true, then all TeamDrives of the domain in which the requester is an administrator arereturned.

typeTeamdrivesService

type TeamdrivesService struct {// contains filtered or unexported fields}

funcNewTeamdrivesService

func NewTeamdrivesService(s *Service) *TeamdrivesService

func (*TeamdrivesService)Create

func (r *TeamdrivesService) Create(requestIdstring, teamdrive *TeamDrive) *TeamdrivesCreateCall

Create: Deprecated: Use `drives.create` instead.

  • requestId: An ID, such as a random UUID, which uniquely identifies thisuser's request for idempotent creation of a Team Drive. A repeated requestby the same user and with the same request ID will avoid creatingduplicates by attempting to create the same Team Drive. If the Team Drivealready exists a 409 error will be returned.

func (*TeamdrivesService)Delete

func (r *TeamdrivesService) Delete(teamDriveIdstring) *TeamdrivesDeleteCall

Delete: Deprecated: Use `drives.delete` instead.

- teamDriveId: The ID of the Team Drive.

func (*TeamdrivesService)Get

func (r *TeamdrivesService) Get(teamDriveIdstring) *TeamdrivesGetCall

Get: Deprecated: Use `drives.get` instead.

- teamDriveId: The ID of the Team Drive.

func (*TeamdrivesService)List

List: Deprecated: Use `drives.list` instead.

func (*TeamdrivesService)Update

func (r *TeamdrivesService) Update(teamDriveIdstring, teamdrive *TeamDrive) *TeamdrivesUpdateCall

Update: Deprecated: Use `drives.update` instead.

- teamDriveId: The ID of the Team Drive.

typeTeamdrivesUpdateCall

type TeamdrivesUpdateCall struct {// contains filtered or unexported fields}

func (*TeamdrivesUpdateCall)Context

Context sets the context to be used in this call's Do method.

func (*TeamdrivesUpdateCall)Do

Do executes the "drive.teamdrives.update" call.Any non-2xx status code is an error. Response headers are in either*TeamDrive.ServerResponse.Header or (if a response was returned at all) inerror.(*googleapi.Error).Header. Use googleapi.IsNotModified to checkwhether the returned error was because http.StatusNotModified was returned.

func (*TeamdrivesUpdateCall)Fields

Fields allows partial responses to be retrieved. Seehttps://developers.google.com/gdata/docs/2.0/basics#PartialResponse for moredetails.

func (*TeamdrivesUpdateCall)Header

func (c *TeamdrivesUpdateCall) Header()http.Header

Header returns a http.Header that can be modified by the caller to addheaders to the request.

func (*TeamdrivesUpdateCall)UseDomainAdminAccess

func (c *TeamdrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccessbool) *TeamdrivesUpdateCall

UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":Issue the request as a domain administrator; if set to true, then therequester will be granted access if they are an administrator of the domainto which the Team Drive belongs.

typeUser

type User struct {// DisplayName: Output only. A plain text displayable name for this user.DisplayNamestring `json:"displayName,omitempty"`// EmailAddress: Output only. The email address of the user. This may not be// present in certain contexts if the user has not made their email address// visible to the requester.EmailAddressstring `json:"emailAddress,omitempty"`// Kind: Output only. Identifies what kind of resource this is. Value: the// fixed string `drive#user`.Kindstring `json:"kind,omitempty"`// Me: Output only. Whether this user is the requesting user.Mebool `json:"me,omitempty"`// PermissionId: Output only. The user's ID as visible in Permission resources.PermissionIdstring `json:"permissionId,omitempty"`// PhotoLink: Output only. A link to the user's profile photo, if available.PhotoLinkstring `json:"photoLink,omitempty"`// ForceSendFields is a list of field names (e.g. "DisplayName") 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. "DisplayName") 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:"-"`}

User: Information about a Drive user.

func (User)MarshalJSON

func (sUser) MarshalJSON() ([]byte,error)

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp