...

Source file src/google.golang.org/api/drive/v3/drive-gen.go

Documentation: google.golang.org/api/drive/v3

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package drive provides access to the Google Drive API.
     8  //
     9  // For product documentation, see: https://developers.google.com/drive/
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/drive/v3"
    27  //	...
    28  //	ctx := context.Background()
    29  //	driveService, err := drive.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // By default, all available scopes (see "Constants") are used to authenticate.
    38  // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
    39  //
    40  //	driveService, err := drive.NewService(ctx, option.WithScopes(drive.DriveScriptsScope))
    41  //
    42  // To use an API key for authentication (note: some APIs do not support API
    43  // keys), use [google.golang.org/api/option.WithAPIKey]:
    44  //
    45  //	driveService, err := drive.NewService(ctx, option.WithAPIKey("AIza..."))
    46  //
    47  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    48  // flow, use [google.golang.org/api/option.WithTokenSource]:
    49  //
    50  //	config := &oauth2.Config{...}
    51  //	// ...
    52  //	token, err := config.Exchange(ctx, ...)
    53  //	driveService, err := drive.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    54  //
    55  // See [google.golang.org/api/option.ClientOption] for details on options.
    56  package drive // import "google.golang.org/api/drive/v3"
    57  
    58  import (
    59  	"bytes"
    60  	"context"
    61  	"encoding/json"
    62  	"errors"
    63  	"fmt"
    64  	"io"
    65  	"net/http"
    66  	"net/url"
    67  	"strconv"
    68  	"strings"
    69  
    70  	googleapi "google.golang.org/api/googleapi"
    71  	internal "google.golang.org/api/internal"
    72  	gensupport "google.golang.org/api/internal/gensupport"
    73  	option "google.golang.org/api/option"
    74  	internaloption "google.golang.org/api/option/internaloption"
    75  	htransport "google.golang.org/api/transport/http"
    76  )
    77  
    78  // Always reference these packages, just in case the auto-generated code
    79  // below doesn't.
    80  var _ = bytes.NewBuffer
    81  var _ = strconv.Itoa
    82  var _ = fmt.Sprintf
    83  var _ = json.NewDecoder
    84  var _ = io.Copy
    85  var _ = url.Parse
    86  var _ = gensupport.MarshalJSON
    87  var _ = googleapi.Version
    88  var _ = errors.New
    89  var _ = strings.Replace
    90  var _ = context.Canceled
    91  var _ = internaloption.WithDefaultEndpoint
    92  var _ = internal.Version
    93  
    94  const apiId = "drive:v3"
    95  const apiName = "drive"
    96  const apiVersion = "v3"
    97  const basePath = "https://www.googleapis.com/drive/v3/"
    98  const basePathTemplate = "https://www.UNIVERSE_DOMAIN/drive/v3/"
    99  const mtlsBasePath = "https://www.mtls.googleapis.com/drive/v3/"
   100  
   101  // OAuth2 scopes used by this API.
   102  const (
   103  	// See, edit, create, and delete all of your Google Drive files
   104  	DriveScope = "https://www.googleapis.com/auth/drive"
   105  
   106  	// See, create, and delete its own configuration data in your Google Drive
   107  	DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata"
   108  
   109  	// View your Google Drive apps
   110  	DriveAppsReadonlyScope = "https://www.googleapis.com/auth/drive.apps.readonly"
   111  
   112  	// See, edit, create, and delete only the specific Google Drive files you use
   113  	// with this app
   114  	DriveFileScope = "https://www.googleapis.com/auth/drive.file"
   115  
   116  	// View and manage metadata of files in your Google Drive
   117  	DriveMetadataScope = "https://www.googleapis.com/auth/drive.metadata"
   118  
   119  	// See information about your Google Drive files
   120  	DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/drive.metadata.readonly"
   121  
   122  	// View the photos, videos and albums in your Google Photos
   123  	DrivePhotosReadonlyScope = "https://www.googleapis.com/auth/drive.photos.readonly"
   124  
   125  	// See and download all your Google Drive files
   126  	DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly"
   127  
   128  	// Modify your Google Apps Script scripts' behavior
   129  	DriveScriptsScope = "https://www.googleapis.com/auth/drive.scripts"
   130  )
   131  
   132  // NewService creates a new Service.
   133  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   134  	scopesOption := internaloption.WithDefaultScopes(
   135  		"https://www.googleapis.com/auth/drive",
   136  		"https://www.googleapis.com/auth/drive.appdata",
   137  		"https://www.googleapis.com/auth/drive.apps.readonly",
   138  		"https://www.googleapis.com/auth/drive.file",
   139  		"https://www.googleapis.com/auth/drive.metadata",
   140  		"https://www.googleapis.com/auth/drive.metadata.readonly",
   141  		"https://www.googleapis.com/auth/drive.photos.readonly",
   142  		"https://www.googleapis.com/auth/drive.readonly",
   143  		"https://www.googleapis.com/auth/drive.scripts",
   144  	)
   145  	// NOTE: prepend, so we don't override user-specified scopes.
   146  	opts = append([]option.ClientOption{scopesOption}, opts...)
   147  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   148  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   149  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   150  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   151  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   152  	if err != nil {
   153  		return nil, err
   154  	}
   155  	s, err := New(client)
   156  	if err != nil {
   157  		return nil, err
   158  	}
   159  	if endpoint != "" {
   160  		s.BasePath = endpoint
   161  	}
   162  	return s, nil
   163  }
   164  
   165  // New creates a new Service. It uses the provided http.Client for requests.
   166  //
   167  // Deprecated: please use NewService instead.
   168  // To provide a custom HTTP client, use option.WithHTTPClient.
   169  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   170  func New(client *http.Client) (*Service, error) {
   171  	if client == nil {
   172  		return nil, errors.New("client is nil")
   173  	}
   174  	s := &Service{client: client, BasePath: basePath}
   175  	s.About = NewAboutService(s)
   176  	s.Apps = NewAppsService(s)
   177  	s.Changes = NewChangesService(s)
   178  	s.Channels = NewChannelsService(s)
   179  	s.Comments = NewCommentsService(s)
   180  	s.Drives = NewDrivesService(s)
   181  	s.Files = NewFilesService(s)
   182  	s.Permissions = NewPermissionsService(s)
   183  	s.Replies = NewRepliesService(s)
   184  	s.Revisions = NewRevisionsService(s)
   185  	s.Teamdrives = NewTeamdrivesService(s)
   186  	return s, nil
   187  }
   188  
   189  type Service struct {
   190  	client    *http.Client
   191  	BasePath  string // API endpoint base URL
   192  	UserAgent string // optional additional User-Agent fragment
   193  
   194  	About *AboutService
   195  
   196  	Apps *AppsService
   197  
   198  	Changes *ChangesService
   199  
   200  	Channels *ChannelsService
   201  
   202  	Comments *CommentsService
   203  
   204  	Drives *DrivesService
   205  
   206  	Files *FilesService
   207  
   208  	Permissions *PermissionsService
   209  
   210  	Replies *RepliesService
   211  
   212  	Revisions *RevisionsService
   213  
   214  	Teamdrives *TeamdrivesService
   215  }
   216  
   217  func (s *Service) userAgent() string {
   218  	if s.UserAgent == "" {
   219  		return googleapi.UserAgent
   220  	}
   221  	return googleapi.UserAgent + " " + s.UserAgent
   222  }
   223  
   224  func NewAboutService(s *Service) *AboutService {
   225  	rs := &AboutService{s: s}
   226  	return rs
   227  }
   228  
   229  type AboutService struct {
   230  	s *Service
   231  }
   232  
   233  func NewAppsService(s *Service) *AppsService {
   234  	rs := &AppsService{s: s}
   235  	return rs
   236  }
   237  
   238  type AppsService struct {
   239  	s *Service
   240  }
   241  
   242  func NewChangesService(s *Service) *ChangesService {
   243  	rs := &ChangesService{s: s}
   244  	return rs
   245  }
   246  
   247  type ChangesService struct {
   248  	s *Service
   249  }
   250  
   251  func NewChannelsService(s *Service) *ChannelsService {
   252  	rs := &ChannelsService{s: s}
   253  	return rs
   254  }
   255  
   256  type ChannelsService struct {
   257  	s *Service
   258  }
   259  
   260  func NewCommentsService(s *Service) *CommentsService {
   261  	rs := &CommentsService{s: s}
   262  	return rs
   263  }
   264  
   265  type CommentsService struct {
   266  	s *Service
   267  }
   268  
   269  func NewDrivesService(s *Service) *DrivesService {
   270  	rs := &DrivesService{s: s}
   271  	return rs
   272  }
   273  
   274  type DrivesService struct {
   275  	s *Service
   276  }
   277  
   278  func NewFilesService(s *Service) *FilesService {
   279  	rs := &FilesService{s: s}
   280  	return rs
   281  }
   282  
   283  type FilesService struct {
   284  	s *Service
   285  }
   286  
   287  func NewPermissionsService(s *Service) *PermissionsService {
   288  	rs := &PermissionsService{s: s}
   289  	return rs
   290  }
   291  
   292  type PermissionsService struct {
   293  	s *Service
   294  }
   295  
   296  func NewRepliesService(s *Service) *RepliesService {
   297  	rs := &RepliesService{s: s}
   298  	return rs
   299  }
   300  
   301  type RepliesService struct {
   302  	s *Service
   303  }
   304  
   305  func NewRevisionsService(s *Service) *RevisionsService {
   306  	rs := &RevisionsService{s: s}
   307  	return rs
   308  }
   309  
   310  type RevisionsService struct {
   311  	s *Service
   312  }
   313  
   314  func NewTeamdrivesService(s *Service) *TeamdrivesService {
   315  	rs := &TeamdrivesService{s: s}
   316  	return rs
   317  }
   318  
   319  type TeamdrivesService struct {
   320  	s *Service
   321  }
   322  
   323  // About: Information about the user, the user's Drive, and system
   324  // capabilities.
   325  type About struct {
   326  	// AppInstalled: Whether the user has installed the requesting app.
   327  	AppInstalled bool `json:"appInstalled,omitempty"`
   328  	// CanCreateDrives: Whether the user can create shared drives.
   329  	CanCreateDrives bool `json:"canCreateDrives,omitempty"`
   330  	// CanCreateTeamDrives: Deprecated: Use `canCreateDrives` instead.
   331  	CanCreateTeamDrives bool `json:"canCreateTeamDrives,omitempty"`
   332  	// DriveThemes: A list of themes that are supported for shared drives.
   333  	DriveThemes []*AboutDriveThemes `json:"driveThemes,omitempty"`
   334  	// ExportFormats: A map of source MIME type to possible targets for all
   335  	// supported exports.
   336  	ExportFormats map[string][]string `json:"exportFormats,omitempty"`
   337  	// FolderColorPalette: The currently supported folder colors as RGB hex
   338  	// strings.
   339  	FolderColorPalette []string `json:"folderColorPalette,omitempty"`
   340  	// ImportFormats: A map of source MIME type to possible targets for all
   341  	// supported imports.
   342  	ImportFormats map[string][]string `json:"importFormats,omitempty"`
   343  	// Kind: Identifies what kind of resource this is. Value: the fixed string
   344  	// "drive#about".
   345  	Kind string `json:"kind,omitempty"`
   346  	// MaxImportSizes: A map of maximum import sizes by MIME type, in bytes.
   347  	MaxImportSizes map[string]string `json:"maxImportSizes,omitempty"`
   348  	// MaxUploadSize: The maximum upload size in bytes.
   349  	MaxUploadSize int64 `json:"maxUploadSize,omitempty,string"`
   350  	// StorageQuota: The user's storage quota limits and usage. All fields are
   351  	// measured in bytes.
   352  	StorageQuota *AboutStorageQuota `json:"storageQuota,omitempty"`
   353  	// TeamDriveThemes: Deprecated: Use `driveThemes` instead.
   354  	TeamDriveThemes []*AboutTeamDriveThemes `json:"teamDriveThemes,omitempty"`
   355  	// User: The authenticated user.
   356  	User *User `json:"user,omitempty"`
   357  
   358  	// ServerResponse contains the HTTP response code and headers from the server.
   359  	googleapi.ServerResponse `json:"-"`
   360  	// ForceSendFields is a list of field names (e.g. "AppInstalled") to
   361  	// unconditionally include in API requests. By default, fields with empty or
   362  	// default values are omitted from API requests. See
   363  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   364  	// details.
   365  	ForceSendFields []string `json:"-"`
   366  	// NullFields is a list of field names (e.g. "AppInstalled") to include in API
   367  	// requests with the JSON null value. By default, fields with empty values are
   368  	// omitted from API requests. See
   369  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   370  	NullFields []string `json:"-"`
   371  }
   372  
   373  func (s *About) MarshalJSON() ([]byte, error) {
   374  	type NoMethod About
   375  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   376  }
   377  
   378  type AboutDriveThemes struct {
   379  	// BackgroundImageLink: A link to this theme's background image.
   380  	BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
   381  	// ColorRgb: The color of this theme as an RGB hex string.
   382  	ColorRgb string `json:"colorRgb,omitempty"`
   383  	// Id: The ID of the theme.
   384  	Id string `json:"id,omitempty"`
   385  	// ForceSendFields is a list of field names (e.g. "BackgroundImageLink") to
   386  	// unconditionally include in API requests. By default, fields with empty or
   387  	// default values are omitted from API requests. See
   388  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   389  	// details.
   390  	ForceSendFields []string `json:"-"`
   391  	// NullFields is a list of field names (e.g. "BackgroundImageLink") to include
   392  	// in API requests with the JSON null value. By default, fields with empty
   393  	// values are omitted from API requests. See
   394  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   395  	NullFields []string `json:"-"`
   396  }
   397  
   398  func (s *AboutDriveThemes) MarshalJSON() ([]byte, error) {
   399  	type NoMethod AboutDriveThemes
   400  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   401  }
   402  
   403  // AboutStorageQuota: The user's storage quota limits and usage. All fields are
   404  // measured in bytes.
   405  type AboutStorageQuota struct {
   406  	// Limit: The usage limit, if applicable. This will not be present if the user
   407  	// has unlimited storage.
   408  	Limit int64 `json:"limit,omitempty,string"`
   409  	// Usage: The total usage across all services.
   410  	Usage int64 `json:"usage,omitempty,string"`
   411  	// UsageInDrive: The usage by all files in Google Drive.
   412  	UsageInDrive int64 `json:"usageInDrive,omitempty,string"`
   413  	// UsageInDriveTrash: The usage by trashed files in Google Drive.
   414  	UsageInDriveTrash int64 `json:"usageInDriveTrash,omitempty,string"`
   415  	// ForceSendFields is a list of field names (e.g. "Limit") to unconditionally
   416  	// include in API requests. By default, fields with empty or default values are
   417  	// omitted from API requests. See
   418  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   419  	// details.
   420  	ForceSendFields []string `json:"-"`
   421  	// NullFields is a list of field names (e.g. "Limit") to include in API
   422  	// requests with the JSON null value. By default, fields with empty values are
   423  	// omitted from API requests. See
   424  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   425  	NullFields []string `json:"-"`
   426  }
   427  
   428  func (s *AboutStorageQuota) MarshalJSON() ([]byte, error) {
   429  	type NoMethod AboutStorageQuota
   430  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   431  }
   432  
   433  type AboutTeamDriveThemes struct {
   434  	// BackgroundImageLink: Deprecated: Use `driveThemes/backgroundImageLink`
   435  	// instead.
   436  	BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
   437  	// ColorRgb: Deprecated: Use `driveThemes/colorRgb` instead.
   438  	ColorRgb string `json:"colorRgb,omitempty"`
   439  	// Id: Deprecated: Use `driveThemes/id` instead.
   440  	Id string `json:"id,omitempty"`
   441  	// ForceSendFields is a list of field names (e.g. "BackgroundImageLink") to
   442  	// unconditionally include in API requests. By default, fields with empty or
   443  	// default values are omitted from API requests. See
   444  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   445  	// details.
   446  	ForceSendFields []string `json:"-"`
   447  	// NullFields is a list of field names (e.g. "BackgroundImageLink") to include
   448  	// in API requests with the JSON null value. By default, fields with empty
   449  	// values are omitted from API requests. See
   450  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   451  	NullFields []string `json:"-"`
   452  }
   453  
   454  func (s *AboutTeamDriveThemes) MarshalJSON() ([]byte, error) {
   455  	type NoMethod AboutTeamDriveThemes
   456  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   457  }
   458  
   459  // App: The `apps` resource provides a list of apps that a user has installed,
   460  // with information about each app's supported MIME types, file extensions, and
   461  // other details. Some resource methods (such as `apps.get`) require an
   462  // `appId`. Use the `apps.list` method to retrieve the ID for an installed
   463  // application.
   464  type App struct {
   465  	// Authorized: Whether the app is authorized to access data on the user's
   466  	// Drive.
   467  	Authorized bool `json:"authorized,omitempty"`
   468  	// CreateInFolderTemplate: The template URL to create a file with this app in a
   469  	// given folder. The template contains the {folderId} to be replaced by the
   470  	// folder ID house the new file.
   471  	CreateInFolderTemplate string `json:"createInFolderTemplate,omitempty"`
   472  	// CreateUrl: The URL to create a file with this app.
   473  	CreateUrl string `json:"createUrl,omitempty"`
   474  	// HasDriveWideScope: Whether the app has Drive-wide scope. An app with
   475  	// Drive-wide scope can access all files in the user's Drive.
   476  	HasDriveWideScope bool `json:"hasDriveWideScope,omitempty"`
   477  	// Icons: The various icons for the app.
   478  	Icons []*AppIcons `json:"icons,omitempty"`
   479  	// Id: The ID of the app.
   480  	Id string `json:"id,omitempty"`
   481  	// Installed: Whether the app is installed.
   482  	Installed bool `json:"installed,omitempty"`
   483  	// Kind: Output only. Identifies what kind of resource this is. Value: the
   484  	// fixed string "drive#app".
   485  	Kind string `json:"kind,omitempty"`
   486  	// LongDescription: A long description of the app.
   487  	LongDescription string `json:"longDescription,omitempty"`
   488  	// Name: The name of the app.
   489  	Name string `json:"name,omitempty"`
   490  	// ObjectType: The type of object this app creates such as a Chart. If empty,
   491  	// the app name should be used instead.
   492  	ObjectType string `json:"objectType,omitempty"`
   493  	// OpenUrlTemplate: The template URL for opening files with this app. The
   494  	// template contains {ids} or {exportIds} to be replaced by the actual file
   495  	// IDs. For more information, see Open Files for the full documentation.
   496  	OpenUrlTemplate string `json:"openUrlTemplate,omitempty"`
   497  	// PrimaryFileExtensions: The list of primary file extensions.
   498  	PrimaryFileExtensions []string `json:"primaryFileExtensions,omitempty"`
   499  	// PrimaryMimeTypes: The list of primary MIME types.
   500  	PrimaryMimeTypes []string `json:"primaryMimeTypes,omitempty"`
   501  	// ProductId: The ID of the product listing for this app.
   502  	ProductId string `json:"productId,omitempty"`
   503  	// ProductUrl: A link to the product listing for this app.
   504  	ProductUrl string `json:"productUrl,omitempty"`
   505  	// SecondaryFileExtensions: The list of secondary file extensions.
   506  	SecondaryFileExtensions []string `json:"secondaryFileExtensions,omitempty"`
   507  	// SecondaryMimeTypes: The list of secondary MIME types.
   508  	SecondaryMimeTypes []string `json:"secondaryMimeTypes,omitempty"`
   509  	// ShortDescription: A short description of the app.
   510  	ShortDescription string `json:"shortDescription,omitempty"`
   511  	// SupportsCreate: Whether this app supports creating objects.
   512  	SupportsCreate bool `json:"supportsCreate,omitempty"`
   513  	// SupportsImport: Whether this app supports importing from Google Docs.
   514  	SupportsImport bool `json:"supportsImport,omitempty"`
   515  	// SupportsMultiOpen: Whether this app supports opening more than one file.
   516  	SupportsMultiOpen bool `json:"supportsMultiOpen,omitempty"`
   517  	// SupportsOfflineCreate: Whether this app supports creating files when
   518  	// offline.
   519  	SupportsOfflineCreate bool `json:"supportsOfflineCreate,omitempty"`
   520  	// UseByDefault: Whether the app is selected as the default handler for the
   521  	// types it supports.
   522  	UseByDefault bool `json:"useByDefault,omitempty"`
   523  
   524  	// ServerResponse contains the HTTP response code and headers from the server.
   525  	googleapi.ServerResponse `json:"-"`
   526  	// ForceSendFields is a list of field names (e.g. "Authorized") to
   527  	// unconditionally include in API requests. By default, fields with empty or
   528  	// default values are omitted from API requests. See
   529  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   530  	// details.
   531  	ForceSendFields []string `json:"-"`
   532  	// NullFields is a list of field names (e.g. "Authorized") to include in API
   533  	// requests with the JSON null value. By default, fields with empty values are
   534  	// omitted from API requests. See
   535  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   536  	NullFields []string `json:"-"`
   537  }
   538  
   539  func (s *App) MarshalJSON() ([]byte, error) {
   540  	type NoMethod App
   541  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   542  }
   543  
   544  type AppIcons struct {
   545  	// Category: Category of the icon. Allowed values are: * `application` - The
   546  	// icon for the application. * `document` - The icon for a file associated with
   547  	// the app. * `documentShared` - The icon for a shared file associated with the
   548  	// app.
   549  	Category string `json:"category,omitempty"`
   550  	// IconUrl: URL for the icon.
   551  	IconUrl string `json:"iconUrl,omitempty"`
   552  	// Size: Size of the icon. Represented as the maximum of the width and height.
   553  	Size int64 `json:"size,omitempty"`
   554  	// ForceSendFields is a list of field names (e.g. "Category") to
   555  	// unconditionally include in API requests. By default, fields with empty or
   556  	// default values are omitted from API requests. See
   557  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   558  	// details.
   559  	ForceSendFields []string `json:"-"`
   560  	// NullFields is a list of field names (e.g. "Category") to include in API
   561  	// requests with the JSON null value. By default, fields with empty values are
   562  	// omitted from API requests. See
   563  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   564  	NullFields []string `json:"-"`
   565  }
   566  
   567  func (s *AppIcons) MarshalJSON() ([]byte, error) {
   568  	type NoMethod AppIcons
   569  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   570  }
   571  
   572  // AppList: A list of third-party applications which the user has installed or
   573  // given access to Google Drive.
   574  type AppList struct {
   575  	// DefaultAppIds: The list of app IDs that the user has specified to use by
   576  	// default. The list is in reverse-priority order (lowest to highest).
   577  	DefaultAppIds []string `json:"defaultAppIds,omitempty"`
   578  	// Items: The list of apps.
   579  	Items []*App `json:"items,omitempty"`
   580  	// Kind: Output only. Identifies what kind of resource this is. Value: the
   581  	// fixed string "drive#appList".
   582  	Kind string `json:"kind,omitempty"`
   583  	// SelfLink: A link back to this list.
   584  	SelfLink string `json:"selfLink,omitempty"`
   585  
   586  	// ServerResponse contains the HTTP response code and headers from the server.
   587  	googleapi.ServerResponse `json:"-"`
   588  	// ForceSendFields is a list of field names (e.g. "DefaultAppIds") to
   589  	// unconditionally include in API requests. By default, fields with empty or
   590  	// default values are omitted from API requests. See
   591  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   592  	// details.
   593  	ForceSendFields []string `json:"-"`
   594  	// NullFields is a list of field names (e.g. "DefaultAppIds") to include in API
   595  	// requests with the JSON null value. By default, fields with empty values are
   596  	// omitted from API requests. See
   597  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   598  	NullFields []string `json:"-"`
   599  }
   600  
   601  func (s *AppList) MarshalJSON() ([]byte, error) {
   602  	type NoMethod AppList
   603  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   604  }
   605  
   606  // Change: A change to a file or shared drive.
   607  type Change struct {
   608  	// ChangeType: The type of the change. Possible values are `file` and `drive`.
   609  	ChangeType string `json:"changeType,omitempty"`
   610  	// Drive: The updated state of the shared drive. Present if the changeType is
   611  	// drive, the user is still a member of the shared drive, and the shared drive
   612  	// has not been deleted.
   613  	Drive *Drive `json:"drive,omitempty"`
   614  	// DriveId: The ID of the shared drive associated with this change.
   615  	DriveId string `json:"driveId,omitempty"`
   616  	// File: The updated state of the file. Present if the type is file and the
   617  	// file has not been removed from this list of changes.
   618  	File *File `json:"file,omitempty"`
   619  	// FileId: The ID of the file which has changed.
   620  	FileId string `json:"fileId,omitempty"`
   621  	// Kind: Identifies what kind of resource this is. Value: the fixed string
   622  	// "drive#change".
   623  	Kind string `json:"kind,omitempty"`
   624  	// Removed: Whether the file or shared drive has been removed from this list of
   625  	// changes, for example by deletion or loss of access.
   626  	Removed bool `json:"removed,omitempty"`
   627  	// TeamDrive: Deprecated: Use `drive` instead.
   628  	TeamDrive *TeamDrive `json:"teamDrive,omitempty"`
   629  	// TeamDriveId: Deprecated: Use `driveId` instead.
   630  	TeamDriveId string `json:"teamDriveId,omitempty"`
   631  	// Time: The time of this change (RFC 3339 date-time).
   632  	Time string `json:"time,omitempty"`
   633  	// Type: Deprecated: Use `changeType` instead.
   634  	Type string `json:"type,omitempty"`
   635  	// ForceSendFields is a list of field names (e.g. "ChangeType") to
   636  	// unconditionally include in API requests. By default, fields with empty or
   637  	// default values are omitted from API requests. See
   638  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   639  	// details.
   640  	ForceSendFields []string `json:"-"`
   641  	// NullFields is a list of field names (e.g. "ChangeType") to include in API
   642  	// requests with the JSON null value. By default, fields with empty values are
   643  	// omitted from API requests. See
   644  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   645  	NullFields []string `json:"-"`
   646  }
   647  
   648  func (s *Change) MarshalJSON() ([]byte, error) {
   649  	type NoMethod Change
   650  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   651  }
   652  
   653  // ChangeList: A list of changes for a user.
   654  type ChangeList struct {
   655  	// Changes: The list of changes. If nextPageToken is populated, then this list
   656  	// may be incomplete and an additional page of results should be fetched.
   657  	Changes []*Change `json:"changes,omitempty"`
   658  	// Kind: Identifies what kind of resource this is. Value: the fixed string
   659  	// "drive#changeList".
   660  	Kind string `json:"kind,omitempty"`
   661  	// NewStartPageToken: The starting page token for future changes. This will be
   662  	// present only if the end of the current changes list has been reached. The
   663  	// page token doesn't expire.
   664  	NewStartPageToken string `json:"newStartPageToken,omitempty"`
   665  	// NextPageToken: The page token for the next page of changes. This will be
   666  	// absent if the end of the changes list has been reached. The page token
   667  	// doesn't expire.
   668  	NextPageToken string `json:"nextPageToken,omitempty"`
   669  
   670  	// ServerResponse contains the HTTP response code and headers from the server.
   671  	googleapi.ServerResponse `json:"-"`
   672  	// ForceSendFields is a list of field names (e.g. "Changes") to unconditionally
   673  	// include in API requests. By default, fields with empty or default values are
   674  	// omitted from API requests. See
   675  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   676  	// details.
   677  	ForceSendFields []string `json:"-"`
   678  	// NullFields is a list of field names (e.g. "Changes") to include in API
   679  	// requests with the JSON null value. By default, fields with empty values are
   680  	// omitted from API requests. See
   681  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   682  	NullFields []string `json:"-"`
   683  }
   684  
   685  func (s *ChangeList) MarshalJSON() ([]byte, error) {
   686  	type NoMethod ChangeList
   687  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   688  }
   689  
   690  // Channel: A notification channel used to watch for resource changes.
   691  type Channel struct {
   692  	// Address: The address where notifications are delivered for this channel.
   693  	Address string `json:"address,omitempty"`
   694  	// Expiration: Date and time of notification channel expiration, expressed as a
   695  	// Unix timestamp, in milliseconds. Optional.
   696  	Expiration int64 `json:"expiration,omitempty,string"`
   697  	// Id: A UUID or similar unique string that identifies this channel.
   698  	Id string `json:"id,omitempty"`
   699  	// Kind: Identifies this as a notification channel used to watch for changes to
   700  	// a resource, which is `api#channel`.
   701  	Kind string `json:"kind,omitempty"`
   702  	// Params: Additional parameters controlling delivery channel behavior.
   703  	// Optional.
   704  	Params map[string]string `json:"params,omitempty"`
   705  	// Payload: A Boolean value to indicate whether payload is wanted. Optional.
   706  	Payload bool `json:"payload,omitempty"`
   707  	// ResourceId: An opaque ID that identifies the resource being watched on this
   708  	// channel. Stable across different API versions.
   709  	ResourceId string `json:"resourceId,omitempty"`
   710  	// ResourceUri: A version-specific identifier for the watched resource.
   711  	ResourceUri string `json:"resourceUri,omitempty"`
   712  	// Token: An arbitrary string delivered to the target address with each
   713  	// notification delivered over this channel. Optional.
   714  	Token string `json:"token,omitempty"`
   715  	// Type: The type of delivery mechanism used for this channel. Valid values are
   716  	// "web_hook" or "webhook".
   717  	Type string `json:"type,omitempty"`
   718  
   719  	// ServerResponse contains the HTTP response code and headers from the server.
   720  	googleapi.ServerResponse `json:"-"`
   721  	// ForceSendFields is a list of field names (e.g. "Address") to unconditionally
   722  	// include in API requests. By default, fields with empty or default values are
   723  	// omitted from API requests. See
   724  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   725  	// details.
   726  	ForceSendFields []string `json:"-"`
   727  	// NullFields is a list of field names (e.g. "Address") to include in API
   728  	// requests with the JSON null value. By default, fields with empty values are
   729  	// omitted from API requests. See
   730  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   731  	NullFields []string `json:"-"`
   732  }
   733  
   734  func (s *Channel) MarshalJSON() ([]byte, error) {
   735  	type NoMethod Channel
   736  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   737  }
   738  
   739  // Comment: A comment on a file. Some resource methods (such as
   740  // `comments.update`) require a `commentId`. Use the `comments.list` method to
   741  // retrieve the ID for a comment in a file.
   742  type Comment struct {
   743  	// Anchor: A region of the document represented as a JSON string. For details
   744  	// on defining anchor properties, refer to Manage comments and replies
   745  	// (https://developers.google.com/drive/api/v3/manage-comments).
   746  	Anchor string `json:"anchor,omitempty"`
   747  	// Author: Output only. The author of the comment. The author's email address
   748  	// and permission ID will not be populated.
   749  	Author *User `json:"author,omitempty"`
   750  	// Content: The plain text content of the comment. This field is used for
   751  	// setting the content, while `htmlContent` should be displayed.
   752  	Content string `json:"content,omitempty"`
   753  	// CreatedTime: The time at which the comment was created (RFC 3339 date-time).
   754  	CreatedTime string `json:"createdTime,omitempty"`
   755  	// Deleted: Output only. Whether the comment has been deleted. A deleted
   756  	// comment has no content.
   757  	Deleted bool `json:"deleted,omitempty"`
   758  	// HtmlContent: Output only. The content of the comment with HTML formatting.
   759  	HtmlContent string `json:"htmlContent,omitempty"`
   760  	// Id: Output only. The ID of the comment.
   761  	Id string `json:"id,omitempty"`
   762  	// Kind: Output only. Identifies what kind of resource this is. Value: the
   763  	// fixed string "drive#comment".
   764  	Kind string `json:"kind,omitempty"`
   765  	// ModifiedTime: The last time the comment or any of its replies was modified
   766  	// (RFC 3339 date-time).
   767  	ModifiedTime string `json:"modifiedTime,omitempty"`
   768  	// QuotedFileContent: The file content to which the comment refers, typically
   769  	// within the anchor region. For a text file, for example, this would be the
   770  	// text at the location of the comment.
   771  	QuotedFileContent *CommentQuotedFileContent `json:"quotedFileContent,omitempty"`
   772  	// Replies: Output only. The full list of replies to the comment in
   773  	// chronological order.
   774  	Replies []*Reply `json:"replies,omitempty"`
   775  	// Resolved: Output only. Whether the comment has been resolved by one of its
   776  	// replies.
   777  	Resolved bool `json:"resolved,omitempty"`
   778  
   779  	// ServerResponse contains the HTTP response code and headers from the server.
   780  	googleapi.ServerResponse `json:"-"`
   781  	// ForceSendFields is a list of field names (e.g. "Anchor") to unconditionally
   782  	// include in API requests. By default, fields with empty or default values are
   783  	// omitted from API requests. See
   784  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   785  	// details.
   786  	ForceSendFields []string `json:"-"`
   787  	// NullFields is a list of field names (e.g. "Anchor") to include in API
   788  	// requests with the JSON null value. By default, fields with empty values are
   789  	// omitted from API requests. See
   790  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   791  	NullFields []string `json:"-"`
   792  }
   793  
   794  func (s *Comment) MarshalJSON() ([]byte, error) {
   795  	type NoMethod Comment
   796  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   797  }
   798  
   799  // CommentQuotedFileContent: The file content to which the comment refers,
   800  // typically within the anchor region. For a text file, for example, this would
   801  // be the text at the location of the comment.
   802  type CommentQuotedFileContent struct {
   803  	// MimeType: The MIME type of the quoted content.
   804  	MimeType string `json:"mimeType,omitempty"`
   805  	// Value: The quoted content itself. This is interpreted as plain text if set
   806  	// through the API.
   807  	Value string `json:"value,omitempty"`
   808  	// ForceSendFields is a list of field names (e.g. "MimeType") to
   809  	// unconditionally include in API requests. By default, fields with empty or
   810  	// default values are omitted from API requests. See
   811  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   812  	// details.
   813  	ForceSendFields []string `json:"-"`
   814  	// NullFields is a list of field names (e.g. "MimeType") to include in API
   815  	// requests with the JSON null value. By default, fields with empty values are
   816  	// omitted from API requests. See
   817  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   818  	NullFields []string `json:"-"`
   819  }
   820  
   821  func (s *CommentQuotedFileContent) MarshalJSON() ([]byte, error) {
   822  	type NoMethod CommentQuotedFileContent
   823  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   824  }
   825  
   826  // CommentList: A list of comments on a file.
   827  type CommentList struct {
   828  	// Comments: The list of comments. If nextPageToken is populated, then this
   829  	// list may be incomplete and an additional page of results should be fetched.
   830  	Comments []*Comment `json:"comments,omitempty"`
   831  	// Kind: Identifies what kind of resource this is. Value: the fixed string
   832  	// "drive#commentList".
   833  	Kind string `json:"kind,omitempty"`
   834  	// NextPageToken: The page token for the next page of comments. This will be
   835  	// absent if the end of the comments list has been reached. If the token is
   836  	// rejected for any reason, it should be discarded, and pagination should be
   837  	// restarted from the first page of results. The page token is typically valid
   838  	// for several hours. However, if new items are added or removed, your expected
   839  	// results might differ.
   840  	NextPageToken string `json:"nextPageToken,omitempty"`
   841  
   842  	// ServerResponse contains the HTTP response code and headers from the server.
   843  	googleapi.ServerResponse `json:"-"`
   844  	// ForceSendFields is a list of field names (e.g. "Comments") to
   845  	// unconditionally include in API requests. By default, fields with empty or
   846  	// default values are omitted from API requests. See
   847  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   848  	// details.
   849  	ForceSendFields []string `json:"-"`
   850  	// NullFields is a list of field names (e.g. "Comments") to include in API
   851  	// requests with the JSON null value. By default, fields with empty values are
   852  	// omitted from API requests. See
   853  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   854  	NullFields []string `json:"-"`
   855  }
   856  
   857  func (s *CommentList) MarshalJSON() ([]byte, error) {
   858  	type NoMethod CommentList
   859  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   860  }
   861  
   862  // ContentRestriction: A restriction for accessing the content of the file.
   863  type ContentRestriction struct {
   864  	// OwnerRestricted: Whether the content restriction can only be modified or
   865  	// removed by a user who owns the file. For files in shared drives, any user
   866  	// with `organizer` capabilities can modify or remove this content restriction.
   867  	OwnerRestricted bool `json:"ownerRestricted,omitempty"`
   868  	// ReadOnly: Whether the content of the file is read-only. If a file is
   869  	// read-only, a new revision of the file may not be added, comments may not be
   870  	// added or modified, and the title of the file may not be modified.
   871  	ReadOnly bool `json:"readOnly,omitempty"`
   872  	// Reason: Reason for why the content of the file is restricted. This is only
   873  	// mutable on requests that also set `readOnly=true`.
   874  	Reason string `json:"reason,omitempty"`
   875  	// RestrictingUser: Output only. The user who set the content restriction. Only
   876  	// populated if `readOnly` is true.
   877  	RestrictingUser *User `json:"restrictingUser,omitempty"`
   878  	// RestrictionTime: The time at which the content restriction was set
   879  	// (formatted RFC 3339 timestamp). Only populated if readOnly is true.
   880  	RestrictionTime string `json:"restrictionTime,omitempty"`
   881  	// SystemRestricted: Output only. Whether the content restriction was applied
   882  	// by the system, for example due to an esignature. Users cannot modify or
   883  	// remove system restricted content restrictions.
   884  	SystemRestricted bool `json:"systemRestricted,omitempty"`
   885  	// Type: Output only. The type of the content restriction. Currently the only
   886  	// possible value is `globalContentRestriction`.
   887  	Type string `json:"type,omitempty"`
   888  	// ForceSendFields is a list of field names (e.g. "OwnerRestricted") to
   889  	// unconditionally include in API requests. By default, fields with empty or
   890  	// default values are omitted from API requests. See
   891  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   892  	// details.
   893  	ForceSendFields []string `json:"-"`
   894  	// NullFields is a list of field names (e.g. "OwnerRestricted") to include in
   895  	// API requests with the JSON null value. By default, fields with empty values
   896  	// are omitted from API requests. See
   897  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   898  	NullFields []string `json:"-"`
   899  }
   900  
   901  func (s *ContentRestriction) MarshalJSON() ([]byte, error) {
   902  	type NoMethod ContentRestriction
   903  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   904  }
   905  
   906  // Drive: Representation of a shared drive. Some resource methods (such as
   907  // `drives.update`) require a `driveId`. Use the `drives.list` method to
   908  // retrieve the ID for a shared drive.
   909  type Drive struct {
   910  	// BackgroundImageFile: An image file and cropping parameters from which a
   911  	// background image for this shared drive is set. This is a write only field;
   912  	// it can only be set on `drive.drives.update` requests that don't set
   913  	// `themeId`. When specified, all fields of the `backgroundImageFile` must be
   914  	// set.
   915  	BackgroundImageFile *DriveBackgroundImageFile `json:"backgroundImageFile,omitempty"`
   916  	// BackgroundImageLink: Output only. A short-lived link to this shared drive's
   917  	// background image.
   918  	BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
   919  	// Capabilities: Output only. Capabilities the current user has on this shared
   920  	// drive.
   921  	Capabilities *DriveCapabilities `json:"capabilities,omitempty"`
   922  	// ColorRgb: The color of this shared drive as an RGB hex string. It can only
   923  	// be set on a `drive.drives.update` request that does not set `themeId`.
   924  	ColorRgb string `json:"colorRgb,omitempty"`
   925  	// CreatedTime: The time at which the shared drive was created (RFC 3339
   926  	// date-time).
   927  	CreatedTime string `json:"createdTime,omitempty"`
   928  	// Hidden: Whether the shared drive is hidden from default view.
   929  	Hidden bool `json:"hidden,omitempty"`
   930  	// Id: Output only. The ID of this shared drive which is also the ID of the top
   931  	// level folder of this shared drive.
   932  	Id string `json:"id,omitempty"`
   933  	// Kind: Output only. Identifies what kind of resource this is. Value: the
   934  	// fixed string "drive#drive".
   935  	Kind string `json:"kind,omitempty"`
   936  	// Name: The name of this shared drive.
   937  	Name string `json:"name,omitempty"`
   938  	// OrgUnitId: Output only. The organizational unit of this shared drive. This
   939  	// field is only populated on `drives.list` responses when the
   940  	// `useDomainAdminAccess` parameter is set to `true`.
   941  	OrgUnitId string `json:"orgUnitId,omitempty"`
   942  	// Restrictions: A set of restrictions that apply to this shared drive or items
   943  	// inside this shared drive. Note that restrictions can't be set when creating
   944  	// a shared drive. To add a restriction, first create a shared drive and then
   945  	// use `drives.update` to add restrictions.
   946  	Restrictions *DriveRestrictions `json:"restrictions,omitempty"`
   947  	// ThemeId: The ID of the theme from which the background image and color will
   948  	// be set. The set of possible `driveThemes` can be retrieved from a
   949  	// `drive.about.get` response. When not specified on a `drive.drives.create`
   950  	// request, a random theme is chosen from which the background image and color
   951  	// are set. This is a write-only field; it can only be set on requests that
   952  	// don't set `colorRgb` or `backgroundImageFile`.
   953  	ThemeId string `json:"themeId,omitempty"`
   954  
   955  	// ServerResponse contains the HTTP response code and headers from the server.
   956  	googleapi.ServerResponse `json:"-"`
   957  	// ForceSendFields is a list of field names (e.g. "BackgroundImageFile") to
   958  	// unconditionally include in API requests. By default, fields with empty or
   959  	// default values are omitted from API requests. See
   960  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   961  	// details.
   962  	ForceSendFields []string `json:"-"`
   963  	// NullFields is a list of field names (e.g. "BackgroundImageFile") to include
   964  	// in API requests with the JSON null value. By default, fields with empty
   965  	// values are omitted from API requests. See
   966  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   967  	NullFields []string `json:"-"`
   968  }
   969  
   970  func (s *Drive) MarshalJSON() ([]byte, error) {
   971  	type NoMethod Drive
   972  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   973  }
   974  
   975  // DriveBackgroundImageFile: An image file and cropping parameters from which a
   976  // background image for this shared drive is set. This is a write only field;
   977  // it can only be set on `drive.drives.update` requests that don't set
   978  // `themeId`. When specified, all fields of the `backgroundImageFile` must be
   979  // set.
   980  type DriveBackgroundImageFile struct {
   981  	// Id: The ID of an image file in Google Drive to use for the background image.
   982  	Id string `json:"id,omitempty"`
   983  	// Width: The width of the cropped image in the closed range of 0 to 1. This
   984  	// value represents the width of the cropped image divided by the width of the
   985  	// entire image. The height is computed by applying a width to height aspect
   986  	// ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and
   987  	// 144 pixels high.
   988  	Width float64 `json:"width,omitempty"`
   989  	// XCoordinate: The X coordinate of the upper left corner of the cropping area
   990  	// in the background image. This is a value in the closed range of 0 to 1. This
   991  	// value represents the horizontal distance from the left side of the entire
   992  	// image to the left side of the cropping area divided by the width of the
   993  	// entire image.
   994  	XCoordinate float64 `json:"xCoordinate,omitempty"`
   995  	// YCoordinate: The Y coordinate of the upper left corner of the cropping area
   996  	// in the background image. This is a value in the closed range of 0 to 1. This
   997  	// value represents the vertical distance from the top side of the entire image
   998  	// to the top side of the cropping area divided by the height of the entire
   999  	// image.
  1000  	YCoordinate float64 `json:"yCoordinate,omitempty"`
  1001  	// ForceSendFields is a list of field names (e.g. "Id") to unconditionally
  1002  	// include in API requests. By default, fields with empty or default values are
  1003  	// omitted from API requests. See
  1004  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1005  	// details.
  1006  	ForceSendFields []string `json:"-"`
  1007  	// NullFields is a list of field names (e.g. "Id") to include in API requests
  1008  	// with the JSON null value. By default, fields with empty values are omitted
  1009  	// from API requests. See
  1010  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1011  	NullFields []string `json:"-"`
  1012  }
  1013  
  1014  func (s *DriveBackgroundImageFile) MarshalJSON() ([]byte, error) {
  1015  	type NoMethod DriveBackgroundImageFile
  1016  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1017  }
  1018  
  1019  func (s *DriveBackgroundImageFile) UnmarshalJSON(data []byte) error {
  1020  	type NoMethod DriveBackgroundImageFile
  1021  	var s1 struct {
  1022  		Width       gensupport.JSONFloat64 `json:"width"`
  1023  		XCoordinate gensupport.JSONFloat64 `json:"xCoordinate"`
  1024  		YCoordinate gensupport.JSONFloat64 `json:"yCoordinate"`
  1025  		*NoMethod
  1026  	}
  1027  	s1.NoMethod = (*NoMethod)(s)
  1028  	if err := json.Unmarshal(data, &s1); err != nil {
  1029  		return err
  1030  	}
  1031  	s.Width = float64(s1.Width)
  1032  	s.XCoordinate = float64(s1.XCoordinate)
  1033  	s.YCoordinate = float64(s1.YCoordinate)
  1034  	return nil
  1035  }
  1036  
  1037  // DriveCapabilities: Output only. Capabilities the current user has on this
  1038  // shared drive.
  1039  type DriveCapabilities struct {
  1040  	// CanAddChildren: Output only. Whether the current user can add children to
  1041  	// folders in this shared drive.
  1042  	CanAddChildren bool `json:"canAddChildren,omitempty"`
  1043  	// CanChangeCopyRequiresWriterPermissionRestriction: Output only. Whether the
  1044  	// current user can change the `copyRequiresWriterPermission` restriction of
  1045  	// this shared drive.
  1046  	CanChangeCopyRequiresWriterPermissionRestriction bool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"`
  1047  	// CanChangeDomainUsersOnlyRestriction: Output only. Whether the current user
  1048  	// can change the `domainUsersOnly` restriction of this shared drive.
  1049  	CanChangeDomainUsersOnlyRestriction bool `json:"canChangeDomainUsersOnlyRestriction,omitempty"`
  1050  	// CanChangeDriveBackground: Output only. Whether the current user can change
  1051  	// the background of this shared drive.
  1052  	CanChangeDriveBackground bool `json:"canChangeDriveBackground,omitempty"`
  1053  	// CanChangeDriveMembersOnlyRestriction: Output only. Whether the current user
  1054  	// can change the `driveMembersOnly` restriction of this shared drive.
  1055  	CanChangeDriveMembersOnlyRestriction bool `json:"canChangeDriveMembersOnlyRestriction,omitempty"`
  1056  	// CanChangeSharingFoldersRequiresOrganizerPermissionRestriction: Output only.
  1057  	// Whether the current user can change the
  1058  	// `sharingFoldersRequiresOrganizerPermission` restriction of this shared
  1059  	// drive.
  1060  	CanChangeSharingFoldersRequiresOrganizerPermissionRestriction bool `json:"canChangeSharingFoldersRequiresOrganizerPermissionRestriction,omitempty"`
  1061  	// CanComment: Output only. Whether the current user can comment on files in
  1062  	// this shared drive.
  1063  	CanComment bool `json:"canComment,omitempty"`
  1064  	// CanCopy: Output only. Whether the current user can copy files in this shared
  1065  	// drive.
  1066  	CanCopy bool `json:"canCopy,omitempty"`
  1067  	// CanDeleteChildren: Output only. Whether the current user can delete children
  1068  	// from folders in this shared drive.
  1069  	CanDeleteChildren bool `json:"canDeleteChildren,omitempty"`
  1070  	// CanDeleteDrive: Output only. Whether the current user can delete this shared
  1071  	// drive. Attempting to delete the shared drive may still fail if there are
  1072  	// untrashed items inside the shared drive.
  1073  	CanDeleteDrive bool `json:"canDeleteDrive,omitempty"`
  1074  	// CanDownload: Output only. Whether the current user can download files in
  1075  	// this shared drive.
  1076  	CanDownload bool `json:"canDownload,omitempty"`
  1077  	// CanEdit: Output only. Whether the current user can edit files in this shared
  1078  	// drive
  1079  	CanEdit bool `json:"canEdit,omitempty"`
  1080  	// CanListChildren: Output only. Whether the current user can list the children
  1081  	// of folders in this shared drive.
  1082  	CanListChildren bool `json:"canListChildren,omitempty"`
  1083  	// CanManageMembers: Output only. Whether the current user can add members to
  1084  	// this shared drive or remove them or change their role.
  1085  	CanManageMembers bool `json:"canManageMembers,omitempty"`
  1086  	// CanReadRevisions: Output only. Whether the current user can read the
  1087  	// revisions resource of files in this shared drive.
  1088  	CanReadRevisions bool `json:"canReadRevisions,omitempty"`
  1089  	// CanRename: Output only. Whether the current user can rename files or folders
  1090  	// in this shared drive.
  1091  	CanRename bool `json:"canRename,omitempty"`
  1092  	// CanRenameDrive: Output only. Whether the current user can rename this shared
  1093  	// drive.
  1094  	CanRenameDrive bool `json:"canRenameDrive,omitempty"`
  1095  	// CanResetDriveRestrictions: Output only. Whether the current user can reset
  1096  	// the shared drive restrictions to defaults.
  1097  	CanResetDriveRestrictions bool `json:"canResetDriveRestrictions,omitempty"`
  1098  	// CanShare: Output only. Whether the current user can share files or folders
  1099  	// in this shared drive.
  1100  	CanShare bool `json:"canShare,omitempty"`
  1101  	// CanTrashChildren: Output only. Whether the current user can trash children
  1102  	// from folders in this shared drive.
  1103  	CanTrashChildren bool `json:"canTrashChildren,omitempty"`
  1104  	// ForceSendFields is a list of field names (e.g. "CanAddChildren") to
  1105  	// unconditionally include in API requests. By default, fields with empty or
  1106  	// default values are omitted from API requests. See
  1107  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1108  	// details.
  1109  	ForceSendFields []string `json:"-"`
  1110  	// NullFields is a list of field names (e.g. "CanAddChildren") to include in
  1111  	// API requests with the JSON null value. By default, fields with empty values
  1112  	// are omitted from API requests. See
  1113  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1114  	NullFields []string `json:"-"`
  1115  }
  1116  
  1117  func (s *DriveCapabilities) MarshalJSON() ([]byte, error) {
  1118  	type NoMethod DriveCapabilities
  1119  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1120  }
  1121  
  1122  // DriveRestrictions: A set of restrictions that apply to this shared drive or
  1123  // items inside this shared drive. Note that restrictions can't be set when
  1124  // creating a shared drive. To add a restriction, first create a shared drive
  1125  // and then use `drives.update` to add restrictions.
  1126  type DriveRestrictions struct {
  1127  	// AdminManagedRestrictions: Whether administrative privileges on this shared
  1128  	// drive are required to modify restrictions.
  1129  	AdminManagedRestrictions bool `json:"adminManagedRestrictions,omitempty"`
  1130  	// CopyRequiresWriterPermission: Whether the options to copy, print, or
  1131  	// download files inside this shared drive, should be disabled for readers and
  1132  	// commenters. When this restriction is set to `true`, it will override the
  1133  	// similarly named field to `true` for any file inside this shared drive.
  1134  	CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"`
  1135  	// DomainUsersOnly: Whether access to this shared drive and items inside this
  1136  	// shared drive is restricted to users of the domain to which this shared drive
  1137  	// belongs. This restriction may be overridden by other sharing policies
  1138  	// controlled outside of this shared drive.
  1139  	DomainUsersOnly bool `json:"domainUsersOnly,omitempty"`
  1140  	// DriveMembersOnly: Whether access to items inside this shared drive is
  1141  	// restricted to its members.
  1142  	DriveMembersOnly bool `json:"driveMembersOnly,omitempty"`
  1143  	// SharingFoldersRequiresOrganizerPermission: If true, only users with the
  1144  	// organizer role can share folders. If false, users with either the organizer
  1145  	// role or the file organizer role can share folders.
  1146  	SharingFoldersRequiresOrganizerPermission bool `json:"sharingFoldersRequiresOrganizerPermission,omitempty"`
  1147  	// ForceSendFields is a list of field names (e.g. "AdminManagedRestrictions")
  1148  	// to unconditionally include in API requests. By default, fields with empty or
  1149  	// default values are omitted from API requests. See
  1150  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1151  	// details.
  1152  	ForceSendFields []string `json:"-"`
  1153  	// NullFields is a list of field names (e.g. "AdminManagedRestrictions") to
  1154  	// include in API requests with the JSON null value. By default, fields with
  1155  	// empty values are omitted from API requests. See
  1156  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1157  	NullFields []string `json:"-"`
  1158  }
  1159  
  1160  func (s *DriveRestrictions) MarshalJSON() ([]byte, error) {
  1161  	type NoMethod DriveRestrictions
  1162  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1163  }
  1164  
  1165  // DriveList: A list of shared drives.
  1166  type DriveList struct {
  1167  	// Drives: The list of shared drives. If nextPageToken is populated, then this
  1168  	// list may be incomplete and an additional page of results should be fetched.
  1169  	Drives []*Drive `json:"drives,omitempty"`
  1170  	// Kind: Identifies what kind of resource this is. Value: the fixed string
  1171  	// "drive#driveList".
  1172  	Kind string `json:"kind,omitempty"`
  1173  	// NextPageToken: The page token for the next page of shared drives. This will
  1174  	// be absent if the end of the list has been reached. If the token is rejected
  1175  	// for any reason, it should be discarded, and pagination should be restarted
  1176  	// from the first page of results. The page token is typically valid for
  1177  	// several hours. However, if new items are added or removed, your expected
  1178  	// results might differ.
  1179  	NextPageToken string `json:"nextPageToken,omitempty"`
  1180  
  1181  	// ServerResponse contains the HTTP response code and headers from the server.
  1182  	googleapi.ServerResponse `json:"-"`
  1183  	// ForceSendFields is a list of field names (e.g. "Drives") to unconditionally
  1184  	// include in API requests. By default, fields with empty or default values are
  1185  	// omitted from API requests. See
  1186  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1187  	// details.
  1188  	ForceSendFields []string `json:"-"`
  1189  	// NullFields is a list of field names (e.g. "Drives") to include in API
  1190  	// requests with the JSON null value. By default, fields with empty values are
  1191  	// omitted from API requests. See
  1192  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1193  	NullFields []string `json:"-"`
  1194  }
  1195  
  1196  func (s *DriveList) MarshalJSON() ([]byte, error) {
  1197  	type NoMethod DriveList
  1198  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1199  }
  1200  
  1201  // File: The metadata for a file. Some resource methods (such as
  1202  // `files.update`) require a `fileId`. Use the `files.list` method to retrieve
  1203  // the ID for a file.
  1204  type File struct {
  1205  	// AppProperties: A collection of arbitrary key-value pairs which are private
  1206  	// to the requesting app.
  1207  	// Entries with null values are cleared in update and copy requests. These
  1208  	// properties can only be retrieved using an authenticated request. An
  1209  	// authenticated request uses an access token obtained with a OAuth 2 client
  1210  	// ID. You cannot use an API key to retrieve private properties.
  1211  	AppProperties map[string]string `json:"appProperties,omitempty"`
  1212  	// Capabilities: Output only. Capabilities the current user has on this file.
  1213  	// Each capability corresponds to a fine-grained action that a user may take.
  1214  	Capabilities *FileCapabilities `json:"capabilities,omitempty"`
  1215  	// ContentHints: Additional information about the content of the file. These
  1216  	// fields are never populated in responses.
  1217  	ContentHints *FileContentHints `json:"contentHints,omitempty"`
  1218  	// ContentRestrictions: Restrictions for accessing the content of the file.
  1219  	// Only populated if such a restriction exists.
  1220  	ContentRestrictions []*ContentRestriction `json:"contentRestrictions,omitempty"`
  1221  	// CopyRequiresWriterPermission: Whether the options to copy, print, or
  1222  	// download this file, should be disabled for readers and commenters.
  1223  	CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"`
  1224  	// CreatedTime: The time at which the file was created (RFC 3339 date-time).
  1225  	CreatedTime string `json:"createdTime,omitempty"`
  1226  	// Description: A short description of the file.
  1227  	Description string `json:"description,omitempty"`
  1228  	// DriveId: Output only. ID of the shared drive the file resides in. Only
  1229  	// populated for items in shared drives.
  1230  	DriveId string `json:"driveId,omitempty"`
  1231  	// ExplicitlyTrashed: Output only. Whether the file has been explicitly
  1232  	// trashed, as opposed to recursively trashed from a parent folder.
  1233  	ExplicitlyTrashed bool `json:"explicitlyTrashed,omitempty"`
  1234  	// ExportLinks: Output only. Links for exporting Docs Editors files to specific
  1235  	// formats.
  1236  	ExportLinks map[string]string `json:"exportLinks,omitempty"`
  1237  	// FileExtension: Output only. The final component of `fullFileExtension`. This
  1238  	// is only available for files with binary content in Google Drive.
  1239  	FileExtension string `json:"fileExtension,omitempty"`
  1240  	// FolderColorRgb: The color for a folder or a shortcut to a folder as an RGB
  1241  	// hex string. The supported colors are published in the `folderColorPalette`
  1242  	// field of the About resource. If an unsupported color is specified, the
  1243  	// closest color in the palette is used instead.
  1244  	FolderColorRgb string `json:"folderColorRgb,omitempty"`
  1245  	// FullFileExtension: Output only. The full file extension extracted from the
  1246  	// `name` field. May contain multiple concatenated extensions, such as
  1247  	// "tar.gz". This is only available for files with binary content in Google
  1248  	// Drive. This is automatically updated when the `name` field changes, however
  1249  	// it is not cleared if the new name does not contain a valid extension.
  1250  	FullFileExtension string `json:"fullFileExtension,omitempty"`
  1251  	// HasAugmentedPermissions: Output only. Whether there are permissions directly
  1252  	// on this file. This field is only populated for items in shared drives.
  1253  	HasAugmentedPermissions bool `json:"hasAugmentedPermissions,omitempty"`
  1254  	// HasThumbnail: Output only. Whether this file has a thumbnail. This does not
  1255  	// indicate whether the requesting app has access to the thumbnail. To check
  1256  	// access, look for the presence of the thumbnailLink field.
  1257  	HasThumbnail bool `json:"hasThumbnail,omitempty"`
  1258  	// HeadRevisionId: Output only. The ID of the file's head revision. This is
  1259  	// currently only available for files with binary content in Google Drive.
  1260  	HeadRevisionId string `json:"headRevisionId,omitempty"`
  1261  	// IconLink: Output only. A static, unauthenticated link to the file's icon.
  1262  	IconLink string `json:"iconLink,omitempty"`
  1263  	// Id: The ID of the file.
  1264  	Id string `json:"id,omitempty"`
  1265  	// ImageMediaMetadata: Output only. Additional metadata about image media, if
  1266  	// available.
  1267  	ImageMediaMetadata *FileImageMediaMetadata `json:"imageMediaMetadata,omitempty"`
  1268  	// IsAppAuthorized: Output only. Whether the file was created or opened by the
  1269  	// requesting app.
  1270  	IsAppAuthorized bool `json:"isAppAuthorized,omitempty"`
  1271  	// Kind: Output only. Identifies what kind of resource this is. Value: the
  1272  	// fixed string "drive#file".
  1273  	Kind string `json:"kind,omitempty"`
  1274  	// LabelInfo: Output only. An overview of the labels on the file.
  1275  	LabelInfo *FileLabelInfo `json:"labelInfo,omitempty"`
  1276  	// LastModifyingUser: Output only. The last user to modify the file.
  1277  	LastModifyingUser *User `json:"lastModifyingUser,omitempty"`
  1278  	// LinkShareMetadata: Contains details about the link URLs that clients are
  1279  	// using to refer to this item.
  1280  	LinkShareMetadata *FileLinkShareMetadata `json:"linkShareMetadata,omitempty"`
  1281  	// Md5Checksum: Output only. The MD5 checksum for the content of the file. This
  1282  	// is only applicable to files with binary content in Google Drive.
  1283  	Md5Checksum string `json:"md5Checksum,omitempty"`
  1284  	// MimeType: The MIME type of the file. Google Drive attempts to automatically
  1285  	// detect an appropriate value from uploaded content, if no value is provided.
  1286  	// The value cannot be changed unless a new revision is uploaded. If a file is
  1287  	// created with a Google Doc MIME type, the uploaded content is imported, if
  1288  	// possible. The supported import formats are published in the About resource.
  1289  	MimeType string `json:"mimeType,omitempty"`
  1290  	// ModifiedByMe: Output only. Whether the file has been modified by this user.
  1291  	ModifiedByMe bool `json:"modifiedByMe,omitempty"`
  1292  	// ModifiedByMeTime: The last time the file was modified by the user (RFC 3339
  1293  	// date-time).
  1294  	ModifiedByMeTime string `json:"modifiedByMeTime,omitempty"`
  1295  	// ModifiedTime: he last time the file was modified by anyone (RFC 3339
  1296  	// date-time). Note that setting modifiedTime will also update modifiedByMeTime
  1297  	// for the user.
  1298  	ModifiedTime string `json:"modifiedTime,omitempty"`
  1299  	// Name: The name of the file. This is not necessarily unique within a folder.
  1300  	// Note that for immutable items such as the top level folders of shared
  1301  	// drives, My Drive root folder, and Application Data folder the name is
  1302  	// constant.
  1303  	Name string `json:"name,omitempty"`
  1304  	// OriginalFilename: The original filename of the uploaded content if
  1305  	// available, or else the original value of the `name` field. This is only
  1306  	// available for files with binary content in Google Drive.
  1307  	OriginalFilename string `json:"originalFilename,omitempty"`
  1308  	// OwnedByMe: Output only. Whether the user owns the file. Not populated for
  1309  	// items in shared drives.
  1310  	OwnedByMe bool `json:"ownedByMe,omitempty"`
  1311  	// Owners: Output only. The owner of this file. Only certain legacy files may
  1312  	// have more than one owner. This field isn't populated for items in shared
  1313  	// drives.
  1314  	Owners []*User `json:"owners,omitempty"`
  1315  	// Parents: The IDs of the parent folders which contain the file. If not
  1316  	// specified as part of a create request, the file is placed directly in the
  1317  	// user's My Drive folder. If not specified as part of a copy request, the file
  1318  	// inherits any discoverable parents of the source file. Update requests must
  1319  	// use the `addParents` and `removeParents` parameters to modify the parents
  1320  	// list.
  1321  	Parents []string `json:"parents,omitempty"`
  1322  	// PermissionIds: Output only. List of permission IDs for users with access to
  1323  	// this file.
  1324  	PermissionIds []string `json:"permissionIds,omitempty"`
  1325  	// Permissions: Output only. The full list of permissions for the file. This is
  1326  	// only available if the requesting user can share the file. Not populated for
  1327  	// items in shared drives.
  1328  	Permissions []*Permission `json:"permissions,omitempty"`
  1329  	// Properties: A collection of arbitrary key-value pairs which are visible to
  1330  	// all apps.
  1331  	// Entries with null values are cleared in update and copy requests.
  1332  	Properties map[string]string `json:"properties,omitempty"`
  1333  	// QuotaBytesUsed: Output only. The number of storage quota bytes used by the
  1334  	// file. This includes the head revision as well as previous revisions with
  1335  	// `keepForever` enabled.
  1336  	QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"`
  1337  	// ResourceKey: Output only. A key needed to access the item via a shared link.
  1338  	ResourceKey string `json:"resourceKey,omitempty"`
  1339  	// Sha1Checksum: Output only. The SHA1 checksum associated with this file, if
  1340  	// available. This field is only populated for files with content stored in
  1341  	// Google Drive; it is not populated for Docs Editors or shortcut files.
  1342  	Sha1Checksum string `json:"sha1Checksum,omitempty"`
  1343  	// Sha256Checksum: Output only. The SHA256 checksum associated with this file,
  1344  	// if available. This field is only populated for files with content stored in
  1345  	// Google Drive; it is not populated for Docs Editors or shortcut files.
  1346  	Sha256Checksum string `json:"sha256Checksum,omitempty"`
  1347  	// Shared: Output only. Whether the file has been shared. Not populated for
  1348  	// items in shared drives.
  1349  	Shared bool `json:"shared,omitempty"`
  1350  	// SharedWithMeTime: The time at which the file was shared with the user, if
  1351  	// applicable (RFC 3339 date-time).
  1352  	SharedWithMeTime string `json:"sharedWithMeTime,omitempty"`
  1353  	// SharingUser: Output only. The user who shared the file with the requesting
  1354  	// user, if applicable.
  1355  	SharingUser *User `json:"sharingUser,omitempty"`
  1356  	// ShortcutDetails: Shortcut file details. Only populated for shortcut files,
  1357  	// which have the mimeType field set to `application/vnd.google-apps.shortcut`.
  1358  	ShortcutDetails *FileShortcutDetails `json:"shortcutDetails,omitempty"`
  1359  	// Size: Output only. Size in bytes of blobs and first party editor files.
  1360  	// Won't be populated for files that have no size, like shortcuts and folders.
  1361  	Size int64 `json:"size,omitempty,string"`
  1362  	// Spaces: Output only. The list of spaces which contain the file. The
  1363  	// currently supported values are 'drive', 'appDataFolder' and 'photos'.
  1364  	Spaces []string `json:"spaces,omitempty"`
  1365  	// Starred: Whether the user has starred the file.
  1366  	Starred bool `json:"starred,omitempty"`
  1367  	// TeamDriveId: Deprecated: Output only. Use `driveId` instead.
  1368  	TeamDriveId string `json:"teamDriveId,omitempty"`
  1369  	// ThumbnailLink: Output only. A short-lived link to the file's thumbnail, if
  1370  	// available. Typically lasts on the order of hours. Only populated when the
  1371  	// requesting app can access the file's content. If the file isn't shared
  1372  	// publicly, the URL returned in `Files.thumbnailLink` must be fetched using a
  1373  	// credentialed request.
  1374  	ThumbnailLink string `json:"thumbnailLink,omitempty"`
  1375  	// ThumbnailVersion: Output only. The thumbnail version for use in thumbnail
  1376  	// cache invalidation.
  1377  	ThumbnailVersion int64 `json:"thumbnailVersion,omitempty,string"`
  1378  	// Trashed: Whether the file has been trashed, either explicitly or from a
  1379  	// trashed parent folder. Only the owner may trash a file, and other users
  1380  	// cannot see files in the owner's trash.
  1381  	Trashed bool `json:"trashed,omitempty"`
  1382  	// TrashedTime: The time that the item was trashed (RFC 3339 date-time). Only
  1383  	// populated for items in shared drives.
  1384  	TrashedTime string `json:"trashedTime,omitempty"`
  1385  	// TrashingUser: Output only. If the file has been explicitly trashed, the user
  1386  	// who trashed it. Only populated for items in shared drives.
  1387  	TrashingUser *User `json:"trashingUser,omitempty"`
  1388  	// Version: Output only. A monotonically increasing version number for the
  1389  	// file. This reflects every change made to the file on the server, even those
  1390  	// not visible to the user.
  1391  	Version int64 `json:"version,omitempty,string"`
  1392  	// VideoMediaMetadata: Output only. Additional metadata about video media. This
  1393  	// may not be available immediately upon upload.
  1394  	VideoMediaMetadata *FileVideoMediaMetadata `json:"videoMediaMetadata,omitempty"`
  1395  	// ViewedByMe: Output only. Whether the file has been viewed by this user.
  1396  	ViewedByMe bool `json:"viewedByMe,omitempty"`
  1397  	// ViewedByMeTime: The last time the file was viewed by the user (RFC 3339
  1398  	// date-time).
  1399  	ViewedByMeTime string `json:"viewedByMeTime,omitempty"`
  1400  	// ViewersCanCopyContent: Deprecated: Use `copyRequiresWriterPermission`
  1401  	// instead.
  1402  	ViewersCanCopyContent bool `json:"viewersCanCopyContent,omitempty"`
  1403  	// WebContentLink: Output only. A link for downloading the content of the file
  1404  	// in a browser. This is only available for files with binary content in Google
  1405  	// Drive.
  1406  	WebContentLink string `json:"webContentLink,omitempty"`
  1407  	// WebViewLink: Output only. A link for opening the file in a relevant Google
  1408  	// editor or viewer in a browser.
  1409  	WebViewLink string `json:"webViewLink,omitempty"`
  1410  	// WritersCanShare: Whether users with only `writer` permission can modify the
  1411  	// file's permissions. Not populated for items in shared drives.
  1412  	WritersCanShare bool `json:"writersCanShare,omitempty"`
  1413  
  1414  	// ServerResponse contains the HTTP response code and headers from the server.
  1415  	googleapi.ServerResponse `json:"-"`
  1416  	// ForceSendFields is a list of field names (e.g. "AppProperties") to
  1417  	// unconditionally include in API requests. By default, fields with empty or
  1418  	// default values are omitted from API requests. See
  1419  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1420  	// details.
  1421  	ForceSendFields []string `json:"-"`
  1422  	// NullFields is a list of field names (e.g. "AppProperties") to include in API
  1423  	// requests with the JSON null value. By default, fields with empty values are
  1424  	// omitted from API requests. See
  1425  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1426  	NullFields []string `json:"-"`
  1427  }
  1428  
  1429  func (s *File) MarshalJSON() ([]byte, error) {
  1430  	type NoMethod File
  1431  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1432  }
  1433  
  1434  // FileCapabilities: Output only. Capabilities the current user has on this
  1435  // file. Each capability corresponds to a fine-grained action that a user may
  1436  // take.
  1437  type FileCapabilities struct {
  1438  	// CanAcceptOwnership: Output only. Whether the current user is the pending
  1439  	// owner of the file. Not populated for shared drive files.
  1440  	CanAcceptOwnership bool `json:"canAcceptOwnership,omitempty"`
  1441  	// CanAddChildren: Output only. Whether the current user can add children to
  1442  	// this folder. This is always false when the item is not a folder.
  1443  	CanAddChildren bool `json:"canAddChildren,omitempty"`
  1444  	// CanAddFolderFromAnotherDrive: Output only. Whether the current user can add
  1445  	// a folder from another drive (different shared drive or My Drive) to this
  1446  	// folder. This is false when the item is not a folder. Only populated for
  1447  	// items in shared drives.
  1448  	CanAddFolderFromAnotherDrive bool `json:"canAddFolderFromAnotherDrive,omitempty"`
  1449  	// CanAddMyDriveParent: Output only. Whether the current user can add a parent
  1450  	// for the item without removing an existing parent in the same request. Not
  1451  	// populated for shared drive files.
  1452  	CanAddMyDriveParent bool `json:"canAddMyDriveParent,omitempty"`
  1453  	// CanChangeCopyRequiresWriterPermission: Output only. Whether the current user
  1454  	// can change the `copyRequiresWriterPermission` restriction of this file.
  1455  	CanChangeCopyRequiresWriterPermission bool `json:"canChangeCopyRequiresWriterPermission,omitempty"`
  1456  	// CanChangeSecurityUpdateEnabled: Output only. Whether the current user can
  1457  	// change the securityUpdateEnabled field on link share metadata.
  1458  	CanChangeSecurityUpdateEnabled bool `json:"canChangeSecurityUpdateEnabled,omitempty"`
  1459  	// CanChangeViewersCanCopyContent: Deprecated: Output only.
  1460  	CanChangeViewersCanCopyContent bool `json:"canChangeViewersCanCopyContent,omitempty"`
  1461  	// CanComment: Output only. Whether the current user can comment on this file.
  1462  	CanComment bool `json:"canComment,omitempty"`
  1463  	// CanCopy: Output only. Whether the current user can copy this file. For an
  1464  	// item in a shared drive, whether the current user can copy non-folder
  1465  	// descendants of this item, or this item itself if it is not a folder.
  1466  	CanCopy bool `json:"canCopy,omitempty"`
  1467  	// CanDelete: Output only. Whether the current user can delete this file.
  1468  	CanDelete bool `json:"canDelete,omitempty"`
  1469  	// CanDeleteChildren: Output only. Whether the current user can delete children
  1470  	// of this folder. This is false when the item is not a folder. Only populated
  1471  	// for items in shared drives.
  1472  	CanDeleteChildren bool `json:"canDeleteChildren,omitempty"`
  1473  	// CanDownload: Output only. Whether the current user can download this file.
  1474  	CanDownload bool `json:"canDownload,omitempty"`
  1475  	// CanEdit: Output only. Whether the current user can edit this file. Other
  1476  	// factors may limit the type of changes a user can make to a file. For
  1477  	// example, see `canChangeCopyRequiresWriterPermission` or `canModifyContent`.
  1478  	CanEdit bool `json:"canEdit,omitempty"`
  1479  	// CanListChildren: Output only. Whether the current user can list the children
  1480  	// of this folder. This is always false when the item is not a folder.
  1481  	CanListChildren bool `json:"canListChildren,omitempty"`
  1482  	// CanModifyContent: Output only. Whether the current user can modify the
  1483  	// content of this file.
  1484  	CanModifyContent bool `json:"canModifyContent,omitempty"`
  1485  	// CanModifyContentRestriction: Deprecated: Output only. Use one of
  1486  	// `canModifyEditorContentRestriction`, `canModifyOwnerContentRestriction` or
  1487  	// `canRemoveContentRestriction`.
  1488  	CanModifyContentRestriction bool `json:"canModifyContentRestriction,omitempty"`
  1489  	// CanModifyEditorContentRestriction: Output only. Whether the current user can
  1490  	// add or modify content restrictions on the file which are editor restricted.
  1491  	CanModifyEditorContentRestriction bool `json:"canModifyEditorContentRestriction,omitempty"`
  1492  	// CanModifyLabels: Output only. Whether the current user can modify the labels
  1493  	// on the file.
  1494  	CanModifyLabels bool `json:"canModifyLabels,omitempty"`
  1495  	// CanModifyOwnerContentRestriction: Output only. Whether the current user can
  1496  	// add or modify content restrictions which are owner restricted.
  1497  	CanModifyOwnerContentRestriction bool `json:"canModifyOwnerContentRestriction,omitempty"`
  1498  	// CanMoveChildrenOutOfDrive: Output only. Whether the current user can move
  1499  	// children of this folder outside of the shared drive. This is false when the
  1500  	// item is not a folder. Only populated for items in shared drives.
  1501  	CanMoveChildrenOutOfDrive bool `json:"canMoveChildrenOutOfDrive,omitempty"`
  1502  	// CanMoveChildrenOutOfTeamDrive: Deprecated: Output only. Use
  1503  	// `canMoveChildrenOutOfDrive` instead.
  1504  	CanMoveChildrenOutOfTeamDrive bool `json:"canMoveChildrenOutOfTeamDrive,omitempty"`
  1505  	// CanMoveChildrenWithinDrive: Output only. Whether the current user can move
  1506  	// children of this folder within this drive. This is false when the item is
  1507  	// not a folder. Note that a request to move the child may still fail depending
  1508  	// on the current user's access to the child and to the destination folder.
  1509  	CanMoveChildrenWithinDrive bool `json:"canMoveChildrenWithinDrive,omitempty"`
  1510  	// CanMoveChildrenWithinTeamDrive: Deprecated: Output only. Use
  1511  	// `canMoveChildrenWithinDrive` instead.
  1512  	CanMoveChildrenWithinTeamDrive bool `json:"canMoveChildrenWithinTeamDrive,omitempty"`
  1513  	// CanMoveItemIntoTeamDrive: Deprecated: Output only. Use
  1514  	// `canMoveItemOutOfDrive` instead.
  1515  	CanMoveItemIntoTeamDrive bool `json:"canMoveItemIntoTeamDrive,omitempty"`
  1516  	// CanMoveItemOutOfDrive: Output only. Whether the current user can move this
  1517  	// item outside of this drive by changing its parent. Note that a request to
  1518  	// change the parent of the item may still fail depending on the new parent
  1519  	// that is being added.
  1520  	CanMoveItemOutOfDrive bool `json:"canMoveItemOutOfDrive,omitempty"`
  1521  	// CanMoveItemOutOfTeamDrive: Deprecated: Output only. Use
  1522  	// `canMoveItemOutOfDrive` instead.
  1523  	CanMoveItemOutOfTeamDrive bool `json:"canMoveItemOutOfTeamDrive,omitempty"`
  1524  	// CanMoveItemWithinDrive: Output only. Whether the current user can move this
  1525  	// item within this drive. Note that a request to change the parent of the item
  1526  	// may still fail depending on the new parent that is being added and the
  1527  	// parent that is being removed.
  1528  	CanMoveItemWithinDrive bool `json:"canMoveItemWithinDrive,omitempty"`
  1529  	// CanMoveItemWithinTeamDrive: Deprecated: Output only. Use
  1530  	// `canMoveItemWithinDrive` instead.
  1531  	CanMoveItemWithinTeamDrive bool `json:"canMoveItemWithinTeamDrive,omitempty"`
  1532  	// CanMoveTeamDriveItem: Deprecated: Output only. Use `canMoveItemWithinDrive`
  1533  	// or `canMoveItemOutOfDrive` instead.
  1534  	CanMoveTeamDriveItem bool `json:"canMoveTeamDriveItem,omitempty"`
  1535  	// CanReadDrive: Output only. Whether the current user can read the shared
  1536  	// drive to which this file belongs. Only populated for items in shared drives.
  1537  	CanReadDrive bool `json:"canReadDrive,omitempty"`
  1538  	// CanReadLabels: Output only. Whether the current user can read the labels on
  1539  	// the file.
  1540  	CanReadLabels bool `json:"canReadLabels,omitempty"`
  1541  	// CanReadRevisions: Output only. Whether the current user can read the
  1542  	// revisions resource of this file. For a shared drive item, whether revisions
  1543  	// of non-folder descendants of this item, or this item itself if it is not a
  1544  	// folder, can be read.
  1545  	CanReadRevisions bool `json:"canReadRevisions,omitempty"`
  1546  	// CanReadTeamDrive: Deprecated: Output only. Use `canReadDrive` instead.
  1547  	CanReadTeamDrive bool `json:"canReadTeamDrive,omitempty"`
  1548  	// CanRemoveChildren: Output only. Whether the current user can remove children
  1549  	// from this folder. This is always false when the item is not a folder. For a
  1550  	// folder in a shared drive, use `canDeleteChildren` or `canTrashChildren`
  1551  	// instead.
  1552  	CanRemoveChildren bool `json:"canRemoveChildren,omitempty"`
  1553  	// CanRemoveContentRestriction: Output only. Whether there is a content
  1554  	// restriction on the file that can be removed by the current user.
  1555  	CanRemoveContentRestriction bool `json:"canRemoveContentRestriction,omitempty"`
  1556  	// CanRemoveMyDriveParent: Output only. Whether the current user can remove a
  1557  	// parent from the item without adding another parent in the same request. Not
  1558  	// populated for shared drive files.
  1559  	CanRemoveMyDriveParent bool `json:"canRemoveMyDriveParent,omitempty"`
  1560  	// CanRename: Output only. Whether the current user can rename this file.
  1561  	CanRename bool `json:"canRename,omitempty"`
  1562  	// CanShare: Output only. Whether the current user can modify the sharing
  1563  	// settings for this file.
  1564  	CanShare bool `json:"canShare,omitempty"`
  1565  	// CanTrash: Output only. Whether the current user can move this file to trash.
  1566  	CanTrash bool `json:"canTrash,omitempty"`
  1567  	// CanTrashChildren: Output only. Whether the current user can trash children
  1568  	// of this folder. This is false when the item is not a folder. Only populated
  1569  	// for items in shared drives.
  1570  	CanTrashChildren bool `json:"canTrashChildren,omitempty"`
  1571  	// CanUntrash: Output only. Whether the current user can restore this file from
  1572  	// trash.
  1573  	CanUntrash bool `json:"canUntrash,omitempty"`
  1574  	// ForceSendFields is a list of field names (e.g. "CanAcceptOwnership") to
  1575  	// unconditionally include in API requests. By default, fields with empty or
  1576  	// default values are omitted from API requests. See
  1577  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1578  	// details.
  1579  	ForceSendFields []string `json:"-"`
  1580  	// NullFields is a list of field names (e.g. "CanAcceptOwnership") to include
  1581  	// in API requests with the JSON null value. By default, fields with empty
  1582  	// values are omitted from API requests. See
  1583  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1584  	NullFields []string `json:"-"`
  1585  }
  1586  
  1587  func (s *FileCapabilities) MarshalJSON() ([]byte, error) {
  1588  	type NoMethod FileCapabilities
  1589  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1590  }
  1591  
  1592  // FileContentHints: Additional information about the content of the file.
  1593  // These fields are never populated in responses.
  1594  type FileContentHints struct {
  1595  	// IndexableText: Text to be indexed for the file to improve fullText queries.
  1596  	// This is limited to 128KB in length and may contain HTML elements.
  1597  	IndexableText string `json:"indexableText,omitempty"`
  1598  	// Thumbnail: A thumbnail for the file. This will only be used if Google Drive
  1599  	// cannot generate a standard thumbnail.
  1600  	Thumbnail *FileContentHintsThumbnail `json:"thumbnail,omitempty"`
  1601  	// ForceSendFields is a list of field names (e.g. "IndexableText") to
  1602  	// unconditionally include in API requests. By default, fields with empty or
  1603  	// default values are omitted from API requests. See
  1604  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1605  	// details.
  1606  	ForceSendFields []string `json:"-"`
  1607  	// NullFields is a list of field names (e.g. "IndexableText") to include in API
  1608  	// requests with the JSON null value. By default, fields with empty values are
  1609  	// omitted from API requests. See
  1610  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1611  	NullFields []string `json:"-"`
  1612  }
  1613  
  1614  func (s *FileContentHints) MarshalJSON() ([]byte, error) {
  1615  	type NoMethod FileContentHints
  1616  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1617  }
  1618  
  1619  // FileContentHintsThumbnail: A thumbnail for the file. This will only be used
  1620  // if Google Drive cannot generate a standard thumbnail.
  1621  type FileContentHintsThumbnail struct {
  1622  	// Image: The thumbnail data encoded with URL-safe Base64 (RFC 4648 section 5).
  1623  	Image string `json:"image,omitempty"`
  1624  	// MimeType: The MIME type of the thumbnail.
  1625  	MimeType string `json:"mimeType,omitempty"`
  1626  	// ForceSendFields is a list of field names (e.g. "Image") to unconditionally
  1627  	// include in API requests. By default, fields with empty or default values are
  1628  	// omitted from API requests. See
  1629  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1630  	// details.
  1631  	ForceSendFields []string `json:"-"`
  1632  	// NullFields is a list of field names (e.g. "Image") to include in API
  1633  	// requests with the JSON null value. By default, fields with empty values are
  1634  	// omitted from API requests. See
  1635  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1636  	NullFields []string `json:"-"`
  1637  }
  1638  
  1639  func (s *FileContentHintsThumbnail) MarshalJSON() ([]byte, error) {
  1640  	type NoMethod FileContentHintsThumbnail
  1641  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1642  }
  1643  
  1644  // FileImageMediaMetadata: Output only. Additional metadata about image media,
  1645  // if available.
  1646  type FileImageMediaMetadata struct {
  1647  	// Aperture: Output only. The aperture used to create the photo (f-number).
  1648  	Aperture float64 `json:"aperture,omitempty"`
  1649  	// CameraMake: Output only. The make of the camera used to create the photo.
  1650  	CameraMake string `json:"cameraMake,omitempty"`
  1651  	// CameraModel: Output only. The model of the camera used to create the photo.
  1652  	CameraModel string `json:"cameraModel,omitempty"`
  1653  	// ColorSpace: Output only. The color space of the photo.
  1654  	ColorSpace string `json:"colorSpace,omitempty"`
  1655  	// ExposureBias: Output only. The exposure bias of the photo (APEX value).
  1656  	ExposureBias float64 `json:"exposureBias,omitempty"`
  1657  	// ExposureMode: Output only. The exposure mode used to create the photo.
  1658  	ExposureMode string `json:"exposureMode,omitempty"`
  1659  	// ExposureTime: Output only. The length of the exposure, in seconds.
  1660  	ExposureTime float64 `json:"exposureTime,omitempty"`
  1661  	// FlashUsed: Output only. Whether a flash was used to create the photo.
  1662  	FlashUsed bool `json:"flashUsed,omitempty"`
  1663  	// FocalLength: Output only. The focal length used to create the photo, in
  1664  	// millimeters.
  1665  	FocalLength float64 `json:"focalLength,omitempty"`
  1666  	// Height: Output only. The height of the image in pixels.
  1667  	Height int64 `json:"height,omitempty"`
  1668  	// IsoSpeed: Output only. The ISO speed used to create the photo.
  1669  	IsoSpeed int64 `json:"isoSpeed,omitempty"`
  1670  	// Lens: Output only. The lens used to create the photo.
  1671  	Lens string `json:"lens,omitempty"`
  1672  	// Location: Output only. Geographic location information stored in the image.
  1673  	Location *FileImageMediaMetadataLocation `json:"location,omitempty"`
  1674  	// MaxApertureValue: Output only. The smallest f-number of the lens at the
  1675  	// focal length used to create the photo (APEX value).
  1676  	MaxApertureValue float64 `json:"maxApertureValue,omitempty"`
  1677  	// MeteringMode: Output only. The metering mode used to create the photo.
  1678  	MeteringMode string `json:"meteringMode,omitempty"`
  1679  	// Rotation: Output only. The number of clockwise 90 degree rotations applied
  1680  	// from the image's original orientation.
  1681  	Rotation int64 `json:"rotation,omitempty"`
  1682  	// Sensor: Output only. The type of sensor used to create the photo.
  1683  	Sensor string `json:"sensor,omitempty"`
  1684  	// SubjectDistance: Output only. The distance to the subject of the photo, in
  1685  	// meters.
  1686  	SubjectDistance int64 `json:"subjectDistance,omitempty"`
  1687  	// Time: Output only. The date and time the photo was taken (EXIF DateTime).
  1688  	Time string `json:"time,omitempty"`
  1689  	// WhiteBalance: Output only. The white balance mode used to create the photo.
  1690  	WhiteBalance string `json:"whiteBalance,omitempty"`
  1691  	// Width: Output only. The width of the image in pixels.
  1692  	Width int64 `json:"width,omitempty"`
  1693  	// ForceSendFields is a list of field names (e.g. "Aperture") to
  1694  	// unconditionally include in API requests. By default, fields with empty or
  1695  	// default values are omitted from API requests. See
  1696  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1697  	// details.
  1698  	ForceSendFields []string `json:"-"`
  1699  	// NullFields is a list of field names (e.g. "Aperture") to include in API
  1700  	// requests with the JSON null value. By default, fields with empty values are
  1701  	// omitted from API requests. See
  1702  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1703  	NullFields []string `json:"-"`
  1704  }
  1705  
  1706  func (s *FileImageMediaMetadata) MarshalJSON() ([]byte, error) {
  1707  	type NoMethod FileImageMediaMetadata
  1708  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1709  }
  1710  
  1711  func (s *FileImageMediaMetadata) UnmarshalJSON(data []byte) error {
  1712  	type NoMethod FileImageMediaMetadata
  1713  	var s1 struct {
  1714  		Aperture         gensupport.JSONFloat64 `json:"aperture"`
  1715  		ExposureBias     gensupport.JSONFloat64 `json:"exposureBias"`
  1716  		ExposureTime     gensupport.JSONFloat64 `json:"exposureTime"`
  1717  		FocalLength      gensupport.JSONFloat64 `json:"focalLength"`
  1718  		MaxApertureValue gensupport.JSONFloat64 `json:"maxApertureValue"`
  1719  		*NoMethod
  1720  	}
  1721  	s1.NoMethod = (*NoMethod)(s)
  1722  	if err := json.Unmarshal(data, &s1); err != nil {
  1723  		return err
  1724  	}
  1725  	s.Aperture = float64(s1.Aperture)
  1726  	s.ExposureBias = float64(s1.ExposureBias)
  1727  	s.ExposureTime = float64(s1.ExposureTime)
  1728  	s.FocalLength = float64(s1.FocalLength)
  1729  	s.MaxApertureValue = float64(s1.MaxApertureValue)
  1730  	return nil
  1731  }
  1732  
  1733  // FileImageMediaMetadataLocation: Output only. Geographic location information
  1734  // stored in the image.
  1735  type FileImageMediaMetadataLocation struct {
  1736  	// Altitude: Output only. The altitude stored in the image.
  1737  	Altitude float64 `json:"altitude,omitempty"`
  1738  	// Latitude: Output only. The latitude stored in the image.
  1739  	Latitude float64 `json:"latitude,omitempty"`
  1740  	// Longitude: Output only. The longitude stored in the image.
  1741  	Longitude float64 `json:"longitude,omitempty"`
  1742  	// ForceSendFields is a list of field names (e.g. "Altitude") to
  1743  	// unconditionally include in API requests. By default, fields with empty or
  1744  	// default values are omitted from API requests. See
  1745  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1746  	// details.
  1747  	ForceSendFields []string `json:"-"`
  1748  	// NullFields is a list of field names (e.g. "Altitude") to include in API
  1749  	// requests with the JSON null value. By default, fields with empty values are
  1750  	// omitted from API requests. See
  1751  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1752  	NullFields []string `json:"-"`
  1753  }
  1754  
  1755  func (s *FileImageMediaMetadataLocation) MarshalJSON() ([]byte, error) {
  1756  	type NoMethod FileImageMediaMetadataLocation
  1757  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1758  }
  1759  
  1760  func (s *FileImageMediaMetadataLocation) UnmarshalJSON(data []byte) error {
  1761  	type NoMethod FileImageMediaMetadataLocation
  1762  	var s1 struct {
  1763  		Altitude  gensupport.JSONFloat64 `json:"altitude"`
  1764  		Latitude  gensupport.JSONFloat64 `json:"latitude"`
  1765  		Longitude gensupport.JSONFloat64 `json:"longitude"`
  1766  		*NoMethod
  1767  	}
  1768  	s1.NoMethod = (*NoMethod)(s)
  1769  	if err := json.Unmarshal(data, &s1); err != nil {
  1770  		return err
  1771  	}
  1772  	s.Altitude = float64(s1.Altitude)
  1773  	s.Latitude = float64(s1.Latitude)
  1774  	s.Longitude = float64(s1.Longitude)
  1775  	return nil
  1776  }
  1777  
  1778  // FileLabelInfo: Output only. An overview of the labels on the file.
  1779  type FileLabelInfo struct {
  1780  	// Labels: Output only. The set of labels on the file as requested by the label
  1781  	// IDs in the `includeLabels` parameter. By default, no labels are returned.
  1782  	Labels []*Label `json:"labels,omitempty"`
  1783  	// ForceSendFields is a list of field names (e.g. "Labels") to unconditionally
  1784  	// include in API requests. By default, fields with empty or default values are
  1785  	// omitted from API requests. See
  1786  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1787  	// details.
  1788  	ForceSendFields []string `json:"-"`
  1789  	// NullFields is a list of field names (e.g. "Labels") to include in API
  1790  	// requests with the JSON null value. By default, fields with empty values are
  1791  	// omitted from API requests. See
  1792  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1793  	NullFields []string `json:"-"`
  1794  }
  1795  
  1796  func (s *FileLabelInfo) MarshalJSON() ([]byte, error) {
  1797  	type NoMethod FileLabelInfo
  1798  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1799  }
  1800  
  1801  // FileLinkShareMetadata: Contains details about the link URLs that clients are
  1802  // using to refer to this item.
  1803  type FileLinkShareMetadata struct {
  1804  	// SecurityUpdateEligible: Output only. Whether the file is eligible for
  1805  	// security update.
  1806  	SecurityUpdateEligible bool `json:"securityUpdateEligible,omitempty"`
  1807  	// SecurityUpdateEnabled: Output only. Whether the security update is enabled
  1808  	// for this file.
  1809  	SecurityUpdateEnabled bool `json:"securityUpdateEnabled,omitempty"`
  1810  	// ForceSendFields is a list of field names (e.g. "SecurityUpdateEligible") to
  1811  	// unconditionally include in API requests. By default, fields with empty or
  1812  	// default values are omitted from API requests. See
  1813  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1814  	// details.
  1815  	ForceSendFields []string `json:"-"`
  1816  	// NullFields is a list of field names (e.g. "SecurityUpdateEligible") to
  1817  	// include in API requests with the JSON null value. By default, fields with
  1818  	// empty values are omitted from API requests. See
  1819  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1820  	NullFields []string `json:"-"`
  1821  }
  1822  
  1823  func (s *FileLinkShareMetadata) MarshalJSON() ([]byte, error) {
  1824  	type NoMethod FileLinkShareMetadata
  1825  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1826  }
  1827  
  1828  // FileShortcutDetails: Shortcut file details. Only populated for shortcut
  1829  // files, which have the mimeType field set to
  1830  // `application/vnd.google-apps.shortcut`.
  1831  type FileShortcutDetails struct {
  1832  	// TargetId: The ID of the file that this shortcut points to.
  1833  	TargetId string `json:"targetId,omitempty"`
  1834  	// TargetMimeType: Output only. The MIME type of the file that this shortcut
  1835  	// points to. The value of this field is a snapshot of the target's MIME type,
  1836  	// captured when the shortcut is created.
  1837  	TargetMimeType string `json:"targetMimeType,omitempty"`
  1838  	// TargetResourceKey: Output only. The ResourceKey for the target file.
  1839  	TargetResourceKey string `json:"targetResourceKey,omitempty"`
  1840  	// ForceSendFields is a list of field names (e.g. "TargetId") to
  1841  	// unconditionally include in API requests. By default, fields with empty or
  1842  	// default values are omitted from API requests. See
  1843  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1844  	// details.
  1845  	ForceSendFields []string `json:"-"`
  1846  	// NullFields is a list of field names (e.g. "TargetId") to include in API
  1847  	// requests with the JSON null value. By default, fields with empty values are
  1848  	// omitted from API requests. See
  1849  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1850  	NullFields []string `json:"-"`
  1851  }
  1852  
  1853  func (s *FileShortcutDetails) MarshalJSON() ([]byte, error) {
  1854  	type NoMethod FileShortcutDetails
  1855  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1856  }
  1857  
  1858  // FileVideoMediaMetadata: Output only. Additional metadata about video media.
  1859  // This may not be available immediately upon upload.
  1860  type FileVideoMediaMetadata struct {
  1861  	// DurationMillis: Output only. The duration of the video in milliseconds.
  1862  	DurationMillis int64 `json:"durationMillis,omitempty,string"`
  1863  	// Height: Output only. The height of the video in pixels.
  1864  	Height int64 `json:"height,omitempty"`
  1865  	// Width: Output only. The width of the video in pixels.
  1866  	Width int64 `json:"width,omitempty"`
  1867  	// ForceSendFields is a list of field names (e.g. "DurationMillis") to
  1868  	// unconditionally include in API requests. By default, fields with empty or
  1869  	// default values are omitted from API requests. See
  1870  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1871  	// details.
  1872  	ForceSendFields []string `json:"-"`
  1873  	// NullFields is a list of field names (e.g. "DurationMillis") to include in
  1874  	// API requests with the JSON null value. By default, fields with empty values
  1875  	// are omitted from API requests. See
  1876  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1877  	NullFields []string `json:"-"`
  1878  }
  1879  
  1880  func (s *FileVideoMediaMetadata) MarshalJSON() ([]byte, error) {
  1881  	type NoMethod FileVideoMediaMetadata
  1882  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1883  }
  1884  
  1885  // FileList: A list of files.
  1886  type FileList struct {
  1887  	// Files: The list of files. If nextPageToken is populated, then this list may
  1888  	// be incomplete and an additional page of results should be fetched.
  1889  	Files []*File `json:"files,omitempty"`
  1890  	// IncompleteSearch: Whether the search process was incomplete. If true, then
  1891  	// some search results might be missing, since all documents were not searched.
  1892  	// This can occur when searching multiple drives with the 'allDrives' corpora,
  1893  	// but all corpora couldn't be searched. When this happens, it's suggested that
  1894  	// clients narrow their query by choosing a different corpus such as 'user' or
  1895  	// 'drive'.
  1896  	IncompleteSearch bool `json:"incompleteSearch,omitempty"`
  1897  	// Kind: Identifies what kind of resource this is. Value: the fixed string
  1898  	// "drive#fileList".
  1899  	Kind string `json:"kind,omitempty"`
  1900  	// NextPageToken: The page token for the next page of files. This will be
  1901  	// absent if the end of the files list has been reached. If the token is
  1902  	// rejected for any reason, it should be discarded, and pagination should be
  1903  	// restarted from the first page of results. The page token is typically valid
  1904  	// for several hours. However, if new items are added or removed, your expected
  1905  	// results might differ.
  1906  	NextPageToken string `json:"nextPageToken,omitempty"`
  1907  
  1908  	// ServerResponse contains the HTTP response code and headers from the server.
  1909  	googleapi.ServerResponse `json:"-"`
  1910  	// ForceSendFields is a list of field names (e.g. "Files") to unconditionally
  1911  	// include in API requests. By default, fields with empty or default values are
  1912  	// omitted from API requests. See
  1913  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1914  	// details.
  1915  	ForceSendFields []string `json:"-"`
  1916  	// NullFields is a list of field names (e.g. "Files") to include in API
  1917  	// requests with the JSON null value. By default, fields with empty values are
  1918  	// omitted from API requests. See
  1919  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1920  	NullFields []string `json:"-"`
  1921  }
  1922  
  1923  func (s *FileList) MarshalJSON() ([]byte, error) {
  1924  	type NoMethod FileList
  1925  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1926  }
  1927  
  1928  // GeneratedIds: A list of generated file IDs which can be provided in create
  1929  // requests.
  1930  type GeneratedIds struct {
  1931  	// Ids: The IDs generated for the requesting user in the specified space.
  1932  	Ids []string `json:"ids,omitempty"`
  1933  	// Kind: Identifies what kind of resource this is. Value: the fixed string
  1934  	// "drive#generatedIds".
  1935  	Kind string `json:"kind,omitempty"`
  1936  	// Space: The type of file that can be created with these IDs.
  1937  	Space string `json:"space,omitempty"`
  1938  
  1939  	// ServerResponse contains the HTTP response code and headers from the server.
  1940  	googleapi.ServerResponse `json:"-"`
  1941  	// ForceSendFields is a list of field names (e.g. "Ids") to unconditionally
  1942  	// include in API requests. By default, fields with empty or default values are
  1943  	// omitted from API requests. See
  1944  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1945  	// details.
  1946  	ForceSendFields []string `json:"-"`
  1947  	// NullFields is a list of field names (e.g. "Ids") to include in API requests
  1948  	// with the JSON null value. By default, fields with empty values are omitted
  1949  	// from API requests. See
  1950  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1951  	NullFields []string `json:"-"`
  1952  }
  1953  
  1954  func (s *GeneratedIds) MarshalJSON() ([]byte, error) {
  1955  	type NoMethod GeneratedIds
  1956  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1957  }
  1958  
  1959  // Label: Representation of label and label fields.
  1960  type Label struct {
  1961  	// Fields: A map of the fields on the label, keyed by the field's ID.
  1962  	Fields map[string]LabelField `json:"fields,omitempty"`
  1963  	// Id: The ID of the label.
  1964  	Id string `json:"id,omitempty"`
  1965  	// Kind: This is always drive#label
  1966  	Kind string `json:"kind,omitempty"`
  1967  	// RevisionId: The revision ID of the label.
  1968  	RevisionId string `json:"revisionId,omitempty"`
  1969  	// ForceSendFields is a list of field names (e.g. "Fields") to unconditionally
  1970  	// include in API requests. By default, fields with empty or default values are
  1971  	// omitted from API requests. See
  1972  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1973  	// details.
  1974  	ForceSendFields []string `json:"-"`
  1975  	// NullFields is a list of field names (e.g. "Fields") to include in API
  1976  	// requests with the JSON null value. By default, fields with empty values are
  1977  	// omitted from API requests. See
  1978  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1979  	NullFields []string `json:"-"`
  1980  }
  1981  
  1982  func (s *Label) MarshalJSON() ([]byte, error) {
  1983  	type NoMethod Label
  1984  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1985  }
  1986  
  1987  // LabelField: Representation of field, which is a typed key-value pair.
  1988  type LabelField struct {
  1989  	// DateString: Only present if valueType is dateString. RFC 3339 formatted
  1990  	// date: YYYY-MM-DD.
  1991  	DateString []string `json:"dateString,omitempty"`
  1992  	// Id: The identifier of this label field.
  1993  	Id string `json:"id,omitempty"`
  1994  	// Integer: Only present if `valueType` is `integer`.
  1995  	Integer googleapi.Int64s `json:"integer,omitempty"`
  1996  	// Kind: This is always drive#labelField.
  1997  	Kind string `json:"kind,omitempty"`
  1998  	// Selection: Only present if `valueType` is `selection`
  1999  	Selection []string `json:"selection,omitempty"`
  2000  	// Text: Only present if `valueType` is `text`.
  2001  	Text []string `json:"text,omitempty"`
  2002  	// User: Only present if `valueType` is `user`.
  2003  	User []*User `json:"user,omitempty"`
  2004  	// ValueType: The field type. While new values may be supported in the future,
  2005  	// the following are currently allowed: * `dateString` * `integer` *
  2006  	// `selection` * `text` * `user`
  2007  	ValueType string `json:"valueType,omitempty"`
  2008  	// ForceSendFields is a list of field names (e.g. "DateString") to
  2009  	// unconditionally include in API requests. By default, fields with empty or
  2010  	// default values are omitted from API requests. See
  2011  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2012  	// details.
  2013  	ForceSendFields []string `json:"-"`
  2014  	// NullFields is a list of field names (e.g. "DateString") to include in API
  2015  	// requests with the JSON null value. By default, fields with empty values are
  2016  	// omitted from API requests. See
  2017  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2018  	NullFields []string `json:"-"`
  2019  }
  2020  
  2021  func (s *LabelField) MarshalJSON() ([]byte, error) {
  2022  	type NoMethod LabelField
  2023  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2024  }
  2025  
  2026  // LabelFieldModification: A modification to a label's field.
  2027  type LabelFieldModification struct {
  2028  	// FieldId: The ID of the field to be modified.
  2029  	FieldId string `json:"fieldId,omitempty"`
  2030  	// Kind: This is always drive#labelFieldModification.
  2031  	Kind string `json:"kind,omitempty"`
  2032  	// SetDateValues: Replaces the value of a dateString Field with these new
  2033  	// values. The string must be in the RFC 3339 full-date format: YYYY-MM-DD.
  2034  	SetDateValues []string `json:"setDateValues,omitempty"`
  2035  	// SetIntegerValues: Replaces the value of an `integer` field with these new
  2036  	// values.
  2037  	SetIntegerValues googleapi.Int64s `json:"setIntegerValues,omitempty"`
  2038  	// SetSelectionValues: Replaces a `selection` field with these new values.
  2039  	SetSelectionValues []string `json:"setSelectionValues,omitempty"`
  2040  	// SetTextValues: Sets the value of a `text` field.
  2041  	SetTextValues []string `json:"setTextValues,omitempty"`
  2042  	// SetUserValues: Replaces a `user` field with these new values. The values
  2043  	// must be valid email addresses.
  2044  	SetUserValues []string `json:"setUserValues,omitempty"`
  2045  	// UnsetValues: Unsets the values for this field.
  2046  	UnsetValues bool `json:"unsetValues,omitempty"`
  2047  	// ForceSendFields is a list of field names (e.g. "FieldId") to unconditionally
  2048  	// include in API requests. By default, fields with empty or default values are
  2049  	// omitted from API requests. See
  2050  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2051  	// details.
  2052  	ForceSendFields []string `json:"-"`
  2053  	// NullFields is a list of field names (e.g. "FieldId") to include in API
  2054  	// requests with the JSON null value. By default, fields with empty values are
  2055  	// omitted from API requests. See
  2056  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2057  	NullFields []string `json:"-"`
  2058  }
  2059  
  2060  func (s *LabelFieldModification) MarshalJSON() ([]byte, error) {
  2061  	type NoMethod LabelFieldModification
  2062  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2063  }
  2064  
  2065  // LabelList: A list of labels applied to a file.
  2066  type LabelList struct {
  2067  	// Kind: This is always drive#labelList
  2068  	Kind string `json:"kind,omitempty"`
  2069  	// Labels: The list of labels.
  2070  	Labels []*Label `json:"labels,omitempty"`
  2071  	// NextPageToken: The page token for the next page of labels. This field will
  2072  	// be absent if the end of the list has been reached. If the token is rejected
  2073  	// for any reason, it should be discarded, and pagination should be restarted
  2074  	// from the first page of results. The page token is typically valid for
  2075  	// several hours. However, if new items are added or removed, your expected
  2076  	// results might differ.
  2077  	NextPageToken string `json:"nextPageToken,omitempty"`
  2078  
  2079  	// ServerResponse contains the HTTP response code and headers from the server.
  2080  	googleapi.ServerResponse `json:"-"`
  2081  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
  2082  	// include in API requests. By default, fields with empty or default values are
  2083  	// omitted from API requests. See
  2084  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2085  	// details.
  2086  	ForceSendFields []string `json:"-"`
  2087  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
  2088  	// with the JSON null value. By default, fields with empty values are omitted
  2089  	// from API requests. See
  2090  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2091  	NullFields []string `json:"-"`
  2092  }
  2093  
  2094  func (s *LabelList) MarshalJSON() ([]byte, error) {
  2095  	type NoMethod LabelList
  2096  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2097  }
  2098  
  2099  // LabelModification: A modification to a label on a file. A LabelModification
  2100  // can be used to apply a label to a file, update an existing label on a file,
  2101  // or remove a label from a file.
  2102  type LabelModification struct {
  2103  	// FieldModifications: The list of modifications to this label's fields.
  2104  	FieldModifications []*LabelFieldModification `json:"fieldModifications,omitempty"`
  2105  	// Kind: This is always drive#labelModification.
  2106  	Kind string `json:"kind,omitempty"`
  2107  	// LabelId: The ID of the label to modify.
  2108  	LabelId string `json:"labelId,omitempty"`
  2109  	// RemoveLabel: If true, the label will be removed from the file.
  2110  	RemoveLabel bool `json:"removeLabel,omitempty"`
  2111  	// ForceSendFields is a list of field names (e.g. "FieldModifications") to
  2112  	// unconditionally include in API requests. By default, fields with empty or
  2113  	// default values are omitted from API requests. See
  2114  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2115  	// details.
  2116  	ForceSendFields []string `json:"-"`
  2117  	// NullFields is a list of field names (e.g. "FieldModifications") to include
  2118  	// in API requests with the JSON null value. By default, fields with empty
  2119  	// values are omitted from API requests. See
  2120  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2121  	NullFields []string `json:"-"`
  2122  }
  2123  
  2124  func (s *LabelModification) MarshalJSON() ([]byte, error) {
  2125  	type NoMethod LabelModification
  2126  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2127  }
  2128  
  2129  // ModifyLabelsRequest: A request to modify the set of labels on a file. This
  2130  // request may contain many modifications that will either all succeed or all
  2131  // fail atomically.
  2132  type ModifyLabelsRequest struct {
  2133  	// Kind: This is always drive#modifyLabelsRequest.
  2134  	Kind string `json:"kind,omitempty"`
  2135  	// LabelModifications: The list of modifications to apply to the labels on the
  2136  	// file.
  2137  	LabelModifications []*LabelModification `json:"labelModifications,omitempty"`
  2138  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
  2139  	// include in API requests. By default, fields with empty or default values are
  2140  	// omitted from API requests. See
  2141  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2142  	// details.
  2143  	ForceSendFields []string `json:"-"`
  2144  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
  2145  	// with the JSON null value. By default, fields with empty values are omitted
  2146  	// from API requests. See
  2147  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2148  	NullFields []string `json:"-"`
  2149  }
  2150  
  2151  func (s *ModifyLabelsRequest) MarshalJSON() ([]byte, error) {
  2152  	type NoMethod ModifyLabelsRequest
  2153  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2154  }
  2155  
  2156  // ModifyLabelsResponse: Response to a ModifyLabels request. This contains only
  2157  // those labels which were added or updated by the request.
  2158  type ModifyLabelsResponse struct {
  2159  	// Kind: This is always drive#modifyLabelsResponse
  2160  	Kind string `json:"kind,omitempty"`
  2161  	// ModifiedLabels: The list of labels which were added or updated by the
  2162  	// request.
  2163  	ModifiedLabels []*Label `json:"modifiedLabels,omitempty"`
  2164  
  2165  	// ServerResponse contains the HTTP response code and headers from the server.
  2166  	googleapi.ServerResponse `json:"-"`
  2167  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
  2168  	// include in API requests. By default, fields with empty or default values are
  2169  	// omitted from API requests. See
  2170  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2171  	// details.
  2172  	ForceSendFields []string `json:"-"`
  2173  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
  2174  	// with the JSON null value. By default, fields with empty values are omitted
  2175  	// from API requests. See
  2176  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2177  	NullFields []string `json:"-"`
  2178  }
  2179  
  2180  func (s *ModifyLabelsResponse) MarshalJSON() ([]byte, error) {
  2181  	type NoMethod ModifyLabelsResponse
  2182  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2183  }
  2184  
  2185  // Permission: A permission for a file. A permission grants a user, group,
  2186  // domain, or the world access to a file or a folder hierarchy. Some resource
  2187  // methods (such as `permissions.update`) require a `permissionId`. Use the
  2188  // `permissions.list` method to retrieve the ID for a file, folder, or shared
  2189  // drive.
  2190  type Permission struct {
  2191  	// AllowFileDiscovery: Whether the permission allows the file to be discovered
  2192  	// through search. This is only applicable for permissions of type `domain` or
  2193  	// `anyone`.
  2194  	AllowFileDiscovery bool `json:"allowFileDiscovery,omitempty"`
  2195  	// Deleted: Output only. Whether the account associated with this permission
  2196  	// has been deleted. This field only pertains to user and group permissions.
  2197  	Deleted bool `json:"deleted,omitempty"`
  2198  	// DisplayName: Output only. The "pretty" name of the value of the permission.
  2199  	// The following is a list of examples for each type of permission: * `user` -
  2200  	// User's full name, as defined for their Google account, such as "Joe Smith."
  2201  	// * `group` - Name of the Google Group, such as "The Company Administrators."
  2202  	// * `domain` - String domain name, such as "thecompany.com." * `anyone` - No
  2203  	// `displayName` is present.
  2204  	DisplayName string `json:"displayName,omitempty"`
  2205  	// Domain: The domain to which this permission refers.
  2206  	Domain string `json:"domain,omitempty"`
  2207  	// EmailAddress: The email address of the user or group to which this
  2208  	// permission refers.
  2209  	EmailAddress string `json:"emailAddress,omitempty"`
  2210  	// ExpirationTime: The time at which this permission will expire (RFC 3339
  2211  	// date-time). Expiration times have the following restrictions: - They can
  2212  	// only be set on user and group permissions - The time must be in the future -
  2213  	// The time cannot be more than a year in the future
  2214  	ExpirationTime string `json:"expirationTime,omitempty"`
  2215  	// Id: Output only. The ID of this permission. This is a unique identifier for
  2216  	// the grantee, and is published in User resources as `permissionId`. IDs
  2217  	// should be treated as opaque values.
  2218  	Id string `json:"id,omitempty"`
  2219  	// Kind: Output only. Identifies what kind of resource this is. Value: the
  2220  	// fixed string "drive#permission".
  2221  	Kind string `json:"kind,omitempty"`
  2222  	// PendingOwner: Whether the account associated with this permission is a
  2223  	// pending owner. Only populated for `user` type permissions for files that are
  2224  	// not in a shared drive.
  2225  	PendingOwner bool `json:"pendingOwner,omitempty"`
  2226  	// PermissionDetails: Output only. Details of whether the permissions on this
  2227  	// shared drive item are inherited or directly on this item. This is an
  2228  	// output-only field which is present only for shared drive items.
  2229  	PermissionDetails []*PermissionPermissionDetails `json:"permissionDetails,omitempty"`
  2230  	// PhotoLink: Output only. A link to the user's profile photo, if available.
  2231  	PhotoLink string `json:"photoLink,omitempty"`
  2232  	// Role: The role granted by this permission. While new values may be supported
  2233  	// in the future, the following are currently allowed: * `owner` * `organizer`
  2234  	// * `fileOrganizer` * `writer` * `commenter` * `reader`
  2235  	Role string `json:"role,omitempty"`
  2236  	// TeamDrivePermissionDetails: Output only. Deprecated: Output only. Use
  2237  	// `permissionDetails` instead.
  2238  	TeamDrivePermissionDetails []*PermissionTeamDrivePermissionDetails `json:"teamDrivePermissionDetails,omitempty"`
  2239  	// Type: The type of the grantee. Valid values are: * `user` * `group` *
  2240  	// `domain` * `anyone` When creating a permission, if `type` is `user` or
  2241  	// `group`, you must provide an `emailAddress` for the user or group. When
  2242  	// `type` is `domain`, you must provide a `domain`. There isn't extra
  2243  	// information required for an `anyone` type.
  2244  	Type string `json:"type,omitempty"`
  2245  	// View: Indicates the view for this permission. Only populated for permissions
  2246  	// that belong to a view. 'published' is the only supported value.
  2247  	View string `json:"view,omitempty"`
  2248  
  2249  	// ServerResponse contains the HTTP response code and headers from the server.
  2250  	googleapi.ServerResponse `json:"-"`
  2251  	// ForceSendFields is a list of field names (e.g. "AllowFileDiscovery") to
  2252  	// unconditionally include in API requests. By default, fields with empty or
  2253  	// default values are omitted from API requests. See
  2254  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2255  	// details.
  2256  	ForceSendFields []string `json:"-"`
  2257  	// NullFields is a list of field names (e.g. "AllowFileDiscovery") to include
  2258  	// in API requests with the JSON null value. By default, fields with empty
  2259  	// values are omitted from API requests. See
  2260  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2261  	NullFields []string `json:"-"`
  2262  }
  2263  
  2264  func (s *Permission) MarshalJSON() ([]byte, error) {
  2265  	type NoMethod Permission
  2266  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2267  }
  2268  
  2269  type PermissionPermissionDetails struct {
  2270  	// Inherited: Output only. Whether this permission is inherited. This field is
  2271  	// always populated. This is an output-only field.
  2272  	Inherited bool `json:"inherited,omitempty"`
  2273  	// InheritedFrom: Output only. The ID of the item from which this permission is
  2274  	// inherited. This is an output-only field.
  2275  	InheritedFrom string `json:"inheritedFrom,omitempty"`
  2276  	// PermissionType: Output only. The permission type for this user. While new
  2277  	// values may be added in future, the following are currently possible: *
  2278  	// `file` * `member`
  2279  	PermissionType string `json:"permissionType,omitempty"`
  2280  	// Role: Output only. The primary role for this user. While new values may be
  2281  	// added in the future, the following are currently possible: * `organizer` *
  2282  	// `fileOrganizer` * `writer` * `commenter` * `reader`
  2283  	Role string `json:"role,omitempty"`
  2284  	// ForceSendFields is a list of field names (e.g. "Inherited") to
  2285  	// unconditionally include in API requests. By default, fields with empty or
  2286  	// default values are omitted from API requests. See
  2287  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2288  	// details.
  2289  	ForceSendFields []string `json:"-"`
  2290  	// NullFields is a list of field names (e.g. "Inherited") to include in API
  2291  	// requests with the JSON null value. By default, fields with empty values are
  2292  	// omitted from API requests. See
  2293  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2294  	NullFields []string `json:"-"`
  2295  }
  2296  
  2297  func (s *PermissionPermissionDetails) MarshalJSON() ([]byte, error) {
  2298  	type NoMethod PermissionPermissionDetails
  2299  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2300  }
  2301  
  2302  type PermissionTeamDrivePermissionDetails struct {
  2303  	// Inherited: Deprecated: Output only. Use `permissionDetails/inherited`
  2304  	// instead.
  2305  	Inherited bool `json:"inherited,omitempty"`
  2306  	// InheritedFrom: Deprecated: Output only. Use
  2307  	// `permissionDetails/inheritedFrom` instead.
  2308  	InheritedFrom string `json:"inheritedFrom,omitempty"`
  2309  	// Role: Deprecated: Output only. Use `permissionDetails/role` instead.
  2310  	Role string `json:"role,omitempty"`
  2311  	// TeamDrivePermissionType: Deprecated: Output only. Use
  2312  	// `permissionDetails/permissionType` instead.
  2313  	TeamDrivePermissionType string `json:"teamDrivePermissionType,omitempty"`
  2314  	// ForceSendFields is a list of field names (e.g. "Inherited") to
  2315  	// unconditionally include in API requests. By default, fields with empty or
  2316  	// default values are omitted from API requests. See
  2317  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2318  	// details.
  2319  	ForceSendFields []string `json:"-"`
  2320  	// NullFields is a list of field names (e.g. "Inherited") to include in API
  2321  	// requests with the JSON null value. By default, fields with empty values are
  2322  	// omitted from API requests. See
  2323  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2324  	NullFields []string `json:"-"`
  2325  }
  2326  
  2327  func (s *PermissionTeamDrivePermissionDetails) MarshalJSON() ([]byte, error) {
  2328  	type NoMethod PermissionTeamDrivePermissionDetails
  2329  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2330  }
  2331  
  2332  // PermissionList: A list of permissions for a file.
  2333  type PermissionList struct {
  2334  	// Kind: Identifies what kind of resource this is. Value: the fixed string
  2335  	// "drive#permissionList".
  2336  	Kind string `json:"kind,omitempty"`
  2337  	// NextPageToken: The page token for the next page of permissions. This field
  2338  	// will be absent if the end of the permissions list has been reached. If the
  2339  	// token is rejected for any reason, it should be discarded, and pagination
  2340  	// should be restarted from the first page of results. The page token is
  2341  	// typically valid for several hours. However, if new items are added or
  2342  	// removed, your expected results might differ.
  2343  	NextPageToken string `json:"nextPageToken,omitempty"`
  2344  	// Permissions: The list of permissions. If nextPageToken is populated, then
  2345  	// this list may be incomplete and an additional page of results should be
  2346  	// fetched.
  2347  	Permissions []*Permission `json:"permissions,omitempty"`
  2348  
  2349  	// ServerResponse contains the HTTP response code and headers from the server.
  2350  	googleapi.ServerResponse `json:"-"`
  2351  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
  2352  	// include in API requests. By default, fields with empty or default values are
  2353  	// omitted from API requests. See
  2354  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2355  	// details.
  2356  	ForceSendFields []string `json:"-"`
  2357  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
  2358  	// with the JSON null value. By default, fields with empty values are omitted
  2359  	// from API requests. See
  2360  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2361  	NullFields []string `json:"-"`
  2362  }
  2363  
  2364  func (s *PermissionList) MarshalJSON() ([]byte, error) {
  2365  	type NoMethod PermissionList
  2366  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2367  }
  2368  
  2369  // Reply: A reply to a comment on a file. Some resource methods (such as
  2370  // `replies.update`) require a `replyId`. Use the `replies.list` method to
  2371  // retrieve the ID for a reply.
  2372  type Reply struct {
  2373  	// Action: The action the reply performed to the parent comment. Valid values
  2374  	// are: * `resolve` * `reopen`
  2375  	Action string `json:"action,omitempty"`
  2376  	// Author: Output only. The author of the reply. The author's email address and
  2377  	// permission ID will not be populated.
  2378  	Author *User `json:"author,omitempty"`
  2379  	// Content: The plain text content of the reply. This field is used for setting
  2380  	// the content, while `htmlContent` should be displayed. This is required on
  2381  	// creates if no `action` is specified.
  2382  	Content string `json:"content,omitempty"`
  2383  	// CreatedTime: The time at which the reply was created (RFC 3339 date-time).
  2384  	CreatedTime string `json:"createdTime,omitempty"`
  2385  	// Deleted: Output only. Whether the reply has been deleted. A deleted reply
  2386  	// has no content.
  2387  	Deleted bool `json:"deleted,omitempty"`
  2388  	// HtmlContent: Output only. The content of the reply with HTML formatting.
  2389  	HtmlContent string `json:"htmlContent,omitempty"`
  2390  	// Id: Output only. The ID of the reply.
  2391  	Id string `json:"id,omitempty"`
  2392  	// Kind: Output only. Identifies what kind of resource this is. Value: the
  2393  	// fixed string "drive#reply".
  2394  	Kind string `json:"kind,omitempty"`
  2395  	// ModifiedTime: The last time the reply was modified (RFC 3339 date-time).
  2396  	ModifiedTime string `json:"modifiedTime,omitempty"`
  2397  
  2398  	// ServerResponse contains the HTTP response code and headers from the server.
  2399  	googleapi.ServerResponse `json:"-"`
  2400  	// ForceSendFields is a list of field names (e.g. "Action") to unconditionally
  2401  	// include in API requests. By default, fields with empty or default values are
  2402  	// omitted from API requests. See
  2403  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2404  	// details.
  2405  	ForceSendFields []string `json:"-"`
  2406  	// NullFields is a list of field names (e.g. "Action") to include in API
  2407  	// requests with the JSON null value. By default, fields with empty values are
  2408  	// omitted from API requests. See
  2409  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2410  	NullFields []string `json:"-"`
  2411  }
  2412  
  2413  func (s *Reply) MarshalJSON() ([]byte, error) {
  2414  	type NoMethod Reply
  2415  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2416  }
  2417  
  2418  // ReplyList: A list of replies to a comment on a file.
  2419  type ReplyList struct {
  2420  	// Kind: Identifies what kind of resource this is. Value: the fixed string
  2421  	// "drive#replyList".
  2422  	Kind string `json:"kind,omitempty"`
  2423  	// NextPageToken: The page token for the next page of replies. This will be
  2424  	// absent if the end of the replies list has been reached. If the token is
  2425  	// rejected for any reason, it should be discarded, and pagination should be
  2426  	// restarted from the first page of results. The page token is typically valid
  2427  	// for several hours. However, if new items are added or removed, your expected
  2428  	// results might differ.
  2429  	NextPageToken string `json:"nextPageToken,omitempty"`
  2430  	// Replies: The list of replies. If nextPageToken is populated, then this list
  2431  	// may be incomplete and an additional page of results should be fetched.
  2432  	Replies []*Reply `json:"replies,omitempty"`
  2433  
  2434  	// ServerResponse contains the HTTP response code and headers from the server.
  2435  	googleapi.ServerResponse `json:"-"`
  2436  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
  2437  	// include in API requests. By default, fields with empty or default values are
  2438  	// omitted from API requests. See
  2439  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2440  	// details.
  2441  	ForceSendFields []string `json:"-"`
  2442  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
  2443  	// with the JSON null value. By default, fields with empty values are omitted
  2444  	// from API requests. See
  2445  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2446  	NullFields []string `json:"-"`
  2447  }
  2448  
  2449  func (s *ReplyList) MarshalJSON() ([]byte, error) {
  2450  	type NoMethod ReplyList
  2451  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2452  }
  2453  
  2454  // Revision: The metadata for a revision to a file. Some resource methods (such
  2455  // as `revisions.update`) require a `revisionId`. Use the `revisions.list`
  2456  // method to retrieve the ID for a revision.
  2457  type Revision struct {
  2458  	// ExportLinks: Output only. Links for exporting Docs Editors files to specific
  2459  	// formats.
  2460  	ExportLinks map[string]string `json:"exportLinks,omitempty"`
  2461  	// Id: Output only. The ID of the revision.
  2462  	Id string `json:"id,omitempty"`
  2463  	// KeepForever: Whether to keep this revision forever, even if it is no longer
  2464  	// the head revision. If not set, the revision will be automatically purged 30
  2465  	// days after newer content is uploaded. This can be set on a maximum of 200
  2466  	// revisions for a file. This field is only applicable to files with binary
  2467  	// content in Drive.
  2468  	KeepForever bool `json:"keepForever,omitempty"`
  2469  	// Kind: Output only. Identifies what kind of resource this is. Value: the
  2470  	// fixed string "drive#revision".
  2471  	Kind string `json:"kind,omitempty"`
  2472  	// LastModifyingUser: Output only. The last user to modify this revision.
  2473  	LastModifyingUser *User `json:"lastModifyingUser,omitempty"`
  2474  	// Md5Checksum: Output only. The MD5 checksum of the revision's content. This
  2475  	// is only applicable to files with binary content in Drive.
  2476  	Md5Checksum string `json:"md5Checksum,omitempty"`
  2477  	// MimeType: Output only. The MIME type of the revision.
  2478  	MimeType string `json:"mimeType,omitempty"`
  2479  	// ModifiedTime: The last time the revision was modified (RFC 3339 date-time).
  2480  	ModifiedTime string `json:"modifiedTime,omitempty"`
  2481  	// OriginalFilename: Output only. The original filename used to create this
  2482  	// revision. This is only applicable to files with binary content in Drive.
  2483  	OriginalFilename string `json:"originalFilename,omitempty"`
  2484  	// PublishAuto: Whether subsequent revisions will be automatically republished.
  2485  	// This is only applicable to Docs Editors files.
  2486  	PublishAuto bool `json:"publishAuto,omitempty"`
  2487  	// Published: Whether this revision is published. This is only applicable to
  2488  	// Docs Editors files.
  2489  	Published bool `json:"published,omitempty"`
  2490  	// PublishedLink: Output only. A link to the published revision. This is only
  2491  	// populated for Google Sites files.
  2492  	PublishedLink string `json:"publishedLink,omitempty"`
  2493  	// PublishedOutsideDomain: Whether this revision is published outside the
  2494  	// domain. This is only applicable to Docs Editors files.
  2495  	PublishedOutsideDomain bool `json:"publishedOutsideDomain,omitempty"`
  2496  	// Size: Output only. The size of the revision's content in bytes. This is only
  2497  	// applicable to files with binary content in Drive.
  2498  	Size int64 `json:"size,omitempty,string"`
  2499  
  2500  	// ServerResponse contains the HTTP response code and headers from the server.
  2501  	googleapi.ServerResponse `json:"-"`
  2502  	// ForceSendFields is a list of field names (e.g. "ExportLinks") to
  2503  	// unconditionally include in API requests. By default, fields with empty or
  2504  	// default values are omitted from API requests. See
  2505  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2506  	// details.
  2507  	ForceSendFields []string `json:"-"`
  2508  	// NullFields is a list of field names (e.g. "ExportLinks") to include in API
  2509  	// requests with the JSON null value. By default, fields with empty values are
  2510  	// omitted from API requests. See
  2511  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2512  	NullFields []string `json:"-"`
  2513  }
  2514  
  2515  func (s *Revision) MarshalJSON() ([]byte, error) {
  2516  	type NoMethod Revision
  2517  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2518  }
  2519  
  2520  // RevisionList: A list of revisions of a file.
  2521  type RevisionList struct {
  2522  	// Kind: Identifies what kind of resource this is. Value: the fixed string
  2523  	// "drive#revisionList".
  2524  	Kind string `json:"kind,omitempty"`
  2525  	// NextPageToken: The page token for the next page of revisions. This will be
  2526  	// absent if the end of the revisions list has been reached. If the token is
  2527  	// rejected for any reason, it should be discarded, and pagination should be
  2528  	// restarted from the first page of results. The page token is typically valid
  2529  	// for several hours. However, if new items are added or removed, your expected
  2530  	// results might differ.
  2531  	NextPageToken string `json:"nextPageToken,omitempty"`
  2532  	// Revisions: The list of revisions. If nextPageToken is populated, then this
  2533  	// list may be incomplete and an additional page of results should be fetched.
  2534  	Revisions []*Revision `json:"revisions,omitempty"`
  2535  
  2536  	// ServerResponse contains the HTTP response code and headers from the server.
  2537  	googleapi.ServerResponse `json:"-"`
  2538  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
  2539  	// include in API requests. By default, fields with empty or default values are
  2540  	// omitted from API requests. See
  2541  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2542  	// details.
  2543  	ForceSendFields []string `json:"-"`
  2544  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
  2545  	// with the JSON null value. By default, fields with empty values are omitted
  2546  	// from API requests. See
  2547  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2548  	NullFields []string `json:"-"`
  2549  }
  2550  
  2551  func (s *RevisionList) MarshalJSON() ([]byte, error) {
  2552  	type NoMethod RevisionList
  2553  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2554  }
  2555  
  2556  type StartPageToken struct {
  2557  	// Kind: Identifies what kind of resource this is. Value: the fixed string
  2558  	// "drive#startPageToken".
  2559  	Kind string `json:"kind,omitempty"`
  2560  	// StartPageToken: The starting page token for listing future changes. The page
  2561  	// token doesn't expire.
  2562  	StartPageToken string `json:"startPageToken,omitempty"`
  2563  
  2564  	// ServerResponse contains the HTTP response code and headers from the server.
  2565  	googleapi.ServerResponse `json:"-"`
  2566  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
  2567  	// include in API requests. By default, fields with empty or default values are
  2568  	// omitted from API requests. See
  2569  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2570  	// details.
  2571  	ForceSendFields []string `json:"-"`
  2572  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
  2573  	// with the JSON null value. By default, fields with empty values are omitted
  2574  	// from API requests. See
  2575  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2576  	NullFields []string `json:"-"`
  2577  }
  2578  
  2579  func (s *StartPageToken) MarshalJSON() ([]byte, error) {
  2580  	type NoMethod StartPageToken
  2581  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2582  }
  2583  
  2584  // TeamDrive: Deprecated: use the drive collection instead.
  2585  type TeamDrive struct {
  2586  	// BackgroundImageFile: An image file and cropping parameters from which a
  2587  	// background image for this Team Drive is set. This is a write only field; it
  2588  	// can only be set on `drive.teamdrives.update` requests that don't set
  2589  	// `themeId`. When specified, all fields of the `backgroundImageFile` must be
  2590  	// set.
  2591  	BackgroundImageFile *TeamDriveBackgroundImageFile `json:"backgroundImageFile,omitempty"`
  2592  	// BackgroundImageLink: A short-lived link to this Team Drive's background
  2593  	// image.
  2594  	BackgroundImageLink string `json:"backgroundImageLink,omitempty"`
  2595  	// Capabilities: Capabilities the current user has on this Team Drive.
  2596  	Capabilities *TeamDriveCapabilities `json:"capabilities,omitempty"`
  2597  	// ColorRgb: The color of this Team Drive as an RGB hex string. It can only be
  2598  	// set on a `drive.teamdrives.update` request that does not set `themeId`.
  2599  	ColorRgb string `json:"colorRgb,omitempty"`
  2600  	// CreatedTime: The time at which the Team Drive was created (RFC 3339
  2601  	// date-time).
  2602  	CreatedTime string `json:"createdTime,omitempty"`
  2603  	// Id: The ID of this Team Drive which is also the ID of the top level folder
  2604  	// of this Team Drive.
  2605  	Id string `json:"id,omitempty"`
  2606  	// Kind: Identifies what kind of resource this is. Value: the fixed string
  2607  	// "drive#teamDrive".
  2608  	Kind string `json:"kind,omitempty"`
  2609  	// Name: The name of this Team Drive.
  2610  	Name string `json:"name,omitempty"`
  2611  	// OrgUnitId: The organizational unit of this shared drive. This field is only
  2612  	// populated on `drives.list` responses when the `useDomainAdminAccess`
  2613  	// parameter is set to `true`.
  2614  	OrgUnitId string `json:"orgUnitId,omitempty"`
  2615  	// Restrictions: A set of restrictions that apply to this Team Drive or items
  2616  	// inside this Team Drive.
  2617  	Restrictions *TeamDriveRestrictions `json:"restrictions,omitempty"`
  2618  	// ThemeId: The ID of the theme from which the background image and color will
  2619  	// be set. The set of possible `teamDriveThemes` can be retrieved from a
  2620  	// `drive.about.get` response. When not specified on a
  2621  	// `drive.teamdrives.create` request, a random theme is chosen from which the
  2622  	// background image and color are set. This is a write-only field; it can only
  2623  	// be set on requests that don't set `colorRgb` or `backgroundImageFile`.
  2624  	ThemeId string `json:"themeId,omitempty"`
  2625  
  2626  	// ServerResponse contains the HTTP response code and headers from the server.
  2627  	googleapi.ServerResponse `json:"-"`
  2628  	// ForceSendFields is a list of field names (e.g. "BackgroundImageFile") to
  2629  	// unconditionally include in API requests. By default, fields with empty or
  2630  	// default values are omitted from API requests. See
  2631  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2632  	// details.
  2633  	ForceSendFields []string `json:"-"`
  2634  	// NullFields is a list of field names (e.g. "BackgroundImageFile") to include
  2635  	// in API requests with the JSON null value. By default, fields with empty
  2636  	// values are omitted from API requests. See
  2637  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2638  	NullFields []string `json:"-"`
  2639  }
  2640  
  2641  func (s *TeamDrive) MarshalJSON() ([]byte, error) {
  2642  	type NoMethod TeamDrive
  2643  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2644  }
  2645  
  2646  // TeamDriveBackgroundImageFile: An image file and cropping parameters from
  2647  // which a background image for this Team Drive is set. This is a write only
  2648  // field; it can only be set on `drive.teamdrives.update` requests that don't
  2649  // set `themeId`. When specified, all fields of the `backgroundImageFile` must
  2650  // be set.
  2651  type TeamDriveBackgroundImageFile struct {
  2652  	// Id: The ID of an image file in Drive to use for the background image.
  2653  	Id string `json:"id,omitempty"`
  2654  	// Width: The width of the cropped image in the closed range of 0 to 1. This
  2655  	// value represents the width of the cropped image divided by the width of the
  2656  	// entire image. The height is computed by applying a width to height aspect
  2657  	// ratio of 80 to 9. The resulting image must be at least 1280 pixels wide and
  2658  	// 144 pixels high.
  2659  	Width float64 `json:"width,omitempty"`
  2660  	// XCoordinate: The X coordinate of the upper left corner of the cropping area
  2661  	// in the background image. This is a value in the closed range of 0 to 1. This
  2662  	// value represents the horizontal distance from the left side of the entire
  2663  	// image to the left side of the cropping area divided by the width of the
  2664  	// entire image.
  2665  	XCoordinate float64 `json:"xCoordinate,omitempty"`
  2666  	// YCoordinate: The Y coordinate of the upper left corner of the cropping area
  2667  	// in the background image. This is a value in the closed range of 0 to 1. This
  2668  	// value represents the vertical distance from the top side of the entire image
  2669  	// to the top side of the cropping area divided by the height of the entire
  2670  	// image.
  2671  	YCoordinate float64 `json:"yCoordinate,omitempty"`
  2672  	// ForceSendFields is a list of field names (e.g. "Id") to unconditionally
  2673  	// include in API requests. By default, fields with empty or default values are
  2674  	// omitted from API requests. See
  2675  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2676  	// details.
  2677  	ForceSendFields []string `json:"-"`
  2678  	// NullFields is a list of field names (e.g. "Id") to include in API requests
  2679  	// with the JSON null value. By default, fields with empty values are omitted
  2680  	// from API requests. See
  2681  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2682  	NullFields []string `json:"-"`
  2683  }
  2684  
  2685  func (s *TeamDriveBackgroundImageFile) MarshalJSON() ([]byte, error) {
  2686  	type NoMethod TeamDriveBackgroundImageFile
  2687  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2688  }
  2689  
  2690  func (s *TeamDriveBackgroundImageFile) UnmarshalJSON(data []byte) error {
  2691  	type NoMethod TeamDriveBackgroundImageFile
  2692  	var s1 struct {
  2693  		Width       gensupport.JSONFloat64 `json:"width"`
  2694  		XCoordinate gensupport.JSONFloat64 `json:"xCoordinate"`
  2695  		YCoordinate gensupport.JSONFloat64 `json:"yCoordinate"`
  2696  		*NoMethod
  2697  	}
  2698  	s1.NoMethod = (*NoMethod)(s)
  2699  	if err := json.Unmarshal(data, &s1); err != nil {
  2700  		return err
  2701  	}
  2702  	s.Width = float64(s1.Width)
  2703  	s.XCoordinate = float64(s1.XCoordinate)
  2704  	s.YCoordinate = float64(s1.YCoordinate)
  2705  	return nil
  2706  }
  2707  
  2708  // TeamDriveCapabilities: Capabilities the current user has on this Team Drive.
  2709  type TeamDriveCapabilities struct {
  2710  	// CanAddChildren: Whether the current user can add children to folders in this
  2711  	// Team Drive.
  2712  	CanAddChildren bool `json:"canAddChildren,omitempty"`
  2713  	// CanChangeCopyRequiresWriterPermissionRestriction: Whether the current user
  2714  	// can change the `copyRequiresWriterPermission` restriction of this Team
  2715  	// Drive.
  2716  	CanChangeCopyRequiresWriterPermissionRestriction bool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"`
  2717  	// CanChangeDomainUsersOnlyRestriction: Whether the current user can change the
  2718  	// `domainUsersOnly` restriction of this Team Drive.
  2719  	CanChangeDomainUsersOnlyRestriction bool `json:"canChangeDomainUsersOnlyRestriction,omitempty"`
  2720  	// CanChangeSharingFoldersRequiresOrganizerPermissionRestriction: Whether the
  2721  	// current user can change the `sharingFoldersRequiresOrganizerPermission`
  2722  	// restriction of this Team Drive.
  2723  	CanChangeSharingFoldersRequiresOrganizerPermissionRestriction bool `json:"canChangeSharingFoldersRequiresOrganizerPermissionRestriction,omitempty"`
  2724  	// CanChangeTeamDriveBackground: Whether the current user can change the
  2725  	// background of this Team Drive.
  2726  	CanChangeTeamDriveBackground bool `json:"canChangeTeamDriveBackground,omitempty"`
  2727  	// CanChangeTeamMembersOnlyRestriction: Whether the current user can change the
  2728  	// `teamMembersOnly` restriction of this Team Drive.
  2729  	CanChangeTeamMembersOnlyRestriction bool `json:"canChangeTeamMembersOnlyRestriction,omitempty"`
  2730  	// CanComment: Whether the current user can comment on files in this Team
  2731  	// Drive.
  2732  	CanComment bool `json:"canComment,omitempty"`
  2733  	// CanCopy: Whether the current user can copy files in this Team Drive.
  2734  	CanCopy bool `json:"canCopy,omitempty"`
  2735  	// CanDeleteChildren: Whether the current user can delete children from folders
  2736  	// in this Team Drive.
  2737  	CanDeleteChildren bool `json:"canDeleteChildren,omitempty"`
  2738  	// CanDeleteTeamDrive: Whether the current user can delete this Team Drive.
  2739  	// Attempting to delete the Team Drive may still fail if there are untrashed
  2740  	// items inside the Team Drive.
  2741  	CanDeleteTeamDrive bool `json:"canDeleteTeamDrive,omitempty"`
  2742  	// CanDownload: Whether the current user can download files in this Team Drive.
  2743  	CanDownload bool `json:"canDownload,omitempty"`
  2744  	// CanEdit: Whether the current user can edit files in this Team Drive
  2745  	CanEdit bool `json:"canEdit,omitempty"`
  2746  	// CanListChildren: Whether the current user can list the children of folders
  2747  	// in this Team Drive.
  2748  	CanListChildren bool `json:"canListChildren,omitempty"`
  2749  	// CanManageMembers: Whether the current user can add members to this Team
  2750  	// Drive or remove them or change their role.
  2751  	CanManageMembers bool `json:"canManageMembers,omitempty"`
  2752  	// CanReadRevisions: Whether the current user can read the revisions resource
  2753  	// of files in this Team Drive.
  2754  	CanReadRevisions bool `json:"canReadRevisions,omitempty"`
  2755  	// CanRemoveChildren: Deprecated: Use `canDeleteChildren` or `canTrashChildren`
  2756  	// instead.
  2757  	CanRemoveChildren bool `json:"canRemoveChildren,omitempty"`
  2758  	// CanRename: Whether the current user can rename files or folders in this Team
  2759  	// Drive.
  2760  	CanRename bool `json:"canRename,omitempty"`
  2761  	// CanRenameTeamDrive: Whether the current user can rename this Team Drive.
  2762  	CanRenameTeamDrive bool `json:"canRenameTeamDrive,omitempty"`
  2763  	// CanResetTeamDriveRestrictions: Whether the current user can reset the Team
  2764  	// Drive restrictions to defaults.
  2765  	CanResetTeamDriveRestrictions bool `json:"canResetTeamDriveRestrictions,omitempty"`
  2766  	// CanShare: Whether the current user can share files or folders in this Team
  2767  	// Drive.
  2768  	CanShare bool `json:"canShare,omitempty"`
  2769  	// CanTrashChildren: Whether the current user can trash children from folders
  2770  	// in this Team Drive.
  2771  	CanTrashChildren bool `json:"canTrashChildren,omitempty"`
  2772  	// ForceSendFields is a list of field names (e.g. "CanAddChildren") to
  2773  	// unconditionally include in API requests. By default, fields with empty or
  2774  	// default values are omitted from API requests. See
  2775  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2776  	// details.
  2777  	ForceSendFields []string `json:"-"`
  2778  	// NullFields is a list of field names (e.g. "CanAddChildren") to include in
  2779  	// API requests with the JSON null value. By default, fields with empty values
  2780  	// are omitted from API requests. See
  2781  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2782  	NullFields []string `json:"-"`
  2783  }
  2784  
  2785  func (s *TeamDriveCapabilities) MarshalJSON() ([]byte, error) {
  2786  	type NoMethod TeamDriveCapabilities
  2787  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2788  }
  2789  
  2790  // TeamDriveRestrictions: A set of restrictions that apply to this Team Drive
  2791  // or items inside this Team Drive.
  2792  type TeamDriveRestrictions struct {
  2793  	// AdminManagedRestrictions: Whether administrative privileges on this Team
  2794  	// Drive are required to modify restrictions.
  2795  	AdminManagedRestrictions bool `json:"adminManagedRestrictions,omitempty"`
  2796  	// CopyRequiresWriterPermission: Whether the options to copy, print, or
  2797  	// download files inside this Team Drive, should be disabled for readers and
  2798  	// commenters. When this restriction is set to `true`, it will override the
  2799  	// similarly named field to `true` for any file inside this Team Drive.
  2800  	CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"`
  2801  	// DomainUsersOnly: Whether access to this Team Drive and items inside this
  2802  	// Team Drive is restricted to users of the domain to which this Team Drive
  2803  	// belongs. This restriction may be overridden by other sharing policies
  2804  	// controlled outside of this Team Drive.
  2805  	DomainUsersOnly bool `json:"domainUsersOnly,omitempty"`
  2806  	// SharingFoldersRequiresOrganizerPermission: If true, only users with the
  2807  	// organizer role can share folders. If false, users with either the organizer
  2808  	// role or the file organizer role can share folders.
  2809  	SharingFoldersRequiresOrganizerPermission bool `json:"sharingFoldersRequiresOrganizerPermission,omitempty"`
  2810  	// TeamMembersOnly: Whether access to items inside this Team Drive is
  2811  	// restricted to members of this Team Drive.
  2812  	TeamMembersOnly bool `json:"teamMembersOnly,omitempty"`
  2813  	// ForceSendFields is a list of field names (e.g. "AdminManagedRestrictions")
  2814  	// to unconditionally include in API requests. By default, fields with empty or
  2815  	// default values are omitted from API requests. See
  2816  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2817  	// details.
  2818  	ForceSendFields []string `json:"-"`
  2819  	// NullFields is a list of field names (e.g. "AdminManagedRestrictions") to
  2820  	// include in API requests with the JSON null value. By default, fields with
  2821  	// empty values are omitted from API requests. See
  2822  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2823  	NullFields []string `json:"-"`
  2824  }
  2825  
  2826  func (s *TeamDriveRestrictions) MarshalJSON() ([]byte, error) {
  2827  	type NoMethod TeamDriveRestrictions
  2828  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2829  }
  2830  
  2831  // TeamDriveList: A list of Team Drives.
  2832  type TeamDriveList struct {
  2833  	// Kind: Identifies what kind of resource this is. Value: the fixed string
  2834  	// "drive#teamDriveList".
  2835  	Kind string `json:"kind,omitempty"`
  2836  	// NextPageToken: The page token for the next page of Team Drives. This will be
  2837  	// absent if the end of the Team Drives list has been reached. If the token is
  2838  	// rejected for any reason, it should be discarded, and pagination should be
  2839  	// restarted from the first page of results. The page token is typically valid
  2840  	// for several hours. However, if new items are added or removed, your expected
  2841  	// results might differ.
  2842  	NextPageToken string `json:"nextPageToken,omitempty"`
  2843  	// TeamDrives: The list of Team Drives. If nextPageToken is populated, then
  2844  	// this list may be incomplete and an additional page of results should be
  2845  	// fetched.
  2846  	TeamDrives []*TeamDrive `json:"teamDrives,omitempty"`
  2847  
  2848  	// ServerResponse contains the HTTP response code and headers from the server.
  2849  	googleapi.ServerResponse `json:"-"`
  2850  	// ForceSendFields is a list of field names (e.g. "Kind") to unconditionally
  2851  	// include in API requests. By default, fields with empty or default values are
  2852  	// omitted from API requests. See
  2853  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2854  	// details.
  2855  	ForceSendFields []string `json:"-"`
  2856  	// NullFields is a list of field names (e.g. "Kind") to include in API requests
  2857  	// with the JSON null value. By default, fields with empty values are omitted
  2858  	// from API requests. See
  2859  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2860  	NullFields []string `json:"-"`
  2861  }
  2862  
  2863  func (s *TeamDriveList) MarshalJSON() ([]byte, error) {
  2864  	type NoMethod TeamDriveList
  2865  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2866  }
  2867  
  2868  // User: Information about a Drive user.
  2869  type User struct {
  2870  	// DisplayName: Output only. A plain text displayable name for this user.
  2871  	DisplayName string `json:"displayName,omitempty"`
  2872  	// EmailAddress: Output only. The email address of the user. This may not be
  2873  	// present in certain contexts if the user has not made their email address
  2874  	// visible to the requester.
  2875  	EmailAddress string `json:"emailAddress,omitempty"`
  2876  	// Kind: Output only. Identifies what kind of resource this is. Value: the
  2877  	// fixed string "drive#user".
  2878  	Kind string `json:"kind,omitempty"`
  2879  	// Me: Output only. Whether this user is the requesting user.
  2880  	Me bool `json:"me,omitempty"`
  2881  	// PermissionId: Output only. The user's ID as visible in Permission resources.
  2882  	PermissionId string `json:"permissionId,omitempty"`
  2883  	// PhotoLink: Output only. A link to the user's profile photo, if available.
  2884  	PhotoLink string `json:"photoLink,omitempty"`
  2885  	// ForceSendFields is a list of field names (e.g. "DisplayName") to
  2886  	// unconditionally include in API requests. By default, fields with empty or
  2887  	// default values are omitted from API requests. See
  2888  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2889  	// details.
  2890  	ForceSendFields []string `json:"-"`
  2891  	// NullFields is a list of field names (e.g. "DisplayName") to include in API
  2892  	// requests with the JSON null value. By default, fields with empty values are
  2893  	// omitted from API requests. See
  2894  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2895  	NullFields []string `json:"-"`
  2896  }
  2897  
  2898  func (s *User) MarshalJSON() ([]byte, error) {
  2899  	type NoMethod User
  2900  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2901  }
  2902  
  2903  type AboutGetCall struct {
  2904  	s            *Service
  2905  	urlParams_   gensupport.URLParams
  2906  	ifNoneMatch_ string
  2907  	ctx_         context.Context
  2908  	header_      http.Header
  2909  }
  2910  
  2911  // Get: Gets information about the user, the user's Drive, and system
  2912  // capabilities.
  2913  func (r *AboutService) Get() *AboutGetCall {
  2914  	c := &AboutGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2915  	return c
  2916  }
  2917  
  2918  // Fields allows partial responses to be retrieved. See
  2919  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2920  // details.
  2921  func (c *AboutGetCall) Fields(s ...googleapi.Field) *AboutGetCall {
  2922  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2923  	return c
  2924  }
  2925  
  2926  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2927  // object's ETag matches the given value. This is useful for getting updates
  2928  // only after the object has changed since the last request.
  2929  func (c *AboutGetCall) IfNoneMatch(entityTag string) *AboutGetCall {
  2930  	c.ifNoneMatch_ = entityTag
  2931  	return c
  2932  }
  2933  
  2934  // Context sets the context to be used in this call's Do method.
  2935  func (c *AboutGetCall) Context(ctx context.Context) *AboutGetCall {
  2936  	c.ctx_ = ctx
  2937  	return c
  2938  }
  2939  
  2940  // Header returns a http.Header that can be modified by the caller to add
  2941  // headers to the request.
  2942  func (c *AboutGetCall) Header() http.Header {
  2943  	if c.header_ == nil {
  2944  		c.header_ = make(http.Header)
  2945  	}
  2946  	return c.header_
  2947  }
  2948  
  2949  func (c *AboutGetCall) doRequest(alt string) (*http.Response, error) {
  2950  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2951  	if c.ifNoneMatch_ != "" {
  2952  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2953  	}
  2954  	var body io.Reader = nil
  2955  	c.urlParams_.Set("alt", alt)
  2956  	c.urlParams_.Set("prettyPrint", "false")
  2957  	urls := googleapi.ResolveRelative(c.s.BasePath, "about")
  2958  	urls += "?" + c.urlParams_.Encode()
  2959  	req, err := http.NewRequest("GET", urls, body)
  2960  	if err != nil {
  2961  		return nil, err
  2962  	}
  2963  	req.Header = reqHeaders
  2964  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2965  }
  2966  
  2967  // Do executes the "drive.about.get" call.
  2968  // Any non-2xx status code is an error. Response headers are in either
  2969  // *About.ServerResponse.Header or (if a response was returned at all) in
  2970  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2971  // whether the returned error was because http.StatusNotModified was returned.
  2972  func (c *AboutGetCall) Do(opts ...googleapi.CallOption) (*About, error) {
  2973  	gensupport.SetOptions(c.urlParams_, opts...)
  2974  	res, err := c.doRequest("json")
  2975  	if res != nil && res.StatusCode == http.StatusNotModified {
  2976  		if res.Body != nil {
  2977  			res.Body.Close()
  2978  		}
  2979  		return nil, gensupport.WrapError(&googleapi.Error{
  2980  			Code:   res.StatusCode,
  2981  			Header: res.Header,
  2982  		})
  2983  	}
  2984  	if err != nil {
  2985  		return nil, err
  2986  	}
  2987  	defer googleapi.CloseBody(res)
  2988  	if err := googleapi.CheckResponse(res); err != nil {
  2989  		return nil, gensupport.WrapError(err)
  2990  	}
  2991  	ret := &About{
  2992  		ServerResponse: googleapi.ServerResponse{
  2993  			Header:         res.Header,
  2994  			HTTPStatusCode: res.StatusCode,
  2995  		},
  2996  	}
  2997  	target := &ret
  2998  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2999  		return nil, err
  3000  	}
  3001  	return ret, nil
  3002  }
  3003  
  3004  type AppsGetCall struct {
  3005  	s            *Service
  3006  	appId        string
  3007  	urlParams_   gensupport.URLParams
  3008  	ifNoneMatch_ string
  3009  	ctx_         context.Context
  3010  	header_      http.Header
  3011  }
  3012  
  3013  // Get: Gets a specific app.
  3014  //
  3015  // - appId: The ID of the app.
  3016  func (r *AppsService) Get(appId string) *AppsGetCall {
  3017  	c := &AppsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3018  	c.appId = appId
  3019  	return c
  3020  }
  3021  
  3022  // Fields allows partial responses to be retrieved. See
  3023  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3024  // details.
  3025  func (c *AppsGetCall) Fields(s ...googleapi.Field) *AppsGetCall {
  3026  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3027  	return c
  3028  }
  3029  
  3030  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3031  // object's ETag matches the given value. This is useful for getting updates
  3032  // only after the object has changed since the last request.
  3033  func (c *AppsGetCall) IfNoneMatch(entityTag string) *AppsGetCall {
  3034  	c.ifNoneMatch_ = entityTag
  3035  	return c
  3036  }
  3037  
  3038  // Context sets the context to be used in this call's Do method.
  3039  func (c *AppsGetCall) Context(ctx context.Context) *AppsGetCall {
  3040  	c.ctx_ = ctx
  3041  	return c
  3042  }
  3043  
  3044  // Header returns a http.Header that can be modified by the caller to add
  3045  // headers to the request.
  3046  func (c *AppsGetCall) Header() http.Header {
  3047  	if c.header_ == nil {
  3048  		c.header_ = make(http.Header)
  3049  	}
  3050  	return c.header_
  3051  }
  3052  
  3053  func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) {
  3054  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3055  	if c.ifNoneMatch_ != "" {
  3056  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3057  	}
  3058  	var body io.Reader = nil
  3059  	c.urlParams_.Set("alt", alt)
  3060  	c.urlParams_.Set("prettyPrint", "false")
  3061  	urls := googleapi.ResolveRelative(c.s.BasePath, "apps/{appId}")
  3062  	urls += "?" + c.urlParams_.Encode()
  3063  	req, err := http.NewRequest("GET", urls, body)
  3064  	if err != nil {
  3065  		return nil, err
  3066  	}
  3067  	req.Header = reqHeaders
  3068  	googleapi.Expand(req.URL, map[string]string{
  3069  		"appId": c.appId,
  3070  	})
  3071  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3072  }
  3073  
  3074  // Do executes the "drive.apps.get" call.
  3075  // Any non-2xx status code is an error. Response headers are in either
  3076  // *App.ServerResponse.Header or (if a response was returned at all) in
  3077  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3078  // whether the returned error was because http.StatusNotModified was returned.
  3079  func (c *AppsGetCall) Do(opts ...googleapi.CallOption) (*App, error) {
  3080  	gensupport.SetOptions(c.urlParams_, opts...)
  3081  	res, err := c.doRequest("json")
  3082  	if res != nil && res.StatusCode == http.StatusNotModified {
  3083  		if res.Body != nil {
  3084  			res.Body.Close()
  3085  		}
  3086  		return nil, gensupport.WrapError(&googleapi.Error{
  3087  			Code:   res.StatusCode,
  3088  			Header: res.Header,
  3089  		})
  3090  	}
  3091  	if err != nil {
  3092  		return nil, err
  3093  	}
  3094  	defer googleapi.CloseBody(res)
  3095  	if err := googleapi.CheckResponse(res); err != nil {
  3096  		return nil, gensupport.WrapError(err)
  3097  	}
  3098  	ret := &App{
  3099  		ServerResponse: googleapi.ServerResponse{
  3100  			Header:         res.Header,
  3101  			HTTPStatusCode: res.StatusCode,
  3102  		},
  3103  	}
  3104  	target := &ret
  3105  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3106  		return nil, err
  3107  	}
  3108  	return ret, nil
  3109  }
  3110  
  3111  type AppsListCall struct {
  3112  	s            *Service
  3113  	urlParams_   gensupport.URLParams
  3114  	ifNoneMatch_ string
  3115  	ctx_         context.Context
  3116  	header_      http.Header
  3117  }
  3118  
  3119  // List: Lists a user's installed apps.
  3120  func (r *AppsService) List() *AppsListCall {
  3121  	c := &AppsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3122  	return c
  3123  }
  3124  
  3125  // AppFilterExtensions sets the optional parameter "appFilterExtensions": A
  3126  // comma-separated list of file extensions to limit returned results. All
  3127  // results within the given app query scope which can open any of the given
  3128  // file extensions are included in the response. If `appFilterMimeTypes` are
  3129  // provided as well, the result is a union of the two resulting app lists.
  3130  func (c *AppsListCall) AppFilterExtensions(appFilterExtensions string) *AppsListCall {
  3131  	c.urlParams_.Set("appFilterExtensions", appFilterExtensions)
  3132  	return c
  3133  }
  3134  
  3135  // AppFilterMimeTypes sets the optional parameter "appFilterMimeTypes": A
  3136  // comma-separated list of file extensions to limit returned results. All
  3137  // results within the given app query scope which can open any of the given
  3138  // MIME types will be included in the response. If `appFilterExtensions` are
  3139  // provided as well, the result is a union of the two resulting app lists.
  3140  func (c *AppsListCall) AppFilterMimeTypes(appFilterMimeTypes string) *AppsListCall {
  3141  	c.urlParams_.Set("appFilterMimeTypes", appFilterMimeTypes)
  3142  	return c
  3143  }
  3144  
  3145  // LanguageCode sets the optional parameter "languageCode": A language or
  3146  // locale code, as defined by BCP 47, with some extensions from Unicode's LDML
  3147  // format (http://www.unicode.org/reports/tr35/).
  3148  func (c *AppsListCall) LanguageCode(languageCode string) *AppsListCall {
  3149  	c.urlParams_.Set("languageCode", languageCode)
  3150  	return c
  3151  }
  3152  
  3153  // Fields allows partial responses to be retrieved. See
  3154  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3155  // details.
  3156  func (c *AppsListCall) Fields(s ...googleapi.Field) *AppsListCall {
  3157  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3158  	return c
  3159  }
  3160  
  3161  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3162  // object's ETag matches the given value. This is useful for getting updates
  3163  // only after the object has changed since the last request.
  3164  func (c *AppsListCall) IfNoneMatch(entityTag string) *AppsListCall {
  3165  	c.ifNoneMatch_ = entityTag
  3166  	return c
  3167  }
  3168  
  3169  // Context sets the context to be used in this call's Do method.
  3170  func (c *AppsListCall) Context(ctx context.Context) *AppsListCall {
  3171  	c.ctx_ = ctx
  3172  	return c
  3173  }
  3174  
  3175  // Header returns a http.Header that can be modified by the caller to add
  3176  // headers to the request.
  3177  func (c *AppsListCall) Header() http.Header {
  3178  	if c.header_ == nil {
  3179  		c.header_ = make(http.Header)
  3180  	}
  3181  	return c.header_
  3182  }
  3183  
  3184  func (c *AppsListCall) doRequest(alt string) (*http.Response, error) {
  3185  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3186  	if c.ifNoneMatch_ != "" {
  3187  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3188  	}
  3189  	var body io.Reader = nil
  3190  	c.urlParams_.Set("alt", alt)
  3191  	c.urlParams_.Set("prettyPrint", "false")
  3192  	urls := googleapi.ResolveRelative(c.s.BasePath, "apps")
  3193  	urls += "?" + c.urlParams_.Encode()
  3194  	req, err := http.NewRequest("GET", urls, body)
  3195  	if err != nil {
  3196  		return nil, err
  3197  	}
  3198  	req.Header = reqHeaders
  3199  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3200  }
  3201  
  3202  // Do executes the "drive.apps.list" call.
  3203  // Any non-2xx status code is an error. Response headers are in either
  3204  // *AppList.ServerResponse.Header or (if a response was returned at all) in
  3205  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3206  // whether the returned error was because http.StatusNotModified was returned.
  3207  func (c *AppsListCall) Do(opts ...googleapi.CallOption) (*AppList, error) {
  3208  	gensupport.SetOptions(c.urlParams_, opts...)
  3209  	res, err := c.doRequest("json")
  3210  	if res != nil && res.StatusCode == http.StatusNotModified {
  3211  		if res.Body != nil {
  3212  			res.Body.Close()
  3213  		}
  3214  		return nil, gensupport.WrapError(&googleapi.Error{
  3215  			Code:   res.StatusCode,
  3216  			Header: res.Header,
  3217  		})
  3218  	}
  3219  	if err != nil {
  3220  		return nil, err
  3221  	}
  3222  	defer googleapi.CloseBody(res)
  3223  	if err := googleapi.CheckResponse(res); err != nil {
  3224  		return nil, gensupport.WrapError(err)
  3225  	}
  3226  	ret := &AppList{
  3227  		ServerResponse: googleapi.ServerResponse{
  3228  			Header:         res.Header,
  3229  			HTTPStatusCode: res.StatusCode,
  3230  		},
  3231  	}
  3232  	target := &ret
  3233  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3234  		return nil, err
  3235  	}
  3236  	return ret, nil
  3237  }
  3238  
  3239  type ChangesGetStartPageTokenCall struct {
  3240  	s            *Service
  3241  	urlParams_   gensupport.URLParams
  3242  	ifNoneMatch_ string
  3243  	ctx_         context.Context
  3244  	header_      http.Header
  3245  }
  3246  
  3247  // GetStartPageToken: Gets the starting pageToken for listing future changes.
  3248  func (r *ChangesService) GetStartPageToken() *ChangesGetStartPageTokenCall {
  3249  	c := &ChangesGetStartPageTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3250  	return c
  3251  }
  3252  
  3253  // DriveId sets the optional parameter "driveId": The ID of the shared drive
  3254  // for which the starting pageToken for listing future changes from that shared
  3255  // drive will be returned.
  3256  func (c *ChangesGetStartPageTokenCall) DriveId(driveId string) *ChangesGetStartPageTokenCall {
  3257  	c.urlParams_.Set("driveId", driveId)
  3258  	return c
  3259  }
  3260  
  3261  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  3262  // the requesting application supports both My Drives and shared drives.
  3263  func (c *ChangesGetStartPageTokenCall) SupportsAllDrives(supportsAllDrives bool) *ChangesGetStartPageTokenCall {
  3264  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  3265  	return c
  3266  }
  3267  
  3268  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  3269  // Deprecated: Use `supportsAllDrives` instead.
  3270  func (c *ChangesGetStartPageTokenCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesGetStartPageTokenCall {
  3271  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  3272  	return c
  3273  }
  3274  
  3275  // TeamDriveId sets the optional parameter "teamDriveId": Deprecated: Use
  3276  // `driveId` instead.
  3277  func (c *ChangesGetStartPageTokenCall) TeamDriveId(teamDriveId string) *ChangesGetStartPageTokenCall {
  3278  	c.urlParams_.Set("teamDriveId", teamDriveId)
  3279  	return c
  3280  }
  3281  
  3282  // Fields allows partial responses to be retrieved. See
  3283  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3284  // details.
  3285  func (c *ChangesGetStartPageTokenCall) Fields(s ...googleapi.Field) *ChangesGetStartPageTokenCall {
  3286  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3287  	return c
  3288  }
  3289  
  3290  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3291  // object's ETag matches the given value. This is useful for getting updates
  3292  // only after the object has changed since the last request.
  3293  func (c *ChangesGetStartPageTokenCall) IfNoneMatch(entityTag string) *ChangesGetStartPageTokenCall {
  3294  	c.ifNoneMatch_ = entityTag
  3295  	return c
  3296  }
  3297  
  3298  // Context sets the context to be used in this call's Do method.
  3299  func (c *ChangesGetStartPageTokenCall) Context(ctx context.Context) *ChangesGetStartPageTokenCall {
  3300  	c.ctx_ = ctx
  3301  	return c
  3302  }
  3303  
  3304  // Header returns a http.Header that can be modified by the caller to add
  3305  // headers to the request.
  3306  func (c *ChangesGetStartPageTokenCall) Header() http.Header {
  3307  	if c.header_ == nil {
  3308  		c.header_ = make(http.Header)
  3309  	}
  3310  	return c.header_
  3311  }
  3312  
  3313  func (c *ChangesGetStartPageTokenCall) doRequest(alt string) (*http.Response, error) {
  3314  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3315  	if c.ifNoneMatch_ != "" {
  3316  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3317  	}
  3318  	var body io.Reader = nil
  3319  	c.urlParams_.Set("alt", alt)
  3320  	c.urlParams_.Set("prettyPrint", "false")
  3321  	urls := googleapi.ResolveRelative(c.s.BasePath, "changes/startPageToken")
  3322  	urls += "?" + c.urlParams_.Encode()
  3323  	req, err := http.NewRequest("GET", urls, body)
  3324  	if err != nil {
  3325  		return nil, err
  3326  	}
  3327  	req.Header = reqHeaders
  3328  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3329  }
  3330  
  3331  // Do executes the "drive.changes.getStartPageToken" call.
  3332  // Any non-2xx status code is an error. Response headers are in either
  3333  // *StartPageToken.ServerResponse.Header or (if a response was returned at all)
  3334  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3335  // whether the returned error was because http.StatusNotModified was returned.
  3336  func (c *ChangesGetStartPageTokenCall) Do(opts ...googleapi.CallOption) (*StartPageToken, error) {
  3337  	gensupport.SetOptions(c.urlParams_, opts...)
  3338  	res, err := c.doRequest("json")
  3339  	if res != nil && res.StatusCode == http.StatusNotModified {
  3340  		if res.Body != nil {
  3341  			res.Body.Close()
  3342  		}
  3343  		return nil, gensupport.WrapError(&googleapi.Error{
  3344  			Code:   res.StatusCode,
  3345  			Header: res.Header,
  3346  		})
  3347  	}
  3348  	if err != nil {
  3349  		return nil, err
  3350  	}
  3351  	defer googleapi.CloseBody(res)
  3352  	if err := googleapi.CheckResponse(res); err != nil {
  3353  		return nil, gensupport.WrapError(err)
  3354  	}
  3355  	ret := &StartPageToken{
  3356  		ServerResponse: googleapi.ServerResponse{
  3357  			Header:         res.Header,
  3358  			HTTPStatusCode: res.StatusCode,
  3359  		},
  3360  	}
  3361  	target := &ret
  3362  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3363  		return nil, err
  3364  	}
  3365  	return ret, nil
  3366  }
  3367  
  3368  type ChangesListCall struct {
  3369  	s            *Service
  3370  	urlParams_   gensupport.URLParams
  3371  	ifNoneMatch_ string
  3372  	ctx_         context.Context
  3373  	header_      http.Header
  3374  }
  3375  
  3376  // List: Lists the changes for a user or shared drive.
  3377  //
  3378  //   - pageToken: The token for continuing a previous list request on the next
  3379  //     page. This should be set to the value of 'nextPageToken' from the previous
  3380  //     response or to the response from the getStartPageToken method.
  3381  func (r *ChangesService) List(pageToken string) *ChangesListCall {
  3382  	c := &ChangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3383  	c.urlParams_.Set("pageToken", pageToken)
  3384  	return c
  3385  }
  3386  
  3387  // DriveId sets the optional parameter "driveId": The shared drive from which
  3388  // changes will be returned. If specified the change IDs will be reflective of
  3389  // the shared drive; use the combined drive ID and change ID as an identifier.
  3390  func (c *ChangesListCall) DriveId(driveId string) *ChangesListCall {
  3391  	c.urlParams_.Set("driveId", driveId)
  3392  	return c
  3393  }
  3394  
  3395  // IncludeCorpusRemovals sets the optional parameter "includeCorpusRemovals":
  3396  // Whether changes should include the file resource if the file is still
  3397  // accessible by the user at the time of the request, even when a file was
  3398  // removed from the list of changes and there will be no further change entries
  3399  // for this file.
  3400  func (c *ChangesListCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesListCall {
  3401  	c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals))
  3402  	return c
  3403  }
  3404  
  3405  // IncludeItemsFromAllDrives sets the optional parameter
  3406  // "includeItemsFromAllDrives": Whether both My Drive and shared drive items
  3407  // should be included in results.
  3408  func (c *ChangesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesListCall {
  3409  	c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives))
  3410  	return c
  3411  }
  3412  
  3413  // IncludeLabels sets the optional parameter "includeLabels": A comma-separated
  3414  // list of IDs of labels to include in the `labelInfo` part of the response.
  3415  func (c *ChangesListCall) IncludeLabels(includeLabels string) *ChangesListCall {
  3416  	c.urlParams_.Set("includeLabels", includeLabels)
  3417  	return c
  3418  }
  3419  
  3420  // IncludePermissionsForView sets the optional parameter
  3421  // "includePermissionsForView": Specifies which additional view's permissions
  3422  // to include in the response. Only 'published' is supported.
  3423  func (c *ChangesListCall) IncludePermissionsForView(includePermissionsForView string) *ChangesListCall {
  3424  	c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
  3425  	return c
  3426  }
  3427  
  3428  // IncludeRemoved sets the optional parameter "includeRemoved": Whether to
  3429  // include changes indicating that items have been removed from the list of
  3430  // changes, for example by deletion or loss of access.
  3431  func (c *ChangesListCall) IncludeRemoved(includeRemoved bool) *ChangesListCall {
  3432  	c.urlParams_.Set("includeRemoved", fmt.Sprint(includeRemoved))
  3433  	return c
  3434  }
  3435  
  3436  // IncludeTeamDriveItems sets the optional parameter "includeTeamDriveItems":
  3437  // Deprecated: Use `includeItemsFromAllDrives` instead.
  3438  func (c *ChangesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesListCall {
  3439  	c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems))
  3440  	return c
  3441  }
  3442  
  3443  // PageSize sets the optional parameter "pageSize": The maximum number of
  3444  // changes to return per page.
  3445  func (c *ChangesListCall) PageSize(pageSize int64) *ChangesListCall {
  3446  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3447  	return c
  3448  }
  3449  
  3450  // RestrictToMyDrive sets the optional parameter "restrictToMyDrive": Whether
  3451  // to restrict the results to changes inside the My Drive hierarchy. This omits
  3452  // changes to files such as those in the Application Data folder or shared
  3453  // files which have not been added to My Drive.
  3454  func (c *ChangesListCall) RestrictToMyDrive(restrictToMyDrive bool) *ChangesListCall {
  3455  	c.urlParams_.Set("restrictToMyDrive", fmt.Sprint(restrictToMyDrive))
  3456  	return c
  3457  }
  3458  
  3459  // Spaces sets the optional parameter "spaces": A comma-separated list of
  3460  // spaces to query within the corpora. Supported values are 'drive' and
  3461  // 'appDataFolder'.
  3462  func (c *ChangesListCall) Spaces(spaces string) *ChangesListCall {
  3463  	c.urlParams_.Set("spaces", spaces)
  3464  	return c
  3465  }
  3466  
  3467  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  3468  // the requesting application supports both My Drives and shared drives.
  3469  func (c *ChangesListCall) SupportsAllDrives(supportsAllDrives bool) *ChangesListCall {
  3470  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  3471  	return c
  3472  }
  3473  
  3474  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  3475  // Deprecated: Use `supportsAllDrives` instead.
  3476  func (c *ChangesListCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesListCall {
  3477  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  3478  	return c
  3479  }
  3480  
  3481  // TeamDriveId sets the optional parameter "teamDriveId": Deprecated: Use
  3482  // `driveId` instead.
  3483  func (c *ChangesListCall) TeamDriveId(teamDriveId string) *ChangesListCall {
  3484  	c.urlParams_.Set("teamDriveId", teamDriveId)
  3485  	return c
  3486  }
  3487  
  3488  // Fields allows partial responses to be retrieved. See
  3489  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3490  // details.
  3491  func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall {
  3492  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3493  	return c
  3494  }
  3495  
  3496  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3497  // object's ETag matches the given value. This is useful for getting updates
  3498  // only after the object has changed since the last request.
  3499  func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall {
  3500  	c.ifNoneMatch_ = entityTag
  3501  	return c
  3502  }
  3503  
  3504  // Context sets the context to be used in this call's Do method.
  3505  func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall {
  3506  	c.ctx_ = ctx
  3507  	return c
  3508  }
  3509  
  3510  // Header returns a http.Header that can be modified by the caller to add
  3511  // headers to the request.
  3512  func (c *ChangesListCall) Header() http.Header {
  3513  	if c.header_ == nil {
  3514  		c.header_ = make(http.Header)
  3515  	}
  3516  	return c.header_
  3517  }
  3518  
  3519  func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) {
  3520  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3521  	if c.ifNoneMatch_ != "" {
  3522  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3523  	}
  3524  	var body io.Reader = nil
  3525  	c.urlParams_.Set("alt", alt)
  3526  	c.urlParams_.Set("prettyPrint", "false")
  3527  	urls := googleapi.ResolveRelative(c.s.BasePath, "changes")
  3528  	urls += "?" + c.urlParams_.Encode()
  3529  	req, err := http.NewRequest("GET", urls, body)
  3530  	if err != nil {
  3531  		return nil, err
  3532  	}
  3533  	req.Header = reqHeaders
  3534  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3535  }
  3536  
  3537  // Do executes the "drive.changes.list" call.
  3538  // Any non-2xx status code is an error. Response headers are in either
  3539  // *ChangeList.ServerResponse.Header or (if a response was returned at all) in
  3540  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3541  // whether the returned error was because http.StatusNotModified was returned.
  3542  func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangeList, error) {
  3543  	gensupport.SetOptions(c.urlParams_, opts...)
  3544  	res, err := c.doRequest("json")
  3545  	if res != nil && res.StatusCode == http.StatusNotModified {
  3546  		if res.Body != nil {
  3547  			res.Body.Close()
  3548  		}
  3549  		return nil, gensupport.WrapError(&googleapi.Error{
  3550  			Code:   res.StatusCode,
  3551  			Header: res.Header,
  3552  		})
  3553  	}
  3554  	if err != nil {
  3555  		return nil, err
  3556  	}
  3557  	defer googleapi.CloseBody(res)
  3558  	if err := googleapi.CheckResponse(res); err != nil {
  3559  		return nil, gensupport.WrapError(err)
  3560  	}
  3561  	ret := &ChangeList{
  3562  		ServerResponse: googleapi.ServerResponse{
  3563  			Header:         res.Header,
  3564  			HTTPStatusCode: res.StatusCode,
  3565  		},
  3566  	}
  3567  	target := &ret
  3568  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3569  		return nil, err
  3570  	}
  3571  	return ret, nil
  3572  }
  3573  
  3574  type ChangesWatchCall struct {
  3575  	s          *Service
  3576  	channel    *Channel
  3577  	urlParams_ gensupport.URLParams
  3578  	ctx_       context.Context
  3579  	header_    http.Header
  3580  }
  3581  
  3582  // Watch: Subscribes to changes for a user.
  3583  //
  3584  //   - pageToken: The token for continuing a previous list request on the next
  3585  //     page. This should be set to the value of 'nextPageToken' from the previous
  3586  //     response or to the response from the getStartPageToken method.
  3587  func (r *ChangesService) Watch(pageToken string, channel *Channel) *ChangesWatchCall {
  3588  	c := &ChangesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3589  	c.urlParams_.Set("pageToken", pageToken)
  3590  	c.channel = channel
  3591  	return c
  3592  }
  3593  
  3594  // DriveId sets the optional parameter "driveId": The shared drive from which
  3595  // changes will be returned. If specified the change IDs will be reflective of
  3596  // the shared drive; use the combined drive ID and change ID as an identifier.
  3597  func (c *ChangesWatchCall) DriveId(driveId string) *ChangesWatchCall {
  3598  	c.urlParams_.Set("driveId", driveId)
  3599  	return c
  3600  }
  3601  
  3602  // IncludeCorpusRemovals sets the optional parameter "includeCorpusRemovals":
  3603  // Whether changes should include the file resource if the file is still
  3604  // accessible by the user at the time of the request, even when a file was
  3605  // removed from the list of changes and there will be no further change entries
  3606  // for this file.
  3607  func (c *ChangesWatchCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesWatchCall {
  3608  	c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals))
  3609  	return c
  3610  }
  3611  
  3612  // IncludeItemsFromAllDrives sets the optional parameter
  3613  // "includeItemsFromAllDrives": Whether both My Drive and shared drive items
  3614  // should be included in results.
  3615  func (c *ChangesWatchCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesWatchCall {
  3616  	c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives))
  3617  	return c
  3618  }
  3619  
  3620  // IncludeLabels sets the optional parameter "includeLabels": A comma-separated
  3621  // list of IDs of labels to include in the `labelInfo` part of the response.
  3622  func (c *ChangesWatchCall) IncludeLabels(includeLabels string) *ChangesWatchCall {
  3623  	c.urlParams_.Set("includeLabels", includeLabels)
  3624  	return c
  3625  }
  3626  
  3627  // IncludePermissionsForView sets the optional parameter
  3628  // "includePermissionsForView": Specifies which additional view's permissions
  3629  // to include in the response. Only 'published' is supported.
  3630  func (c *ChangesWatchCall) IncludePermissionsForView(includePermissionsForView string) *ChangesWatchCall {
  3631  	c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
  3632  	return c
  3633  }
  3634  
  3635  // IncludeRemoved sets the optional parameter "includeRemoved": Whether to
  3636  // include changes indicating that items have been removed from the list of
  3637  // changes, for example by deletion or loss of access.
  3638  func (c *ChangesWatchCall) IncludeRemoved(includeRemoved bool) *ChangesWatchCall {
  3639  	c.urlParams_.Set("includeRemoved", fmt.Sprint(includeRemoved))
  3640  	return c
  3641  }
  3642  
  3643  // IncludeTeamDriveItems sets the optional parameter "includeTeamDriveItems":
  3644  // Deprecated: Use `includeItemsFromAllDrives` instead.
  3645  func (c *ChangesWatchCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesWatchCall {
  3646  	c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems))
  3647  	return c
  3648  }
  3649  
  3650  // PageSize sets the optional parameter "pageSize": The maximum number of
  3651  // changes to return per page.
  3652  func (c *ChangesWatchCall) PageSize(pageSize int64) *ChangesWatchCall {
  3653  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3654  	return c
  3655  }
  3656  
  3657  // RestrictToMyDrive sets the optional parameter "restrictToMyDrive": Whether
  3658  // to restrict the results to changes inside the My Drive hierarchy. This omits
  3659  // changes to files such as those in the Application Data folder or shared
  3660  // files which have not been added to My Drive.
  3661  func (c *ChangesWatchCall) RestrictToMyDrive(restrictToMyDrive bool) *ChangesWatchCall {
  3662  	c.urlParams_.Set("restrictToMyDrive", fmt.Sprint(restrictToMyDrive))
  3663  	return c
  3664  }
  3665  
  3666  // Spaces sets the optional parameter "spaces": A comma-separated list of
  3667  // spaces to query within the corpora. Supported values are 'drive' and
  3668  // 'appDataFolder'.
  3669  func (c *ChangesWatchCall) Spaces(spaces string) *ChangesWatchCall {
  3670  	c.urlParams_.Set("spaces", spaces)
  3671  	return c
  3672  }
  3673  
  3674  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  3675  // the requesting application supports both My Drives and shared drives.
  3676  func (c *ChangesWatchCall) SupportsAllDrives(supportsAllDrives bool) *ChangesWatchCall {
  3677  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  3678  	return c
  3679  }
  3680  
  3681  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  3682  // Deprecated: Use `supportsAllDrives` instead.
  3683  func (c *ChangesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesWatchCall {
  3684  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  3685  	return c
  3686  }
  3687  
  3688  // TeamDriveId sets the optional parameter "teamDriveId": Deprecated: Use
  3689  // `driveId` instead.
  3690  func (c *ChangesWatchCall) TeamDriveId(teamDriveId string) *ChangesWatchCall {
  3691  	c.urlParams_.Set("teamDriveId", teamDriveId)
  3692  	return c
  3693  }
  3694  
  3695  // Fields allows partial responses to be retrieved. See
  3696  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3697  // details.
  3698  func (c *ChangesWatchCall) Fields(s ...googleapi.Field) *ChangesWatchCall {
  3699  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3700  	return c
  3701  }
  3702  
  3703  // Context sets the context to be used in this call's Do method.
  3704  func (c *ChangesWatchCall) Context(ctx context.Context) *ChangesWatchCall {
  3705  	c.ctx_ = ctx
  3706  	return c
  3707  }
  3708  
  3709  // Header returns a http.Header that can be modified by the caller to add
  3710  // headers to the request.
  3711  func (c *ChangesWatchCall) Header() http.Header {
  3712  	if c.header_ == nil {
  3713  		c.header_ = make(http.Header)
  3714  	}
  3715  	return c.header_
  3716  }
  3717  
  3718  func (c *ChangesWatchCall) doRequest(alt string) (*http.Response, error) {
  3719  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3720  	var body io.Reader = nil
  3721  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  3722  	if err != nil {
  3723  		return nil, err
  3724  	}
  3725  	c.urlParams_.Set("alt", alt)
  3726  	c.urlParams_.Set("prettyPrint", "false")
  3727  	urls := googleapi.ResolveRelative(c.s.BasePath, "changes/watch")
  3728  	urls += "?" + c.urlParams_.Encode()
  3729  	req, err := http.NewRequest("POST", urls, body)
  3730  	if err != nil {
  3731  		return nil, err
  3732  	}
  3733  	req.Header = reqHeaders
  3734  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3735  }
  3736  
  3737  // Do executes the "drive.changes.watch" call.
  3738  // Any non-2xx status code is an error. Response headers are in either
  3739  // *Channel.ServerResponse.Header or (if a response was returned at all) in
  3740  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3741  // whether the returned error was because http.StatusNotModified was returned.
  3742  func (c *ChangesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  3743  	gensupport.SetOptions(c.urlParams_, opts...)
  3744  	res, err := c.doRequest("json")
  3745  	if res != nil && res.StatusCode == http.StatusNotModified {
  3746  		if res.Body != nil {
  3747  			res.Body.Close()
  3748  		}
  3749  		return nil, gensupport.WrapError(&googleapi.Error{
  3750  			Code:   res.StatusCode,
  3751  			Header: res.Header,
  3752  		})
  3753  	}
  3754  	if err != nil {
  3755  		return nil, err
  3756  	}
  3757  	defer googleapi.CloseBody(res)
  3758  	if err := googleapi.CheckResponse(res); err != nil {
  3759  		return nil, gensupport.WrapError(err)
  3760  	}
  3761  	ret := &Channel{
  3762  		ServerResponse: googleapi.ServerResponse{
  3763  			Header:         res.Header,
  3764  			HTTPStatusCode: res.StatusCode,
  3765  		},
  3766  	}
  3767  	target := &ret
  3768  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3769  		return nil, err
  3770  	}
  3771  	return ret, nil
  3772  }
  3773  
  3774  type ChannelsStopCall struct {
  3775  	s          *Service
  3776  	channel    *Channel
  3777  	urlParams_ gensupport.URLParams
  3778  	ctx_       context.Context
  3779  	header_    http.Header
  3780  }
  3781  
  3782  // Stop: Stops watching resources through this channel.
  3783  func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
  3784  	c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3785  	c.channel = channel
  3786  	return c
  3787  }
  3788  
  3789  // Fields allows partial responses to be retrieved. See
  3790  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3791  // details.
  3792  func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
  3793  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3794  	return c
  3795  }
  3796  
  3797  // Context sets the context to be used in this call's Do method.
  3798  func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
  3799  	c.ctx_ = ctx
  3800  	return c
  3801  }
  3802  
  3803  // Header returns a http.Header that can be modified by the caller to add
  3804  // headers to the request.
  3805  func (c *ChannelsStopCall) Header() http.Header {
  3806  	if c.header_ == nil {
  3807  		c.header_ = make(http.Header)
  3808  	}
  3809  	return c.header_
  3810  }
  3811  
  3812  func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
  3813  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3814  	var body io.Reader = nil
  3815  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  3816  	if err != nil {
  3817  		return nil, err
  3818  	}
  3819  	c.urlParams_.Set("alt", alt)
  3820  	c.urlParams_.Set("prettyPrint", "false")
  3821  	urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
  3822  	urls += "?" + c.urlParams_.Encode()
  3823  	req, err := http.NewRequest("POST", urls, body)
  3824  	if err != nil {
  3825  		return nil, err
  3826  	}
  3827  	req.Header = reqHeaders
  3828  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3829  }
  3830  
  3831  // Do executes the "drive.channels.stop" call.
  3832  func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
  3833  	gensupport.SetOptions(c.urlParams_, opts...)
  3834  	res, err := c.doRequest("json")
  3835  	if err != nil {
  3836  		return err
  3837  	}
  3838  	defer googleapi.CloseBody(res)
  3839  	if err := googleapi.CheckResponse(res); err != nil {
  3840  		return gensupport.WrapError(err)
  3841  	}
  3842  	return nil
  3843  }
  3844  
  3845  type CommentsCreateCall struct {
  3846  	s          *Service
  3847  	fileId     string
  3848  	comment    *Comment
  3849  	urlParams_ gensupport.URLParams
  3850  	ctx_       context.Context
  3851  	header_    http.Header
  3852  }
  3853  
  3854  // Create: Creates a comment on a file.
  3855  //
  3856  // - fileId: The ID of the file.
  3857  func (r *CommentsService) Create(fileId string, comment *Comment) *CommentsCreateCall {
  3858  	c := &CommentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3859  	c.fileId = fileId
  3860  	c.comment = comment
  3861  	return c
  3862  }
  3863  
  3864  // Fields allows partial responses to be retrieved. See
  3865  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3866  // details.
  3867  func (c *CommentsCreateCall) Fields(s ...googleapi.Field) *CommentsCreateCall {
  3868  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3869  	return c
  3870  }
  3871  
  3872  // Context sets the context to be used in this call's Do method.
  3873  func (c *CommentsCreateCall) Context(ctx context.Context) *CommentsCreateCall {
  3874  	c.ctx_ = ctx
  3875  	return c
  3876  }
  3877  
  3878  // Header returns a http.Header that can be modified by the caller to add
  3879  // headers to the request.
  3880  func (c *CommentsCreateCall) Header() http.Header {
  3881  	if c.header_ == nil {
  3882  		c.header_ = make(http.Header)
  3883  	}
  3884  	return c.header_
  3885  }
  3886  
  3887  func (c *CommentsCreateCall) doRequest(alt string) (*http.Response, error) {
  3888  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3889  	var body io.Reader = nil
  3890  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
  3891  	if err != nil {
  3892  		return nil, err
  3893  	}
  3894  	c.urlParams_.Set("alt", alt)
  3895  	c.urlParams_.Set("prettyPrint", "false")
  3896  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments")
  3897  	urls += "?" + c.urlParams_.Encode()
  3898  	req, err := http.NewRequest("POST", urls, body)
  3899  	if err != nil {
  3900  		return nil, err
  3901  	}
  3902  	req.Header = reqHeaders
  3903  	googleapi.Expand(req.URL, map[string]string{
  3904  		"fileId": c.fileId,
  3905  	})
  3906  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3907  }
  3908  
  3909  // Do executes the "drive.comments.create" call.
  3910  // Any non-2xx status code is an error. Response headers are in either
  3911  // *Comment.ServerResponse.Header or (if a response was returned at all) in
  3912  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3913  // whether the returned error was because http.StatusNotModified was returned.
  3914  func (c *CommentsCreateCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  3915  	gensupport.SetOptions(c.urlParams_, opts...)
  3916  	res, err := c.doRequest("json")
  3917  	if res != nil && res.StatusCode == http.StatusNotModified {
  3918  		if res.Body != nil {
  3919  			res.Body.Close()
  3920  		}
  3921  		return nil, gensupport.WrapError(&googleapi.Error{
  3922  			Code:   res.StatusCode,
  3923  			Header: res.Header,
  3924  		})
  3925  	}
  3926  	if err != nil {
  3927  		return nil, err
  3928  	}
  3929  	defer googleapi.CloseBody(res)
  3930  	if err := googleapi.CheckResponse(res); err != nil {
  3931  		return nil, gensupport.WrapError(err)
  3932  	}
  3933  	ret := &Comment{
  3934  		ServerResponse: googleapi.ServerResponse{
  3935  			Header:         res.Header,
  3936  			HTTPStatusCode: res.StatusCode,
  3937  		},
  3938  	}
  3939  	target := &ret
  3940  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3941  		return nil, err
  3942  	}
  3943  	return ret, nil
  3944  }
  3945  
  3946  type CommentsDeleteCall struct {
  3947  	s          *Service
  3948  	fileId     string
  3949  	commentId  string
  3950  	urlParams_ gensupport.URLParams
  3951  	ctx_       context.Context
  3952  	header_    http.Header
  3953  }
  3954  
  3955  // Delete: Deletes a comment.
  3956  //
  3957  // - commentId: The ID of the comment.
  3958  // - fileId: The ID of the file.
  3959  func (r *CommentsService) Delete(fileId string, commentId string) *CommentsDeleteCall {
  3960  	c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3961  	c.fileId = fileId
  3962  	c.commentId = commentId
  3963  	return c
  3964  }
  3965  
  3966  // Fields allows partial responses to be retrieved. See
  3967  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3968  // details.
  3969  func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall {
  3970  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3971  	return c
  3972  }
  3973  
  3974  // Context sets the context to be used in this call's Do method.
  3975  func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall {
  3976  	c.ctx_ = ctx
  3977  	return c
  3978  }
  3979  
  3980  // Header returns a http.Header that can be modified by the caller to add
  3981  // headers to the request.
  3982  func (c *CommentsDeleteCall) Header() http.Header {
  3983  	if c.header_ == nil {
  3984  		c.header_ = make(http.Header)
  3985  	}
  3986  	return c.header_
  3987  }
  3988  
  3989  func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3990  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3991  	var body io.Reader = nil
  3992  	c.urlParams_.Set("alt", alt)
  3993  	c.urlParams_.Set("prettyPrint", "false")
  3994  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}")
  3995  	urls += "?" + c.urlParams_.Encode()
  3996  	req, err := http.NewRequest("DELETE", urls, body)
  3997  	if err != nil {
  3998  		return nil, err
  3999  	}
  4000  	req.Header = reqHeaders
  4001  	googleapi.Expand(req.URL, map[string]string{
  4002  		"fileId":    c.fileId,
  4003  		"commentId": c.commentId,
  4004  	})
  4005  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4006  }
  4007  
  4008  // Do executes the "drive.comments.delete" call.
  4009  func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error {
  4010  	gensupport.SetOptions(c.urlParams_, opts...)
  4011  	res, err := c.doRequest("json")
  4012  	if err != nil {
  4013  		return err
  4014  	}
  4015  	defer googleapi.CloseBody(res)
  4016  	if err := googleapi.CheckResponse(res); err != nil {
  4017  		return gensupport.WrapError(err)
  4018  	}
  4019  	return nil
  4020  }
  4021  
  4022  type CommentsGetCall struct {
  4023  	s            *Service
  4024  	fileId       string
  4025  	commentId    string
  4026  	urlParams_   gensupport.URLParams
  4027  	ifNoneMatch_ string
  4028  	ctx_         context.Context
  4029  	header_      http.Header
  4030  }
  4031  
  4032  // Get: Gets a comment by ID.
  4033  //
  4034  // - commentId: The ID of the comment.
  4035  // - fileId: The ID of the file.
  4036  func (r *CommentsService) Get(fileId string, commentId string) *CommentsGetCall {
  4037  	c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4038  	c.fileId = fileId
  4039  	c.commentId = commentId
  4040  	return c
  4041  }
  4042  
  4043  // IncludeDeleted sets the optional parameter "includeDeleted": Whether to
  4044  // return deleted comments. Deleted comments will not include their original
  4045  // content.
  4046  func (c *CommentsGetCall) IncludeDeleted(includeDeleted bool) *CommentsGetCall {
  4047  	c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
  4048  	return c
  4049  }
  4050  
  4051  // Fields allows partial responses to be retrieved. See
  4052  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4053  // details.
  4054  func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall {
  4055  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4056  	return c
  4057  }
  4058  
  4059  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4060  // object's ETag matches the given value. This is useful for getting updates
  4061  // only after the object has changed since the last request.
  4062  func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall {
  4063  	c.ifNoneMatch_ = entityTag
  4064  	return c
  4065  }
  4066  
  4067  // Context sets the context to be used in this call's Do method.
  4068  func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall {
  4069  	c.ctx_ = ctx
  4070  	return c
  4071  }
  4072  
  4073  // Header returns a http.Header that can be modified by the caller to add
  4074  // headers to the request.
  4075  func (c *CommentsGetCall) Header() http.Header {
  4076  	if c.header_ == nil {
  4077  		c.header_ = make(http.Header)
  4078  	}
  4079  	return c.header_
  4080  }
  4081  
  4082  func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) {
  4083  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4084  	if c.ifNoneMatch_ != "" {
  4085  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4086  	}
  4087  	var body io.Reader = nil
  4088  	c.urlParams_.Set("alt", alt)
  4089  	c.urlParams_.Set("prettyPrint", "false")
  4090  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}")
  4091  	urls += "?" + c.urlParams_.Encode()
  4092  	req, err := http.NewRequest("GET", urls, body)
  4093  	if err != nil {
  4094  		return nil, err
  4095  	}
  4096  	req.Header = reqHeaders
  4097  	googleapi.Expand(req.URL, map[string]string{
  4098  		"fileId":    c.fileId,
  4099  		"commentId": c.commentId,
  4100  	})
  4101  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4102  }
  4103  
  4104  // Do executes the "drive.comments.get" call.
  4105  // Any non-2xx status code is an error. Response headers are in either
  4106  // *Comment.ServerResponse.Header or (if a response was returned at all) in
  4107  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4108  // whether the returned error was because http.StatusNotModified was returned.
  4109  func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  4110  	gensupport.SetOptions(c.urlParams_, opts...)
  4111  	res, err := c.doRequest("json")
  4112  	if res != nil && res.StatusCode == http.StatusNotModified {
  4113  		if res.Body != nil {
  4114  			res.Body.Close()
  4115  		}
  4116  		return nil, gensupport.WrapError(&googleapi.Error{
  4117  			Code:   res.StatusCode,
  4118  			Header: res.Header,
  4119  		})
  4120  	}
  4121  	if err != nil {
  4122  		return nil, err
  4123  	}
  4124  	defer googleapi.CloseBody(res)
  4125  	if err := googleapi.CheckResponse(res); err != nil {
  4126  		return nil, gensupport.WrapError(err)
  4127  	}
  4128  	ret := &Comment{
  4129  		ServerResponse: googleapi.ServerResponse{
  4130  			Header:         res.Header,
  4131  			HTTPStatusCode: res.StatusCode,
  4132  		},
  4133  	}
  4134  	target := &ret
  4135  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4136  		return nil, err
  4137  	}
  4138  	return ret, nil
  4139  }
  4140  
  4141  type CommentsListCall struct {
  4142  	s            *Service
  4143  	fileId       string
  4144  	urlParams_   gensupport.URLParams
  4145  	ifNoneMatch_ string
  4146  	ctx_         context.Context
  4147  	header_      http.Header
  4148  }
  4149  
  4150  // List: Lists a file's comments.
  4151  //
  4152  // - fileId: The ID of the file.
  4153  func (r *CommentsService) List(fileId string) *CommentsListCall {
  4154  	c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4155  	c.fileId = fileId
  4156  	return c
  4157  }
  4158  
  4159  // IncludeDeleted sets the optional parameter "includeDeleted": Whether to
  4160  // include deleted comments. Deleted comments will not include their original
  4161  // content.
  4162  func (c *CommentsListCall) IncludeDeleted(includeDeleted bool) *CommentsListCall {
  4163  	c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
  4164  	return c
  4165  }
  4166  
  4167  // PageSize sets the optional parameter "pageSize": The maximum number of
  4168  // comments to return per page.
  4169  func (c *CommentsListCall) PageSize(pageSize int64) *CommentsListCall {
  4170  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4171  	return c
  4172  }
  4173  
  4174  // PageToken sets the optional parameter "pageToken": The token for continuing
  4175  // a previous list request on the next page. This should be set to the value of
  4176  // 'nextPageToken' from the previous response.
  4177  func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall {
  4178  	c.urlParams_.Set("pageToken", pageToken)
  4179  	return c
  4180  }
  4181  
  4182  // StartModifiedTime sets the optional parameter "startModifiedTime": The
  4183  // minimum value of 'modifiedTime' for the result comments (RFC 3339
  4184  // date-time).
  4185  func (c *CommentsListCall) StartModifiedTime(startModifiedTime string) *CommentsListCall {
  4186  	c.urlParams_.Set("startModifiedTime", startModifiedTime)
  4187  	return c
  4188  }
  4189  
  4190  // Fields allows partial responses to be retrieved. See
  4191  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4192  // details.
  4193  func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall {
  4194  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4195  	return c
  4196  }
  4197  
  4198  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4199  // object's ETag matches the given value. This is useful for getting updates
  4200  // only after the object has changed since the last request.
  4201  func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall {
  4202  	c.ifNoneMatch_ = entityTag
  4203  	return c
  4204  }
  4205  
  4206  // Context sets the context to be used in this call's Do method.
  4207  func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall {
  4208  	c.ctx_ = ctx
  4209  	return c
  4210  }
  4211  
  4212  // Header returns a http.Header that can be modified by the caller to add
  4213  // headers to the request.
  4214  func (c *CommentsListCall) Header() http.Header {
  4215  	if c.header_ == nil {
  4216  		c.header_ = make(http.Header)
  4217  	}
  4218  	return c.header_
  4219  }
  4220  
  4221  func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) {
  4222  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4223  	if c.ifNoneMatch_ != "" {
  4224  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4225  	}
  4226  	var body io.Reader = nil
  4227  	c.urlParams_.Set("alt", alt)
  4228  	c.urlParams_.Set("prettyPrint", "false")
  4229  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments")
  4230  	urls += "?" + c.urlParams_.Encode()
  4231  	req, err := http.NewRequest("GET", urls, body)
  4232  	if err != nil {
  4233  		return nil, err
  4234  	}
  4235  	req.Header = reqHeaders
  4236  	googleapi.Expand(req.URL, map[string]string{
  4237  		"fileId": c.fileId,
  4238  	})
  4239  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4240  }
  4241  
  4242  // Do executes the "drive.comments.list" call.
  4243  // Any non-2xx status code is an error. Response headers are in either
  4244  // *CommentList.ServerResponse.Header or (if a response was returned at all) in
  4245  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4246  // whether the returned error was because http.StatusNotModified was returned.
  4247  func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) {
  4248  	gensupport.SetOptions(c.urlParams_, opts...)
  4249  	res, err := c.doRequest("json")
  4250  	if res != nil && res.StatusCode == http.StatusNotModified {
  4251  		if res.Body != nil {
  4252  			res.Body.Close()
  4253  		}
  4254  		return nil, gensupport.WrapError(&googleapi.Error{
  4255  			Code:   res.StatusCode,
  4256  			Header: res.Header,
  4257  		})
  4258  	}
  4259  	if err != nil {
  4260  		return nil, err
  4261  	}
  4262  	defer googleapi.CloseBody(res)
  4263  	if err := googleapi.CheckResponse(res); err != nil {
  4264  		return nil, gensupport.WrapError(err)
  4265  	}
  4266  	ret := &CommentList{
  4267  		ServerResponse: googleapi.ServerResponse{
  4268  			Header:         res.Header,
  4269  			HTTPStatusCode: res.StatusCode,
  4270  		},
  4271  	}
  4272  	target := &ret
  4273  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4274  		return nil, err
  4275  	}
  4276  	return ret, nil
  4277  }
  4278  
  4279  // Pages invokes f for each page of results.
  4280  // A non-nil error returned from f will halt the iteration.
  4281  // The provided context supersedes any context provided to the Context method.
  4282  func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error {
  4283  	c.ctx_ = ctx
  4284  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4285  	for {
  4286  		x, err := c.Do()
  4287  		if err != nil {
  4288  			return err
  4289  		}
  4290  		if err := f(x); err != nil {
  4291  			return err
  4292  		}
  4293  		if x.NextPageToken == "" {
  4294  			return nil
  4295  		}
  4296  		c.PageToken(x.NextPageToken)
  4297  	}
  4298  }
  4299  
  4300  type CommentsUpdateCall struct {
  4301  	s          *Service
  4302  	fileId     string
  4303  	commentId  string
  4304  	comment    *Comment
  4305  	urlParams_ gensupport.URLParams
  4306  	ctx_       context.Context
  4307  	header_    http.Header
  4308  }
  4309  
  4310  // Update: Updates a comment with patch semantics.
  4311  //
  4312  // - commentId: The ID of the comment.
  4313  // - fileId: The ID of the file.
  4314  func (r *CommentsService) Update(fileId string, commentId string, comment *Comment) *CommentsUpdateCall {
  4315  	c := &CommentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4316  	c.fileId = fileId
  4317  	c.commentId = commentId
  4318  	c.comment = comment
  4319  	return c
  4320  }
  4321  
  4322  // Fields allows partial responses to be retrieved. See
  4323  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4324  // details.
  4325  func (c *CommentsUpdateCall) Fields(s ...googleapi.Field) *CommentsUpdateCall {
  4326  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4327  	return c
  4328  }
  4329  
  4330  // Context sets the context to be used in this call's Do method.
  4331  func (c *CommentsUpdateCall) Context(ctx context.Context) *CommentsUpdateCall {
  4332  	c.ctx_ = ctx
  4333  	return c
  4334  }
  4335  
  4336  // Header returns a http.Header that can be modified by the caller to add
  4337  // headers to the request.
  4338  func (c *CommentsUpdateCall) Header() http.Header {
  4339  	if c.header_ == nil {
  4340  		c.header_ = make(http.Header)
  4341  	}
  4342  	return c.header_
  4343  }
  4344  
  4345  func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) {
  4346  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4347  	var body io.Reader = nil
  4348  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment)
  4349  	if err != nil {
  4350  		return nil, err
  4351  	}
  4352  	c.urlParams_.Set("alt", alt)
  4353  	c.urlParams_.Set("prettyPrint", "false")
  4354  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}")
  4355  	urls += "?" + c.urlParams_.Encode()
  4356  	req, err := http.NewRequest("PATCH", urls, body)
  4357  	if err != nil {
  4358  		return nil, err
  4359  	}
  4360  	req.Header = reqHeaders
  4361  	googleapi.Expand(req.URL, map[string]string{
  4362  		"fileId":    c.fileId,
  4363  		"commentId": c.commentId,
  4364  	})
  4365  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4366  }
  4367  
  4368  // Do executes the "drive.comments.update" call.
  4369  // Any non-2xx status code is an error. Response headers are in either
  4370  // *Comment.ServerResponse.Header or (if a response was returned at all) in
  4371  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4372  // whether the returned error was because http.StatusNotModified was returned.
  4373  func (c *CommentsUpdateCall) Do(opts ...googleapi.CallOption) (*Comment, error) {
  4374  	gensupport.SetOptions(c.urlParams_, opts...)
  4375  	res, err := c.doRequest("json")
  4376  	if res != nil && res.StatusCode == http.StatusNotModified {
  4377  		if res.Body != nil {
  4378  			res.Body.Close()
  4379  		}
  4380  		return nil, gensupport.WrapError(&googleapi.Error{
  4381  			Code:   res.StatusCode,
  4382  			Header: res.Header,
  4383  		})
  4384  	}
  4385  	if err != nil {
  4386  		return nil, err
  4387  	}
  4388  	defer googleapi.CloseBody(res)
  4389  	if err := googleapi.CheckResponse(res); err != nil {
  4390  		return nil, gensupport.WrapError(err)
  4391  	}
  4392  	ret := &Comment{
  4393  		ServerResponse: googleapi.ServerResponse{
  4394  			Header:         res.Header,
  4395  			HTTPStatusCode: res.StatusCode,
  4396  		},
  4397  	}
  4398  	target := &ret
  4399  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4400  		return nil, err
  4401  	}
  4402  	return ret, nil
  4403  }
  4404  
  4405  type DrivesCreateCall struct {
  4406  	s          *Service
  4407  	drive      *Drive
  4408  	urlParams_ gensupport.URLParams
  4409  	ctx_       context.Context
  4410  	header_    http.Header
  4411  }
  4412  
  4413  // Create: Creates a shared drive.
  4414  //
  4415  //   - requestId: An ID, such as a random UUID, which uniquely identifies this
  4416  //     user's request for idempotent creation of a shared drive. A repeated
  4417  //     request by the same user and with the same request ID will avoid creating
  4418  //     duplicates by attempting to create the same shared drive. If the shared
  4419  //     drive already exists a 409 error will be returned.
  4420  func (r *DrivesService) Create(requestId string, drive *Drive) *DrivesCreateCall {
  4421  	c := &DrivesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4422  	c.urlParams_.Set("requestId", requestId)
  4423  	c.drive = drive
  4424  	return c
  4425  }
  4426  
  4427  // Fields allows partial responses to be retrieved. See
  4428  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4429  // details.
  4430  func (c *DrivesCreateCall) Fields(s ...googleapi.Field) *DrivesCreateCall {
  4431  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4432  	return c
  4433  }
  4434  
  4435  // Context sets the context to be used in this call's Do method.
  4436  func (c *DrivesCreateCall) Context(ctx context.Context) *DrivesCreateCall {
  4437  	c.ctx_ = ctx
  4438  	return c
  4439  }
  4440  
  4441  // Header returns a http.Header that can be modified by the caller to add
  4442  // headers to the request.
  4443  func (c *DrivesCreateCall) Header() http.Header {
  4444  	if c.header_ == nil {
  4445  		c.header_ = make(http.Header)
  4446  	}
  4447  	return c.header_
  4448  }
  4449  
  4450  func (c *DrivesCreateCall) doRequest(alt string) (*http.Response, error) {
  4451  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4452  	var body io.Reader = nil
  4453  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive)
  4454  	if err != nil {
  4455  		return nil, err
  4456  	}
  4457  	c.urlParams_.Set("alt", alt)
  4458  	c.urlParams_.Set("prettyPrint", "false")
  4459  	urls := googleapi.ResolveRelative(c.s.BasePath, "drives")
  4460  	urls += "?" + c.urlParams_.Encode()
  4461  	req, err := http.NewRequest("POST", urls, body)
  4462  	if err != nil {
  4463  		return nil, err
  4464  	}
  4465  	req.Header = reqHeaders
  4466  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4467  }
  4468  
  4469  // Do executes the "drive.drives.create" call.
  4470  // Any non-2xx status code is an error. Response headers are in either
  4471  // *Drive.ServerResponse.Header or (if a response was returned at all) in
  4472  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4473  // whether the returned error was because http.StatusNotModified was returned.
  4474  func (c *DrivesCreateCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
  4475  	gensupport.SetOptions(c.urlParams_, opts...)
  4476  	res, err := c.doRequest("json")
  4477  	if res != nil && res.StatusCode == http.StatusNotModified {
  4478  		if res.Body != nil {
  4479  			res.Body.Close()
  4480  		}
  4481  		return nil, gensupport.WrapError(&googleapi.Error{
  4482  			Code:   res.StatusCode,
  4483  			Header: res.Header,
  4484  		})
  4485  	}
  4486  	if err != nil {
  4487  		return nil, err
  4488  	}
  4489  	defer googleapi.CloseBody(res)
  4490  	if err := googleapi.CheckResponse(res); err != nil {
  4491  		return nil, gensupport.WrapError(err)
  4492  	}
  4493  	ret := &Drive{
  4494  		ServerResponse: googleapi.ServerResponse{
  4495  			Header:         res.Header,
  4496  			HTTPStatusCode: res.StatusCode,
  4497  		},
  4498  	}
  4499  	target := &ret
  4500  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4501  		return nil, err
  4502  	}
  4503  	return ret, nil
  4504  }
  4505  
  4506  type DrivesDeleteCall struct {
  4507  	s          *Service
  4508  	driveId    string
  4509  	urlParams_ gensupport.URLParams
  4510  	ctx_       context.Context
  4511  	header_    http.Header
  4512  }
  4513  
  4514  // Delete: Permanently deletes a shared drive for which the user is an
  4515  // `organizer`. The shared drive cannot contain any untrashed items.
  4516  //
  4517  // - driveId: The ID of the shared drive.
  4518  func (r *DrivesService) Delete(driveId string) *DrivesDeleteCall {
  4519  	c := &DrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4520  	c.driveId = driveId
  4521  	return c
  4522  }
  4523  
  4524  // AllowItemDeletion sets the optional parameter "allowItemDeletion": Whether
  4525  // any items inside the shared drive should also be deleted. This option is
  4526  // only supported when `useDomainAdminAccess` is also set to `true`.
  4527  func (c *DrivesDeleteCall) AllowItemDeletion(allowItemDeletion bool) *DrivesDeleteCall {
  4528  	c.urlParams_.Set("allowItemDeletion", fmt.Sprint(allowItemDeletion))
  4529  	return c
  4530  }
  4531  
  4532  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  4533  // Issue the request as a domain administrator; if set to true, then the
  4534  // requester will be granted access if they are an administrator of the domain
  4535  // to which the shared drive belongs.
  4536  func (c *DrivesDeleteCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesDeleteCall {
  4537  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  4538  	return c
  4539  }
  4540  
  4541  // Fields allows partial responses to be retrieved. See
  4542  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4543  // details.
  4544  func (c *DrivesDeleteCall) Fields(s ...googleapi.Field) *DrivesDeleteCall {
  4545  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4546  	return c
  4547  }
  4548  
  4549  // Context sets the context to be used in this call's Do method.
  4550  func (c *DrivesDeleteCall) Context(ctx context.Context) *DrivesDeleteCall {
  4551  	c.ctx_ = ctx
  4552  	return c
  4553  }
  4554  
  4555  // Header returns a http.Header that can be modified by the caller to add
  4556  // headers to the request.
  4557  func (c *DrivesDeleteCall) Header() http.Header {
  4558  	if c.header_ == nil {
  4559  		c.header_ = make(http.Header)
  4560  	}
  4561  	return c.header_
  4562  }
  4563  
  4564  func (c *DrivesDeleteCall) doRequest(alt string) (*http.Response, error) {
  4565  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4566  	var body io.Reader = nil
  4567  	c.urlParams_.Set("alt", alt)
  4568  	c.urlParams_.Set("prettyPrint", "false")
  4569  	urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}")
  4570  	urls += "?" + c.urlParams_.Encode()
  4571  	req, err := http.NewRequest("DELETE", urls, body)
  4572  	if err != nil {
  4573  		return nil, err
  4574  	}
  4575  	req.Header = reqHeaders
  4576  	googleapi.Expand(req.URL, map[string]string{
  4577  		"driveId": c.driveId,
  4578  	})
  4579  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4580  }
  4581  
  4582  // Do executes the "drive.drives.delete" call.
  4583  func (c *DrivesDeleteCall) Do(opts ...googleapi.CallOption) error {
  4584  	gensupport.SetOptions(c.urlParams_, opts...)
  4585  	res, err := c.doRequest("json")
  4586  	if err != nil {
  4587  		return err
  4588  	}
  4589  	defer googleapi.CloseBody(res)
  4590  	if err := googleapi.CheckResponse(res); err != nil {
  4591  		return gensupport.WrapError(err)
  4592  	}
  4593  	return nil
  4594  }
  4595  
  4596  type DrivesGetCall struct {
  4597  	s            *Service
  4598  	driveId      string
  4599  	urlParams_   gensupport.URLParams
  4600  	ifNoneMatch_ string
  4601  	ctx_         context.Context
  4602  	header_      http.Header
  4603  }
  4604  
  4605  // Get: Gets a shared drive's metadata by ID.
  4606  //
  4607  // - driveId: The ID of the shared drive.
  4608  func (r *DrivesService) Get(driveId string) *DrivesGetCall {
  4609  	c := &DrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4610  	c.driveId = driveId
  4611  	return c
  4612  }
  4613  
  4614  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  4615  // Issue the request as a domain administrator; if set to true, then the
  4616  // requester will be granted access if they are an administrator of the domain
  4617  // to which the shared drive belongs.
  4618  func (c *DrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesGetCall {
  4619  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  4620  	return c
  4621  }
  4622  
  4623  // Fields allows partial responses to be retrieved. See
  4624  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4625  // details.
  4626  func (c *DrivesGetCall) Fields(s ...googleapi.Field) *DrivesGetCall {
  4627  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4628  	return c
  4629  }
  4630  
  4631  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4632  // object's ETag matches the given value. This is useful for getting updates
  4633  // only after the object has changed since the last request.
  4634  func (c *DrivesGetCall) IfNoneMatch(entityTag string) *DrivesGetCall {
  4635  	c.ifNoneMatch_ = entityTag
  4636  	return c
  4637  }
  4638  
  4639  // Context sets the context to be used in this call's Do method.
  4640  func (c *DrivesGetCall) Context(ctx context.Context) *DrivesGetCall {
  4641  	c.ctx_ = ctx
  4642  	return c
  4643  }
  4644  
  4645  // Header returns a http.Header that can be modified by the caller to add
  4646  // headers to the request.
  4647  func (c *DrivesGetCall) Header() http.Header {
  4648  	if c.header_ == nil {
  4649  		c.header_ = make(http.Header)
  4650  	}
  4651  	return c.header_
  4652  }
  4653  
  4654  func (c *DrivesGetCall) doRequest(alt string) (*http.Response, error) {
  4655  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4656  	if c.ifNoneMatch_ != "" {
  4657  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4658  	}
  4659  	var body io.Reader = nil
  4660  	c.urlParams_.Set("alt", alt)
  4661  	c.urlParams_.Set("prettyPrint", "false")
  4662  	urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}")
  4663  	urls += "?" + c.urlParams_.Encode()
  4664  	req, err := http.NewRequest("GET", urls, body)
  4665  	if err != nil {
  4666  		return nil, err
  4667  	}
  4668  	req.Header = reqHeaders
  4669  	googleapi.Expand(req.URL, map[string]string{
  4670  		"driveId": c.driveId,
  4671  	})
  4672  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4673  }
  4674  
  4675  // Do executes the "drive.drives.get" call.
  4676  // Any non-2xx status code is an error. Response headers are in either
  4677  // *Drive.ServerResponse.Header or (if a response was returned at all) in
  4678  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4679  // whether the returned error was because http.StatusNotModified was returned.
  4680  func (c *DrivesGetCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
  4681  	gensupport.SetOptions(c.urlParams_, opts...)
  4682  	res, err := c.doRequest("json")
  4683  	if res != nil && res.StatusCode == http.StatusNotModified {
  4684  		if res.Body != nil {
  4685  			res.Body.Close()
  4686  		}
  4687  		return nil, gensupport.WrapError(&googleapi.Error{
  4688  			Code:   res.StatusCode,
  4689  			Header: res.Header,
  4690  		})
  4691  	}
  4692  	if err != nil {
  4693  		return nil, err
  4694  	}
  4695  	defer googleapi.CloseBody(res)
  4696  	if err := googleapi.CheckResponse(res); err != nil {
  4697  		return nil, gensupport.WrapError(err)
  4698  	}
  4699  	ret := &Drive{
  4700  		ServerResponse: googleapi.ServerResponse{
  4701  			Header:         res.Header,
  4702  			HTTPStatusCode: res.StatusCode,
  4703  		},
  4704  	}
  4705  	target := &ret
  4706  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4707  		return nil, err
  4708  	}
  4709  	return ret, nil
  4710  }
  4711  
  4712  type DrivesHideCall struct {
  4713  	s          *Service
  4714  	driveId    string
  4715  	urlParams_ gensupport.URLParams
  4716  	ctx_       context.Context
  4717  	header_    http.Header
  4718  }
  4719  
  4720  // Hide: Hides a shared drive from the default view.
  4721  //
  4722  // - driveId: The ID of the shared drive.
  4723  func (r *DrivesService) Hide(driveId string) *DrivesHideCall {
  4724  	c := &DrivesHideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4725  	c.driveId = driveId
  4726  	return c
  4727  }
  4728  
  4729  // Fields allows partial responses to be retrieved. See
  4730  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4731  // details.
  4732  func (c *DrivesHideCall) Fields(s ...googleapi.Field) *DrivesHideCall {
  4733  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4734  	return c
  4735  }
  4736  
  4737  // Context sets the context to be used in this call's Do method.
  4738  func (c *DrivesHideCall) Context(ctx context.Context) *DrivesHideCall {
  4739  	c.ctx_ = ctx
  4740  	return c
  4741  }
  4742  
  4743  // Header returns a http.Header that can be modified by the caller to add
  4744  // headers to the request.
  4745  func (c *DrivesHideCall) Header() http.Header {
  4746  	if c.header_ == nil {
  4747  		c.header_ = make(http.Header)
  4748  	}
  4749  	return c.header_
  4750  }
  4751  
  4752  func (c *DrivesHideCall) doRequest(alt string) (*http.Response, error) {
  4753  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4754  	var body io.Reader = nil
  4755  	c.urlParams_.Set("alt", alt)
  4756  	c.urlParams_.Set("prettyPrint", "false")
  4757  	urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/hide")
  4758  	urls += "?" + c.urlParams_.Encode()
  4759  	req, err := http.NewRequest("POST", urls, body)
  4760  	if err != nil {
  4761  		return nil, err
  4762  	}
  4763  	req.Header = reqHeaders
  4764  	googleapi.Expand(req.URL, map[string]string{
  4765  		"driveId": c.driveId,
  4766  	})
  4767  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4768  }
  4769  
  4770  // Do executes the "drive.drives.hide" call.
  4771  // Any non-2xx status code is an error. Response headers are in either
  4772  // *Drive.ServerResponse.Header or (if a response was returned at all) in
  4773  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4774  // whether the returned error was because http.StatusNotModified was returned.
  4775  func (c *DrivesHideCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
  4776  	gensupport.SetOptions(c.urlParams_, opts...)
  4777  	res, err := c.doRequest("json")
  4778  	if res != nil && res.StatusCode == http.StatusNotModified {
  4779  		if res.Body != nil {
  4780  			res.Body.Close()
  4781  		}
  4782  		return nil, gensupport.WrapError(&googleapi.Error{
  4783  			Code:   res.StatusCode,
  4784  			Header: res.Header,
  4785  		})
  4786  	}
  4787  	if err != nil {
  4788  		return nil, err
  4789  	}
  4790  	defer googleapi.CloseBody(res)
  4791  	if err := googleapi.CheckResponse(res); err != nil {
  4792  		return nil, gensupport.WrapError(err)
  4793  	}
  4794  	ret := &Drive{
  4795  		ServerResponse: googleapi.ServerResponse{
  4796  			Header:         res.Header,
  4797  			HTTPStatusCode: res.StatusCode,
  4798  		},
  4799  	}
  4800  	target := &ret
  4801  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4802  		return nil, err
  4803  	}
  4804  	return ret, nil
  4805  }
  4806  
  4807  type DrivesListCall struct {
  4808  	s            *Service
  4809  	urlParams_   gensupport.URLParams
  4810  	ifNoneMatch_ string
  4811  	ctx_         context.Context
  4812  	header_      http.Header
  4813  }
  4814  
  4815  // List:  Lists the user's shared drives. This method accepts the `q`
  4816  // parameter, which is a search query combining one or more search terms. For
  4817  // more information, see the Search for shared drives
  4818  // (/drive/api/guides/search-shareddrives) guide.
  4819  func (r *DrivesService) List() *DrivesListCall {
  4820  	c := &DrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4821  	return c
  4822  }
  4823  
  4824  // PageSize sets the optional parameter "pageSize": Maximum number of shared
  4825  // drives to return per page.
  4826  func (c *DrivesListCall) PageSize(pageSize int64) *DrivesListCall {
  4827  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4828  	return c
  4829  }
  4830  
  4831  // PageToken sets the optional parameter "pageToken": Page token for shared
  4832  // drives.
  4833  func (c *DrivesListCall) PageToken(pageToken string) *DrivesListCall {
  4834  	c.urlParams_.Set("pageToken", pageToken)
  4835  	return c
  4836  }
  4837  
  4838  // Q sets the optional parameter "q": Query string for searching shared drives.
  4839  func (c *DrivesListCall) Q(q string) *DrivesListCall {
  4840  	c.urlParams_.Set("q", q)
  4841  	return c
  4842  }
  4843  
  4844  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  4845  // Issue the request as a domain administrator; if set to true, then all shared
  4846  // drives of the domain in which the requester is an administrator are
  4847  // returned.
  4848  func (c *DrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesListCall {
  4849  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  4850  	return c
  4851  }
  4852  
  4853  // Fields allows partial responses to be retrieved. See
  4854  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4855  // details.
  4856  func (c *DrivesListCall) Fields(s ...googleapi.Field) *DrivesListCall {
  4857  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4858  	return c
  4859  }
  4860  
  4861  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4862  // object's ETag matches the given value. This is useful for getting updates
  4863  // only after the object has changed since the last request.
  4864  func (c *DrivesListCall) IfNoneMatch(entityTag string) *DrivesListCall {
  4865  	c.ifNoneMatch_ = entityTag
  4866  	return c
  4867  }
  4868  
  4869  // Context sets the context to be used in this call's Do method.
  4870  func (c *DrivesListCall) Context(ctx context.Context) *DrivesListCall {
  4871  	c.ctx_ = ctx
  4872  	return c
  4873  }
  4874  
  4875  // Header returns a http.Header that can be modified by the caller to add
  4876  // headers to the request.
  4877  func (c *DrivesListCall) Header() http.Header {
  4878  	if c.header_ == nil {
  4879  		c.header_ = make(http.Header)
  4880  	}
  4881  	return c.header_
  4882  }
  4883  
  4884  func (c *DrivesListCall) doRequest(alt string) (*http.Response, error) {
  4885  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4886  	if c.ifNoneMatch_ != "" {
  4887  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4888  	}
  4889  	var body io.Reader = nil
  4890  	c.urlParams_.Set("alt", alt)
  4891  	c.urlParams_.Set("prettyPrint", "false")
  4892  	urls := googleapi.ResolveRelative(c.s.BasePath, "drives")
  4893  	urls += "?" + c.urlParams_.Encode()
  4894  	req, err := http.NewRequest("GET", urls, body)
  4895  	if err != nil {
  4896  		return nil, err
  4897  	}
  4898  	req.Header = reqHeaders
  4899  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4900  }
  4901  
  4902  // Do executes the "drive.drives.list" call.
  4903  // Any non-2xx status code is an error. Response headers are in either
  4904  // *DriveList.ServerResponse.Header or (if a response was returned at all) in
  4905  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4906  // whether the returned error was because http.StatusNotModified was returned.
  4907  func (c *DrivesListCall) Do(opts ...googleapi.CallOption) (*DriveList, error) {
  4908  	gensupport.SetOptions(c.urlParams_, opts...)
  4909  	res, err := c.doRequest("json")
  4910  	if res != nil && res.StatusCode == http.StatusNotModified {
  4911  		if res.Body != nil {
  4912  			res.Body.Close()
  4913  		}
  4914  		return nil, gensupport.WrapError(&googleapi.Error{
  4915  			Code:   res.StatusCode,
  4916  			Header: res.Header,
  4917  		})
  4918  	}
  4919  	if err != nil {
  4920  		return nil, err
  4921  	}
  4922  	defer googleapi.CloseBody(res)
  4923  	if err := googleapi.CheckResponse(res); err != nil {
  4924  		return nil, gensupport.WrapError(err)
  4925  	}
  4926  	ret := &DriveList{
  4927  		ServerResponse: googleapi.ServerResponse{
  4928  			Header:         res.Header,
  4929  			HTTPStatusCode: res.StatusCode,
  4930  		},
  4931  	}
  4932  	target := &ret
  4933  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4934  		return nil, err
  4935  	}
  4936  	return ret, nil
  4937  }
  4938  
  4939  // Pages invokes f for each page of results.
  4940  // A non-nil error returned from f will halt the iteration.
  4941  // The provided context supersedes any context provided to the Context method.
  4942  func (c *DrivesListCall) Pages(ctx context.Context, f func(*DriveList) error) error {
  4943  	c.ctx_ = ctx
  4944  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4945  	for {
  4946  		x, err := c.Do()
  4947  		if err != nil {
  4948  			return err
  4949  		}
  4950  		if err := f(x); err != nil {
  4951  			return err
  4952  		}
  4953  		if x.NextPageToken == "" {
  4954  			return nil
  4955  		}
  4956  		c.PageToken(x.NextPageToken)
  4957  	}
  4958  }
  4959  
  4960  type DrivesUnhideCall struct {
  4961  	s          *Service
  4962  	driveId    string
  4963  	urlParams_ gensupport.URLParams
  4964  	ctx_       context.Context
  4965  	header_    http.Header
  4966  }
  4967  
  4968  // Unhide: Restores a shared drive to the default view.
  4969  //
  4970  // - driveId: The ID of the shared drive.
  4971  func (r *DrivesService) Unhide(driveId string) *DrivesUnhideCall {
  4972  	c := &DrivesUnhideCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4973  	c.driveId = driveId
  4974  	return c
  4975  }
  4976  
  4977  // Fields allows partial responses to be retrieved. See
  4978  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4979  // details.
  4980  func (c *DrivesUnhideCall) Fields(s ...googleapi.Field) *DrivesUnhideCall {
  4981  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4982  	return c
  4983  }
  4984  
  4985  // Context sets the context to be used in this call's Do method.
  4986  func (c *DrivesUnhideCall) Context(ctx context.Context) *DrivesUnhideCall {
  4987  	c.ctx_ = ctx
  4988  	return c
  4989  }
  4990  
  4991  // Header returns a http.Header that can be modified by the caller to add
  4992  // headers to the request.
  4993  func (c *DrivesUnhideCall) Header() http.Header {
  4994  	if c.header_ == nil {
  4995  		c.header_ = make(http.Header)
  4996  	}
  4997  	return c.header_
  4998  }
  4999  
  5000  func (c *DrivesUnhideCall) doRequest(alt string) (*http.Response, error) {
  5001  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5002  	var body io.Reader = nil
  5003  	c.urlParams_.Set("alt", alt)
  5004  	c.urlParams_.Set("prettyPrint", "false")
  5005  	urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/unhide")
  5006  	urls += "?" + c.urlParams_.Encode()
  5007  	req, err := http.NewRequest("POST", urls, body)
  5008  	if err != nil {
  5009  		return nil, err
  5010  	}
  5011  	req.Header = reqHeaders
  5012  	googleapi.Expand(req.URL, map[string]string{
  5013  		"driveId": c.driveId,
  5014  	})
  5015  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5016  }
  5017  
  5018  // Do executes the "drive.drives.unhide" call.
  5019  // Any non-2xx status code is an error. Response headers are in either
  5020  // *Drive.ServerResponse.Header or (if a response was returned at all) in
  5021  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5022  // whether the returned error was because http.StatusNotModified was returned.
  5023  func (c *DrivesUnhideCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
  5024  	gensupport.SetOptions(c.urlParams_, opts...)
  5025  	res, err := c.doRequest("json")
  5026  	if res != nil && res.StatusCode == http.StatusNotModified {
  5027  		if res.Body != nil {
  5028  			res.Body.Close()
  5029  		}
  5030  		return nil, gensupport.WrapError(&googleapi.Error{
  5031  			Code:   res.StatusCode,
  5032  			Header: res.Header,
  5033  		})
  5034  	}
  5035  	if err != nil {
  5036  		return nil, err
  5037  	}
  5038  	defer googleapi.CloseBody(res)
  5039  	if err := googleapi.CheckResponse(res); err != nil {
  5040  		return nil, gensupport.WrapError(err)
  5041  	}
  5042  	ret := &Drive{
  5043  		ServerResponse: googleapi.ServerResponse{
  5044  			Header:         res.Header,
  5045  			HTTPStatusCode: res.StatusCode,
  5046  		},
  5047  	}
  5048  	target := &ret
  5049  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5050  		return nil, err
  5051  	}
  5052  	return ret, nil
  5053  }
  5054  
  5055  type DrivesUpdateCall struct {
  5056  	s          *Service
  5057  	driveId    string
  5058  	drive      *Drive
  5059  	urlParams_ gensupport.URLParams
  5060  	ctx_       context.Context
  5061  	header_    http.Header
  5062  }
  5063  
  5064  // Update: Updates the metadata for a shared drive.
  5065  //
  5066  // - driveId: The ID of the shared drive.
  5067  func (r *DrivesService) Update(driveId string, drive *Drive) *DrivesUpdateCall {
  5068  	c := &DrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5069  	c.driveId = driveId
  5070  	c.drive = drive
  5071  	return c
  5072  }
  5073  
  5074  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  5075  // Issue the request as a domain administrator; if set to true, then the
  5076  // requester will be granted access if they are an administrator of the domain
  5077  // to which the shared drive belongs.
  5078  func (c *DrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesUpdateCall {
  5079  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  5080  	return c
  5081  }
  5082  
  5083  // Fields allows partial responses to be retrieved. See
  5084  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5085  // details.
  5086  func (c *DrivesUpdateCall) Fields(s ...googleapi.Field) *DrivesUpdateCall {
  5087  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5088  	return c
  5089  }
  5090  
  5091  // Context sets the context to be used in this call's Do method.
  5092  func (c *DrivesUpdateCall) Context(ctx context.Context) *DrivesUpdateCall {
  5093  	c.ctx_ = ctx
  5094  	return c
  5095  }
  5096  
  5097  // Header returns a http.Header that can be modified by the caller to add
  5098  // headers to the request.
  5099  func (c *DrivesUpdateCall) Header() http.Header {
  5100  	if c.header_ == nil {
  5101  		c.header_ = make(http.Header)
  5102  	}
  5103  	return c.header_
  5104  }
  5105  
  5106  func (c *DrivesUpdateCall) doRequest(alt string) (*http.Response, error) {
  5107  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5108  	var body io.Reader = nil
  5109  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive)
  5110  	if err != nil {
  5111  		return nil, err
  5112  	}
  5113  	c.urlParams_.Set("alt", alt)
  5114  	c.urlParams_.Set("prettyPrint", "false")
  5115  	urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}")
  5116  	urls += "?" + c.urlParams_.Encode()
  5117  	req, err := http.NewRequest("PATCH", urls, body)
  5118  	if err != nil {
  5119  		return nil, err
  5120  	}
  5121  	req.Header = reqHeaders
  5122  	googleapi.Expand(req.URL, map[string]string{
  5123  		"driveId": c.driveId,
  5124  	})
  5125  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5126  }
  5127  
  5128  // Do executes the "drive.drives.update" call.
  5129  // Any non-2xx status code is an error. Response headers are in either
  5130  // *Drive.ServerResponse.Header or (if a response was returned at all) in
  5131  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5132  // whether the returned error was because http.StatusNotModified was returned.
  5133  func (c *DrivesUpdateCall) Do(opts ...googleapi.CallOption) (*Drive, error) {
  5134  	gensupport.SetOptions(c.urlParams_, opts...)
  5135  	res, err := c.doRequest("json")
  5136  	if res != nil && res.StatusCode == http.StatusNotModified {
  5137  		if res.Body != nil {
  5138  			res.Body.Close()
  5139  		}
  5140  		return nil, gensupport.WrapError(&googleapi.Error{
  5141  			Code:   res.StatusCode,
  5142  			Header: res.Header,
  5143  		})
  5144  	}
  5145  	if err != nil {
  5146  		return nil, err
  5147  	}
  5148  	defer googleapi.CloseBody(res)
  5149  	if err := googleapi.CheckResponse(res); err != nil {
  5150  		return nil, gensupport.WrapError(err)
  5151  	}
  5152  	ret := &Drive{
  5153  		ServerResponse: googleapi.ServerResponse{
  5154  			Header:         res.Header,
  5155  			HTTPStatusCode: res.StatusCode,
  5156  		},
  5157  	}
  5158  	target := &ret
  5159  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5160  		return nil, err
  5161  	}
  5162  	return ret, nil
  5163  }
  5164  
  5165  type FilesCopyCall struct {
  5166  	s          *Service
  5167  	fileId     string
  5168  	file       *File
  5169  	urlParams_ gensupport.URLParams
  5170  	ctx_       context.Context
  5171  	header_    http.Header
  5172  }
  5173  
  5174  // Copy: Creates a copy of a file and applies any requested updates with patch
  5175  // semantics.
  5176  //
  5177  // - fileId: The ID of the file.
  5178  func (r *FilesService) Copy(fileId string, file *File) *FilesCopyCall {
  5179  	c := &FilesCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5180  	c.fileId = fileId
  5181  	c.file = file
  5182  	return c
  5183  }
  5184  
  5185  // EnforceSingleParent sets the optional parameter "enforceSingleParent":
  5186  // Deprecated. Copying files into multiple folders is no longer supported. Use
  5187  // shortcuts instead.
  5188  func (c *FilesCopyCall) EnforceSingleParent(enforceSingleParent bool) *FilesCopyCall {
  5189  	c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
  5190  	return c
  5191  }
  5192  
  5193  // IgnoreDefaultVisibility sets the optional parameter
  5194  // "ignoreDefaultVisibility": Whether to ignore the domain's default visibility
  5195  // settings for the created file. Domain administrators can choose to make all
  5196  // uploaded files visible to the domain by default; this parameter bypasses
  5197  // that behavior for the request. Permissions are still inherited from parent
  5198  // folders.
  5199  func (c *FilesCopyCall) IgnoreDefaultVisibility(ignoreDefaultVisibility bool) *FilesCopyCall {
  5200  	c.urlParams_.Set("ignoreDefaultVisibility", fmt.Sprint(ignoreDefaultVisibility))
  5201  	return c
  5202  }
  5203  
  5204  // IncludeLabels sets the optional parameter "includeLabels": A comma-separated
  5205  // list of IDs of labels to include in the `labelInfo` part of the response.
  5206  func (c *FilesCopyCall) IncludeLabels(includeLabels string) *FilesCopyCall {
  5207  	c.urlParams_.Set("includeLabels", includeLabels)
  5208  	return c
  5209  }
  5210  
  5211  // IncludePermissionsForView sets the optional parameter
  5212  // "includePermissionsForView": Specifies which additional view's permissions
  5213  // to include in the response. Only 'published' is supported.
  5214  func (c *FilesCopyCall) IncludePermissionsForView(includePermissionsForView string) *FilesCopyCall {
  5215  	c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
  5216  	return c
  5217  }
  5218  
  5219  // KeepRevisionForever sets the optional parameter "keepRevisionForever":
  5220  // Whether to set the 'keepForever' field in the new head revision. This is
  5221  // only applicable to files with binary content in Google Drive. Only 200
  5222  // revisions for the file can be kept forever. If the limit is reached, try
  5223  // deleting pinned revisions.
  5224  func (c *FilesCopyCall) KeepRevisionForever(keepRevisionForever bool) *FilesCopyCall {
  5225  	c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever))
  5226  	return c
  5227  }
  5228  
  5229  // OcrLanguage sets the optional parameter "ocrLanguage": A language hint for
  5230  // OCR processing during image import (ISO 639-1 code).
  5231  func (c *FilesCopyCall) OcrLanguage(ocrLanguage string) *FilesCopyCall {
  5232  	c.urlParams_.Set("ocrLanguage", ocrLanguage)
  5233  	return c
  5234  }
  5235  
  5236  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  5237  // the requesting application supports both My Drives and shared drives.
  5238  func (c *FilesCopyCall) SupportsAllDrives(supportsAllDrives bool) *FilesCopyCall {
  5239  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  5240  	return c
  5241  }
  5242  
  5243  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  5244  // Deprecated: Use `supportsAllDrives` instead.
  5245  func (c *FilesCopyCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesCopyCall {
  5246  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  5247  	return c
  5248  }
  5249  
  5250  // Fields allows partial responses to be retrieved. See
  5251  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5252  // details.
  5253  func (c *FilesCopyCall) Fields(s ...googleapi.Field) *FilesCopyCall {
  5254  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5255  	return c
  5256  }
  5257  
  5258  // Context sets the context to be used in this call's Do method.
  5259  func (c *FilesCopyCall) Context(ctx context.Context) *FilesCopyCall {
  5260  	c.ctx_ = ctx
  5261  	return c
  5262  }
  5263  
  5264  // Header returns a http.Header that can be modified by the caller to add
  5265  // headers to the request.
  5266  func (c *FilesCopyCall) Header() http.Header {
  5267  	if c.header_ == nil {
  5268  		c.header_ = make(http.Header)
  5269  	}
  5270  	return c.header_
  5271  }
  5272  
  5273  func (c *FilesCopyCall) doRequest(alt string) (*http.Response, error) {
  5274  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5275  	var body io.Reader = nil
  5276  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.file)
  5277  	if err != nil {
  5278  		return nil, err
  5279  	}
  5280  	c.urlParams_.Set("alt", alt)
  5281  	c.urlParams_.Set("prettyPrint", "false")
  5282  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/copy")
  5283  	urls += "?" + c.urlParams_.Encode()
  5284  	req, err := http.NewRequest("POST", urls, body)
  5285  	if err != nil {
  5286  		return nil, err
  5287  	}
  5288  	req.Header = reqHeaders
  5289  	googleapi.Expand(req.URL, map[string]string{
  5290  		"fileId": c.fileId,
  5291  	})
  5292  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5293  }
  5294  
  5295  // Do executes the "drive.files.copy" call.
  5296  // Any non-2xx status code is an error. Response headers are in either
  5297  // *File.ServerResponse.Header or (if a response was returned at all) in
  5298  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5299  // whether the returned error was because http.StatusNotModified was returned.
  5300  func (c *FilesCopyCall) Do(opts ...googleapi.CallOption) (*File, error) {
  5301  	gensupport.SetOptions(c.urlParams_, opts...)
  5302  	res, err := c.doRequest("json")
  5303  	if res != nil && res.StatusCode == http.StatusNotModified {
  5304  		if res.Body != nil {
  5305  			res.Body.Close()
  5306  		}
  5307  		return nil, gensupport.WrapError(&googleapi.Error{
  5308  			Code:   res.StatusCode,
  5309  			Header: res.Header,
  5310  		})
  5311  	}
  5312  	if err != nil {
  5313  		return nil, err
  5314  	}
  5315  	defer googleapi.CloseBody(res)
  5316  	if err := googleapi.CheckResponse(res); err != nil {
  5317  		return nil, gensupport.WrapError(err)
  5318  	}
  5319  	ret := &File{
  5320  		ServerResponse: googleapi.ServerResponse{
  5321  			Header:         res.Header,
  5322  			HTTPStatusCode: res.StatusCode,
  5323  		},
  5324  	}
  5325  	target := &ret
  5326  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5327  		return nil, err
  5328  	}
  5329  	return ret, nil
  5330  }
  5331  
  5332  type FilesCreateCall struct {
  5333  	s          *Service
  5334  	file       *File
  5335  	urlParams_ gensupport.URLParams
  5336  	mediaInfo_ *gensupport.MediaInfo
  5337  	ctx_       context.Context
  5338  	header_    http.Header
  5339  }
  5340  
  5341  // Create:  Creates a new file. This method supports an */upload* URI and
  5342  // accepts uploaded media with the following characteristics: - *Maximum file
  5343  // size:* 5,120 GB - *Accepted Media MIME types:*`*/*` Note: Specify a valid
  5344  // MIME type, rather than the literal `*/*` value. The literal `*/*` is only
  5345  // used to indicate that any valid MIME type can be uploaded. For more
  5346  // information on uploading files, see Upload file data
  5347  // (/drive/api/guides/manage-uploads). Apps creating shortcuts with
  5348  // `files.create` must specify the MIME type
  5349  // `application/vnd.google-apps.shortcut`. Apps should specify a file extension
  5350  // in the `name` property when inserting files with the API. For example, an
  5351  // operation to insert a JPEG file should specify something like "name":
  5352  // "cat.jpg" in the metadata. Subsequent `GET` requests include the read-only
  5353  // `fileExtension` property populated with the extension originally specified
  5354  // in the `title` property. When a Google Drive user requests to download a
  5355  // file, or when the file is downloaded through the sync client, Drive builds a
  5356  // full filename (with extension) based on the title. In cases where the
  5357  // extension is missing, Drive attempts to determine the extension based on the
  5358  // file's MIME type.
  5359  func (r *FilesService) Create(file *File) *FilesCreateCall {
  5360  	c := &FilesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5361  	c.file = file
  5362  	return c
  5363  }
  5364  
  5365  // EnforceSingleParent sets the optional parameter "enforceSingleParent":
  5366  // Deprecated. Creating files in multiple folders is no longer supported.
  5367  func (c *FilesCreateCall) EnforceSingleParent(enforceSingleParent bool) *FilesCreateCall {
  5368  	c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
  5369  	return c
  5370  }
  5371  
  5372  // IgnoreDefaultVisibility sets the optional parameter
  5373  // "ignoreDefaultVisibility": Whether to ignore the domain's default visibility
  5374  // settings for the created file. Domain administrators can choose to make all
  5375  // uploaded files visible to the domain by default; this parameter bypasses
  5376  // that behavior for the request. Permissions are still inherited from parent
  5377  // folders.
  5378  func (c *FilesCreateCall) IgnoreDefaultVisibility(ignoreDefaultVisibility bool) *FilesCreateCall {
  5379  	c.urlParams_.Set("ignoreDefaultVisibility", fmt.Sprint(ignoreDefaultVisibility))
  5380  	return c
  5381  }
  5382  
  5383  // IncludeLabels sets the optional parameter "includeLabels": A comma-separated
  5384  // list of IDs of labels to include in the `labelInfo` part of the response.
  5385  func (c *FilesCreateCall) IncludeLabels(includeLabels string) *FilesCreateCall {
  5386  	c.urlParams_.Set("includeLabels", includeLabels)
  5387  	return c
  5388  }
  5389  
  5390  // IncludePermissionsForView sets the optional parameter
  5391  // "includePermissionsForView": Specifies which additional view's permissions
  5392  // to include in the response. Only 'published' is supported.
  5393  func (c *FilesCreateCall) IncludePermissionsForView(includePermissionsForView string) *FilesCreateCall {
  5394  	c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
  5395  	return c
  5396  }
  5397  
  5398  // KeepRevisionForever sets the optional parameter "keepRevisionForever":
  5399  // Whether to set the 'keepForever' field in the new head revision. This is
  5400  // only applicable to files with binary content in Google Drive. Only 200
  5401  // revisions for the file can be kept forever. If the limit is reached, try
  5402  // deleting pinned revisions.
  5403  func (c *FilesCreateCall) KeepRevisionForever(keepRevisionForever bool) *FilesCreateCall {
  5404  	c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever))
  5405  	return c
  5406  }
  5407  
  5408  // OcrLanguage sets the optional parameter "ocrLanguage": A language hint for
  5409  // OCR processing during image import (ISO 639-1 code).
  5410  func (c *FilesCreateCall) OcrLanguage(ocrLanguage string) *FilesCreateCall {
  5411  	c.urlParams_.Set("ocrLanguage", ocrLanguage)
  5412  	return c
  5413  }
  5414  
  5415  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  5416  // the requesting application supports both My Drives and shared drives.
  5417  func (c *FilesCreateCall) SupportsAllDrives(supportsAllDrives bool) *FilesCreateCall {
  5418  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  5419  	return c
  5420  }
  5421  
  5422  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  5423  // Deprecated: Use `supportsAllDrives` instead.
  5424  func (c *FilesCreateCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesCreateCall {
  5425  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  5426  	return c
  5427  }
  5428  
  5429  // UseContentAsIndexableText sets the optional parameter
  5430  // "useContentAsIndexableText": Whether to use the uploaded content as
  5431  // indexable text.
  5432  func (c *FilesCreateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesCreateCall {
  5433  	c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText))
  5434  	return c
  5435  }
  5436  
  5437  // Media specifies the media to upload in one or more chunks. The chunk size
  5438  // may be controlled by supplying a MediaOption generated by
  5439  // googleapi.ChunkSize. The chunk size defaults to
  5440  // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
  5441  // request will be determined by sniffing the contents of r, unless a
  5442  // MediaOption generated by googleapi.ContentType is supplied.
  5443  // At most one of Media and ResumableMedia may be set.
  5444  func (c *FilesCreateCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesCreateCall {
  5445  	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  5446  	return c
  5447  }
  5448  
  5449  // ResumableMedia specifies the media to upload in chunks and can be canceled
  5450  // with ctx.
  5451  //
  5452  // Deprecated: use Media instead.
  5453  //
  5454  // At most one of Media and ResumableMedia may be set. mediaType identifies the
  5455  // MIME media type of the upload, such as "image/png". If mediaType is "", it
  5456  // will be auto-detected. The provided ctx will supersede any context
  5457  // previously provided to the Context method.
  5458  func (c *FilesCreateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesCreateCall {
  5459  	c.ctx_ = ctx
  5460  	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  5461  	return c
  5462  }
  5463  
  5464  // ProgressUpdater provides a callback function that will be called after every
  5465  // chunk. It should be a low-latency function in order to not slow down the
  5466  // upload operation. This should only be called when using ResumableMedia (as
  5467  // opposed to Media).
  5468  func (c *FilesCreateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesCreateCall {
  5469  	c.mediaInfo_.SetProgressUpdater(pu)
  5470  	return c
  5471  }
  5472  
  5473  // Fields allows partial responses to be retrieved. See
  5474  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5475  // details.
  5476  func (c *FilesCreateCall) Fields(s ...googleapi.Field) *FilesCreateCall {
  5477  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5478  	return c
  5479  }
  5480  
  5481  // Context sets the context to be used in this call's Do method.
  5482  // This context will supersede any context previously provided to the
  5483  // ResumableMedia method.
  5484  func (c *FilesCreateCall) Context(ctx context.Context) *FilesCreateCall {
  5485  	c.ctx_ = ctx
  5486  	return c
  5487  }
  5488  
  5489  // Header returns a http.Header that can be modified by the caller to add
  5490  // headers to the request.
  5491  func (c *FilesCreateCall) Header() http.Header {
  5492  	if c.header_ == nil {
  5493  		c.header_ = make(http.Header)
  5494  	}
  5495  	return c.header_
  5496  }
  5497  
  5498  func (c *FilesCreateCall) doRequest(alt string) (*http.Response, error) {
  5499  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5500  	var body io.Reader = nil
  5501  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.file)
  5502  	if err != nil {
  5503  		return nil, err
  5504  	}
  5505  	c.urlParams_.Set("alt", alt)
  5506  	c.urlParams_.Set("prettyPrint", "false")
  5507  	urls := googleapi.ResolveRelative(c.s.BasePath, "files")
  5508  	if c.mediaInfo_ != nil {
  5509  		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v3/files")
  5510  		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  5511  	}
  5512  	if body == nil {
  5513  		body = new(bytes.Buffer)
  5514  		reqHeaders.Set("Content-Type", "application/json")
  5515  	}
  5516  	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  5517  	defer cleanup()
  5518  	urls += "?" + c.urlParams_.Encode()
  5519  	req, err := http.NewRequest("POST", urls, body)
  5520  	if err != nil {
  5521  		return nil, err
  5522  	}
  5523  	req.Header = reqHeaders
  5524  	req.GetBody = getBody
  5525  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5526  }
  5527  
  5528  // Do executes the "drive.files.create" call.
  5529  // Any non-2xx status code is an error. Response headers are in either
  5530  // *File.ServerResponse.Header or (if a response was returned at all) in
  5531  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5532  // whether the returned error was because http.StatusNotModified was returned.
  5533  func (c *FilesCreateCall) Do(opts ...googleapi.CallOption) (*File, error) {
  5534  	gensupport.SetOptions(c.urlParams_, opts...)
  5535  	res, err := c.doRequest("json")
  5536  	if res != nil && res.StatusCode == http.StatusNotModified {
  5537  		if res.Body != nil {
  5538  			res.Body.Close()
  5539  		}
  5540  		return nil, gensupport.WrapError(&googleapi.Error{
  5541  			Code:   res.StatusCode,
  5542  			Header: res.Header,
  5543  		})
  5544  	}
  5545  	if err != nil {
  5546  		return nil, err
  5547  	}
  5548  	defer googleapi.CloseBody(res)
  5549  	if err := googleapi.CheckResponse(res); err != nil {
  5550  		return nil, gensupport.WrapError(err)
  5551  	}
  5552  	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  5553  	if rx != nil {
  5554  		rx.Client = c.s.client
  5555  		rx.UserAgent = c.s.userAgent()
  5556  		ctx := c.ctx_
  5557  		if ctx == nil {
  5558  			ctx = context.TODO()
  5559  		}
  5560  		res, err = rx.Upload(ctx)
  5561  		if err != nil {
  5562  			return nil, err
  5563  		}
  5564  		defer res.Body.Close()
  5565  		if err := googleapi.CheckResponse(res); err != nil {
  5566  			return nil, gensupport.WrapError(err)
  5567  		}
  5568  	}
  5569  	ret := &File{
  5570  		ServerResponse: googleapi.ServerResponse{
  5571  			Header:         res.Header,
  5572  			HTTPStatusCode: res.StatusCode,
  5573  		},
  5574  	}
  5575  	target := &ret
  5576  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5577  		return nil, err
  5578  	}
  5579  	return ret, nil
  5580  }
  5581  
  5582  type FilesDeleteCall struct {
  5583  	s          *Service
  5584  	fileId     string
  5585  	urlParams_ gensupport.URLParams
  5586  	ctx_       context.Context
  5587  	header_    http.Header
  5588  }
  5589  
  5590  // Delete: Permanently deletes a file owned by the user without moving it to
  5591  // the trash. If the file belongs to a shared drive, the user must be an
  5592  // `organizer` on the parent folder. If the target is a folder, all descendants
  5593  // owned by the user are also deleted.
  5594  //
  5595  // - fileId: The ID of the file.
  5596  func (r *FilesService) Delete(fileId string) *FilesDeleteCall {
  5597  	c := &FilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5598  	c.fileId = fileId
  5599  	return c
  5600  }
  5601  
  5602  // EnforceSingleParent sets the optional parameter "enforceSingleParent":
  5603  // Deprecated: If an item is not in a shared drive and its last parent is
  5604  // deleted but the item itself is not, the item will be placed under its
  5605  // owner's root.
  5606  func (c *FilesDeleteCall) EnforceSingleParent(enforceSingleParent bool) *FilesDeleteCall {
  5607  	c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
  5608  	return c
  5609  }
  5610  
  5611  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  5612  // the requesting application supports both My Drives and shared drives.
  5613  func (c *FilesDeleteCall) SupportsAllDrives(supportsAllDrives bool) *FilesDeleteCall {
  5614  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  5615  	return c
  5616  }
  5617  
  5618  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  5619  // Deprecated: Use `supportsAllDrives` instead.
  5620  func (c *FilesDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesDeleteCall {
  5621  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  5622  	return c
  5623  }
  5624  
  5625  // Fields allows partial responses to be retrieved. See
  5626  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5627  // details.
  5628  func (c *FilesDeleteCall) Fields(s ...googleapi.Field) *FilesDeleteCall {
  5629  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5630  	return c
  5631  }
  5632  
  5633  // Context sets the context to be used in this call's Do method.
  5634  func (c *FilesDeleteCall) Context(ctx context.Context) *FilesDeleteCall {
  5635  	c.ctx_ = ctx
  5636  	return c
  5637  }
  5638  
  5639  // Header returns a http.Header that can be modified by the caller to add
  5640  // headers to the request.
  5641  func (c *FilesDeleteCall) Header() http.Header {
  5642  	if c.header_ == nil {
  5643  		c.header_ = make(http.Header)
  5644  	}
  5645  	return c.header_
  5646  }
  5647  
  5648  func (c *FilesDeleteCall) doRequest(alt string) (*http.Response, error) {
  5649  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5650  	var body io.Reader = nil
  5651  	c.urlParams_.Set("alt", alt)
  5652  	c.urlParams_.Set("prettyPrint", "false")
  5653  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}")
  5654  	urls += "?" + c.urlParams_.Encode()
  5655  	req, err := http.NewRequest("DELETE", urls, body)
  5656  	if err != nil {
  5657  		return nil, err
  5658  	}
  5659  	req.Header = reqHeaders
  5660  	googleapi.Expand(req.URL, map[string]string{
  5661  		"fileId": c.fileId,
  5662  	})
  5663  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5664  }
  5665  
  5666  // Do executes the "drive.files.delete" call.
  5667  func (c *FilesDeleteCall) Do(opts ...googleapi.CallOption) error {
  5668  	gensupport.SetOptions(c.urlParams_, opts...)
  5669  	res, err := c.doRequest("json")
  5670  	if err != nil {
  5671  		return err
  5672  	}
  5673  	defer googleapi.CloseBody(res)
  5674  	if err := googleapi.CheckResponse(res); err != nil {
  5675  		return gensupport.WrapError(err)
  5676  	}
  5677  	return nil
  5678  }
  5679  
  5680  type FilesEmptyTrashCall struct {
  5681  	s          *Service
  5682  	urlParams_ gensupport.URLParams
  5683  	ctx_       context.Context
  5684  	header_    http.Header
  5685  }
  5686  
  5687  // EmptyTrash: Permanently deletes all of the user's trashed files.
  5688  func (r *FilesService) EmptyTrash() *FilesEmptyTrashCall {
  5689  	c := &FilesEmptyTrashCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5690  	return c
  5691  }
  5692  
  5693  // DriveId sets the optional parameter "driveId": If set, empties the trash of
  5694  // the provided shared drive.
  5695  func (c *FilesEmptyTrashCall) DriveId(driveId string) *FilesEmptyTrashCall {
  5696  	c.urlParams_.Set("driveId", driveId)
  5697  	return c
  5698  }
  5699  
  5700  // EnforceSingleParent sets the optional parameter "enforceSingleParent":
  5701  // Deprecated: If an item is not in a shared drive and its last parent is
  5702  // deleted but the item itself is not, the item will be placed under its
  5703  // owner's root.
  5704  func (c *FilesEmptyTrashCall) EnforceSingleParent(enforceSingleParent bool) *FilesEmptyTrashCall {
  5705  	c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
  5706  	return c
  5707  }
  5708  
  5709  // Fields allows partial responses to be retrieved. See
  5710  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5711  // details.
  5712  func (c *FilesEmptyTrashCall) Fields(s ...googleapi.Field) *FilesEmptyTrashCall {
  5713  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5714  	return c
  5715  }
  5716  
  5717  // Context sets the context to be used in this call's Do method.
  5718  func (c *FilesEmptyTrashCall) Context(ctx context.Context) *FilesEmptyTrashCall {
  5719  	c.ctx_ = ctx
  5720  	return c
  5721  }
  5722  
  5723  // Header returns a http.Header that can be modified by the caller to add
  5724  // headers to the request.
  5725  func (c *FilesEmptyTrashCall) Header() http.Header {
  5726  	if c.header_ == nil {
  5727  		c.header_ = make(http.Header)
  5728  	}
  5729  	return c.header_
  5730  }
  5731  
  5732  func (c *FilesEmptyTrashCall) doRequest(alt string) (*http.Response, error) {
  5733  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5734  	var body io.Reader = nil
  5735  	c.urlParams_.Set("alt", alt)
  5736  	c.urlParams_.Set("prettyPrint", "false")
  5737  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/trash")
  5738  	urls += "?" + c.urlParams_.Encode()
  5739  	req, err := http.NewRequest("DELETE", urls, body)
  5740  	if err != nil {
  5741  		return nil, err
  5742  	}
  5743  	req.Header = reqHeaders
  5744  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5745  }
  5746  
  5747  // Do executes the "drive.files.emptyTrash" call.
  5748  func (c *FilesEmptyTrashCall) Do(opts ...googleapi.CallOption) error {
  5749  	gensupport.SetOptions(c.urlParams_, opts...)
  5750  	res, err := c.doRequest("json")
  5751  	if err != nil {
  5752  		return err
  5753  	}
  5754  	defer googleapi.CloseBody(res)
  5755  	if err := googleapi.CheckResponse(res); err != nil {
  5756  		return gensupport.WrapError(err)
  5757  	}
  5758  	return nil
  5759  }
  5760  
  5761  type FilesExportCall struct {
  5762  	s            *Service
  5763  	fileId       string
  5764  	urlParams_   gensupport.URLParams
  5765  	ifNoneMatch_ string
  5766  	ctx_         context.Context
  5767  	header_      http.Header
  5768  }
  5769  
  5770  // Export: Exports a Google Workspace document to the requested MIME type and
  5771  // returns exported byte content. Note that the exported content is limited to
  5772  // 10MB.
  5773  //
  5774  // - fileId: The ID of the file.
  5775  // - mimeType: The MIME type of the format requested for this export.
  5776  func (r *FilesService) Export(fileId string, mimeType string) *FilesExportCall {
  5777  	c := &FilesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5778  	c.fileId = fileId
  5779  	c.urlParams_.Set("mimeType", mimeType)
  5780  	return c
  5781  }
  5782  
  5783  // Fields allows partial responses to be retrieved. See
  5784  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5785  // details.
  5786  func (c *FilesExportCall) Fields(s ...googleapi.Field) *FilesExportCall {
  5787  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5788  	return c
  5789  }
  5790  
  5791  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5792  // object's ETag matches the given value. This is useful for getting updates
  5793  // only after the object has changed since the last request.
  5794  func (c *FilesExportCall) IfNoneMatch(entityTag string) *FilesExportCall {
  5795  	c.ifNoneMatch_ = entityTag
  5796  	return c
  5797  }
  5798  
  5799  // Context sets the context to be used in this call's Do and Download methods.
  5800  func (c *FilesExportCall) Context(ctx context.Context) *FilesExportCall {
  5801  	c.ctx_ = ctx
  5802  	return c
  5803  }
  5804  
  5805  // Header returns a http.Header that can be modified by the caller to add
  5806  // headers to the request.
  5807  func (c *FilesExportCall) Header() http.Header {
  5808  	if c.header_ == nil {
  5809  		c.header_ = make(http.Header)
  5810  	}
  5811  	return c.header_
  5812  }
  5813  
  5814  func (c *FilesExportCall) doRequest(alt string) (*http.Response, error) {
  5815  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5816  	if c.ifNoneMatch_ != "" {
  5817  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5818  	}
  5819  	var body io.Reader = nil
  5820  	c.urlParams_.Set("alt", alt)
  5821  	c.urlParams_.Set("prettyPrint", "false")
  5822  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/export")
  5823  	urls += "?" + c.urlParams_.Encode()
  5824  	req, err := http.NewRequest("GET", urls, body)
  5825  	if err != nil {
  5826  		return nil, err
  5827  	}
  5828  	req.Header = reqHeaders
  5829  	googleapi.Expand(req.URL, map[string]string{
  5830  		"fileId": c.fileId,
  5831  	})
  5832  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5833  }
  5834  
  5835  // Download fetches the API endpoint's "media" value, instead of the normal
  5836  // API response value. If the returned error is nil, the Response is guaranteed to
  5837  // have a 2xx status code. Callers must close the Response.Body as usual.
  5838  func (c *FilesExportCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  5839  	gensupport.SetOptions(c.urlParams_, opts...)
  5840  	res, err := c.doRequest("media")
  5841  	if err != nil {
  5842  		return nil, err
  5843  	}
  5844  	if err := googleapi.CheckResponse(res); err != nil {
  5845  		res.Body.Close()
  5846  		return nil, gensupport.WrapError(err)
  5847  	}
  5848  	return res, nil
  5849  }
  5850  
  5851  // Do executes the "drive.files.export" call.
  5852  func (c *FilesExportCall) Do(opts ...googleapi.CallOption) error {
  5853  	gensupport.SetOptions(c.urlParams_, opts...)
  5854  	res, err := c.doRequest("json")
  5855  	if err != nil {
  5856  		return err
  5857  	}
  5858  	defer googleapi.CloseBody(res)
  5859  	if err := googleapi.CheckResponse(res); err != nil {
  5860  		return gensupport.WrapError(err)
  5861  	}
  5862  	return nil
  5863  }
  5864  
  5865  type FilesGenerateIdsCall struct {
  5866  	s            *Service
  5867  	urlParams_   gensupport.URLParams
  5868  	ifNoneMatch_ string
  5869  	ctx_         context.Context
  5870  	header_      http.Header
  5871  }
  5872  
  5873  // GenerateIds: Generates a set of file IDs which can be provided in create or
  5874  // copy requests.
  5875  func (r *FilesService) GenerateIds() *FilesGenerateIdsCall {
  5876  	c := &FilesGenerateIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5877  	return c
  5878  }
  5879  
  5880  // Count sets the optional parameter "count": The number of IDs to return.
  5881  func (c *FilesGenerateIdsCall) Count(count int64) *FilesGenerateIdsCall {
  5882  	c.urlParams_.Set("count", fmt.Sprint(count))
  5883  	return c
  5884  }
  5885  
  5886  // Space sets the optional parameter "space": The space in which the IDs can be
  5887  // used to create new files. Supported values are 'drive' and 'appDataFolder'.
  5888  // (Default: 'drive')
  5889  func (c *FilesGenerateIdsCall) Space(space string) *FilesGenerateIdsCall {
  5890  	c.urlParams_.Set("space", space)
  5891  	return c
  5892  }
  5893  
  5894  // Type sets the optional parameter "type": The type of items which the IDs can
  5895  // be used for. Supported values are 'files' and 'shortcuts'. Note that
  5896  // 'shortcuts' are only supported in the `drive` 'space'. (Default: 'files')
  5897  func (c *FilesGenerateIdsCall) Type(type_ string) *FilesGenerateIdsCall {
  5898  	c.urlParams_.Set("type", type_)
  5899  	return c
  5900  }
  5901  
  5902  // Fields allows partial responses to be retrieved. See
  5903  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5904  // details.
  5905  func (c *FilesGenerateIdsCall) Fields(s ...googleapi.Field) *FilesGenerateIdsCall {
  5906  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5907  	return c
  5908  }
  5909  
  5910  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5911  // object's ETag matches the given value. This is useful for getting updates
  5912  // only after the object has changed since the last request.
  5913  func (c *FilesGenerateIdsCall) IfNoneMatch(entityTag string) *FilesGenerateIdsCall {
  5914  	c.ifNoneMatch_ = entityTag
  5915  	return c
  5916  }
  5917  
  5918  // Context sets the context to be used in this call's Do method.
  5919  func (c *FilesGenerateIdsCall) Context(ctx context.Context) *FilesGenerateIdsCall {
  5920  	c.ctx_ = ctx
  5921  	return c
  5922  }
  5923  
  5924  // Header returns a http.Header that can be modified by the caller to add
  5925  // headers to the request.
  5926  func (c *FilesGenerateIdsCall) Header() http.Header {
  5927  	if c.header_ == nil {
  5928  		c.header_ = make(http.Header)
  5929  	}
  5930  	return c.header_
  5931  }
  5932  
  5933  func (c *FilesGenerateIdsCall) doRequest(alt string) (*http.Response, error) {
  5934  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5935  	if c.ifNoneMatch_ != "" {
  5936  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5937  	}
  5938  	var body io.Reader = nil
  5939  	c.urlParams_.Set("alt", alt)
  5940  	c.urlParams_.Set("prettyPrint", "false")
  5941  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/generateIds")
  5942  	urls += "?" + c.urlParams_.Encode()
  5943  	req, err := http.NewRequest("GET", urls, body)
  5944  	if err != nil {
  5945  		return nil, err
  5946  	}
  5947  	req.Header = reqHeaders
  5948  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5949  }
  5950  
  5951  // Do executes the "drive.files.generateIds" call.
  5952  // Any non-2xx status code is an error. Response headers are in either
  5953  // *GeneratedIds.ServerResponse.Header or (if a response was returned at all)
  5954  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5955  // whether the returned error was because http.StatusNotModified was returned.
  5956  func (c *FilesGenerateIdsCall) Do(opts ...googleapi.CallOption) (*GeneratedIds, error) {
  5957  	gensupport.SetOptions(c.urlParams_, opts...)
  5958  	res, err := c.doRequest("json")
  5959  	if res != nil && res.StatusCode == http.StatusNotModified {
  5960  		if res.Body != nil {
  5961  			res.Body.Close()
  5962  		}
  5963  		return nil, gensupport.WrapError(&googleapi.Error{
  5964  			Code:   res.StatusCode,
  5965  			Header: res.Header,
  5966  		})
  5967  	}
  5968  	if err != nil {
  5969  		return nil, err
  5970  	}
  5971  	defer googleapi.CloseBody(res)
  5972  	if err := googleapi.CheckResponse(res); err != nil {
  5973  		return nil, gensupport.WrapError(err)
  5974  	}
  5975  	ret := &GeneratedIds{
  5976  		ServerResponse: googleapi.ServerResponse{
  5977  			Header:         res.Header,
  5978  			HTTPStatusCode: res.StatusCode,
  5979  		},
  5980  	}
  5981  	target := &ret
  5982  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5983  		return nil, err
  5984  	}
  5985  	return ret, nil
  5986  }
  5987  
  5988  type FilesGetCall struct {
  5989  	s            *Service
  5990  	fileId       string
  5991  	urlParams_   gensupport.URLParams
  5992  	ifNoneMatch_ string
  5993  	ctx_         context.Context
  5994  	header_      http.Header
  5995  }
  5996  
  5997  // Get:  Gets a file's metadata or content by ID. If you provide the URL
  5998  // parameter `alt=media`, then the response includes the file contents in the
  5999  // response body. Downloading content with `alt=media` only works if the file
  6000  // is stored in Drive. To download Google Docs, Sheets, and Slides use
  6001  // `files.export` (/drive/api/reference/rest/v3/files/export) instead. For more
  6002  // information, see Download & export files
  6003  // (/drive/api/guides/manage-downloads).
  6004  //
  6005  // - fileId: The ID of the file.
  6006  func (r *FilesService) Get(fileId string) *FilesGetCall {
  6007  	c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6008  	c.fileId = fileId
  6009  	return c
  6010  }
  6011  
  6012  // AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": Whether the
  6013  // user is acknowledging the risk of downloading known malware or other abusive
  6014  // files. This is only applicable when alt=media.
  6015  func (c *FilesGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesGetCall {
  6016  	c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse))
  6017  	return c
  6018  }
  6019  
  6020  // IncludeLabels sets the optional parameter "includeLabels": A comma-separated
  6021  // list of IDs of labels to include in the `labelInfo` part of the response.
  6022  func (c *FilesGetCall) IncludeLabels(includeLabels string) *FilesGetCall {
  6023  	c.urlParams_.Set("includeLabels", includeLabels)
  6024  	return c
  6025  }
  6026  
  6027  // IncludePermissionsForView sets the optional parameter
  6028  // "includePermissionsForView": Specifies which additional view's permissions
  6029  // to include in the response. Only 'published' is supported.
  6030  func (c *FilesGetCall) IncludePermissionsForView(includePermissionsForView string) *FilesGetCall {
  6031  	c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
  6032  	return c
  6033  }
  6034  
  6035  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  6036  // the requesting application supports both My Drives and shared drives.
  6037  func (c *FilesGetCall) SupportsAllDrives(supportsAllDrives bool) *FilesGetCall {
  6038  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  6039  	return c
  6040  }
  6041  
  6042  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  6043  // Deprecated: Use `supportsAllDrives` instead.
  6044  func (c *FilesGetCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesGetCall {
  6045  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  6046  	return c
  6047  }
  6048  
  6049  // Fields allows partial responses to be retrieved. See
  6050  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6051  // details.
  6052  func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall {
  6053  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6054  	return c
  6055  }
  6056  
  6057  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6058  // object's ETag matches the given value. This is useful for getting updates
  6059  // only after the object has changed since the last request.
  6060  func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall {
  6061  	c.ifNoneMatch_ = entityTag
  6062  	return c
  6063  }
  6064  
  6065  // Context sets the context to be used in this call's Do and Download methods.
  6066  func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall {
  6067  	c.ctx_ = ctx
  6068  	return c
  6069  }
  6070  
  6071  // Header returns a http.Header that can be modified by the caller to add
  6072  // headers to the request.
  6073  func (c *FilesGetCall) Header() http.Header {
  6074  	if c.header_ == nil {
  6075  		c.header_ = make(http.Header)
  6076  	}
  6077  	return c.header_
  6078  }
  6079  
  6080  func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) {
  6081  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6082  	if c.ifNoneMatch_ != "" {
  6083  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6084  	}
  6085  	var body io.Reader = nil
  6086  	c.urlParams_.Set("alt", alt)
  6087  	c.urlParams_.Set("prettyPrint", "false")
  6088  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}")
  6089  	urls += "?" + c.urlParams_.Encode()
  6090  	req, err := http.NewRequest("GET", urls, body)
  6091  	if err != nil {
  6092  		return nil, err
  6093  	}
  6094  	req.Header = reqHeaders
  6095  	googleapi.Expand(req.URL, map[string]string{
  6096  		"fileId": c.fileId,
  6097  	})
  6098  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6099  }
  6100  
  6101  // Download fetches the API endpoint's "media" value, instead of the normal
  6102  // API response value. If the returned error is nil, the Response is guaranteed to
  6103  // have a 2xx status code. Callers must close the Response.Body as usual.
  6104  func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  6105  	gensupport.SetOptions(c.urlParams_, opts...)
  6106  	res, err := c.doRequest("media")
  6107  	if err != nil {
  6108  		return nil, err
  6109  	}
  6110  	if err := googleapi.CheckResponse(res); err != nil {
  6111  		res.Body.Close()
  6112  		return nil, gensupport.WrapError(err)
  6113  	}
  6114  	return res, nil
  6115  }
  6116  
  6117  // Do executes the "drive.files.get" call.
  6118  // Any non-2xx status code is an error. Response headers are in either
  6119  // *File.ServerResponse.Header or (if a response was returned at all) in
  6120  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6121  // whether the returned error was because http.StatusNotModified was returned.
  6122  func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) {
  6123  	gensupport.SetOptions(c.urlParams_, opts...)
  6124  	res, err := c.doRequest("json")
  6125  	if res != nil && res.StatusCode == http.StatusNotModified {
  6126  		if res.Body != nil {
  6127  			res.Body.Close()
  6128  		}
  6129  		return nil, gensupport.WrapError(&googleapi.Error{
  6130  			Code:   res.StatusCode,
  6131  			Header: res.Header,
  6132  		})
  6133  	}
  6134  	if err != nil {
  6135  		return nil, err
  6136  	}
  6137  	defer googleapi.CloseBody(res)
  6138  	if err := googleapi.CheckResponse(res); err != nil {
  6139  		return nil, gensupport.WrapError(err)
  6140  	}
  6141  	ret := &File{
  6142  		ServerResponse: googleapi.ServerResponse{
  6143  			Header:         res.Header,
  6144  			HTTPStatusCode: res.StatusCode,
  6145  		},
  6146  	}
  6147  	target := &ret
  6148  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6149  		return nil, err
  6150  	}
  6151  	return ret, nil
  6152  }
  6153  
  6154  type FilesListCall struct {
  6155  	s            *Service
  6156  	urlParams_   gensupport.URLParams
  6157  	ifNoneMatch_ string
  6158  	ctx_         context.Context
  6159  	header_      http.Header
  6160  }
  6161  
  6162  // List:  Lists the user's files. This method accepts the `q` parameter, which
  6163  // is a search query combining one or more search terms. For more information,
  6164  // see the Search for files & folders (/drive/api/guides/search-files) guide.
  6165  // *Note:* This method returns *all* files by default, including trashed files.
  6166  // If you don't want trashed files to appear in the list, use the
  6167  // `trashed=false` query parameter to remove trashed files from the results.
  6168  func (r *FilesService) List() *FilesListCall {
  6169  	c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6170  	return c
  6171  }
  6172  
  6173  // Corpora sets the optional parameter "corpora": Bodies of items
  6174  // (files/documents) to which the query applies. Supported bodies are 'user',
  6175  // 'domain', 'drive', and 'allDrives'. Prefer 'user' or 'drive' to 'allDrives'
  6176  // for efficiency. By default, corpora is set to 'user'. However, this can
  6177  // change depending on the filter set through the 'q' parameter.
  6178  func (c *FilesListCall) Corpora(corpora string) *FilesListCall {
  6179  	c.urlParams_.Set("corpora", corpora)
  6180  	return c
  6181  }
  6182  
  6183  // Corpus sets the optional parameter "corpus": Deprecated: The source of files
  6184  // to list. Use 'corpora' instead.
  6185  //
  6186  // Possible values:
  6187  //
  6188  //	"domain" - Files shared to the user's domain.
  6189  //	"user" - Files owned by or shared to the user.
  6190  func (c *FilesListCall) Corpus(corpus string) *FilesListCall {
  6191  	c.urlParams_.Set("corpus", corpus)
  6192  	return c
  6193  }
  6194  
  6195  // DriveId sets the optional parameter "driveId": ID of the shared drive to
  6196  // search.
  6197  func (c *FilesListCall) DriveId(driveId string) *FilesListCall {
  6198  	c.urlParams_.Set("driveId", driveId)
  6199  	return c
  6200  }
  6201  
  6202  // IncludeItemsFromAllDrives sets the optional parameter
  6203  // "includeItemsFromAllDrives": Whether both My Drive and shared drive items
  6204  // should be included in results.
  6205  func (c *FilesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *FilesListCall {
  6206  	c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives))
  6207  	return c
  6208  }
  6209  
  6210  // IncludeLabels sets the optional parameter "includeLabels": A comma-separated
  6211  // list of IDs of labels to include in the `labelInfo` part of the response.
  6212  func (c *FilesListCall) IncludeLabels(includeLabels string) *FilesListCall {
  6213  	c.urlParams_.Set("includeLabels", includeLabels)
  6214  	return c
  6215  }
  6216  
  6217  // IncludePermissionsForView sets the optional parameter
  6218  // "includePermissionsForView": Specifies which additional view's permissions
  6219  // to include in the response. Only 'published' is supported.
  6220  func (c *FilesListCall) IncludePermissionsForView(includePermissionsForView string) *FilesListCall {
  6221  	c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
  6222  	return c
  6223  }
  6224  
  6225  // IncludeTeamDriveItems sets the optional parameter "includeTeamDriveItems":
  6226  // Deprecated: Use `includeItemsFromAllDrives` instead.
  6227  func (c *FilesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *FilesListCall {
  6228  	c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems))
  6229  	return c
  6230  }
  6231  
  6232  // OrderBy sets the optional parameter "orderBy": A comma-separated list of
  6233  // sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime',
  6234  // 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency',
  6235  // 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts
  6236  // ascending by default, but can be reversed with the 'desc' modifier. Example
  6237  // usage: ?orderBy=folder,modifiedTime desc,name.
  6238  func (c *FilesListCall) OrderBy(orderBy string) *FilesListCall {
  6239  	c.urlParams_.Set("orderBy", orderBy)
  6240  	return c
  6241  }
  6242  
  6243  // PageSize sets the optional parameter "pageSize": The maximum number of files
  6244  // to return per page. Partial or empty result pages are possible even before
  6245  // the end of the files list has been reached.
  6246  func (c *FilesListCall) PageSize(pageSize int64) *FilesListCall {
  6247  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6248  	return c
  6249  }
  6250  
  6251  // PageToken sets the optional parameter "pageToken": The token for continuing
  6252  // a previous list request on the next page. This should be set to the value of
  6253  // 'nextPageToken' from the previous response.
  6254  func (c *FilesListCall) PageToken(pageToken string) *FilesListCall {
  6255  	c.urlParams_.Set("pageToken", pageToken)
  6256  	return c
  6257  }
  6258  
  6259  // Q sets the optional parameter "q": A query for filtering the file results.
  6260  // See the "Search for files & folders" guide for supported syntax.
  6261  func (c *FilesListCall) Q(q string) *FilesListCall {
  6262  	c.urlParams_.Set("q", q)
  6263  	return c
  6264  }
  6265  
  6266  // Spaces sets the optional parameter "spaces": A comma-separated list of
  6267  // spaces to query within the corpora. Supported values are 'drive' and
  6268  // 'appDataFolder'.
  6269  func (c *FilesListCall) Spaces(spaces string) *FilesListCall {
  6270  	c.urlParams_.Set("spaces", spaces)
  6271  	return c
  6272  }
  6273  
  6274  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  6275  // the requesting application supports both My Drives and shared drives.
  6276  func (c *FilesListCall) SupportsAllDrives(supportsAllDrives bool) *FilesListCall {
  6277  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  6278  	return c
  6279  }
  6280  
  6281  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  6282  // Deprecated: Use `supportsAllDrives` instead.
  6283  func (c *FilesListCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesListCall {
  6284  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  6285  	return c
  6286  }
  6287  
  6288  // TeamDriveId sets the optional parameter "teamDriveId": Deprecated: Use
  6289  // `driveId` instead.
  6290  func (c *FilesListCall) TeamDriveId(teamDriveId string) *FilesListCall {
  6291  	c.urlParams_.Set("teamDriveId", teamDriveId)
  6292  	return c
  6293  }
  6294  
  6295  // Fields allows partial responses to be retrieved. See
  6296  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6297  // details.
  6298  func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall {
  6299  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6300  	return c
  6301  }
  6302  
  6303  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6304  // object's ETag matches the given value. This is useful for getting updates
  6305  // only after the object has changed since the last request.
  6306  func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall {
  6307  	c.ifNoneMatch_ = entityTag
  6308  	return c
  6309  }
  6310  
  6311  // Context sets the context to be used in this call's Do method.
  6312  func (c *FilesListCall) Context(ctx context.Context) *FilesListCall {
  6313  	c.ctx_ = ctx
  6314  	return c
  6315  }
  6316  
  6317  // Header returns a http.Header that can be modified by the caller to add
  6318  // headers to the request.
  6319  func (c *FilesListCall) Header() http.Header {
  6320  	if c.header_ == nil {
  6321  		c.header_ = make(http.Header)
  6322  	}
  6323  	return c.header_
  6324  }
  6325  
  6326  func (c *FilesListCall) doRequest(alt string) (*http.Response, error) {
  6327  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6328  	if c.ifNoneMatch_ != "" {
  6329  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6330  	}
  6331  	var body io.Reader = nil
  6332  	c.urlParams_.Set("alt", alt)
  6333  	c.urlParams_.Set("prettyPrint", "false")
  6334  	urls := googleapi.ResolveRelative(c.s.BasePath, "files")
  6335  	urls += "?" + c.urlParams_.Encode()
  6336  	req, err := http.NewRequest("GET", urls, body)
  6337  	if err != nil {
  6338  		return nil, err
  6339  	}
  6340  	req.Header = reqHeaders
  6341  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6342  }
  6343  
  6344  // Do executes the "drive.files.list" call.
  6345  // Any non-2xx status code is an error. Response headers are in either
  6346  // *FileList.ServerResponse.Header or (if a response was returned at all) in
  6347  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6348  // whether the returned error was because http.StatusNotModified was returned.
  6349  func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) {
  6350  	gensupport.SetOptions(c.urlParams_, opts...)
  6351  	res, err := c.doRequest("json")
  6352  	if res != nil && res.StatusCode == http.StatusNotModified {
  6353  		if res.Body != nil {
  6354  			res.Body.Close()
  6355  		}
  6356  		return nil, gensupport.WrapError(&googleapi.Error{
  6357  			Code:   res.StatusCode,
  6358  			Header: res.Header,
  6359  		})
  6360  	}
  6361  	if err != nil {
  6362  		return nil, err
  6363  	}
  6364  	defer googleapi.CloseBody(res)
  6365  	if err := googleapi.CheckResponse(res); err != nil {
  6366  		return nil, gensupport.WrapError(err)
  6367  	}
  6368  	ret := &FileList{
  6369  		ServerResponse: googleapi.ServerResponse{
  6370  			Header:         res.Header,
  6371  			HTTPStatusCode: res.StatusCode,
  6372  		},
  6373  	}
  6374  	target := &ret
  6375  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6376  		return nil, err
  6377  	}
  6378  	return ret, nil
  6379  }
  6380  
  6381  // Pages invokes f for each page of results.
  6382  // A non-nil error returned from f will halt the iteration.
  6383  // The provided context supersedes any context provided to the Context method.
  6384  func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error {
  6385  	c.ctx_ = ctx
  6386  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  6387  	for {
  6388  		x, err := c.Do()
  6389  		if err != nil {
  6390  			return err
  6391  		}
  6392  		if err := f(x); err != nil {
  6393  			return err
  6394  		}
  6395  		if x.NextPageToken == "" {
  6396  			return nil
  6397  		}
  6398  		c.PageToken(x.NextPageToken)
  6399  	}
  6400  }
  6401  
  6402  type FilesListLabelsCall struct {
  6403  	s            *Service
  6404  	fileId       string
  6405  	urlParams_   gensupport.URLParams
  6406  	ifNoneMatch_ string
  6407  	ctx_         context.Context
  6408  	header_      http.Header
  6409  }
  6410  
  6411  // ListLabels: Lists the labels on a file.
  6412  //
  6413  // - fileId: The ID for the file.
  6414  func (r *FilesService) ListLabels(fileId string) *FilesListLabelsCall {
  6415  	c := &FilesListLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6416  	c.fileId = fileId
  6417  	return c
  6418  }
  6419  
  6420  // MaxResults sets the optional parameter "maxResults": The maximum number of
  6421  // labels to return per page. When not set, defaults to 100.
  6422  func (c *FilesListLabelsCall) MaxResults(maxResults int64) *FilesListLabelsCall {
  6423  	c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
  6424  	return c
  6425  }
  6426  
  6427  // PageToken sets the optional parameter "pageToken": The token for continuing
  6428  // a previous list request on the next page. This should be set to the value of
  6429  // 'nextPageToken' from the previous response.
  6430  func (c *FilesListLabelsCall) PageToken(pageToken string) *FilesListLabelsCall {
  6431  	c.urlParams_.Set("pageToken", pageToken)
  6432  	return c
  6433  }
  6434  
  6435  // Fields allows partial responses to be retrieved. See
  6436  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6437  // details.
  6438  func (c *FilesListLabelsCall) Fields(s ...googleapi.Field) *FilesListLabelsCall {
  6439  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6440  	return c
  6441  }
  6442  
  6443  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6444  // object's ETag matches the given value. This is useful for getting updates
  6445  // only after the object has changed since the last request.
  6446  func (c *FilesListLabelsCall) IfNoneMatch(entityTag string) *FilesListLabelsCall {
  6447  	c.ifNoneMatch_ = entityTag
  6448  	return c
  6449  }
  6450  
  6451  // Context sets the context to be used in this call's Do method.
  6452  func (c *FilesListLabelsCall) Context(ctx context.Context) *FilesListLabelsCall {
  6453  	c.ctx_ = ctx
  6454  	return c
  6455  }
  6456  
  6457  // Header returns a http.Header that can be modified by the caller to add
  6458  // headers to the request.
  6459  func (c *FilesListLabelsCall) Header() http.Header {
  6460  	if c.header_ == nil {
  6461  		c.header_ = make(http.Header)
  6462  	}
  6463  	return c.header_
  6464  }
  6465  
  6466  func (c *FilesListLabelsCall) doRequest(alt string) (*http.Response, error) {
  6467  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6468  	if c.ifNoneMatch_ != "" {
  6469  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6470  	}
  6471  	var body io.Reader = nil
  6472  	c.urlParams_.Set("alt", alt)
  6473  	c.urlParams_.Set("prettyPrint", "false")
  6474  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/listLabels")
  6475  	urls += "?" + c.urlParams_.Encode()
  6476  	req, err := http.NewRequest("GET", urls, body)
  6477  	if err != nil {
  6478  		return nil, err
  6479  	}
  6480  	req.Header = reqHeaders
  6481  	googleapi.Expand(req.URL, map[string]string{
  6482  		"fileId": c.fileId,
  6483  	})
  6484  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6485  }
  6486  
  6487  // Do executes the "drive.files.listLabels" call.
  6488  // Any non-2xx status code is an error. Response headers are in either
  6489  // *LabelList.ServerResponse.Header or (if a response was returned at all) in
  6490  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6491  // whether the returned error was because http.StatusNotModified was returned.
  6492  func (c *FilesListLabelsCall) Do(opts ...googleapi.CallOption) (*LabelList, error) {
  6493  	gensupport.SetOptions(c.urlParams_, opts...)
  6494  	res, err := c.doRequest("json")
  6495  	if res != nil && res.StatusCode == http.StatusNotModified {
  6496  		if res.Body != nil {
  6497  			res.Body.Close()
  6498  		}
  6499  		return nil, gensupport.WrapError(&googleapi.Error{
  6500  			Code:   res.StatusCode,
  6501  			Header: res.Header,
  6502  		})
  6503  	}
  6504  	if err != nil {
  6505  		return nil, err
  6506  	}
  6507  	defer googleapi.CloseBody(res)
  6508  	if err := googleapi.CheckResponse(res); err != nil {
  6509  		return nil, gensupport.WrapError(err)
  6510  	}
  6511  	ret := &LabelList{
  6512  		ServerResponse: googleapi.ServerResponse{
  6513  			Header:         res.Header,
  6514  			HTTPStatusCode: res.StatusCode,
  6515  		},
  6516  	}
  6517  	target := &ret
  6518  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6519  		return nil, err
  6520  	}
  6521  	return ret, nil
  6522  }
  6523  
  6524  // Pages invokes f for each page of results.
  6525  // A non-nil error returned from f will halt the iteration.
  6526  // The provided context supersedes any context provided to the Context method.
  6527  func (c *FilesListLabelsCall) Pages(ctx context.Context, f func(*LabelList) error) error {
  6528  	c.ctx_ = ctx
  6529  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  6530  	for {
  6531  		x, err := c.Do()
  6532  		if err != nil {
  6533  			return err
  6534  		}
  6535  		if err := f(x); err != nil {
  6536  			return err
  6537  		}
  6538  		if x.NextPageToken == "" {
  6539  			return nil
  6540  		}
  6541  		c.PageToken(x.NextPageToken)
  6542  	}
  6543  }
  6544  
  6545  type FilesModifyLabelsCall struct {
  6546  	s                   *Service
  6547  	fileId              string
  6548  	modifylabelsrequest *ModifyLabelsRequest
  6549  	urlParams_          gensupport.URLParams
  6550  	ctx_                context.Context
  6551  	header_             http.Header
  6552  }
  6553  
  6554  // ModifyLabels: Modifies the set of labels applied to a file. Returns a list
  6555  // of the labels that were added or modified.
  6556  //
  6557  // - fileId: The ID of the file to which the labels belong.
  6558  func (r *FilesService) ModifyLabels(fileId string, modifylabelsrequest *ModifyLabelsRequest) *FilesModifyLabelsCall {
  6559  	c := &FilesModifyLabelsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6560  	c.fileId = fileId
  6561  	c.modifylabelsrequest = modifylabelsrequest
  6562  	return c
  6563  }
  6564  
  6565  // Fields allows partial responses to be retrieved. See
  6566  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6567  // details.
  6568  func (c *FilesModifyLabelsCall) Fields(s ...googleapi.Field) *FilesModifyLabelsCall {
  6569  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6570  	return c
  6571  }
  6572  
  6573  // Context sets the context to be used in this call's Do method.
  6574  func (c *FilesModifyLabelsCall) Context(ctx context.Context) *FilesModifyLabelsCall {
  6575  	c.ctx_ = ctx
  6576  	return c
  6577  }
  6578  
  6579  // Header returns a http.Header that can be modified by the caller to add
  6580  // headers to the request.
  6581  func (c *FilesModifyLabelsCall) Header() http.Header {
  6582  	if c.header_ == nil {
  6583  		c.header_ = make(http.Header)
  6584  	}
  6585  	return c.header_
  6586  }
  6587  
  6588  func (c *FilesModifyLabelsCall) doRequest(alt string) (*http.Response, error) {
  6589  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6590  	var body io.Reader = nil
  6591  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifylabelsrequest)
  6592  	if err != nil {
  6593  		return nil, err
  6594  	}
  6595  	c.urlParams_.Set("alt", alt)
  6596  	c.urlParams_.Set("prettyPrint", "false")
  6597  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/modifyLabels")
  6598  	urls += "?" + c.urlParams_.Encode()
  6599  	req, err := http.NewRequest("POST", urls, body)
  6600  	if err != nil {
  6601  		return nil, err
  6602  	}
  6603  	req.Header = reqHeaders
  6604  	googleapi.Expand(req.URL, map[string]string{
  6605  		"fileId": c.fileId,
  6606  	})
  6607  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6608  }
  6609  
  6610  // Do executes the "drive.files.modifyLabels" call.
  6611  // Any non-2xx status code is an error. Response headers are in either
  6612  // *ModifyLabelsResponse.ServerResponse.Header or (if a response was returned
  6613  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6614  // check whether the returned error was because http.StatusNotModified was
  6615  // returned.
  6616  func (c *FilesModifyLabelsCall) Do(opts ...googleapi.CallOption) (*ModifyLabelsResponse, error) {
  6617  	gensupport.SetOptions(c.urlParams_, opts...)
  6618  	res, err := c.doRequest("json")
  6619  	if res != nil && res.StatusCode == http.StatusNotModified {
  6620  		if res.Body != nil {
  6621  			res.Body.Close()
  6622  		}
  6623  		return nil, gensupport.WrapError(&googleapi.Error{
  6624  			Code:   res.StatusCode,
  6625  			Header: res.Header,
  6626  		})
  6627  	}
  6628  	if err != nil {
  6629  		return nil, err
  6630  	}
  6631  	defer googleapi.CloseBody(res)
  6632  	if err := googleapi.CheckResponse(res); err != nil {
  6633  		return nil, gensupport.WrapError(err)
  6634  	}
  6635  	ret := &ModifyLabelsResponse{
  6636  		ServerResponse: googleapi.ServerResponse{
  6637  			Header:         res.Header,
  6638  			HTTPStatusCode: res.StatusCode,
  6639  		},
  6640  	}
  6641  	target := &ret
  6642  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6643  		return nil, err
  6644  	}
  6645  	return ret, nil
  6646  }
  6647  
  6648  type FilesUpdateCall struct {
  6649  	s          *Service
  6650  	fileId     string
  6651  	file       *File
  6652  	urlParams_ gensupport.URLParams
  6653  	mediaInfo_ *gensupport.MediaInfo
  6654  	ctx_       context.Context
  6655  	header_    http.Header
  6656  }
  6657  
  6658  // Update:  Updates a file's metadata and/or content. When calling this method,
  6659  // only populate fields in the request that you want to modify. When updating
  6660  // fields, some fields might be changed automatically, such as `modifiedDate`.
  6661  // This method supports patch semantics. This method supports an */upload* URI
  6662  // and accepts uploaded media with the following characteristics: - *Maximum
  6663  // file size:* 5,120 GB - *Accepted Media MIME types:*`*/*` Note: Specify a
  6664  // valid MIME type, rather than the literal `*/*` value. The literal `*/*` is
  6665  // only used to indicate that any valid MIME type can be uploaded. For more
  6666  // information on uploading files, see Upload file data
  6667  // (/drive/api/guides/manage-uploads).
  6668  //
  6669  // - fileId: The ID of the file.
  6670  func (r *FilesService) Update(fileId string, file *File) *FilesUpdateCall {
  6671  	c := &FilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6672  	c.fileId = fileId
  6673  	c.file = file
  6674  	return c
  6675  }
  6676  
  6677  // AddParents sets the optional parameter "addParents": A comma-separated list
  6678  // of parent IDs to add.
  6679  func (c *FilesUpdateCall) AddParents(addParents string) *FilesUpdateCall {
  6680  	c.urlParams_.Set("addParents", addParents)
  6681  	return c
  6682  }
  6683  
  6684  // EnforceSingleParent sets the optional parameter "enforceSingleParent":
  6685  // Deprecated: Adding files to multiple folders is no longer supported. Use
  6686  // shortcuts instead.
  6687  func (c *FilesUpdateCall) EnforceSingleParent(enforceSingleParent bool) *FilesUpdateCall {
  6688  	c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
  6689  	return c
  6690  }
  6691  
  6692  // IncludeLabels sets the optional parameter "includeLabels": A comma-separated
  6693  // list of IDs of labels to include in the `labelInfo` part of the response.
  6694  func (c *FilesUpdateCall) IncludeLabels(includeLabels string) *FilesUpdateCall {
  6695  	c.urlParams_.Set("includeLabels", includeLabels)
  6696  	return c
  6697  }
  6698  
  6699  // IncludePermissionsForView sets the optional parameter
  6700  // "includePermissionsForView": Specifies which additional view's permissions
  6701  // to include in the response. Only 'published' is supported.
  6702  func (c *FilesUpdateCall) IncludePermissionsForView(includePermissionsForView string) *FilesUpdateCall {
  6703  	c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
  6704  	return c
  6705  }
  6706  
  6707  // KeepRevisionForever sets the optional parameter "keepRevisionForever":
  6708  // Whether to set the 'keepForever' field in the new head revision. This is
  6709  // only applicable to files with binary content in Google Drive. Only 200
  6710  // revisions for the file can be kept forever. If the limit is reached, try
  6711  // deleting pinned revisions.
  6712  func (c *FilesUpdateCall) KeepRevisionForever(keepRevisionForever bool) *FilesUpdateCall {
  6713  	c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever))
  6714  	return c
  6715  }
  6716  
  6717  // OcrLanguage sets the optional parameter "ocrLanguage": A language hint for
  6718  // OCR processing during image import (ISO 639-1 code).
  6719  func (c *FilesUpdateCall) OcrLanguage(ocrLanguage string) *FilesUpdateCall {
  6720  	c.urlParams_.Set("ocrLanguage", ocrLanguage)
  6721  	return c
  6722  }
  6723  
  6724  // RemoveParents sets the optional parameter "removeParents": A comma-separated
  6725  // list of parent IDs to remove.
  6726  func (c *FilesUpdateCall) RemoveParents(removeParents string) *FilesUpdateCall {
  6727  	c.urlParams_.Set("removeParents", removeParents)
  6728  	return c
  6729  }
  6730  
  6731  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  6732  // the requesting application supports both My Drives and shared drives.
  6733  func (c *FilesUpdateCall) SupportsAllDrives(supportsAllDrives bool) *FilesUpdateCall {
  6734  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  6735  	return c
  6736  }
  6737  
  6738  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  6739  // Deprecated: Use `supportsAllDrives` instead.
  6740  func (c *FilesUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesUpdateCall {
  6741  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  6742  	return c
  6743  }
  6744  
  6745  // UseContentAsIndexableText sets the optional parameter
  6746  // "useContentAsIndexableText": Whether to use the uploaded content as
  6747  // indexable text.
  6748  func (c *FilesUpdateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesUpdateCall {
  6749  	c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText))
  6750  	return c
  6751  }
  6752  
  6753  // Media specifies the media to upload in one or more chunks. The chunk size
  6754  // may be controlled by supplying a MediaOption generated by
  6755  // googleapi.ChunkSize. The chunk size defaults to
  6756  // googleapi.DefaultUploadChunkSize.The Content-Type header used in the upload
  6757  // request will be determined by sniffing the contents of r, unless a
  6758  // MediaOption generated by googleapi.ContentType is supplied.
  6759  // At most one of Media and ResumableMedia may be set.
  6760  func (c *FilesUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesUpdateCall {
  6761  	c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
  6762  	return c
  6763  }
  6764  
  6765  // ResumableMedia specifies the media to upload in chunks and can be canceled
  6766  // with ctx.
  6767  //
  6768  // Deprecated: use Media instead.
  6769  //
  6770  // At most one of Media and ResumableMedia may be set. mediaType identifies the
  6771  // MIME media type of the upload, such as "image/png". If mediaType is "", it
  6772  // will be auto-detected. The provided ctx will supersede any context
  6773  // previously provided to the Context method.
  6774  func (c *FilesUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesUpdateCall {
  6775  	c.ctx_ = ctx
  6776  	c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
  6777  	return c
  6778  }
  6779  
  6780  // ProgressUpdater provides a callback function that will be called after every
  6781  // chunk. It should be a low-latency function in order to not slow down the
  6782  // upload operation. This should only be called when using ResumableMedia (as
  6783  // opposed to Media).
  6784  func (c *FilesUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesUpdateCall {
  6785  	c.mediaInfo_.SetProgressUpdater(pu)
  6786  	return c
  6787  }
  6788  
  6789  // Fields allows partial responses to be retrieved. See
  6790  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6791  // details.
  6792  func (c *FilesUpdateCall) Fields(s ...googleapi.Field) *FilesUpdateCall {
  6793  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6794  	return c
  6795  }
  6796  
  6797  // Context sets the context to be used in this call's Do method.
  6798  // This context will supersede any context previously provided to the
  6799  // ResumableMedia method.
  6800  func (c *FilesUpdateCall) Context(ctx context.Context) *FilesUpdateCall {
  6801  	c.ctx_ = ctx
  6802  	return c
  6803  }
  6804  
  6805  // Header returns a http.Header that can be modified by the caller to add
  6806  // headers to the request.
  6807  func (c *FilesUpdateCall) Header() http.Header {
  6808  	if c.header_ == nil {
  6809  		c.header_ = make(http.Header)
  6810  	}
  6811  	return c.header_
  6812  }
  6813  
  6814  func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) {
  6815  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6816  	var body io.Reader = nil
  6817  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.file)
  6818  	if err != nil {
  6819  		return nil, err
  6820  	}
  6821  	c.urlParams_.Set("alt", alt)
  6822  	c.urlParams_.Set("prettyPrint", "false")
  6823  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}")
  6824  	if c.mediaInfo_ != nil {
  6825  		urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v3/files/{fileId}")
  6826  		c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
  6827  	}
  6828  	if body == nil {
  6829  		body = new(bytes.Buffer)
  6830  		reqHeaders.Set("Content-Type", "application/json")
  6831  	}
  6832  	body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
  6833  	defer cleanup()
  6834  	urls += "?" + c.urlParams_.Encode()
  6835  	req, err := http.NewRequest("PATCH", urls, body)
  6836  	if err != nil {
  6837  		return nil, err
  6838  	}
  6839  	req.Header = reqHeaders
  6840  	req.GetBody = getBody
  6841  	googleapi.Expand(req.URL, map[string]string{
  6842  		"fileId": c.fileId,
  6843  	})
  6844  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6845  }
  6846  
  6847  // Do executes the "drive.files.update" call.
  6848  // Any non-2xx status code is an error. Response headers are in either
  6849  // *File.ServerResponse.Header or (if a response was returned at all) in
  6850  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6851  // whether the returned error was because http.StatusNotModified was returned.
  6852  func (c *FilesUpdateCall) Do(opts ...googleapi.CallOption) (*File, error) {
  6853  	gensupport.SetOptions(c.urlParams_, opts...)
  6854  	res, err := c.doRequest("json")
  6855  	if res != nil && res.StatusCode == http.StatusNotModified {
  6856  		if res.Body != nil {
  6857  			res.Body.Close()
  6858  		}
  6859  		return nil, gensupport.WrapError(&googleapi.Error{
  6860  			Code:   res.StatusCode,
  6861  			Header: res.Header,
  6862  		})
  6863  	}
  6864  	if err != nil {
  6865  		return nil, err
  6866  	}
  6867  	defer googleapi.CloseBody(res)
  6868  	if err := googleapi.CheckResponse(res); err != nil {
  6869  		return nil, gensupport.WrapError(err)
  6870  	}
  6871  	rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
  6872  	if rx != nil {
  6873  		rx.Client = c.s.client
  6874  		rx.UserAgent = c.s.userAgent()
  6875  		ctx := c.ctx_
  6876  		if ctx == nil {
  6877  			ctx = context.TODO()
  6878  		}
  6879  		res, err = rx.Upload(ctx)
  6880  		if err != nil {
  6881  			return nil, err
  6882  		}
  6883  		defer res.Body.Close()
  6884  		if err := googleapi.CheckResponse(res); err != nil {
  6885  			return nil, gensupport.WrapError(err)
  6886  		}
  6887  	}
  6888  	ret := &File{
  6889  		ServerResponse: googleapi.ServerResponse{
  6890  			Header:         res.Header,
  6891  			HTTPStatusCode: res.StatusCode,
  6892  		},
  6893  	}
  6894  	target := &ret
  6895  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6896  		return nil, err
  6897  	}
  6898  	return ret, nil
  6899  }
  6900  
  6901  type FilesWatchCall struct {
  6902  	s          *Service
  6903  	fileId     string
  6904  	channel    *Channel
  6905  	urlParams_ gensupport.URLParams
  6906  	ctx_       context.Context
  6907  	header_    http.Header
  6908  }
  6909  
  6910  // Watch: Subscribes to changes to a file.
  6911  //
  6912  // - fileId: The ID of the file.
  6913  func (r *FilesService) Watch(fileId string, channel *Channel) *FilesWatchCall {
  6914  	c := &FilesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6915  	c.fileId = fileId
  6916  	c.channel = channel
  6917  	return c
  6918  }
  6919  
  6920  // AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": Whether the
  6921  // user is acknowledging the risk of downloading known malware or other abusive
  6922  // files. This is only applicable when alt=media.
  6923  func (c *FilesWatchCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesWatchCall {
  6924  	c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse))
  6925  	return c
  6926  }
  6927  
  6928  // IncludeLabels sets the optional parameter "includeLabels": A comma-separated
  6929  // list of IDs of labels to include in the `labelInfo` part of the response.
  6930  func (c *FilesWatchCall) IncludeLabels(includeLabels string) *FilesWatchCall {
  6931  	c.urlParams_.Set("includeLabels", includeLabels)
  6932  	return c
  6933  }
  6934  
  6935  // IncludePermissionsForView sets the optional parameter
  6936  // "includePermissionsForView": Specifies which additional view's permissions
  6937  // to include in the response. Only 'published' is supported.
  6938  func (c *FilesWatchCall) IncludePermissionsForView(includePermissionsForView string) *FilesWatchCall {
  6939  	c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
  6940  	return c
  6941  }
  6942  
  6943  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  6944  // the requesting application supports both My Drives and shared drives.
  6945  func (c *FilesWatchCall) SupportsAllDrives(supportsAllDrives bool) *FilesWatchCall {
  6946  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  6947  	return c
  6948  }
  6949  
  6950  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  6951  // Deprecated: Use `supportsAllDrives` instead.
  6952  func (c *FilesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesWatchCall {
  6953  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  6954  	return c
  6955  }
  6956  
  6957  // Fields allows partial responses to be retrieved. See
  6958  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6959  // details.
  6960  func (c *FilesWatchCall) Fields(s ...googleapi.Field) *FilesWatchCall {
  6961  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6962  	return c
  6963  }
  6964  
  6965  // Context sets the context to be used in this call's Do method.
  6966  func (c *FilesWatchCall) Context(ctx context.Context) *FilesWatchCall {
  6967  	c.ctx_ = ctx
  6968  	return c
  6969  }
  6970  
  6971  // Header returns a http.Header that can be modified by the caller to add
  6972  // headers to the request.
  6973  func (c *FilesWatchCall) Header() http.Header {
  6974  	if c.header_ == nil {
  6975  		c.header_ = make(http.Header)
  6976  	}
  6977  	return c.header_
  6978  }
  6979  
  6980  func (c *FilesWatchCall) doRequest(alt string) (*http.Response, error) {
  6981  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6982  	var body io.Reader = nil
  6983  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
  6984  	if err != nil {
  6985  		return nil, err
  6986  	}
  6987  	c.urlParams_.Set("alt", alt)
  6988  	c.urlParams_.Set("prettyPrint", "false")
  6989  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/watch")
  6990  	urls += "?" + c.urlParams_.Encode()
  6991  	req, err := http.NewRequest("POST", urls, body)
  6992  	if err != nil {
  6993  		return nil, err
  6994  	}
  6995  	req.Header = reqHeaders
  6996  	googleapi.Expand(req.URL, map[string]string{
  6997  		"fileId": c.fileId,
  6998  	})
  6999  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7000  }
  7001  
  7002  // Do executes the "drive.files.watch" call.
  7003  // Any non-2xx status code is an error. Response headers are in either
  7004  // *Channel.ServerResponse.Header or (if a response was returned at all) in
  7005  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7006  // whether the returned error was because http.StatusNotModified was returned.
  7007  func (c *FilesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
  7008  	gensupport.SetOptions(c.urlParams_, opts...)
  7009  	res, err := c.doRequest("json")
  7010  	if res != nil && res.StatusCode == http.StatusNotModified {
  7011  		if res.Body != nil {
  7012  			res.Body.Close()
  7013  		}
  7014  		return nil, gensupport.WrapError(&googleapi.Error{
  7015  			Code:   res.StatusCode,
  7016  			Header: res.Header,
  7017  		})
  7018  	}
  7019  	if err != nil {
  7020  		return nil, err
  7021  	}
  7022  	defer googleapi.CloseBody(res)
  7023  	if err := googleapi.CheckResponse(res); err != nil {
  7024  		return nil, gensupport.WrapError(err)
  7025  	}
  7026  	ret := &Channel{
  7027  		ServerResponse: googleapi.ServerResponse{
  7028  			Header:         res.Header,
  7029  			HTTPStatusCode: res.StatusCode,
  7030  		},
  7031  	}
  7032  	target := &ret
  7033  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7034  		return nil, err
  7035  	}
  7036  	return ret, nil
  7037  }
  7038  
  7039  type PermissionsCreateCall struct {
  7040  	s          *Service
  7041  	fileId     string
  7042  	permission *Permission
  7043  	urlParams_ gensupport.URLParams
  7044  	ctx_       context.Context
  7045  	header_    http.Header
  7046  }
  7047  
  7048  // Create: Creates a permission for a file or shared drive. **Warning:**
  7049  // Concurrent permissions operations on the same file are not supported; only
  7050  // the last update is applied.
  7051  //
  7052  // - fileId: The ID of the file or shared drive.
  7053  func (r *PermissionsService) Create(fileId string, permission *Permission) *PermissionsCreateCall {
  7054  	c := &PermissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7055  	c.fileId = fileId
  7056  	c.permission = permission
  7057  	return c
  7058  }
  7059  
  7060  // EmailMessage sets the optional parameter "emailMessage": A plain text custom
  7061  // message to include in the notification email.
  7062  func (c *PermissionsCreateCall) EmailMessage(emailMessage string) *PermissionsCreateCall {
  7063  	c.urlParams_.Set("emailMessage", emailMessage)
  7064  	return c
  7065  }
  7066  
  7067  // EnforceSingleParent sets the optional parameter "enforceSingleParent":
  7068  // Deprecated: See `moveToNewOwnersRoot` for details.
  7069  func (c *PermissionsCreateCall) EnforceSingleParent(enforceSingleParent bool) *PermissionsCreateCall {
  7070  	c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent))
  7071  	return c
  7072  }
  7073  
  7074  // MoveToNewOwnersRoot sets the optional parameter "moveToNewOwnersRoot": This
  7075  // parameter will only take effect if the item is not in a shared drive and the
  7076  // request is attempting to transfer the ownership of the item. If set to
  7077  // `true`, the item will be moved to the new owner's My Drive root folder and
  7078  // all prior parents removed. If set to `false`, parents are not changed.
  7079  func (c *PermissionsCreateCall) MoveToNewOwnersRoot(moveToNewOwnersRoot bool) *PermissionsCreateCall {
  7080  	c.urlParams_.Set("moveToNewOwnersRoot", fmt.Sprint(moveToNewOwnersRoot))
  7081  	return c
  7082  }
  7083  
  7084  // SendNotificationEmail sets the optional parameter "sendNotificationEmail":
  7085  // Whether to send a notification email when sharing to users or groups. This
  7086  // defaults to true for users and groups, and is not allowed for other
  7087  // requests. It must not be disabled for ownership transfers.
  7088  func (c *PermissionsCreateCall) SendNotificationEmail(sendNotificationEmail bool) *PermissionsCreateCall {
  7089  	c.urlParams_.Set("sendNotificationEmail", fmt.Sprint(sendNotificationEmail))
  7090  	return c
  7091  }
  7092  
  7093  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  7094  // the requesting application supports both My Drives and shared drives.
  7095  func (c *PermissionsCreateCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsCreateCall {
  7096  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  7097  	return c
  7098  }
  7099  
  7100  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  7101  // Deprecated: Use `supportsAllDrives` instead.
  7102  func (c *PermissionsCreateCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsCreateCall {
  7103  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  7104  	return c
  7105  }
  7106  
  7107  // TransferOwnership sets the optional parameter "transferOwnership": Whether
  7108  // to transfer ownership to the specified user and downgrade the current owner
  7109  // to a writer. This parameter is required as an acknowledgement of the side
  7110  // effect.
  7111  func (c *PermissionsCreateCall) TransferOwnership(transferOwnership bool) *PermissionsCreateCall {
  7112  	c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership))
  7113  	return c
  7114  }
  7115  
  7116  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  7117  // Issue the request as a domain administrator; if set to true, then the
  7118  // requester will be granted access if the file ID parameter refers to a shared
  7119  // drive and the requester is an administrator of the domain to which the
  7120  // shared drive belongs.
  7121  func (c *PermissionsCreateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsCreateCall {
  7122  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  7123  	return c
  7124  }
  7125  
  7126  // Fields allows partial responses to be retrieved. See
  7127  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7128  // details.
  7129  func (c *PermissionsCreateCall) Fields(s ...googleapi.Field) *PermissionsCreateCall {
  7130  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7131  	return c
  7132  }
  7133  
  7134  // Context sets the context to be used in this call's Do method.
  7135  func (c *PermissionsCreateCall) Context(ctx context.Context) *PermissionsCreateCall {
  7136  	c.ctx_ = ctx
  7137  	return c
  7138  }
  7139  
  7140  // Header returns a http.Header that can be modified by the caller to add
  7141  // headers to the request.
  7142  func (c *PermissionsCreateCall) Header() http.Header {
  7143  	if c.header_ == nil {
  7144  		c.header_ = make(http.Header)
  7145  	}
  7146  	return c.header_
  7147  }
  7148  
  7149  func (c *PermissionsCreateCall) doRequest(alt string) (*http.Response, error) {
  7150  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7151  	var body io.Reader = nil
  7152  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission)
  7153  	if err != nil {
  7154  		return nil, err
  7155  	}
  7156  	c.urlParams_.Set("alt", alt)
  7157  	c.urlParams_.Set("prettyPrint", "false")
  7158  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions")
  7159  	urls += "?" + c.urlParams_.Encode()
  7160  	req, err := http.NewRequest("POST", urls, body)
  7161  	if err != nil {
  7162  		return nil, err
  7163  	}
  7164  	req.Header = reqHeaders
  7165  	googleapi.Expand(req.URL, map[string]string{
  7166  		"fileId": c.fileId,
  7167  	})
  7168  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7169  }
  7170  
  7171  // Do executes the "drive.permissions.create" call.
  7172  // Any non-2xx status code is an error. Response headers are in either
  7173  // *Permission.ServerResponse.Header or (if a response was returned at all) in
  7174  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7175  // whether the returned error was because http.StatusNotModified was returned.
  7176  func (c *PermissionsCreateCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
  7177  	gensupport.SetOptions(c.urlParams_, opts...)
  7178  	res, err := c.doRequest("json")
  7179  	if res != nil && res.StatusCode == http.StatusNotModified {
  7180  		if res.Body != nil {
  7181  			res.Body.Close()
  7182  		}
  7183  		return nil, gensupport.WrapError(&googleapi.Error{
  7184  			Code:   res.StatusCode,
  7185  			Header: res.Header,
  7186  		})
  7187  	}
  7188  	if err != nil {
  7189  		return nil, err
  7190  	}
  7191  	defer googleapi.CloseBody(res)
  7192  	if err := googleapi.CheckResponse(res); err != nil {
  7193  		return nil, gensupport.WrapError(err)
  7194  	}
  7195  	ret := &Permission{
  7196  		ServerResponse: googleapi.ServerResponse{
  7197  			Header:         res.Header,
  7198  			HTTPStatusCode: res.StatusCode,
  7199  		},
  7200  	}
  7201  	target := &ret
  7202  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7203  		return nil, err
  7204  	}
  7205  	return ret, nil
  7206  }
  7207  
  7208  type PermissionsDeleteCall struct {
  7209  	s            *Service
  7210  	fileId       string
  7211  	permissionId string
  7212  	urlParams_   gensupport.URLParams
  7213  	ctx_         context.Context
  7214  	header_      http.Header
  7215  }
  7216  
  7217  // Delete: Deletes a permission. **Warning:** Concurrent permissions operations
  7218  // on the same file are not supported; only the last update is applied.
  7219  //
  7220  // - fileId: The ID of the file or shared drive.
  7221  // - permissionId: The ID of the permission.
  7222  func (r *PermissionsService) Delete(fileId string, permissionId string) *PermissionsDeleteCall {
  7223  	c := &PermissionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7224  	c.fileId = fileId
  7225  	c.permissionId = permissionId
  7226  	return c
  7227  }
  7228  
  7229  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  7230  // the requesting application supports both My Drives and shared drives.
  7231  func (c *PermissionsDeleteCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsDeleteCall {
  7232  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  7233  	return c
  7234  }
  7235  
  7236  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  7237  // Deprecated: Use `supportsAllDrives` instead.
  7238  func (c *PermissionsDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsDeleteCall {
  7239  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  7240  	return c
  7241  }
  7242  
  7243  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  7244  // Issue the request as a domain administrator; if set to true, then the
  7245  // requester will be granted access if the file ID parameter refers to a shared
  7246  // drive and the requester is an administrator of the domain to which the
  7247  // shared drive belongs.
  7248  func (c *PermissionsDeleteCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsDeleteCall {
  7249  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  7250  	return c
  7251  }
  7252  
  7253  // Fields allows partial responses to be retrieved. See
  7254  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7255  // details.
  7256  func (c *PermissionsDeleteCall) Fields(s ...googleapi.Field) *PermissionsDeleteCall {
  7257  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7258  	return c
  7259  }
  7260  
  7261  // Context sets the context to be used in this call's Do method.
  7262  func (c *PermissionsDeleteCall) Context(ctx context.Context) *PermissionsDeleteCall {
  7263  	c.ctx_ = ctx
  7264  	return c
  7265  }
  7266  
  7267  // Header returns a http.Header that can be modified by the caller to add
  7268  // headers to the request.
  7269  func (c *PermissionsDeleteCall) Header() http.Header {
  7270  	if c.header_ == nil {
  7271  		c.header_ = make(http.Header)
  7272  	}
  7273  	return c.header_
  7274  }
  7275  
  7276  func (c *PermissionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7277  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7278  	var body io.Reader = nil
  7279  	c.urlParams_.Set("alt", alt)
  7280  	c.urlParams_.Set("prettyPrint", "false")
  7281  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}")
  7282  	urls += "?" + c.urlParams_.Encode()
  7283  	req, err := http.NewRequest("DELETE", urls, body)
  7284  	if err != nil {
  7285  		return nil, err
  7286  	}
  7287  	req.Header = reqHeaders
  7288  	googleapi.Expand(req.URL, map[string]string{
  7289  		"fileId":       c.fileId,
  7290  		"permissionId": c.permissionId,
  7291  	})
  7292  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7293  }
  7294  
  7295  // Do executes the "drive.permissions.delete" call.
  7296  func (c *PermissionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  7297  	gensupport.SetOptions(c.urlParams_, opts...)
  7298  	res, err := c.doRequest("json")
  7299  	if err != nil {
  7300  		return err
  7301  	}
  7302  	defer googleapi.CloseBody(res)
  7303  	if err := googleapi.CheckResponse(res); err != nil {
  7304  		return gensupport.WrapError(err)
  7305  	}
  7306  	return nil
  7307  }
  7308  
  7309  type PermissionsGetCall struct {
  7310  	s            *Service
  7311  	fileId       string
  7312  	permissionId string
  7313  	urlParams_   gensupport.URLParams
  7314  	ifNoneMatch_ string
  7315  	ctx_         context.Context
  7316  	header_      http.Header
  7317  }
  7318  
  7319  // Get: Gets a permission by ID.
  7320  //
  7321  // - fileId: The ID of the file.
  7322  // - permissionId: The ID of the permission.
  7323  func (r *PermissionsService) Get(fileId string, permissionId string) *PermissionsGetCall {
  7324  	c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7325  	c.fileId = fileId
  7326  	c.permissionId = permissionId
  7327  	return c
  7328  }
  7329  
  7330  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  7331  // the requesting application supports both My Drives and shared drives.
  7332  func (c *PermissionsGetCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsGetCall {
  7333  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  7334  	return c
  7335  }
  7336  
  7337  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  7338  // Deprecated: Use `supportsAllDrives` instead.
  7339  func (c *PermissionsGetCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsGetCall {
  7340  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  7341  	return c
  7342  }
  7343  
  7344  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  7345  // Issue the request as a domain administrator; if set to true, then the
  7346  // requester will be granted access if the file ID parameter refers to a shared
  7347  // drive and the requester is an administrator of the domain to which the
  7348  // shared drive belongs.
  7349  func (c *PermissionsGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsGetCall {
  7350  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  7351  	return c
  7352  }
  7353  
  7354  // Fields allows partial responses to be retrieved. See
  7355  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7356  // details.
  7357  func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall {
  7358  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7359  	return c
  7360  }
  7361  
  7362  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7363  // object's ETag matches the given value. This is useful for getting updates
  7364  // only after the object has changed since the last request.
  7365  func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall {
  7366  	c.ifNoneMatch_ = entityTag
  7367  	return c
  7368  }
  7369  
  7370  // Context sets the context to be used in this call's Do method.
  7371  func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall {
  7372  	c.ctx_ = ctx
  7373  	return c
  7374  }
  7375  
  7376  // Header returns a http.Header that can be modified by the caller to add
  7377  // headers to the request.
  7378  func (c *PermissionsGetCall) Header() http.Header {
  7379  	if c.header_ == nil {
  7380  		c.header_ = make(http.Header)
  7381  	}
  7382  	return c.header_
  7383  }
  7384  
  7385  func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) {
  7386  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7387  	if c.ifNoneMatch_ != "" {
  7388  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7389  	}
  7390  	var body io.Reader = nil
  7391  	c.urlParams_.Set("alt", alt)
  7392  	c.urlParams_.Set("prettyPrint", "false")
  7393  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}")
  7394  	urls += "?" + c.urlParams_.Encode()
  7395  	req, err := http.NewRequest("GET", urls, body)
  7396  	if err != nil {
  7397  		return nil, err
  7398  	}
  7399  	req.Header = reqHeaders
  7400  	googleapi.Expand(req.URL, map[string]string{
  7401  		"fileId":       c.fileId,
  7402  		"permissionId": c.permissionId,
  7403  	})
  7404  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7405  }
  7406  
  7407  // Do executes the "drive.permissions.get" call.
  7408  // Any non-2xx status code is an error. Response headers are in either
  7409  // *Permission.ServerResponse.Header or (if a response was returned at all) in
  7410  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7411  // whether the returned error was because http.StatusNotModified was returned.
  7412  func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
  7413  	gensupport.SetOptions(c.urlParams_, opts...)
  7414  	res, err := c.doRequest("json")
  7415  	if res != nil && res.StatusCode == http.StatusNotModified {
  7416  		if res.Body != nil {
  7417  			res.Body.Close()
  7418  		}
  7419  		return nil, gensupport.WrapError(&googleapi.Error{
  7420  			Code:   res.StatusCode,
  7421  			Header: res.Header,
  7422  		})
  7423  	}
  7424  	if err != nil {
  7425  		return nil, err
  7426  	}
  7427  	defer googleapi.CloseBody(res)
  7428  	if err := googleapi.CheckResponse(res); err != nil {
  7429  		return nil, gensupport.WrapError(err)
  7430  	}
  7431  	ret := &Permission{
  7432  		ServerResponse: googleapi.ServerResponse{
  7433  			Header:         res.Header,
  7434  			HTTPStatusCode: res.StatusCode,
  7435  		},
  7436  	}
  7437  	target := &ret
  7438  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7439  		return nil, err
  7440  	}
  7441  	return ret, nil
  7442  }
  7443  
  7444  type PermissionsListCall struct {
  7445  	s            *Service
  7446  	fileId       string
  7447  	urlParams_   gensupport.URLParams
  7448  	ifNoneMatch_ string
  7449  	ctx_         context.Context
  7450  	header_      http.Header
  7451  }
  7452  
  7453  // List: Lists a file's or shared drive's permissions.
  7454  //
  7455  // - fileId: The ID of the file or shared drive.
  7456  func (r *PermissionsService) List(fileId string) *PermissionsListCall {
  7457  	c := &PermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7458  	c.fileId = fileId
  7459  	return c
  7460  }
  7461  
  7462  // IncludePermissionsForView sets the optional parameter
  7463  // "includePermissionsForView": Specifies which additional view's permissions
  7464  // to include in the response. Only 'published' is supported.
  7465  func (c *PermissionsListCall) IncludePermissionsForView(includePermissionsForView string) *PermissionsListCall {
  7466  	c.urlParams_.Set("includePermissionsForView", includePermissionsForView)
  7467  	return c
  7468  }
  7469  
  7470  // PageSize sets the optional parameter "pageSize": The maximum number of
  7471  // permissions to return per page. When not set for files in a shared drive, at
  7472  // most 100 results will be returned. When not set for files that are not in a
  7473  // shared drive, the entire list will be returned.
  7474  func (c *PermissionsListCall) PageSize(pageSize int64) *PermissionsListCall {
  7475  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7476  	return c
  7477  }
  7478  
  7479  // PageToken sets the optional parameter "pageToken": The token for continuing
  7480  // a previous list request on the next page. This should be set to the value of
  7481  // 'nextPageToken' from the previous response.
  7482  func (c *PermissionsListCall) PageToken(pageToken string) *PermissionsListCall {
  7483  	c.urlParams_.Set("pageToken", pageToken)
  7484  	return c
  7485  }
  7486  
  7487  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  7488  // the requesting application supports both My Drives and shared drives.
  7489  func (c *PermissionsListCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsListCall {
  7490  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  7491  	return c
  7492  }
  7493  
  7494  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  7495  // Deprecated: Use `supportsAllDrives` instead.
  7496  func (c *PermissionsListCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsListCall {
  7497  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  7498  	return c
  7499  }
  7500  
  7501  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  7502  // Issue the request as a domain administrator; if set to true, then the
  7503  // requester will be granted access if the file ID parameter refers to a shared
  7504  // drive and the requester is an administrator of the domain to which the
  7505  // shared drive belongs.
  7506  func (c *PermissionsListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsListCall {
  7507  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  7508  	return c
  7509  }
  7510  
  7511  // Fields allows partial responses to be retrieved. See
  7512  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7513  // details.
  7514  func (c *PermissionsListCall) Fields(s ...googleapi.Field) *PermissionsListCall {
  7515  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7516  	return c
  7517  }
  7518  
  7519  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7520  // object's ETag matches the given value. This is useful for getting updates
  7521  // only after the object has changed since the last request.
  7522  func (c *PermissionsListCall) IfNoneMatch(entityTag string) *PermissionsListCall {
  7523  	c.ifNoneMatch_ = entityTag
  7524  	return c
  7525  }
  7526  
  7527  // Context sets the context to be used in this call's Do method.
  7528  func (c *PermissionsListCall) Context(ctx context.Context) *PermissionsListCall {
  7529  	c.ctx_ = ctx
  7530  	return c
  7531  }
  7532  
  7533  // Header returns a http.Header that can be modified by the caller to add
  7534  // headers to the request.
  7535  func (c *PermissionsListCall) Header() http.Header {
  7536  	if c.header_ == nil {
  7537  		c.header_ = make(http.Header)
  7538  	}
  7539  	return c.header_
  7540  }
  7541  
  7542  func (c *PermissionsListCall) doRequest(alt string) (*http.Response, error) {
  7543  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7544  	if c.ifNoneMatch_ != "" {
  7545  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7546  	}
  7547  	var body io.Reader = nil
  7548  	c.urlParams_.Set("alt", alt)
  7549  	c.urlParams_.Set("prettyPrint", "false")
  7550  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions")
  7551  	urls += "?" + c.urlParams_.Encode()
  7552  	req, err := http.NewRequest("GET", urls, body)
  7553  	if err != nil {
  7554  		return nil, err
  7555  	}
  7556  	req.Header = reqHeaders
  7557  	googleapi.Expand(req.URL, map[string]string{
  7558  		"fileId": c.fileId,
  7559  	})
  7560  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7561  }
  7562  
  7563  // Do executes the "drive.permissions.list" call.
  7564  // Any non-2xx status code is an error. Response headers are in either
  7565  // *PermissionList.ServerResponse.Header or (if a response was returned at all)
  7566  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7567  // whether the returned error was because http.StatusNotModified was returned.
  7568  func (c *PermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionList, error) {
  7569  	gensupport.SetOptions(c.urlParams_, opts...)
  7570  	res, err := c.doRequest("json")
  7571  	if res != nil && res.StatusCode == http.StatusNotModified {
  7572  		if res.Body != nil {
  7573  			res.Body.Close()
  7574  		}
  7575  		return nil, gensupport.WrapError(&googleapi.Error{
  7576  			Code:   res.StatusCode,
  7577  			Header: res.Header,
  7578  		})
  7579  	}
  7580  	if err != nil {
  7581  		return nil, err
  7582  	}
  7583  	defer googleapi.CloseBody(res)
  7584  	if err := googleapi.CheckResponse(res); err != nil {
  7585  		return nil, gensupport.WrapError(err)
  7586  	}
  7587  	ret := &PermissionList{
  7588  		ServerResponse: googleapi.ServerResponse{
  7589  			Header:         res.Header,
  7590  			HTTPStatusCode: res.StatusCode,
  7591  		},
  7592  	}
  7593  	target := &ret
  7594  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7595  		return nil, err
  7596  	}
  7597  	return ret, nil
  7598  }
  7599  
  7600  // Pages invokes f for each page of results.
  7601  // A non-nil error returned from f will halt the iteration.
  7602  // The provided context supersedes any context provided to the Context method.
  7603  func (c *PermissionsListCall) Pages(ctx context.Context, f func(*PermissionList) error) error {
  7604  	c.ctx_ = ctx
  7605  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  7606  	for {
  7607  		x, err := c.Do()
  7608  		if err != nil {
  7609  			return err
  7610  		}
  7611  		if err := f(x); err != nil {
  7612  			return err
  7613  		}
  7614  		if x.NextPageToken == "" {
  7615  			return nil
  7616  		}
  7617  		c.PageToken(x.NextPageToken)
  7618  	}
  7619  }
  7620  
  7621  type PermissionsUpdateCall struct {
  7622  	s            *Service
  7623  	fileId       string
  7624  	permissionId string
  7625  	permission   *Permission
  7626  	urlParams_   gensupport.URLParams
  7627  	ctx_         context.Context
  7628  	header_      http.Header
  7629  }
  7630  
  7631  // Update: Updates a permission with patch semantics. **Warning:** Concurrent
  7632  // permissions operations on the same file are not supported; only the last
  7633  // update is applied.
  7634  //
  7635  // - fileId: The ID of the file or shared drive.
  7636  // - permissionId: The ID of the permission.
  7637  func (r *PermissionsService) Update(fileId string, permissionId string, permission *Permission) *PermissionsUpdateCall {
  7638  	c := &PermissionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7639  	c.fileId = fileId
  7640  	c.permissionId = permissionId
  7641  	c.permission = permission
  7642  	return c
  7643  }
  7644  
  7645  // RemoveExpiration sets the optional parameter "removeExpiration": Whether to
  7646  // remove the expiration date.
  7647  func (c *PermissionsUpdateCall) RemoveExpiration(removeExpiration bool) *PermissionsUpdateCall {
  7648  	c.urlParams_.Set("removeExpiration", fmt.Sprint(removeExpiration))
  7649  	return c
  7650  }
  7651  
  7652  // SupportsAllDrives sets the optional parameter "supportsAllDrives": Whether
  7653  // the requesting application supports both My Drives and shared drives.
  7654  func (c *PermissionsUpdateCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsUpdateCall {
  7655  	c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives))
  7656  	return c
  7657  }
  7658  
  7659  // SupportsTeamDrives sets the optional parameter "supportsTeamDrives":
  7660  // Deprecated: Use `supportsAllDrives` instead.
  7661  func (c *PermissionsUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsUpdateCall {
  7662  	c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives))
  7663  	return c
  7664  }
  7665  
  7666  // TransferOwnership sets the optional parameter "transferOwnership": Whether
  7667  // to transfer ownership to the specified user and downgrade the current owner
  7668  // to a writer. This parameter is required as an acknowledgement of the side
  7669  // effect.
  7670  func (c *PermissionsUpdateCall) TransferOwnership(transferOwnership bool) *PermissionsUpdateCall {
  7671  	c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership))
  7672  	return c
  7673  }
  7674  
  7675  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  7676  // Issue the request as a domain administrator; if set to true, then the
  7677  // requester will be granted access if the file ID parameter refers to a shared
  7678  // drive and the requester is an administrator of the domain to which the
  7679  // shared drive belongs.
  7680  func (c *PermissionsUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsUpdateCall {
  7681  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  7682  	return c
  7683  }
  7684  
  7685  // Fields allows partial responses to be retrieved. See
  7686  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7687  // details.
  7688  func (c *PermissionsUpdateCall) Fields(s ...googleapi.Field) *PermissionsUpdateCall {
  7689  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7690  	return c
  7691  }
  7692  
  7693  // Context sets the context to be used in this call's Do method.
  7694  func (c *PermissionsUpdateCall) Context(ctx context.Context) *PermissionsUpdateCall {
  7695  	c.ctx_ = ctx
  7696  	return c
  7697  }
  7698  
  7699  // Header returns a http.Header that can be modified by the caller to add
  7700  // headers to the request.
  7701  func (c *PermissionsUpdateCall) Header() http.Header {
  7702  	if c.header_ == nil {
  7703  		c.header_ = make(http.Header)
  7704  	}
  7705  	return c.header_
  7706  }
  7707  
  7708  func (c *PermissionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  7709  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7710  	var body io.Reader = nil
  7711  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission)
  7712  	if err != nil {
  7713  		return nil, err
  7714  	}
  7715  	c.urlParams_.Set("alt", alt)
  7716  	c.urlParams_.Set("prettyPrint", "false")
  7717  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}")
  7718  	urls += "?" + c.urlParams_.Encode()
  7719  	req, err := http.NewRequest("PATCH", urls, body)
  7720  	if err != nil {
  7721  		return nil, err
  7722  	}
  7723  	req.Header = reqHeaders
  7724  	googleapi.Expand(req.URL, map[string]string{
  7725  		"fileId":       c.fileId,
  7726  		"permissionId": c.permissionId,
  7727  	})
  7728  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7729  }
  7730  
  7731  // Do executes the "drive.permissions.update" call.
  7732  // Any non-2xx status code is an error. Response headers are in either
  7733  // *Permission.ServerResponse.Header or (if a response was returned at all) in
  7734  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7735  // whether the returned error was because http.StatusNotModified was returned.
  7736  func (c *PermissionsUpdateCall) Do(opts ...googleapi.CallOption) (*Permission, error) {
  7737  	gensupport.SetOptions(c.urlParams_, opts...)
  7738  	res, err := c.doRequest("json")
  7739  	if res != nil && res.StatusCode == http.StatusNotModified {
  7740  		if res.Body != nil {
  7741  			res.Body.Close()
  7742  		}
  7743  		return nil, gensupport.WrapError(&googleapi.Error{
  7744  			Code:   res.StatusCode,
  7745  			Header: res.Header,
  7746  		})
  7747  	}
  7748  	if err != nil {
  7749  		return nil, err
  7750  	}
  7751  	defer googleapi.CloseBody(res)
  7752  	if err := googleapi.CheckResponse(res); err != nil {
  7753  		return nil, gensupport.WrapError(err)
  7754  	}
  7755  	ret := &Permission{
  7756  		ServerResponse: googleapi.ServerResponse{
  7757  			Header:         res.Header,
  7758  			HTTPStatusCode: res.StatusCode,
  7759  		},
  7760  	}
  7761  	target := &ret
  7762  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7763  		return nil, err
  7764  	}
  7765  	return ret, nil
  7766  }
  7767  
  7768  type RepliesCreateCall struct {
  7769  	s          *Service
  7770  	fileId     string
  7771  	commentId  string
  7772  	reply      *Reply
  7773  	urlParams_ gensupport.URLParams
  7774  	ctx_       context.Context
  7775  	header_    http.Header
  7776  }
  7777  
  7778  // Create: Creates a reply to a comment.
  7779  //
  7780  // - commentId: The ID of the comment.
  7781  // - fileId: The ID of the file.
  7782  func (r *RepliesService) Create(fileId string, commentId string, reply *Reply) *RepliesCreateCall {
  7783  	c := &RepliesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7784  	c.fileId = fileId
  7785  	c.commentId = commentId
  7786  	c.reply = reply
  7787  	return c
  7788  }
  7789  
  7790  // Fields allows partial responses to be retrieved. See
  7791  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7792  // details.
  7793  func (c *RepliesCreateCall) Fields(s ...googleapi.Field) *RepliesCreateCall {
  7794  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7795  	return c
  7796  }
  7797  
  7798  // Context sets the context to be used in this call's Do method.
  7799  func (c *RepliesCreateCall) Context(ctx context.Context) *RepliesCreateCall {
  7800  	c.ctx_ = ctx
  7801  	return c
  7802  }
  7803  
  7804  // Header returns a http.Header that can be modified by the caller to add
  7805  // headers to the request.
  7806  func (c *RepliesCreateCall) Header() http.Header {
  7807  	if c.header_ == nil {
  7808  		c.header_ = make(http.Header)
  7809  	}
  7810  	return c.header_
  7811  }
  7812  
  7813  func (c *RepliesCreateCall) doRequest(alt string) (*http.Response, error) {
  7814  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7815  	var body io.Reader = nil
  7816  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reply)
  7817  	if err != nil {
  7818  		return nil, err
  7819  	}
  7820  	c.urlParams_.Set("alt", alt)
  7821  	c.urlParams_.Set("prettyPrint", "false")
  7822  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies")
  7823  	urls += "?" + c.urlParams_.Encode()
  7824  	req, err := http.NewRequest("POST", urls, body)
  7825  	if err != nil {
  7826  		return nil, err
  7827  	}
  7828  	req.Header = reqHeaders
  7829  	googleapi.Expand(req.URL, map[string]string{
  7830  		"fileId":    c.fileId,
  7831  		"commentId": c.commentId,
  7832  	})
  7833  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7834  }
  7835  
  7836  // Do executes the "drive.replies.create" call.
  7837  // Any non-2xx status code is an error. Response headers are in either
  7838  // *Reply.ServerResponse.Header or (if a response was returned at all) in
  7839  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7840  // whether the returned error was because http.StatusNotModified was returned.
  7841  func (c *RepliesCreateCall) Do(opts ...googleapi.CallOption) (*Reply, error) {
  7842  	gensupport.SetOptions(c.urlParams_, opts...)
  7843  	res, err := c.doRequest("json")
  7844  	if res != nil && res.StatusCode == http.StatusNotModified {
  7845  		if res.Body != nil {
  7846  			res.Body.Close()
  7847  		}
  7848  		return nil, gensupport.WrapError(&googleapi.Error{
  7849  			Code:   res.StatusCode,
  7850  			Header: res.Header,
  7851  		})
  7852  	}
  7853  	if err != nil {
  7854  		return nil, err
  7855  	}
  7856  	defer googleapi.CloseBody(res)
  7857  	if err := googleapi.CheckResponse(res); err != nil {
  7858  		return nil, gensupport.WrapError(err)
  7859  	}
  7860  	ret := &Reply{
  7861  		ServerResponse: googleapi.ServerResponse{
  7862  			Header:         res.Header,
  7863  			HTTPStatusCode: res.StatusCode,
  7864  		},
  7865  	}
  7866  	target := &ret
  7867  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7868  		return nil, err
  7869  	}
  7870  	return ret, nil
  7871  }
  7872  
  7873  type RepliesDeleteCall struct {
  7874  	s          *Service
  7875  	fileId     string
  7876  	commentId  string
  7877  	replyId    string
  7878  	urlParams_ gensupport.URLParams
  7879  	ctx_       context.Context
  7880  	header_    http.Header
  7881  }
  7882  
  7883  // Delete: Deletes a reply.
  7884  //
  7885  // - commentId: The ID of the comment.
  7886  // - fileId: The ID of the file.
  7887  // - replyId: The ID of the reply.
  7888  func (r *RepliesService) Delete(fileId string, commentId string, replyId string) *RepliesDeleteCall {
  7889  	c := &RepliesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7890  	c.fileId = fileId
  7891  	c.commentId = commentId
  7892  	c.replyId = replyId
  7893  	return c
  7894  }
  7895  
  7896  // Fields allows partial responses to be retrieved. See
  7897  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7898  // details.
  7899  func (c *RepliesDeleteCall) Fields(s ...googleapi.Field) *RepliesDeleteCall {
  7900  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7901  	return c
  7902  }
  7903  
  7904  // Context sets the context to be used in this call's Do method.
  7905  func (c *RepliesDeleteCall) Context(ctx context.Context) *RepliesDeleteCall {
  7906  	c.ctx_ = ctx
  7907  	return c
  7908  }
  7909  
  7910  // Header returns a http.Header that can be modified by the caller to add
  7911  // headers to the request.
  7912  func (c *RepliesDeleteCall) Header() http.Header {
  7913  	if c.header_ == nil {
  7914  		c.header_ = make(http.Header)
  7915  	}
  7916  	return c.header_
  7917  }
  7918  
  7919  func (c *RepliesDeleteCall) doRequest(alt string) (*http.Response, error) {
  7920  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7921  	var body io.Reader = nil
  7922  	c.urlParams_.Set("alt", alt)
  7923  	c.urlParams_.Set("prettyPrint", "false")
  7924  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}")
  7925  	urls += "?" + c.urlParams_.Encode()
  7926  	req, err := http.NewRequest("DELETE", urls, body)
  7927  	if err != nil {
  7928  		return nil, err
  7929  	}
  7930  	req.Header = reqHeaders
  7931  	googleapi.Expand(req.URL, map[string]string{
  7932  		"fileId":    c.fileId,
  7933  		"commentId": c.commentId,
  7934  		"replyId":   c.replyId,
  7935  	})
  7936  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7937  }
  7938  
  7939  // Do executes the "drive.replies.delete" call.
  7940  func (c *RepliesDeleteCall) Do(opts ...googleapi.CallOption) error {
  7941  	gensupport.SetOptions(c.urlParams_, opts...)
  7942  	res, err := c.doRequest("json")
  7943  	if err != nil {
  7944  		return err
  7945  	}
  7946  	defer googleapi.CloseBody(res)
  7947  	if err := googleapi.CheckResponse(res); err != nil {
  7948  		return gensupport.WrapError(err)
  7949  	}
  7950  	return nil
  7951  }
  7952  
  7953  type RepliesGetCall struct {
  7954  	s            *Service
  7955  	fileId       string
  7956  	commentId    string
  7957  	replyId      string
  7958  	urlParams_   gensupport.URLParams
  7959  	ifNoneMatch_ string
  7960  	ctx_         context.Context
  7961  	header_      http.Header
  7962  }
  7963  
  7964  // Get: Gets a reply by ID.
  7965  //
  7966  // - commentId: The ID of the comment.
  7967  // - fileId: The ID of the file.
  7968  // - replyId: The ID of the reply.
  7969  func (r *RepliesService) Get(fileId string, commentId string, replyId string) *RepliesGetCall {
  7970  	c := &RepliesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7971  	c.fileId = fileId
  7972  	c.commentId = commentId
  7973  	c.replyId = replyId
  7974  	return c
  7975  }
  7976  
  7977  // IncludeDeleted sets the optional parameter "includeDeleted": Whether to
  7978  // return deleted replies. Deleted replies will not include their original
  7979  // content.
  7980  func (c *RepliesGetCall) IncludeDeleted(includeDeleted bool) *RepliesGetCall {
  7981  	c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
  7982  	return c
  7983  }
  7984  
  7985  // Fields allows partial responses to be retrieved. See
  7986  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7987  // details.
  7988  func (c *RepliesGetCall) Fields(s ...googleapi.Field) *RepliesGetCall {
  7989  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7990  	return c
  7991  }
  7992  
  7993  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7994  // object's ETag matches the given value. This is useful for getting updates
  7995  // only after the object has changed since the last request.
  7996  func (c *RepliesGetCall) IfNoneMatch(entityTag string) *RepliesGetCall {
  7997  	c.ifNoneMatch_ = entityTag
  7998  	return c
  7999  }
  8000  
  8001  // Context sets the context to be used in this call's Do method.
  8002  func (c *RepliesGetCall) Context(ctx context.Context) *RepliesGetCall {
  8003  	c.ctx_ = ctx
  8004  	return c
  8005  }
  8006  
  8007  // Header returns a http.Header that can be modified by the caller to add
  8008  // headers to the request.
  8009  func (c *RepliesGetCall) Header() http.Header {
  8010  	if c.header_ == nil {
  8011  		c.header_ = make(http.Header)
  8012  	}
  8013  	return c.header_
  8014  }
  8015  
  8016  func (c *RepliesGetCall) doRequest(alt string) (*http.Response, error) {
  8017  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8018  	if c.ifNoneMatch_ != "" {
  8019  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8020  	}
  8021  	var body io.Reader = nil
  8022  	c.urlParams_.Set("alt", alt)
  8023  	c.urlParams_.Set("prettyPrint", "false")
  8024  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}")
  8025  	urls += "?" + c.urlParams_.Encode()
  8026  	req, err := http.NewRequest("GET", urls, body)
  8027  	if err != nil {
  8028  		return nil, err
  8029  	}
  8030  	req.Header = reqHeaders
  8031  	googleapi.Expand(req.URL, map[string]string{
  8032  		"fileId":    c.fileId,
  8033  		"commentId": c.commentId,
  8034  		"replyId":   c.replyId,
  8035  	})
  8036  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8037  }
  8038  
  8039  // Do executes the "drive.replies.get" call.
  8040  // Any non-2xx status code is an error. Response headers are in either
  8041  // *Reply.ServerResponse.Header or (if a response was returned at all) in
  8042  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8043  // whether the returned error was because http.StatusNotModified was returned.
  8044  func (c *RepliesGetCall) Do(opts ...googleapi.CallOption) (*Reply, error) {
  8045  	gensupport.SetOptions(c.urlParams_, opts...)
  8046  	res, err := c.doRequest("json")
  8047  	if res != nil && res.StatusCode == http.StatusNotModified {
  8048  		if res.Body != nil {
  8049  			res.Body.Close()
  8050  		}
  8051  		return nil, gensupport.WrapError(&googleapi.Error{
  8052  			Code:   res.StatusCode,
  8053  			Header: res.Header,
  8054  		})
  8055  	}
  8056  	if err != nil {
  8057  		return nil, err
  8058  	}
  8059  	defer googleapi.CloseBody(res)
  8060  	if err := googleapi.CheckResponse(res); err != nil {
  8061  		return nil, gensupport.WrapError(err)
  8062  	}
  8063  	ret := &Reply{
  8064  		ServerResponse: googleapi.ServerResponse{
  8065  			Header:         res.Header,
  8066  			HTTPStatusCode: res.StatusCode,
  8067  		},
  8068  	}
  8069  	target := &ret
  8070  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8071  		return nil, err
  8072  	}
  8073  	return ret, nil
  8074  }
  8075  
  8076  type RepliesListCall struct {
  8077  	s            *Service
  8078  	fileId       string
  8079  	commentId    string
  8080  	urlParams_   gensupport.URLParams
  8081  	ifNoneMatch_ string
  8082  	ctx_         context.Context
  8083  	header_      http.Header
  8084  }
  8085  
  8086  // List: Lists a comment's replies.
  8087  //
  8088  // - commentId: The ID of the comment.
  8089  // - fileId: The ID of the file.
  8090  func (r *RepliesService) List(fileId string, commentId string) *RepliesListCall {
  8091  	c := &RepliesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8092  	c.fileId = fileId
  8093  	c.commentId = commentId
  8094  	return c
  8095  }
  8096  
  8097  // IncludeDeleted sets the optional parameter "includeDeleted": Whether to
  8098  // include deleted replies. Deleted replies will not include their original
  8099  // content.
  8100  func (c *RepliesListCall) IncludeDeleted(includeDeleted bool) *RepliesListCall {
  8101  	c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted))
  8102  	return c
  8103  }
  8104  
  8105  // PageSize sets the optional parameter "pageSize": The maximum number of
  8106  // replies to return per page.
  8107  func (c *RepliesListCall) PageSize(pageSize int64) *RepliesListCall {
  8108  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8109  	return c
  8110  }
  8111  
  8112  // PageToken sets the optional parameter "pageToken": The token for continuing
  8113  // a previous list request on the next page. This should be set to the value of
  8114  // 'nextPageToken' from the previous response.
  8115  func (c *RepliesListCall) PageToken(pageToken string) *RepliesListCall {
  8116  	c.urlParams_.Set("pageToken", pageToken)
  8117  	return c
  8118  }
  8119  
  8120  // Fields allows partial responses to be retrieved. See
  8121  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8122  // details.
  8123  func (c *RepliesListCall) Fields(s ...googleapi.Field) *RepliesListCall {
  8124  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8125  	return c
  8126  }
  8127  
  8128  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  8129  // object's ETag matches the given value. This is useful for getting updates
  8130  // only after the object has changed since the last request.
  8131  func (c *RepliesListCall) IfNoneMatch(entityTag string) *RepliesListCall {
  8132  	c.ifNoneMatch_ = entityTag
  8133  	return c
  8134  }
  8135  
  8136  // Context sets the context to be used in this call's Do method.
  8137  func (c *RepliesListCall) Context(ctx context.Context) *RepliesListCall {
  8138  	c.ctx_ = ctx
  8139  	return c
  8140  }
  8141  
  8142  // Header returns a http.Header that can be modified by the caller to add
  8143  // headers to the request.
  8144  func (c *RepliesListCall) Header() http.Header {
  8145  	if c.header_ == nil {
  8146  		c.header_ = make(http.Header)
  8147  	}
  8148  	return c.header_
  8149  }
  8150  
  8151  func (c *RepliesListCall) doRequest(alt string) (*http.Response, error) {
  8152  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8153  	if c.ifNoneMatch_ != "" {
  8154  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8155  	}
  8156  	var body io.Reader = nil
  8157  	c.urlParams_.Set("alt", alt)
  8158  	c.urlParams_.Set("prettyPrint", "false")
  8159  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies")
  8160  	urls += "?" + c.urlParams_.Encode()
  8161  	req, err := http.NewRequest("GET", urls, body)
  8162  	if err != nil {
  8163  		return nil, err
  8164  	}
  8165  	req.Header = reqHeaders
  8166  	googleapi.Expand(req.URL, map[string]string{
  8167  		"fileId":    c.fileId,
  8168  		"commentId": c.commentId,
  8169  	})
  8170  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8171  }
  8172  
  8173  // Do executes the "drive.replies.list" call.
  8174  // Any non-2xx status code is an error. Response headers are in either
  8175  // *ReplyList.ServerResponse.Header or (if a response was returned at all) in
  8176  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8177  // whether the returned error was because http.StatusNotModified was returned.
  8178  func (c *RepliesListCall) Do(opts ...googleapi.CallOption) (*ReplyList, error) {
  8179  	gensupport.SetOptions(c.urlParams_, opts...)
  8180  	res, err := c.doRequest("json")
  8181  	if res != nil && res.StatusCode == http.StatusNotModified {
  8182  		if res.Body != nil {
  8183  			res.Body.Close()
  8184  		}
  8185  		return nil, gensupport.WrapError(&googleapi.Error{
  8186  			Code:   res.StatusCode,
  8187  			Header: res.Header,
  8188  		})
  8189  	}
  8190  	if err != nil {
  8191  		return nil, err
  8192  	}
  8193  	defer googleapi.CloseBody(res)
  8194  	if err := googleapi.CheckResponse(res); err != nil {
  8195  		return nil, gensupport.WrapError(err)
  8196  	}
  8197  	ret := &ReplyList{
  8198  		ServerResponse: googleapi.ServerResponse{
  8199  			Header:         res.Header,
  8200  			HTTPStatusCode: res.StatusCode,
  8201  		},
  8202  	}
  8203  	target := &ret
  8204  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8205  		return nil, err
  8206  	}
  8207  	return ret, nil
  8208  }
  8209  
  8210  // Pages invokes f for each page of results.
  8211  // A non-nil error returned from f will halt the iteration.
  8212  // The provided context supersedes any context provided to the Context method.
  8213  func (c *RepliesListCall) Pages(ctx context.Context, f func(*ReplyList) error) error {
  8214  	c.ctx_ = ctx
  8215  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  8216  	for {
  8217  		x, err := c.Do()
  8218  		if err != nil {
  8219  			return err
  8220  		}
  8221  		if err := f(x); err != nil {
  8222  			return err
  8223  		}
  8224  		if x.NextPageToken == "" {
  8225  			return nil
  8226  		}
  8227  		c.PageToken(x.NextPageToken)
  8228  	}
  8229  }
  8230  
  8231  type RepliesUpdateCall struct {
  8232  	s          *Service
  8233  	fileId     string
  8234  	commentId  string
  8235  	replyId    string
  8236  	reply      *Reply
  8237  	urlParams_ gensupport.URLParams
  8238  	ctx_       context.Context
  8239  	header_    http.Header
  8240  }
  8241  
  8242  // Update: Updates a reply with patch semantics.
  8243  //
  8244  // - commentId: The ID of the comment.
  8245  // - fileId: The ID of the file.
  8246  // - replyId: The ID of the reply.
  8247  func (r *RepliesService) Update(fileId string, commentId string, replyId string, reply *Reply) *RepliesUpdateCall {
  8248  	c := &RepliesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8249  	c.fileId = fileId
  8250  	c.commentId = commentId
  8251  	c.replyId = replyId
  8252  	c.reply = reply
  8253  	return c
  8254  }
  8255  
  8256  // Fields allows partial responses to be retrieved. See
  8257  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8258  // details.
  8259  func (c *RepliesUpdateCall) Fields(s ...googleapi.Field) *RepliesUpdateCall {
  8260  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8261  	return c
  8262  }
  8263  
  8264  // Context sets the context to be used in this call's Do method.
  8265  func (c *RepliesUpdateCall) Context(ctx context.Context) *RepliesUpdateCall {
  8266  	c.ctx_ = ctx
  8267  	return c
  8268  }
  8269  
  8270  // Header returns a http.Header that can be modified by the caller to add
  8271  // headers to the request.
  8272  func (c *RepliesUpdateCall) Header() http.Header {
  8273  	if c.header_ == nil {
  8274  		c.header_ = make(http.Header)
  8275  	}
  8276  	return c.header_
  8277  }
  8278  
  8279  func (c *RepliesUpdateCall) doRequest(alt string) (*http.Response, error) {
  8280  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  8281  	var body io.Reader = nil
  8282  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reply)
  8283  	if err != nil {
  8284  		return nil, err
  8285  	}
  8286  	c.urlParams_.Set("alt", alt)
  8287  	c.urlParams_.Set("prettyPrint", "false")
  8288  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}")
  8289  	urls += "?" + c.urlParams_.Encode()
  8290  	req, err := http.NewRequest("PATCH", urls, body)
  8291  	if err != nil {
  8292  		return nil, err
  8293  	}
  8294  	req.Header = reqHeaders
  8295  	googleapi.Expand(req.URL, map[string]string{
  8296  		"fileId":    c.fileId,
  8297  		"commentId": c.commentId,
  8298  		"replyId":   c.replyId,
  8299  	})
  8300  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8301  }
  8302  
  8303  // Do executes the "drive.replies.update" call.
  8304  // Any non-2xx status code is an error. Response headers are in either
  8305  // *Reply.ServerResponse.Header or (if a response was returned at all) in
  8306  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8307  // whether the returned error was because http.StatusNotModified was returned.
  8308  func (c *RepliesUpdateCall) Do(opts ...googleapi.CallOption) (*Reply, error) {
  8309  	gensupport.SetOptions(c.urlParams_, opts...)
  8310  	res, err := c.doRequest("json")
  8311  	if res != nil && res.StatusCode == http.StatusNotModified {
  8312  		if res.Body != nil {
  8313  			res.Body.Close()
  8314  		}
  8315  		return nil, gensupport.WrapError(&googleapi.Error{
  8316  			Code:   res.StatusCode,
  8317  			Header: res.Header,
  8318  		})
  8319  	}
  8320  	if err != nil {
  8321  		return nil, err
  8322  	}
  8323  	defer googleapi.CloseBody(res)
  8324  	if err := googleapi.CheckResponse(res); err != nil {
  8325  		return nil, gensupport.WrapError(err)
  8326  	}
  8327  	ret := &Reply{
  8328  		ServerResponse: googleapi.ServerResponse{
  8329  			Header:         res.Header,
  8330  			HTTPStatusCode: res.StatusCode,
  8331  		},
  8332  	}
  8333  	target := &ret
  8334  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8335  		return nil, err
  8336  	}
  8337  	return ret, nil
  8338  }
  8339  
  8340  type RevisionsDeleteCall struct {
  8341  	s          *Service
  8342  	fileId     string
  8343  	revisionId string
  8344  	urlParams_ gensupport.URLParams
  8345  	ctx_       context.Context
  8346  	header_    http.Header
  8347  }
  8348  
  8349  // Delete: Permanently deletes a file version. You can only delete revisions
  8350  // for files with binary content in Google Drive, like images or videos.
  8351  // Revisions for other files, like Google Docs or Sheets, and the last
  8352  // remaining file version can't be deleted.
  8353  //
  8354  // - fileId: The ID of the file.
  8355  // - revisionId: The ID of the revision.
  8356  func (r *RevisionsService) Delete(fileId string, revisionId string) *RevisionsDeleteCall {
  8357  	c := &RevisionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8358  	c.fileId = fileId
  8359  	c.revisionId = revisionId
  8360  	return c
  8361  }
  8362  
  8363  // Fields allows partial responses to be retrieved. See
  8364  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8365  // details.
  8366  func (c *RevisionsDeleteCall) Fields(s ...googleapi.Field) *RevisionsDeleteCall {
  8367  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8368  	return c
  8369  }
  8370  
  8371  // Context sets the context to be used in this call's Do method.
  8372  func (c *RevisionsDeleteCall) Context(ctx context.Context) *RevisionsDeleteCall {
  8373  	c.ctx_ = ctx
  8374  	return c
  8375  }
  8376  
  8377  // Header returns a http.Header that can be modified by the caller to add
  8378  // headers to the request.
  8379  func (c *RevisionsDeleteCall) Header() http.Header {
  8380  	if c.header_ == nil {
  8381  		c.header_ = make(http.Header)
  8382  	}
  8383  	return c.header_
  8384  }
  8385  
  8386  func (c *RevisionsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8387  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8388  	var body io.Reader = nil
  8389  	c.urlParams_.Set("alt", alt)
  8390  	c.urlParams_.Set("prettyPrint", "false")
  8391  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}")
  8392  	urls += "?" + c.urlParams_.Encode()
  8393  	req, err := http.NewRequest("DELETE", urls, body)
  8394  	if err != nil {
  8395  		return nil, err
  8396  	}
  8397  	req.Header = reqHeaders
  8398  	googleapi.Expand(req.URL, map[string]string{
  8399  		"fileId":     c.fileId,
  8400  		"revisionId": c.revisionId,
  8401  	})
  8402  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8403  }
  8404  
  8405  // Do executes the "drive.revisions.delete" call.
  8406  func (c *RevisionsDeleteCall) Do(opts ...googleapi.CallOption) error {
  8407  	gensupport.SetOptions(c.urlParams_, opts...)
  8408  	res, err := c.doRequest("json")
  8409  	if err != nil {
  8410  		return err
  8411  	}
  8412  	defer googleapi.CloseBody(res)
  8413  	if err := googleapi.CheckResponse(res); err != nil {
  8414  		return gensupport.WrapError(err)
  8415  	}
  8416  	return nil
  8417  }
  8418  
  8419  type RevisionsGetCall struct {
  8420  	s            *Service
  8421  	fileId       string
  8422  	revisionId   string
  8423  	urlParams_   gensupport.URLParams
  8424  	ifNoneMatch_ string
  8425  	ctx_         context.Context
  8426  	header_      http.Header
  8427  }
  8428  
  8429  // Get: Gets a revision's metadata or content by ID.
  8430  //
  8431  // - fileId: The ID of the file.
  8432  // - revisionId: The ID of the revision.
  8433  func (r *RevisionsService) Get(fileId string, revisionId string) *RevisionsGetCall {
  8434  	c := &RevisionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8435  	c.fileId = fileId
  8436  	c.revisionId = revisionId
  8437  	return c
  8438  }
  8439  
  8440  // AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": Whether the
  8441  // user is acknowledging the risk of downloading known malware or other abusive
  8442  // files. This is only applicable when alt=media.
  8443  func (c *RevisionsGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *RevisionsGetCall {
  8444  	c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse))
  8445  	return c
  8446  }
  8447  
  8448  // Fields allows partial responses to be retrieved. See
  8449  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8450  // details.
  8451  func (c *RevisionsGetCall) Fields(s ...googleapi.Field) *RevisionsGetCall {
  8452  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8453  	return c
  8454  }
  8455  
  8456  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  8457  // object's ETag matches the given value. This is useful for getting updates
  8458  // only after the object has changed since the last request.
  8459  func (c *RevisionsGetCall) IfNoneMatch(entityTag string) *RevisionsGetCall {
  8460  	c.ifNoneMatch_ = entityTag
  8461  	return c
  8462  }
  8463  
  8464  // Context sets the context to be used in this call's Do and Download methods.
  8465  func (c *RevisionsGetCall) Context(ctx context.Context) *RevisionsGetCall {
  8466  	c.ctx_ = ctx
  8467  	return c
  8468  }
  8469  
  8470  // Header returns a http.Header that can be modified by the caller to add
  8471  // headers to the request.
  8472  func (c *RevisionsGetCall) Header() http.Header {
  8473  	if c.header_ == nil {
  8474  		c.header_ = make(http.Header)
  8475  	}
  8476  	return c.header_
  8477  }
  8478  
  8479  func (c *RevisionsGetCall) doRequest(alt string) (*http.Response, error) {
  8480  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8481  	if c.ifNoneMatch_ != "" {
  8482  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8483  	}
  8484  	var body io.Reader = nil
  8485  	c.urlParams_.Set("alt", alt)
  8486  	c.urlParams_.Set("prettyPrint", "false")
  8487  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}")
  8488  	urls += "?" + c.urlParams_.Encode()
  8489  	req, err := http.NewRequest("GET", urls, body)
  8490  	if err != nil {
  8491  		return nil, err
  8492  	}
  8493  	req.Header = reqHeaders
  8494  	googleapi.Expand(req.URL, map[string]string{
  8495  		"fileId":     c.fileId,
  8496  		"revisionId": c.revisionId,
  8497  	})
  8498  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8499  }
  8500  
  8501  // Download fetches the API endpoint's "media" value, instead of the normal
  8502  // API response value. If the returned error is nil, the Response is guaranteed to
  8503  // have a 2xx status code. Callers must close the Response.Body as usual.
  8504  func (c *RevisionsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
  8505  	gensupport.SetOptions(c.urlParams_, opts...)
  8506  	res, err := c.doRequest("media")
  8507  	if err != nil {
  8508  		return nil, err
  8509  	}
  8510  	if err := googleapi.CheckResponse(res); err != nil {
  8511  		res.Body.Close()
  8512  		return nil, gensupport.WrapError(err)
  8513  	}
  8514  	return res, nil
  8515  }
  8516  
  8517  // Do executes the "drive.revisions.get" call.
  8518  // Any non-2xx status code is an error. Response headers are in either
  8519  // *Revision.ServerResponse.Header or (if a response was returned at all) in
  8520  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8521  // whether the returned error was because http.StatusNotModified was returned.
  8522  func (c *RevisionsGetCall) Do(opts ...googleapi.CallOption) (*Revision, error) {
  8523  	gensupport.SetOptions(c.urlParams_, opts...)
  8524  	res, err := c.doRequest("json")
  8525  	if res != nil && res.StatusCode == http.StatusNotModified {
  8526  		if res.Body != nil {
  8527  			res.Body.Close()
  8528  		}
  8529  		return nil, gensupport.WrapError(&googleapi.Error{
  8530  			Code:   res.StatusCode,
  8531  			Header: res.Header,
  8532  		})
  8533  	}
  8534  	if err != nil {
  8535  		return nil, err
  8536  	}
  8537  	defer googleapi.CloseBody(res)
  8538  	if err := googleapi.CheckResponse(res); err != nil {
  8539  		return nil, gensupport.WrapError(err)
  8540  	}
  8541  	ret := &Revision{
  8542  		ServerResponse: googleapi.ServerResponse{
  8543  			Header:         res.Header,
  8544  			HTTPStatusCode: res.StatusCode,
  8545  		},
  8546  	}
  8547  	target := &ret
  8548  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8549  		return nil, err
  8550  	}
  8551  	return ret, nil
  8552  }
  8553  
  8554  type RevisionsListCall struct {
  8555  	s            *Service
  8556  	fileId       string
  8557  	urlParams_   gensupport.URLParams
  8558  	ifNoneMatch_ string
  8559  	ctx_         context.Context
  8560  	header_      http.Header
  8561  }
  8562  
  8563  // List: Lists a file's revisions.
  8564  //
  8565  // - fileId: The ID of the file.
  8566  func (r *RevisionsService) List(fileId string) *RevisionsListCall {
  8567  	c := &RevisionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8568  	c.fileId = fileId
  8569  	return c
  8570  }
  8571  
  8572  // PageSize sets the optional parameter "pageSize": The maximum number of
  8573  // revisions to return per page.
  8574  func (c *RevisionsListCall) PageSize(pageSize int64) *RevisionsListCall {
  8575  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8576  	return c
  8577  }
  8578  
  8579  // PageToken sets the optional parameter "pageToken": The token for continuing
  8580  // a previous list request on the next page. This should be set to the value of
  8581  // 'nextPageToken' from the previous response.
  8582  func (c *RevisionsListCall) PageToken(pageToken string) *RevisionsListCall {
  8583  	c.urlParams_.Set("pageToken", pageToken)
  8584  	return c
  8585  }
  8586  
  8587  // Fields allows partial responses to be retrieved. See
  8588  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8589  // details.
  8590  func (c *RevisionsListCall) Fields(s ...googleapi.Field) *RevisionsListCall {
  8591  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8592  	return c
  8593  }
  8594  
  8595  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  8596  // object's ETag matches the given value. This is useful for getting updates
  8597  // only after the object has changed since the last request.
  8598  func (c *RevisionsListCall) IfNoneMatch(entityTag string) *RevisionsListCall {
  8599  	c.ifNoneMatch_ = entityTag
  8600  	return c
  8601  }
  8602  
  8603  // Context sets the context to be used in this call's Do method.
  8604  func (c *RevisionsListCall) Context(ctx context.Context) *RevisionsListCall {
  8605  	c.ctx_ = ctx
  8606  	return c
  8607  }
  8608  
  8609  // Header returns a http.Header that can be modified by the caller to add
  8610  // headers to the request.
  8611  func (c *RevisionsListCall) Header() http.Header {
  8612  	if c.header_ == nil {
  8613  		c.header_ = make(http.Header)
  8614  	}
  8615  	return c.header_
  8616  }
  8617  
  8618  func (c *RevisionsListCall) doRequest(alt string) (*http.Response, error) {
  8619  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8620  	if c.ifNoneMatch_ != "" {
  8621  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8622  	}
  8623  	var body io.Reader = nil
  8624  	c.urlParams_.Set("alt", alt)
  8625  	c.urlParams_.Set("prettyPrint", "false")
  8626  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions")
  8627  	urls += "?" + c.urlParams_.Encode()
  8628  	req, err := http.NewRequest("GET", urls, body)
  8629  	if err != nil {
  8630  		return nil, err
  8631  	}
  8632  	req.Header = reqHeaders
  8633  	googleapi.Expand(req.URL, map[string]string{
  8634  		"fileId": c.fileId,
  8635  	})
  8636  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8637  }
  8638  
  8639  // Do executes the "drive.revisions.list" call.
  8640  // Any non-2xx status code is an error. Response headers are in either
  8641  // *RevisionList.ServerResponse.Header or (if a response was returned at all)
  8642  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8643  // whether the returned error was because http.StatusNotModified was returned.
  8644  func (c *RevisionsListCall) Do(opts ...googleapi.CallOption) (*RevisionList, error) {
  8645  	gensupport.SetOptions(c.urlParams_, opts...)
  8646  	res, err := c.doRequest("json")
  8647  	if res != nil && res.StatusCode == http.StatusNotModified {
  8648  		if res.Body != nil {
  8649  			res.Body.Close()
  8650  		}
  8651  		return nil, gensupport.WrapError(&googleapi.Error{
  8652  			Code:   res.StatusCode,
  8653  			Header: res.Header,
  8654  		})
  8655  	}
  8656  	if err != nil {
  8657  		return nil, err
  8658  	}
  8659  	defer googleapi.CloseBody(res)
  8660  	if err := googleapi.CheckResponse(res); err != nil {
  8661  		return nil, gensupport.WrapError(err)
  8662  	}
  8663  	ret := &RevisionList{
  8664  		ServerResponse: googleapi.ServerResponse{
  8665  			Header:         res.Header,
  8666  			HTTPStatusCode: res.StatusCode,
  8667  		},
  8668  	}
  8669  	target := &ret
  8670  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8671  		return nil, err
  8672  	}
  8673  	return ret, nil
  8674  }
  8675  
  8676  // Pages invokes f for each page of results.
  8677  // A non-nil error returned from f will halt the iteration.
  8678  // The provided context supersedes any context provided to the Context method.
  8679  func (c *RevisionsListCall) Pages(ctx context.Context, f func(*RevisionList) error) error {
  8680  	c.ctx_ = ctx
  8681  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  8682  	for {
  8683  		x, err := c.Do()
  8684  		if err != nil {
  8685  			return err
  8686  		}
  8687  		if err := f(x); err != nil {
  8688  			return err
  8689  		}
  8690  		if x.NextPageToken == "" {
  8691  			return nil
  8692  		}
  8693  		c.PageToken(x.NextPageToken)
  8694  	}
  8695  }
  8696  
  8697  type RevisionsUpdateCall struct {
  8698  	s          *Service
  8699  	fileId     string
  8700  	revisionId string
  8701  	revision   *Revision
  8702  	urlParams_ gensupport.URLParams
  8703  	ctx_       context.Context
  8704  	header_    http.Header
  8705  }
  8706  
  8707  // Update: Updates a revision with patch semantics.
  8708  //
  8709  // - fileId: The ID of the file.
  8710  // - revisionId: The ID of the revision.
  8711  func (r *RevisionsService) Update(fileId string, revisionId string, revision *Revision) *RevisionsUpdateCall {
  8712  	c := &RevisionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8713  	c.fileId = fileId
  8714  	c.revisionId = revisionId
  8715  	c.revision = revision
  8716  	return c
  8717  }
  8718  
  8719  // Fields allows partial responses to be retrieved. See
  8720  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8721  // details.
  8722  func (c *RevisionsUpdateCall) Fields(s ...googleapi.Field) *RevisionsUpdateCall {
  8723  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8724  	return c
  8725  }
  8726  
  8727  // Context sets the context to be used in this call's Do method.
  8728  func (c *RevisionsUpdateCall) Context(ctx context.Context) *RevisionsUpdateCall {
  8729  	c.ctx_ = ctx
  8730  	return c
  8731  }
  8732  
  8733  // Header returns a http.Header that can be modified by the caller to add
  8734  // headers to the request.
  8735  func (c *RevisionsUpdateCall) Header() http.Header {
  8736  	if c.header_ == nil {
  8737  		c.header_ = make(http.Header)
  8738  	}
  8739  	return c.header_
  8740  }
  8741  
  8742  func (c *RevisionsUpdateCall) doRequest(alt string) (*http.Response, error) {
  8743  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  8744  	var body io.Reader = nil
  8745  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision)
  8746  	if err != nil {
  8747  		return nil, err
  8748  	}
  8749  	c.urlParams_.Set("alt", alt)
  8750  	c.urlParams_.Set("prettyPrint", "false")
  8751  	urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}")
  8752  	urls += "?" + c.urlParams_.Encode()
  8753  	req, err := http.NewRequest("PATCH", urls, body)
  8754  	if err != nil {
  8755  		return nil, err
  8756  	}
  8757  	req.Header = reqHeaders
  8758  	googleapi.Expand(req.URL, map[string]string{
  8759  		"fileId":     c.fileId,
  8760  		"revisionId": c.revisionId,
  8761  	})
  8762  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8763  }
  8764  
  8765  // Do executes the "drive.revisions.update" call.
  8766  // Any non-2xx status code is an error. Response headers are in either
  8767  // *Revision.ServerResponse.Header or (if a response was returned at all) in
  8768  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8769  // whether the returned error was because http.StatusNotModified was returned.
  8770  func (c *RevisionsUpdateCall) Do(opts ...googleapi.CallOption) (*Revision, error) {
  8771  	gensupport.SetOptions(c.urlParams_, opts...)
  8772  	res, err := c.doRequest("json")
  8773  	if res != nil && res.StatusCode == http.StatusNotModified {
  8774  		if res.Body != nil {
  8775  			res.Body.Close()
  8776  		}
  8777  		return nil, gensupport.WrapError(&googleapi.Error{
  8778  			Code:   res.StatusCode,
  8779  			Header: res.Header,
  8780  		})
  8781  	}
  8782  	if err != nil {
  8783  		return nil, err
  8784  	}
  8785  	defer googleapi.CloseBody(res)
  8786  	if err := googleapi.CheckResponse(res); err != nil {
  8787  		return nil, gensupport.WrapError(err)
  8788  	}
  8789  	ret := &Revision{
  8790  		ServerResponse: googleapi.ServerResponse{
  8791  			Header:         res.Header,
  8792  			HTTPStatusCode: res.StatusCode,
  8793  		},
  8794  	}
  8795  	target := &ret
  8796  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8797  		return nil, err
  8798  	}
  8799  	return ret, nil
  8800  }
  8801  
  8802  type TeamdrivesCreateCall struct {
  8803  	s          *Service
  8804  	teamdrive  *TeamDrive
  8805  	urlParams_ gensupport.URLParams
  8806  	ctx_       context.Context
  8807  	header_    http.Header
  8808  }
  8809  
  8810  // Create: Deprecated: Use `drives.create` instead.
  8811  //
  8812  //   - requestId: An ID, such as a random UUID, which uniquely identifies this
  8813  //     user's request for idempotent creation of a Team Drive. A repeated request
  8814  //     by the same user and with the same request ID will avoid creating
  8815  //     duplicates by attempting to create the same Team Drive. If the Team Drive
  8816  //     already exists a 409 error will be returned.
  8817  func (r *TeamdrivesService) Create(requestId string, teamdrive *TeamDrive) *TeamdrivesCreateCall {
  8818  	c := &TeamdrivesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8819  	c.urlParams_.Set("requestId", requestId)
  8820  	c.teamdrive = teamdrive
  8821  	return c
  8822  }
  8823  
  8824  // Fields allows partial responses to be retrieved. See
  8825  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8826  // details.
  8827  func (c *TeamdrivesCreateCall) Fields(s ...googleapi.Field) *TeamdrivesCreateCall {
  8828  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8829  	return c
  8830  }
  8831  
  8832  // Context sets the context to be used in this call's Do method.
  8833  func (c *TeamdrivesCreateCall) Context(ctx context.Context) *TeamdrivesCreateCall {
  8834  	c.ctx_ = ctx
  8835  	return c
  8836  }
  8837  
  8838  // Header returns a http.Header that can be modified by the caller to add
  8839  // headers to the request.
  8840  func (c *TeamdrivesCreateCall) Header() http.Header {
  8841  	if c.header_ == nil {
  8842  		c.header_ = make(http.Header)
  8843  	}
  8844  	return c.header_
  8845  }
  8846  
  8847  func (c *TeamdrivesCreateCall) doRequest(alt string) (*http.Response, error) {
  8848  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  8849  	var body io.Reader = nil
  8850  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive)
  8851  	if err != nil {
  8852  		return nil, err
  8853  	}
  8854  	c.urlParams_.Set("alt", alt)
  8855  	c.urlParams_.Set("prettyPrint", "false")
  8856  	urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives")
  8857  	urls += "?" + c.urlParams_.Encode()
  8858  	req, err := http.NewRequest("POST", urls, body)
  8859  	if err != nil {
  8860  		return nil, err
  8861  	}
  8862  	req.Header = reqHeaders
  8863  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8864  }
  8865  
  8866  // Do executes the "drive.teamdrives.create" call.
  8867  // Any non-2xx status code is an error. Response headers are in either
  8868  // *TeamDrive.ServerResponse.Header or (if a response was returned at all) in
  8869  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8870  // whether the returned error was because http.StatusNotModified was returned.
  8871  func (c *TeamdrivesCreateCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) {
  8872  	gensupport.SetOptions(c.urlParams_, opts...)
  8873  	res, err := c.doRequest("json")
  8874  	if res != nil && res.StatusCode == http.StatusNotModified {
  8875  		if res.Body != nil {
  8876  			res.Body.Close()
  8877  		}
  8878  		return nil, gensupport.WrapError(&googleapi.Error{
  8879  			Code:   res.StatusCode,
  8880  			Header: res.Header,
  8881  		})
  8882  	}
  8883  	if err != nil {
  8884  		return nil, err
  8885  	}
  8886  	defer googleapi.CloseBody(res)
  8887  	if err := googleapi.CheckResponse(res); err != nil {
  8888  		return nil, gensupport.WrapError(err)
  8889  	}
  8890  	ret := &TeamDrive{
  8891  		ServerResponse: googleapi.ServerResponse{
  8892  			Header:         res.Header,
  8893  			HTTPStatusCode: res.StatusCode,
  8894  		},
  8895  	}
  8896  	target := &ret
  8897  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8898  		return nil, err
  8899  	}
  8900  	return ret, nil
  8901  }
  8902  
  8903  type TeamdrivesDeleteCall struct {
  8904  	s           *Service
  8905  	teamDriveId string
  8906  	urlParams_  gensupport.URLParams
  8907  	ctx_        context.Context
  8908  	header_     http.Header
  8909  }
  8910  
  8911  // Delete: Deprecated: Use `drives.delete` instead.
  8912  //
  8913  // - teamDriveId: The ID of the Team Drive.
  8914  func (r *TeamdrivesService) Delete(teamDriveId string) *TeamdrivesDeleteCall {
  8915  	c := &TeamdrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8916  	c.teamDriveId = teamDriveId
  8917  	return c
  8918  }
  8919  
  8920  // Fields allows partial responses to be retrieved. See
  8921  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8922  // details.
  8923  func (c *TeamdrivesDeleteCall) Fields(s ...googleapi.Field) *TeamdrivesDeleteCall {
  8924  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8925  	return c
  8926  }
  8927  
  8928  // Context sets the context to be used in this call's Do method.
  8929  func (c *TeamdrivesDeleteCall) Context(ctx context.Context) *TeamdrivesDeleteCall {
  8930  	c.ctx_ = ctx
  8931  	return c
  8932  }
  8933  
  8934  // Header returns a http.Header that can be modified by the caller to add
  8935  // headers to the request.
  8936  func (c *TeamdrivesDeleteCall) Header() http.Header {
  8937  	if c.header_ == nil {
  8938  		c.header_ = make(http.Header)
  8939  	}
  8940  	return c.header_
  8941  }
  8942  
  8943  func (c *TeamdrivesDeleteCall) doRequest(alt string) (*http.Response, error) {
  8944  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8945  	var body io.Reader = nil
  8946  	c.urlParams_.Set("alt", alt)
  8947  	c.urlParams_.Set("prettyPrint", "false")
  8948  	urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}")
  8949  	urls += "?" + c.urlParams_.Encode()
  8950  	req, err := http.NewRequest("DELETE", urls, body)
  8951  	if err != nil {
  8952  		return nil, err
  8953  	}
  8954  	req.Header = reqHeaders
  8955  	googleapi.Expand(req.URL, map[string]string{
  8956  		"teamDriveId": c.teamDriveId,
  8957  	})
  8958  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8959  }
  8960  
  8961  // Do executes the "drive.teamdrives.delete" call.
  8962  func (c *TeamdrivesDeleteCall) Do(opts ...googleapi.CallOption) error {
  8963  	gensupport.SetOptions(c.urlParams_, opts...)
  8964  	res, err := c.doRequest("json")
  8965  	if err != nil {
  8966  		return err
  8967  	}
  8968  	defer googleapi.CloseBody(res)
  8969  	if err := googleapi.CheckResponse(res); err != nil {
  8970  		return gensupport.WrapError(err)
  8971  	}
  8972  	return nil
  8973  }
  8974  
  8975  type TeamdrivesGetCall struct {
  8976  	s            *Service
  8977  	teamDriveId  string
  8978  	urlParams_   gensupport.URLParams
  8979  	ifNoneMatch_ string
  8980  	ctx_         context.Context
  8981  	header_      http.Header
  8982  }
  8983  
  8984  // Get: Deprecated: Use `drives.get` instead.
  8985  //
  8986  // - teamDriveId: The ID of the Team Drive.
  8987  func (r *TeamdrivesService) Get(teamDriveId string) *TeamdrivesGetCall {
  8988  	c := &TeamdrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8989  	c.teamDriveId = teamDriveId
  8990  	return c
  8991  }
  8992  
  8993  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  8994  // Issue the request as a domain administrator; if set to true, then the
  8995  // requester will be granted access if they are an administrator of the domain
  8996  // to which the Team Drive belongs.
  8997  func (c *TeamdrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesGetCall {
  8998  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  8999  	return c
  9000  }
  9001  
  9002  // Fields allows partial responses to be retrieved. See
  9003  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9004  // details.
  9005  func (c *TeamdrivesGetCall) Fields(s ...googleapi.Field) *TeamdrivesGetCall {
  9006  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9007  	return c
  9008  }
  9009  
  9010  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  9011  // object's ETag matches the given value. This is useful for getting updates
  9012  // only after the object has changed since the last request.
  9013  func (c *TeamdrivesGetCall) IfNoneMatch(entityTag string) *TeamdrivesGetCall {
  9014  	c.ifNoneMatch_ = entityTag
  9015  	return c
  9016  }
  9017  
  9018  // Context sets the context to be used in this call's Do method.
  9019  func (c *TeamdrivesGetCall) Context(ctx context.Context) *TeamdrivesGetCall {
  9020  	c.ctx_ = ctx
  9021  	return c
  9022  }
  9023  
  9024  // Header returns a http.Header that can be modified by the caller to add
  9025  // headers to the request.
  9026  func (c *TeamdrivesGetCall) Header() http.Header {
  9027  	if c.header_ == nil {
  9028  		c.header_ = make(http.Header)
  9029  	}
  9030  	return c.header_
  9031  }
  9032  
  9033  func (c *TeamdrivesGetCall) doRequest(alt string) (*http.Response, error) {
  9034  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  9035  	if c.ifNoneMatch_ != "" {
  9036  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9037  	}
  9038  	var body io.Reader = nil
  9039  	c.urlParams_.Set("alt", alt)
  9040  	c.urlParams_.Set("prettyPrint", "false")
  9041  	urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}")
  9042  	urls += "?" + c.urlParams_.Encode()
  9043  	req, err := http.NewRequest("GET", urls, body)
  9044  	if err != nil {
  9045  		return nil, err
  9046  	}
  9047  	req.Header = reqHeaders
  9048  	googleapi.Expand(req.URL, map[string]string{
  9049  		"teamDriveId": c.teamDriveId,
  9050  	})
  9051  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9052  }
  9053  
  9054  // Do executes the "drive.teamdrives.get" call.
  9055  // Any non-2xx status code is an error. Response headers are in either
  9056  // *TeamDrive.ServerResponse.Header or (if a response was returned at all) in
  9057  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9058  // whether the returned error was because http.StatusNotModified was returned.
  9059  func (c *TeamdrivesGetCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) {
  9060  	gensupport.SetOptions(c.urlParams_, opts...)
  9061  	res, err := c.doRequest("json")
  9062  	if res != nil && res.StatusCode == http.StatusNotModified {
  9063  		if res.Body != nil {
  9064  			res.Body.Close()
  9065  		}
  9066  		return nil, gensupport.WrapError(&googleapi.Error{
  9067  			Code:   res.StatusCode,
  9068  			Header: res.Header,
  9069  		})
  9070  	}
  9071  	if err != nil {
  9072  		return nil, err
  9073  	}
  9074  	defer googleapi.CloseBody(res)
  9075  	if err := googleapi.CheckResponse(res); err != nil {
  9076  		return nil, gensupport.WrapError(err)
  9077  	}
  9078  	ret := &TeamDrive{
  9079  		ServerResponse: googleapi.ServerResponse{
  9080  			Header:         res.Header,
  9081  			HTTPStatusCode: res.StatusCode,
  9082  		},
  9083  	}
  9084  	target := &ret
  9085  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9086  		return nil, err
  9087  	}
  9088  	return ret, nil
  9089  }
  9090  
  9091  type TeamdrivesListCall struct {
  9092  	s            *Service
  9093  	urlParams_   gensupport.URLParams
  9094  	ifNoneMatch_ string
  9095  	ctx_         context.Context
  9096  	header_      http.Header
  9097  }
  9098  
  9099  // List: Deprecated: Use `drives.list` instead.
  9100  func (r *TeamdrivesService) List() *TeamdrivesListCall {
  9101  	c := &TeamdrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9102  	return c
  9103  }
  9104  
  9105  // PageSize sets the optional parameter "pageSize": Maximum number of Team
  9106  // Drives to return.
  9107  func (c *TeamdrivesListCall) PageSize(pageSize int64) *TeamdrivesListCall {
  9108  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9109  	return c
  9110  }
  9111  
  9112  // PageToken sets the optional parameter "pageToken": Page token for Team
  9113  // Drives.
  9114  func (c *TeamdrivesListCall) PageToken(pageToken string) *TeamdrivesListCall {
  9115  	c.urlParams_.Set("pageToken", pageToken)
  9116  	return c
  9117  }
  9118  
  9119  // Q sets the optional parameter "q": Query string for searching Team Drives.
  9120  func (c *TeamdrivesListCall) Q(q string) *TeamdrivesListCall {
  9121  	c.urlParams_.Set("q", q)
  9122  	return c
  9123  }
  9124  
  9125  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  9126  // Issue the request as a domain administrator; if set to true, then all Team
  9127  // Drives of the domain in which the requester is an administrator are
  9128  // returned.
  9129  func (c *TeamdrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesListCall {
  9130  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  9131  	return c
  9132  }
  9133  
  9134  // Fields allows partial responses to be retrieved. See
  9135  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9136  // details.
  9137  func (c *TeamdrivesListCall) Fields(s ...googleapi.Field) *TeamdrivesListCall {
  9138  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9139  	return c
  9140  }
  9141  
  9142  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  9143  // object's ETag matches the given value. This is useful for getting updates
  9144  // only after the object has changed since the last request.
  9145  func (c *TeamdrivesListCall) IfNoneMatch(entityTag string) *TeamdrivesListCall {
  9146  	c.ifNoneMatch_ = entityTag
  9147  	return c
  9148  }
  9149  
  9150  // Context sets the context to be used in this call's Do method.
  9151  func (c *TeamdrivesListCall) Context(ctx context.Context) *TeamdrivesListCall {
  9152  	c.ctx_ = ctx
  9153  	return c
  9154  }
  9155  
  9156  // Header returns a http.Header that can be modified by the caller to add
  9157  // headers to the request.
  9158  func (c *TeamdrivesListCall) Header() http.Header {
  9159  	if c.header_ == nil {
  9160  		c.header_ = make(http.Header)
  9161  	}
  9162  	return c.header_
  9163  }
  9164  
  9165  func (c *TeamdrivesListCall) doRequest(alt string) (*http.Response, error) {
  9166  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  9167  	if c.ifNoneMatch_ != "" {
  9168  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9169  	}
  9170  	var body io.Reader = nil
  9171  	c.urlParams_.Set("alt", alt)
  9172  	c.urlParams_.Set("prettyPrint", "false")
  9173  	urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives")
  9174  	urls += "?" + c.urlParams_.Encode()
  9175  	req, err := http.NewRequest("GET", urls, body)
  9176  	if err != nil {
  9177  		return nil, err
  9178  	}
  9179  	req.Header = reqHeaders
  9180  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9181  }
  9182  
  9183  // Do executes the "drive.teamdrives.list" call.
  9184  // Any non-2xx status code is an error. Response headers are in either
  9185  // *TeamDriveList.ServerResponse.Header or (if a response was returned at all)
  9186  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9187  // whether the returned error was because http.StatusNotModified was returned.
  9188  func (c *TeamdrivesListCall) Do(opts ...googleapi.CallOption) (*TeamDriveList, error) {
  9189  	gensupport.SetOptions(c.urlParams_, opts...)
  9190  	res, err := c.doRequest("json")
  9191  	if res != nil && res.StatusCode == http.StatusNotModified {
  9192  		if res.Body != nil {
  9193  			res.Body.Close()
  9194  		}
  9195  		return nil, gensupport.WrapError(&googleapi.Error{
  9196  			Code:   res.StatusCode,
  9197  			Header: res.Header,
  9198  		})
  9199  	}
  9200  	if err != nil {
  9201  		return nil, err
  9202  	}
  9203  	defer googleapi.CloseBody(res)
  9204  	if err := googleapi.CheckResponse(res); err != nil {
  9205  		return nil, gensupport.WrapError(err)
  9206  	}
  9207  	ret := &TeamDriveList{
  9208  		ServerResponse: googleapi.ServerResponse{
  9209  			Header:         res.Header,
  9210  			HTTPStatusCode: res.StatusCode,
  9211  		},
  9212  	}
  9213  	target := &ret
  9214  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9215  		return nil, err
  9216  	}
  9217  	return ret, nil
  9218  }
  9219  
  9220  // Pages invokes f for each page of results.
  9221  // A non-nil error returned from f will halt the iteration.
  9222  // The provided context supersedes any context provided to the Context method.
  9223  func (c *TeamdrivesListCall) Pages(ctx context.Context, f func(*TeamDriveList) error) error {
  9224  	c.ctx_ = ctx
  9225  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  9226  	for {
  9227  		x, err := c.Do()
  9228  		if err != nil {
  9229  			return err
  9230  		}
  9231  		if err := f(x); err != nil {
  9232  			return err
  9233  		}
  9234  		if x.NextPageToken == "" {
  9235  			return nil
  9236  		}
  9237  		c.PageToken(x.NextPageToken)
  9238  	}
  9239  }
  9240  
  9241  type TeamdrivesUpdateCall struct {
  9242  	s           *Service
  9243  	teamDriveId string
  9244  	teamdrive   *TeamDrive
  9245  	urlParams_  gensupport.URLParams
  9246  	ctx_        context.Context
  9247  	header_     http.Header
  9248  }
  9249  
  9250  // Update: Deprecated: Use `drives.update` instead.
  9251  //
  9252  // - teamDriveId: The ID of the Team Drive.
  9253  func (r *TeamdrivesService) Update(teamDriveId string, teamdrive *TeamDrive) *TeamdrivesUpdateCall {
  9254  	c := &TeamdrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9255  	c.teamDriveId = teamDriveId
  9256  	c.teamdrive = teamdrive
  9257  	return c
  9258  }
  9259  
  9260  // UseDomainAdminAccess sets the optional parameter "useDomainAdminAccess":
  9261  // Issue the request as a domain administrator; if set to true, then the
  9262  // requester will be granted access if they are an administrator of the domain
  9263  // to which the Team Drive belongs.
  9264  func (c *TeamdrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesUpdateCall {
  9265  	c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess))
  9266  	return c
  9267  }
  9268  
  9269  // Fields allows partial responses to be retrieved. See
  9270  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9271  // details.
  9272  func (c *TeamdrivesUpdateCall) Fields(s ...googleapi.Field) *TeamdrivesUpdateCall {
  9273  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9274  	return c
  9275  }
  9276  
  9277  // Context sets the context to be used in this call's Do method.
  9278  func (c *TeamdrivesUpdateCall) Context(ctx context.Context) *TeamdrivesUpdateCall {
  9279  	c.ctx_ = ctx
  9280  	return c
  9281  }
  9282  
  9283  // Header returns a http.Header that can be modified by the caller to add
  9284  // headers to the request.
  9285  func (c *TeamdrivesUpdateCall) Header() http.Header {
  9286  	if c.header_ == nil {
  9287  		c.header_ = make(http.Header)
  9288  	}
  9289  	return c.header_
  9290  }
  9291  
  9292  func (c *TeamdrivesUpdateCall) doRequest(alt string) (*http.Response, error) {
  9293  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  9294  	var body io.Reader = nil
  9295  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive)
  9296  	if err != nil {
  9297  		return nil, err
  9298  	}
  9299  	c.urlParams_.Set("alt", alt)
  9300  	c.urlParams_.Set("prettyPrint", "false")
  9301  	urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}")
  9302  	urls += "?" + c.urlParams_.Encode()
  9303  	req, err := http.NewRequest("PATCH", urls, body)
  9304  	if err != nil {
  9305  		return nil, err
  9306  	}
  9307  	req.Header = reqHeaders
  9308  	googleapi.Expand(req.URL, map[string]string{
  9309  		"teamDriveId": c.teamDriveId,
  9310  	})
  9311  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9312  }
  9313  
  9314  // Do executes the "drive.teamdrives.update" call.
  9315  // Any non-2xx status code is an error. Response headers are in either
  9316  // *TeamDrive.ServerResponse.Header or (if a response was returned at all) in
  9317  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9318  // whether the returned error was because http.StatusNotModified was returned.
  9319  func (c *TeamdrivesUpdateCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) {
  9320  	gensupport.SetOptions(c.urlParams_, opts...)
  9321  	res, err := c.doRequest("json")
  9322  	if res != nil && res.StatusCode == http.StatusNotModified {
  9323  		if res.Body != nil {
  9324  			res.Body.Close()
  9325  		}
  9326  		return nil, gensupport.WrapError(&googleapi.Error{
  9327  			Code:   res.StatusCode,
  9328  			Header: res.Header,
  9329  		})
  9330  	}
  9331  	if err != nil {
  9332  		return nil, err
  9333  	}
  9334  	defer googleapi.CloseBody(res)
  9335  	if err := googleapi.CheckResponse(res); err != nil {
  9336  		return nil, gensupport.WrapError(err)
  9337  	}
  9338  	ret := &TeamDrive{
  9339  		ServerResponse: googleapi.ServerResponse{
  9340  			Header:         res.Header,
  9341  			HTTPStatusCode: res.StatusCode,
  9342  		},
  9343  	}
  9344  	target := &ret
  9345  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9346  		return nil, err
  9347  	}
  9348  	return ret, nil
  9349  }
  9350  

View as plain text