1// Copyright 2021 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 Drive API. 8// 9// For product documentation, see: https://developers.google.com/drive/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/drive/v3" 16// ... 17// ctx := context.Background() 18// driveService, err := drive.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes: 27// 28// driveService, err := drive.NewService(ctx, option.WithScopes(drive.DriveScriptsScope)) 29// 30// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 31// 32// driveService, err := drive.NewService(ctx, option.WithAPIKey("AIza...")) 33// 34// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 35// 36// config := &oauth2.Config{...} 37// // ... 38// token, err := config.Exchange(ctx, ...) 39// driveService, err := drive.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 40// 41// See https://godoc.org/google.golang.org/api/option/ for details on options. 42package drive // import "google.golang.org/api/drive/v3" 43 44import ( 45 "bytes" 46 "context" 47 "encoding/json" 48 "errors" 49 "fmt" 50 "io" 51 "net/http" 52 "net/url" 53 "strconv" 54 "strings" 55 56 googleapi "google.golang.org/api/googleapi" 57 gensupport "google.golang.org/api/internal/gensupport" 58 option "google.golang.org/api/option" 59 internaloption "google.golang.org/api/option/internaloption" 60 htransport "google.golang.org/api/transport/http" 61) 62 63// Always reference these packages, just in case the auto-generated code 64// below doesn't. 65var _ = bytes.NewBuffer 66var _ = strconv.Itoa 67var _ = fmt.Sprintf 68var _ = json.NewDecoder 69var _ = io.Copy 70var _ = url.Parse 71var _ = gensupport.MarshalJSON 72var _ = googleapi.Version 73var _ = errors.New 74var _ = strings.Replace 75var _ = context.Canceled 76var _ = internaloption.WithDefaultEndpoint 77 78const apiId = "drive:v3" 79const apiName = "drive" 80const apiVersion = "v3" 81const basePath = "https://www.googleapis.com/drive/v3/" 82 83// OAuth2 scopes used by this API. 84const ( 85 // See, edit, create, and delete all of your Google Drive files 86 DriveScope = "https://www.googleapis.com/auth/drive" 87 88 // See, create, and delete its own configuration data in your Google 89 // Drive 90 DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata" 91 92 // See, edit, create, and delete only the specific Google Drive files 93 // you use with this app 94 DriveFileScope = "https://www.googleapis.com/auth/drive.file" 95 96 // View and manage metadata of files in your Google Drive 97 DriveMetadataScope = "https://www.googleapis.com/auth/drive.metadata" 98 99 // See information about your Google Drive files 100 DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/drive.metadata.readonly" 101 102 // View the photos, videos and albums in your Google Photos 103 DrivePhotosReadonlyScope = "https://www.googleapis.com/auth/drive.photos.readonly" 104 105 // See and download all your Google Drive files 106 DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly" 107 108 // Modify your Google Apps Script scripts' behavior 109 DriveScriptsScope = "https://www.googleapis.com/auth/drive.scripts" 110) 111 112// NewService creates a new Service. 113func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 114 scopesOption := option.WithScopes( 115 "https://www.googleapis.com/auth/drive", 116 "https://www.googleapis.com/auth/drive.appdata", 117 "https://www.googleapis.com/auth/drive.file", 118 "https://www.googleapis.com/auth/drive.metadata", 119 "https://www.googleapis.com/auth/drive.metadata.readonly", 120 "https://www.googleapis.com/auth/drive.photos.readonly", 121 "https://www.googleapis.com/auth/drive.readonly", 122 "https://www.googleapis.com/auth/drive.scripts", 123 ) 124 // NOTE: prepend, so we don't override user-specified scopes. 125 opts = append([]option.ClientOption{scopesOption}, opts...) 126 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 127 client, endpoint, err := htransport.NewClient(ctx, opts...) 128 if err != nil { 129 return nil, err 130 } 131 s, err := New(client) 132 if err != nil { 133 return nil, err 134 } 135 if endpoint != "" { 136 s.BasePath = endpoint 137 } 138 return s, nil 139} 140 141// New creates a new Service. It uses the provided http.Client for requests. 142// 143// Deprecated: please use NewService instead. 144// To provide a custom HTTP client, use option.WithHTTPClient. 145// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 146func New(client *http.Client) (*Service, error) { 147 if client == nil { 148 return nil, errors.New("client is nil") 149 } 150 s := &Service{client: client, BasePath: basePath} 151 s.About = NewAboutService(s) 152 s.Changes = NewChangesService(s) 153 s.Channels = NewChannelsService(s) 154 s.Comments = NewCommentsService(s) 155 s.Drives = NewDrivesService(s) 156 s.Files = NewFilesService(s) 157 s.Permissions = NewPermissionsService(s) 158 s.Replies = NewRepliesService(s) 159 s.Revisions = NewRevisionsService(s) 160 s.Teamdrives = NewTeamdrivesService(s) 161 return s, nil 162} 163 164type Service struct { 165 client *http.Client 166 BasePath string // API endpoint base URL 167 UserAgent string // optional additional User-Agent fragment 168 169 About *AboutService 170 171 Changes *ChangesService 172 173 Channels *ChannelsService 174 175 Comments *CommentsService 176 177 Drives *DrivesService 178 179 Files *FilesService 180 181 Permissions *PermissionsService 182 183 Replies *RepliesService 184 185 Revisions *RevisionsService 186 187 Teamdrives *TeamdrivesService 188} 189 190func (s *Service) userAgent() string { 191 if s.UserAgent == "" { 192 return googleapi.UserAgent 193 } 194 return googleapi.UserAgent + " " + s.UserAgent 195} 196 197func NewAboutService(s *Service) *AboutService { 198 rs := &AboutService{s: s} 199 return rs 200} 201 202type AboutService struct { 203 s *Service 204} 205 206func NewChangesService(s *Service) *ChangesService { 207 rs := &ChangesService{s: s} 208 return rs 209} 210 211type ChangesService struct { 212 s *Service 213} 214 215func NewChannelsService(s *Service) *ChannelsService { 216 rs := &ChannelsService{s: s} 217 return rs 218} 219 220type ChannelsService struct { 221 s *Service 222} 223 224func NewCommentsService(s *Service) *CommentsService { 225 rs := &CommentsService{s: s} 226 return rs 227} 228 229type CommentsService struct { 230 s *Service 231} 232 233func NewDrivesService(s *Service) *DrivesService { 234 rs := &DrivesService{s: s} 235 return rs 236} 237 238type DrivesService struct { 239 s *Service 240} 241 242func NewFilesService(s *Service) *FilesService { 243 rs := &FilesService{s: s} 244 return rs 245} 246 247type FilesService struct { 248 s *Service 249} 250 251func NewPermissionsService(s *Service) *PermissionsService { 252 rs := &PermissionsService{s: s} 253 return rs 254} 255 256type PermissionsService struct { 257 s *Service 258} 259 260func NewRepliesService(s *Service) *RepliesService { 261 rs := &RepliesService{s: s} 262 return rs 263} 264 265type RepliesService struct { 266 s *Service 267} 268 269func NewRevisionsService(s *Service) *RevisionsService { 270 rs := &RevisionsService{s: s} 271 return rs 272} 273 274type RevisionsService struct { 275 s *Service 276} 277 278func NewTeamdrivesService(s *Service) *TeamdrivesService { 279 rs := &TeamdrivesService{s: s} 280 return rs 281} 282 283type TeamdrivesService struct { 284 s *Service 285} 286 287// About: Information about the user, the user's Drive, and system 288// capabilities. 289type About struct { 290 // AppInstalled: Whether the user has installed the requesting app. 291 AppInstalled bool `json:"appInstalled,omitempty"` 292 293 // CanCreateDrives: Whether the user can create shared drives. 294 CanCreateDrives bool `json:"canCreateDrives,omitempty"` 295 296 // CanCreateTeamDrives: Deprecated - use canCreateDrives instead. 297 CanCreateTeamDrives bool `json:"canCreateTeamDrives,omitempty"` 298 299 // DriveThemes: A list of themes that are supported for shared drives. 300 DriveThemes []*AboutDriveThemes `json:"driveThemes,omitempty"` 301 302 // ExportFormats: A map of source MIME type to possible targets for all 303 // supported exports. 304 ExportFormats map[string][]string `json:"exportFormats,omitempty"` 305 306 // FolderColorPalette: The currently supported folder colors as RGB hex 307 // strings. 308 FolderColorPalette []string `json:"folderColorPalette,omitempty"` 309 310 // ImportFormats: A map of source MIME type to possible targets for all 311 // supported imports. 312 ImportFormats map[string][]string `json:"importFormats,omitempty"` 313 314 // Kind: Identifies what kind of resource this is. Value: the fixed 315 // string "drive#about". 316 Kind string `json:"kind,omitempty"` 317 318 // MaxImportSizes: A map of maximum import sizes by MIME type, in bytes. 319 MaxImportSizes map[string]string `json:"maxImportSizes,omitempty"` 320 321 // MaxUploadSize: The maximum upload size in bytes. 322 MaxUploadSize int64 `json:"maxUploadSize,omitempty,string"` 323 324 // StorageQuota: The user's storage quota limits and usage. All fields 325 // are measured in bytes. 326 StorageQuota *AboutStorageQuota `json:"storageQuota,omitempty"` 327 328 // TeamDriveThemes: Deprecated - use driveThemes instead. 329 TeamDriveThemes []*AboutTeamDriveThemes `json:"teamDriveThemes,omitempty"` 330 331 // User: The authenticated user. 332 User *User `json:"user,omitempty"` 333 334 // ServerResponse contains the HTTP response code and headers from the 335 // server. 336 googleapi.ServerResponse `json:"-"` 337 338 // ForceSendFields is a list of field names (e.g. "AppInstalled") to 339 // unconditionally include in API requests. By default, fields with 340 // empty or default values are omitted from API requests. However, any 341 // non-pointer, non-interface field appearing in ForceSendFields will be 342 // sent to the server regardless of whether the field is empty or not. 343 // This may be used to include empty fields in Patch requests. 344 ForceSendFields []string `json:"-"` 345 346 // NullFields is a list of field names (e.g. "AppInstalled") to include 347 // in API requests with the JSON null value. By default, fields with 348 // empty values are omitted from API requests. However, any field with 349 // an empty value appearing in NullFields will be sent to the server as 350 // null. It is an error if a field in this list has a non-empty value. 351 // This may be used to include null fields in Patch requests. 352 NullFields []string `json:"-"` 353} 354 355func (s *About) MarshalJSON() ([]byte, error) { 356 type NoMethod About 357 raw := NoMethod(*s) 358 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 359} 360 361type AboutDriveThemes struct { 362 // BackgroundImageLink: A link to this theme's background image. 363 BackgroundImageLink string `json:"backgroundImageLink,omitempty"` 364 365 // ColorRgb: The color of this theme as an RGB hex string. 366 ColorRgb string `json:"colorRgb,omitempty"` 367 368 // Id: The ID of the theme. 369 Id string `json:"id,omitempty"` 370 371 // ForceSendFields is a list of field names (e.g. "BackgroundImageLink") 372 // to unconditionally include in API requests. By default, fields with 373 // empty or default values are omitted from API requests. However, any 374 // non-pointer, non-interface field appearing in ForceSendFields will be 375 // sent to the server regardless of whether the field is empty or not. 376 // This may be used to include empty fields in Patch requests. 377 ForceSendFields []string `json:"-"` 378 379 // NullFields is a list of field names (e.g. "BackgroundImageLink") to 380 // include in API requests with the JSON null value. By default, fields 381 // with empty values are omitted from API requests. However, any field 382 // with an empty value appearing in NullFields will be sent to the 383 // server as null. It is an error if a field in this list has a 384 // non-empty value. This may be used to include null fields in Patch 385 // requests. 386 NullFields []string `json:"-"` 387} 388 389func (s *AboutDriveThemes) MarshalJSON() ([]byte, error) { 390 type NoMethod AboutDriveThemes 391 raw := NoMethod(*s) 392 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 393} 394 395// AboutStorageQuota: The user's storage quota limits and usage. All 396// fields are measured in bytes. 397type AboutStorageQuota struct { 398 // Limit: The usage limit, if applicable. This will not be present if 399 // the user has unlimited storage. 400 Limit int64 `json:"limit,omitempty,string"` 401 402 // Usage: The total usage across all services. 403 Usage int64 `json:"usage,omitempty,string"` 404 405 // UsageInDrive: The usage by all files in Google Drive. 406 UsageInDrive int64 `json:"usageInDrive,omitempty,string"` 407 408 // UsageInDriveTrash: The usage by trashed files in Google Drive. 409 UsageInDriveTrash int64 `json:"usageInDriveTrash,omitempty,string"` 410 411 // ForceSendFields is a list of field names (e.g. "Limit") to 412 // unconditionally include in API requests. By default, fields with 413 // empty or default values are omitted from API requests. However, any 414 // non-pointer, non-interface field appearing in ForceSendFields will be 415 // sent to the server regardless of whether the field is empty or not. 416 // This may be used to include empty fields in Patch requests. 417 ForceSendFields []string `json:"-"` 418 419 // NullFields is a list of field names (e.g. "Limit") to include in API 420 // requests with the JSON null value. By default, fields with empty 421 // values are omitted from API requests. However, any field with an 422 // empty value appearing in NullFields will be sent to the server as 423 // null. It is an error if a field in this list has a non-empty value. 424 // This may be used to include null fields in Patch requests. 425 NullFields []string `json:"-"` 426} 427 428func (s *AboutStorageQuota) MarshalJSON() ([]byte, error) { 429 type NoMethod AboutStorageQuota 430 raw := NoMethod(*s) 431 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 432} 433 434type AboutTeamDriveThemes struct { 435 // BackgroundImageLink: Deprecated - use driveThemes/backgroundImageLink 436 // instead. 437 BackgroundImageLink string `json:"backgroundImageLink,omitempty"` 438 439 // ColorRgb: Deprecated - use driveThemes/colorRgb instead. 440 ColorRgb string `json:"colorRgb,omitempty"` 441 442 // Id: Deprecated - use driveThemes/id instead. 443 Id string `json:"id,omitempty"` 444 445 // ForceSendFields is a list of field names (e.g. "BackgroundImageLink") 446 // to unconditionally include in API requests. By default, fields with 447 // empty or default values are omitted from API requests. However, any 448 // non-pointer, non-interface field appearing in ForceSendFields will be 449 // sent to the server regardless of whether the field is empty or not. 450 // This may be used to include empty fields in Patch requests. 451 ForceSendFields []string `json:"-"` 452 453 // NullFields is a list of field names (e.g. "BackgroundImageLink") to 454 // include in API requests with the JSON null value. By default, fields 455 // with empty values are omitted from API requests. However, any field 456 // with an empty value appearing in NullFields will be sent to the 457 // server as null. It is an error if a field in this list has a 458 // non-empty value. This may be used to include null fields in Patch 459 // requests. 460 NullFields []string `json:"-"` 461} 462 463func (s *AboutTeamDriveThemes) MarshalJSON() ([]byte, error) { 464 type NoMethod AboutTeamDriveThemes 465 raw := NoMethod(*s) 466 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 467} 468 469// Change: A change to a file or shared drive. 470type Change struct { 471 // ChangeType: The type of the change. Possible values are file and 472 // drive. 473 ChangeType string `json:"changeType,omitempty"` 474 475 // Drive: The updated state of the shared drive. Present if the 476 // changeType is drive, the user is still a member of the shared drive, 477 // and the shared drive has not been deleted. 478 Drive *Drive `json:"drive,omitempty"` 479 480 // DriveId: The ID of the shared drive associated with this change. 481 DriveId string `json:"driveId,omitempty"` 482 483 // File: The updated state of the file. Present if the type is file and 484 // the file has not been removed from this list of changes. 485 File *File `json:"file,omitempty"` 486 487 // FileId: The ID of the file which has changed. 488 FileId string `json:"fileId,omitempty"` 489 490 // Kind: Identifies what kind of resource this is. Value: the fixed 491 // string "drive#change". 492 Kind string `json:"kind,omitempty"` 493 494 // Removed: Whether the file or shared drive has been removed from this 495 // list of changes, for example by deletion or loss of access. 496 Removed bool `json:"removed,omitempty"` 497 498 // TeamDrive: Deprecated - use drive instead. 499 TeamDrive *TeamDrive `json:"teamDrive,omitempty"` 500 501 // TeamDriveId: Deprecated - use driveId instead. 502 TeamDriveId string `json:"teamDriveId,omitempty"` 503 504 // Time: The time of this change (RFC 3339 date-time). 505 Time string `json:"time,omitempty"` 506 507 // Type: Deprecated - use changeType instead. 508 Type string `json:"type,omitempty"` 509 510 // ForceSendFields is a list of field names (e.g. "ChangeType") to 511 // unconditionally include in API requests. By default, fields with 512 // empty or default values are omitted from API requests. However, any 513 // non-pointer, non-interface field appearing in ForceSendFields will be 514 // sent to the server regardless of whether the field is empty or not. 515 // This may be used to include empty fields in Patch requests. 516 ForceSendFields []string `json:"-"` 517 518 // NullFields is a list of field names (e.g. "ChangeType") to include in 519 // API requests with the JSON null value. By default, fields with empty 520 // values are omitted from API requests. However, any field with an 521 // empty value appearing in NullFields will be sent to the server as 522 // null. It is an error if a field in this list has a non-empty value. 523 // This may be used to include null fields in Patch requests. 524 NullFields []string `json:"-"` 525} 526 527func (s *Change) MarshalJSON() ([]byte, error) { 528 type NoMethod Change 529 raw := NoMethod(*s) 530 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 531} 532 533// ChangeList: A list of changes for a user. 534type ChangeList struct { 535 // Changes: The list of changes. If nextPageToken is populated, then 536 // this list may be incomplete and an additional page of results should 537 // be fetched. 538 Changes []*Change `json:"changes,omitempty"` 539 540 // Kind: Identifies what kind of resource this is. Value: the fixed 541 // string "drive#changeList". 542 Kind string `json:"kind,omitempty"` 543 544 // NewStartPageToken: The starting page token for future changes. This 545 // will be present only if the end of the current changes list has been 546 // reached. 547 NewStartPageToken string `json:"newStartPageToken,omitempty"` 548 549 // NextPageToken: The page token for the next page of changes. This will 550 // be absent if the end of the changes list has been reached. If the 551 // token is rejected for any reason, it should be discarded, and 552 // pagination should be restarted from the first page of results. 553 NextPageToken string `json:"nextPageToken,omitempty"` 554 555 // ServerResponse contains the HTTP response code and headers from the 556 // server. 557 googleapi.ServerResponse `json:"-"` 558 559 // ForceSendFields is a list of field names (e.g. "Changes") to 560 // unconditionally include in API requests. By default, fields with 561 // empty or default values are omitted from API requests. However, any 562 // non-pointer, non-interface field appearing in ForceSendFields will be 563 // sent to the server regardless of whether the field is empty or not. 564 // This may be used to include empty fields in Patch requests. 565 ForceSendFields []string `json:"-"` 566 567 // NullFields is a list of field names (e.g. "Changes") to include in 568 // API requests with the JSON null value. By default, fields with empty 569 // values are omitted from API requests. However, any field with an 570 // empty value appearing in NullFields will be sent to the server as 571 // null. It is an error if a field in this list has a non-empty value. 572 // This may be used to include null fields in Patch requests. 573 NullFields []string `json:"-"` 574} 575 576func (s *ChangeList) MarshalJSON() ([]byte, error) { 577 type NoMethod ChangeList 578 raw := NoMethod(*s) 579 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 580} 581 582// Channel: An notification channel used to watch for resource changes. 583type Channel struct { 584 // Address: The address where notifications are delivered for this 585 // channel. 586 Address string `json:"address,omitempty"` 587 588 // Expiration: Date and time of notification channel expiration, 589 // expressed as a Unix timestamp, in milliseconds. Optional. 590 Expiration int64 `json:"expiration,omitempty,string"` 591 592 // Id: A UUID or similar unique string that identifies this channel. 593 Id string `json:"id,omitempty"` 594 595 // Kind: Identifies this as a notification channel used to watch for 596 // changes to a resource, which is "api#channel". 597 Kind string `json:"kind,omitempty"` 598 599 // Params: Additional parameters controlling delivery channel behavior. 600 // Optional. 601 Params map[string]string `json:"params,omitempty"` 602 603 // Payload: A Boolean value to indicate whether payload is wanted. 604 // Optional. 605 Payload bool `json:"payload,omitempty"` 606 607 // ResourceId: An opaque ID that identifies the resource being watched 608 // on this channel. Stable across different API versions. 609 ResourceId string `json:"resourceId,omitempty"` 610 611 // ResourceUri: A version-specific identifier for the watched resource. 612 ResourceUri string `json:"resourceUri,omitempty"` 613 614 // Token: An arbitrary string delivered to the target address with each 615 // notification delivered over this channel. Optional. 616 Token string `json:"token,omitempty"` 617 618 // Type: The type of delivery mechanism used for this channel. Valid 619 // values are "web_hook" (or "webhook"). Both values refer to a channel 620 // where Http requests are used to deliver messages. 621 Type string `json:"type,omitempty"` 622 623 // ServerResponse contains the HTTP response code and headers from the 624 // server. 625 googleapi.ServerResponse `json:"-"` 626 627 // ForceSendFields is a list of field names (e.g. "Address") to 628 // unconditionally include in API requests. By default, fields with 629 // empty or default values are omitted from API requests. However, any 630 // non-pointer, non-interface field appearing in ForceSendFields will be 631 // sent to the server regardless of whether the field is empty or not. 632 // This may be used to include empty fields in Patch requests. 633 ForceSendFields []string `json:"-"` 634 635 // NullFields is a list of field names (e.g. "Address") to include in 636 // API requests with the JSON null value. By default, fields with empty 637 // values are omitted from API requests. However, any field with an 638 // empty value appearing in NullFields will be sent to the server as 639 // null. It is an error if a field in this list has a non-empty value. 640 // This may be used to include null fields in Patch requests. 641 NullFields []string `json:"-"` 642} 643 644func (s *Channel) MarshalJSON() ([]byte, error) { 645 type NoMethod Channel 646 raw := NoMethod(*s) 647 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 648} 649 650// Comment: A comment on a file. 651type Comment struct { 652 // Anchor: A region of the document represented as a JSON string. For 653 // details on defining anchor properties, refer to Add comments and 654 // replies. 655 Anchor string `json:"anchor,omitempty"` 656 657 // Author: The author of the comment. The author's email address and 658 // permission ID will not be populated. 659 Author *User `json:"author,omitempty"` 660 661 // Content: The plain text content of the comment. This field is used 662 // for setting the content, while htmlContent should be displayed. 663 Content string `json:"content,omitempty"` 664 665 // CreatedTime: The time at which the comment was created (RFC 3339 666 // date-time). 667 CreatedTime string `json:"createdTime,omitempty"` 668 669 // Deleted: Whether the comment has been deleted. A deleted comment has 670 // no content. 671 Deleted bool `json:"deleted,omitempty"` 672 673 // HtmlContent: The content of the comment with HTML formatting. 674 HtmlContent string `json:"htmlContent,omitempty"` 675 676 // Id: The ID of the comment. 677 Id string `json:"id,omitempty"` 678 679 // Kind: Identifies what kind of resource this is. Value: the fixed 680 // string "drive#comment". 681 Kind string `json:"kind,omitempty"` 682 683 // ModifiedTime: The last time the comment or any of its replies was 684 // modified (RFC 3339 date-time). 685 ModifiedTime string `json:"modifiedTime,omitempty"` 686 687 // QuotedFileContent: The file content to which the comment refers, 688 // typically within the anchor region. For a text file, for example, 689 // this would be the text at the location of the comment. 690 QuotedFileContent *CommentQuotedFileContent `json:"quotedFileContent,omitempty"` 691 692 // Replies: The full list of replies to the comment in chronological 693 // order. 694 Replies []*Reply `json:"replies,omitempty"` 695 696 // Resolved: Whether the comment has been resolved by one of its 697 // replies. 698 Resolved bool `json:"resolved,omitempty"` 699 700 // ServerResponse contains the HTTP response code and headers from the 701 // server. 702 googleapi.ServerResponse `json:"-"` 703 704 // ForceSendFields is a list of field names (e.g. "Anchor") to 705 // unconditionally include in API requests. By default, fields with 706 // empty or default values are omitted from API requests. However, any 707 // non-pointer, non-interface field appearing in ForceSendFields will be 708 // sent to the server regardless of whether the field is empty or not. 709 // This may be used to include empty fields in Patch requests. 710 ForceSendFields []string `json:"-"` 711 712 // NullFields is a list of field names (e.g. "Anchor") to include in API 713 // requests with the JSON null value. By default, fields with empty 714 // values are omitted from API requests. However, any field with an 715 // empty value appearing in NullFields will be sent to the server as 716 // null. It is an error if a field in this list has a non-empty value. 717 // This may be used to include null fields in Patch requests. 718 NullFields []string `json:"-"` 719} 720 721func (s *Comment) MarshalJSON() ([]byte, error) { 722 type NoMethod Comment 723 raw := NoMethod(*s) 724 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 725} 726 727// CommentQuotedFileContent: The file content to which the comment 728// refers, typically within the anchor region. For a text file, for 729// example, this would be the text at the location of the comment. 730type CommentQuotedFileContent struct { 731 // MimeType: The MIME type of the quoted content. 732 MimeType string `json:"mimeType,omitempty"` 733 734 // Value: The quoted content itself. This is interpreted as plain text 735 // if set through the API. 736 Value string `json:"value,omitempty"` 737 738 // ForceSendFields is a list of field names (e.g. "MimeType") to 739 // unconditionally include in API requests. By default, fields with 740 // empty or default values are omitted from API requests. However, any 741 // non-pointer, non-interface field appearing in ForceSendFields will be 742 // sent to the server regardless of whether the field is empty or not. 743 // This may be used to include empty fields in Patch requests. 744 ForceSendFields []string `json:"-"` 745 746 // NullFields is a list of field names (e.g. "MimeType") to include in 747 // API requests with the JSON null value. By default, fields with empty 748 // values are omitted from API requests. However, any field with an 749 // empty value appearing in NullFields will be sent to the server as 750 // null. It is an error if a field in this list has a non-empty value. 751 // This may be used to include null fields in Patch requests. 752 NullFields []string `json:"-"` 753} 754 755func (s *CommentQuotedFileContent) MarshalJSON() ([]byte, error) { 756 type NoMethod CommentQuotedFileContent 757 raw := NoMethod(*s) 758 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 759} 760 761// CommentList: A list of comments on a file. 762type CommentList struct { 763 // Comments: The list of comments. If nextPageToken is populated, then 764 // this list may be incomplete and an additional page of results should 765 // be fetched. 766 Comments []*Comment `json:"comments,omitempty"` 767 768 // Kind: Identifies what kind of resource this is. Value: the fixed 769 // string "drive#commentList". 770 Kind string `json:"kind,omitempty"` 771 772 // NextPageToken: The page token for the next page of comments. This 773 // will be absent if the end of the comments list has been reached. If 774 // the token is rejected for any reason, it should be discarded, and 775 // pagination should be restarted from the first page of results. 776 NextPageToken string `json:"nextPageToken,omitempty"` 777 778 // ServerResponse contains the HTTP response code and headers from the 779 // server. 780 googleapi.ServerResponse `json:"-"` 781 782 // ForceSendFields is a list of field names (e.g. "Comments") to 783 // unconditionally include in API requests. By default, fields with 784 // empty or default values are omitted from API requests. However, any 785 // non-pointer, non-interface field appearing in ForceSendFields will be 786 // sent to the server regardless of whether the field is empty or not. 787 // This may be used to include empty fields in Patch requests. 788 ForceSendFields []string `json:"-"` 789 790 // NullFields is a list of field names (e.g. "Comments") to include in 791 // API requests with the JSON null value. By default, fields with empty 792 // values are omitted from API requests. However, any field with an 793 // empty value appearing in NullFields will be sent to the server as 794 // null. It is an error if a field in this list has a non-empty value. 795 // This may be used to include null fields in Patch requests. 796 NullFields []string `json:"-"` 797} 798 799func (s *CommentList) MarshalJSON() ([]byte, error) { 800 type NoMethod CommentList 801 raw := NoMethod(*s) 802 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 803} 804 805// ContentRestriction: A restriction for accessing the content of the 806// file. 807type ContentRestriction struct { 808 // ReadOnly: Whether the content of the file is read-only. If a file is 809 // read-only, a new revision of the file may not be added, comments may 810 // not be added or modified, and the title of the file may not be 811 // modified. 812 ReadOnly bool `json:"readOnly,omitempty"` 813 814 // Reason: Reason for why the content of the file is restricted. This is 815 // only mutable on requests that also set readOnly=true. 816 Reason string `json:"reason,omitempty"` 817 818 // RestrictingUser: The user who set the content restriction. Only 819 // populated if readOnly is true. 820 RestrictingUser *User `json:"restrictingUser,omitempty"` 821 822 // RestrictionTime: The time at which the content restriction was set 823 // (formatted RFC 3339 timestamp). Only populated if readOnly is true. 824 RestrictionTime string `json:"restrictionTime,omitempty"` 825 826 // Type: The type of the content restriction. Currently the only 827 // possible value is globalContentRestriction. 828 Type string `json:"type,omitempty"` 829 830 // ForceSendFields is a list of field names (e.g. "ReadOnly") to 831 // unconditionally include in API requests. By default, fields with 832 // empty or default values are omitted from API requests. However, any 833 // non-pointer, non-interface field appearing in ForceSendFields will be 834 // sent to the server regardless of whether the field is empty or not. 835 // This may be used to include empty fields in Patch requests. 836 ForceSendFields []string `json:"-"` 837 838 // NullFields is a list of field names (e.g. "ReadOnly") to include in 839 // API requests with the JSON null value. By default, fields with empty 840 // values are omitted from API requests. However, any field with an 841 // empty value appearing in NullFields will be sent to the server as 842 // null. It is an error if a field in this list has a non-empty value. 843 // This may be used to include null fields in Patch requests. 844 NullFields []string `json:"-"` 845} 846 847func (s *ContentRestriction) MarshalJSON() ([]byte, error) { 848 type NoMethod ContentRestriction 849 raw := NoMethod(*s) 850 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 851} 852 853// Drive: Representation of a shared drive. 854type Drive struct { 855 // BackgroundImageFile: An image file and cropping parameters from which 856 // a background image for this shared drive is set. This is a write only 857 // field; it can only be set on drive.drives.update requests that don't 858 // set themeId. When specified, all fields of the backgroundImageFile 859 // must be set. 860 BackgroundImageFile *DriveBackgroundImageFile `json:"backgroundImageFile,omitempty"` 861 862 // BackgroundImageLink: A short-lived link to this shared drive's 863 // background image. 864 BackgroundImageLink string `json:"backgroundImageLink,omitempty"` 865 866 // Capabilities: Capabilities the current user has on this shared drive. 867 Capabilities *DriveCapabilities `json:"capabilities,omitempty"` 868 869 // ColorRgb: The color of this shared drive as an RGB hex string. It can 870 // only be set on a drive.drives.update request that does not set 871 // themeId. 872 ColorRgb string `json:"colorRgb,omitempty"` 873 874 // CreatedTime: The time at which the shared drive was created (RFC 3339 875 // date-time). 876 CreatedTime string `json:"createdTime,omitempty"` 877 878 // Hidden: Whether the shared drive is hidden from default view. 879 Hidden bool `json:"hidden,omitempty"` 880 881 // Id: The ID of this shared drive which is also the ID of the top level 882 // folder of this shared drive. 883 Id string `json:"id,omitempty"` 884 885 // Kind: Identifies what kind of resource this is. Value: the fixed 886 // string "drive#drive". 887 Kind string `json:"kind,omitempty"` 888 889 // Name: The name of this shared drive. 890 Name string `json:"name,omitempty"` 891 892 // Restrictions: A set of restrictions that apply to this shared drive 893 // or items inside this shared drive. 894 Restrictions *DriveRestrictions `json:"restrictions,omitempty"` 895 896 // ThemeId: The ID of the theme from which the background image and 897 // color will be set. The set of possible driveThemes can be retrieved 898 // from a drive.about.get response. When not specified on a 899 // drive.drives.create request, a random theme is chosen from which the 900 // background image and color are set. This is a write-only field; it 901 // can only be set on requests that don't set colorRgb or 902 // backgroundImageFile. 903 ThemeId string `json:"themeId,omitempty"` 904 905 // ServerResponse contains the HTTP response code and headers from the 906 // server. 907 googleapi.ServerResponse `json:"-"` 908 909 // ForceSendFields is a list of field names (e.g. "BackgroundImageFile") 910 // to unconditionally include in API requests. By default, fields with 911 // empty or default values are omitted from API requests. However, any 912 // non-pointer, non-interface field appearing in ForceSendFields will be 913 // sent to the server regardless of whether the field is empty or not. 914 // This may be used to include empty fields in Patch requests. 915 ForceSendFields []string `json:"-"` 916 917 // NullFields is a list of field names (e.g. "BackgroundImageFile") to 918 // include in API requests with the JSON null value. By default, fields 919 // with empty values are omitted from API requests. However, any field 920 // with an empty value appearing in NullFields will be sent to the 921 // server as null. It is an error if a field in this list has a 922 // non-empty value. This may be used to include null fields in Patch 923 // requests. 924 NullFields []string `json:"-"` 925} 926 927func (s *Drive) MarshalJSON() ([]byte, error) { 928 type NoMethod Drive 929 raw := NoMethod(*s) 930 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 931} 932 933// DriveBackgroundImageFile: An image file and cropping parameters from 934// which a background image for this shared drive is set. This is a 935// write only field; it can only be set on drive.drives.update requests 936// that don't set themeId. When specified, all fields of the 937// backgroundImageFile must be set. 938type DriveBackgroundImageFile struct { 939 // Id: The ID of an image file in Google Drive to use for the background 940 // image. 941 Id string `json:"id,omitempty"` 942 943 // Width: The width of the cropped image in the closed range of 0 to 1. 944 // This value represents the width of the cropped image divided by the 945 // width of the entire image. The height is computed by applying a width 946 // to height aspect ratio of 80 to 9. The resulting image must be at 947 // least 1280 pixels wide and 144 pixels high. 948 Width float64 `json:"width,omitempty"` 949 950 // XCoordinate: The X coordinate of the upper left corner of the 951 // cropping area in the background image. This is a value in the closed 952 // range of 0 to 1. This value represents the horizontal distance from 953 // the left side of the entire image to the left side of the cropping 954 // area divided by the width of the entire image. 955 XCoordinate float64 `json:"xCoordinate,omitempty"` 956 957 // YCoordinate: The Y coordinate of the upper left corner of the 958 // cropping area in the background image. This is a value in the closed 959 // range of 0 to 1. This value represents the vertical distance from the 960 // top side of the entire image to the top side of the cropping area 961 // divided by the height of the entire image. 962 YCoordinate float64 `json:"yCoordinate,omitempty"` 963 964 // ForceSendFields is a list of field names (e.g. "Id") to 965 // unconditionally include in API requests. By default, fields with 966 // empty or default values are omitted from API requests. However, any 967 // non-pointer, non-interface field appearing in ForceSendFields will be 968 // sent to the server regardless of whether the field is empty or not. 969 // This may be used to include empty fields in Patch requests. 970 ForceSendFields []string `json:"-"` 971 972 // NullFields is a list of field names (e.g. "Id") to include in API 973 // requests with the JSON null value. By default, fields with empty 974 // values are omitted from API requests. However, any field with an 975 // empty value appearing in NullFields will be sent to the server as 976 // null. It is an error if a field in this list has a non-empty value. 977 // This may be used to include null fields in Patch requests. 978 NullFields []string `json:"-"` 979} 980 981func (s *DriveBackgroundImageFile) MarshalJSON() ([]byte, error) { 982 type NoMethod DriveBackgroundImageFile 983 raw := NoMethod(*s) 984 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 985} 986 987func (s *DriveBackgroundImageFile) UnmarshalJSON(data []byte) error { 988 type NoMethod DriveBackgroundImageFile 989 var s1 struct { 990 Width gensupport.JSONFloat64 `json:"width"` 991 XCoordinate gensupport.JSONFloat64 `json:"xCoordinate"` 992 YCoordinate gensupport.JSONFloat64 `json:"yCoordinate"` 993 *NoMethod 994 } 995 s1.NoMethod = (*NoMethod)(s) 996 if err := json.Unmarshal(data, &s1); err != nil { 997 return err 998 } 999 s.Width = float64(s1.Width) 1000 s.XCoordinate = float64(s1.XCoordinate) 1001 s.YCoordinate = float64(s1.YCoordinate) 1002 return nil 1003} 1004 1005// DriveCapabilities: Capabilities the current user has on this shared 1006// drive. 1007type DriveCapabilities struct { 1008 // CanAddChildren: Whether the current user can add children to folders 1009 // in this shared drive. 1010 CanAddChildren bool `json:"canAddChildren,omitempty"` 1011 1012 // CanChangeCopyRequiresWriterPermissionRestriction: Whether the current 1013 // user can change the copyRequiresWriterPermission restriction of this 1014 // shared drive. 1015 CanChangeCopyRequiresWriterPermissionRestriction bool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"` 1016 1017 // CanChangeDomainUsersOnlyRestriction: Whether the current user can 1018 // change the domainUsersOnly restriction of this shared drive. 1019 CanChangeDomainUsersOnlyRestriction bool `json:"canChangeDomainUsersOnlyRestriction,omitempty"` 1020 1021 // CanChangeDriveBackground: Whether the current user can change the 1022 // background of this shared drive. 1023 CanChangeDriveBackground bool `json:"canChangeDriveBackground,omitempty"` 1024 1025 // CanChangeDriveMembersOnlyRestriction: Whether the current user can 1026 // change the driveMembersOnly restriction of this shared drive. 1027 CanChangeDriveMembersOnlyRestriction bool `json:"canChangeDriveMembersOnlyRestriction,omitempty"` 1028 1029 // CanComment: Whether the current user can comment on files in this 1030 // shared drive. 1031 CanComment bool `json:"canComment,omitempty"` 1032 1033 // CanCopy: Whether the current user can copy files in this shared 1034 // drive. 1035 CanCopy bool `json:"canCopy,omitempty"` 1036 1037 // CanDeleteChildren: Whether the current user can delete children from 1038 // folders in this shared drive. 1039 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"` 1040 1041 // CanDeleteDrive: Whether the current user can delete this shared 1042 // drive. Attempting to delete the shared drive may still fail if there 1043 // are untrashed items inside the shared drive. 1044 CanDeleteDrive bool `json:"canDeleteDrive,omitempty"` 1045 1046 // CanDownload: Whether the current user can download files in this 1047 // shared drive. 1048 CanDownload bool `json:"canDownload,omitempty"` 1049 1050 // CanEdit: Whether the current user can edit files in this shared drive 1051 CanEdit bool `json:"canEdit,omitempty"` 1052 1053 // CanListChildren: Whether the current user can list the children of 1054 // folders in this shared drive. 1055 CanListChildren bool `json:"canListChildren,omitempty"` 1056 1057 // CanManageMembers: Whether the current user can add members to this 1058 // shared drive or remove them or change their role. 1059 CanManageMembers bool `json:"canManageMembers,omitempty"` 1060 1061 // CanReadRevisions: Whether the current user can read the revisions 1062 // resource of files in this shared drive. 1063 CanReadRevisions bool `json:"canReadRevisions,omitempty"` 1064 1065 // CanRename: Whether the current user can rename files or folders in 1066 // this shared drive. 1067 CanRename bool `json:"canRename,omitempty"` 1068 1069 // CanRenameDrive: Whether the current user can rename this shared 1070 // drive. 1071 CanRenameDrive bool `json:"canRenameDrive,omitempty"` 1072 1073 // CanShare: Whether the current user can share files or folders in this 1074 // shared drive. 1075 CanShare bool `json:"canShare,omitempty"` 1076 1077 // CanTrashChildren: Whether the current user can trash children from 1078 // folders in this shared drive. 1079 CanTrashChildren bool `json:"canTrashChildren,omitempty"` 1080 1081 // ForceSendFields is a list of field names (e.g. "CanAddChildren") to 1082 // unconditionally include in API requests. By default, fields with 1083 // empty or default values are omitted from API requests. However, any 1084 // non-pointer, non-interface field appearing in ForceSendFields will be 1085 // sent to the server regardless of whether the field is empty or not. 1086 // This may be used to include empty fields in Patch requests. 1087 ForceSendFields []string `json:"-"` 1088 1089 // NullFields is a list of field names (e.g. "CanAddChildren") to 1090 // include in API requests with the JSON null value. By default, fields 1091 // with empty values are omitted from API requests. However, any field 1092 // with an empty value appearing in NullFields will be sent to the 1093 // server as null. It is an error if a field in this list has a 1094 // non-empty value. This may be used to include null fields in Patch 1095 // requests. 1096 NullFields []string `json:"-"` 1097} 1098 1099func (s *DriveCapabilities) MarshalJSON() ([]byte, error) { 1100 type NoMethod DriveCapabilities 1101 raw := NoMethod(*s) 1102 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1103} 1104 1105// DriveRestrictions: A set of restrictions that apply to this shared 1106// drive or items inside this shared drive. 1107type DriveRestrictions struct { 1108 // AdminManagedRestrictions: Whether administrative privileges on this 1109 // shared drive are required to modify restrictions. 1110 AdminManagedRestrictions bool `json:"adminManagedRestrictions,omitempty"` 1111 1112 // CopyRequiresWriterPermission: Whether the options to copy, print, or 1113 // download files inside this shared drive, should be disabled for 1114 // readers and commenters. When this restriction is set to true, it will 1115 // override the similarly named field to true for any file inside this 1116 // shared drive. 1117 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"` 1118 1119 // DomainUsersOnly: Whether access to this shared drive and items inside 1120 // this shared drive is restricted to users of the domain to which this 1121 // shared drive belongs. This restriction may be overridden by other 1122 // sharing policies controlled outside of this shared drive. 1123 DomainUsersOnly bool `json:"domainUsersOnly,omitempty"` 1124 1125 // DriveMembersOnly: Whether access to items inside this shared drive is 1126 // restricted to its members. 1127 DriveMembersOnly bool `json:"driveMembersOnly,omitempty"` 1128 1129 // ForceSendFields is a list of field names (e.g. 1130 // "AdminManagedRestrictions") to unconditionally include in API 1131 // requests. By default, fields with empty or default values are omitted 1132 // from API requests. However, any non-pointer, non-interface field 1133 // appearing in ForceSendFields will be sent to the server regardless of 1134 // whether the field is empty or not. This may be used to include empty 1135 // fields in Patch requests. 1136 ForceSendFields []string `json:"-"` 1137 1138 // NullFields is a list of field names (e.g. "AdminManagedRestrictions") 1139 // to include in API requests with the JSON null value. By default, 1140 // fields with empty values are omitted from API requests. However, any 1141 // field with an empty value appearing in NullFields will be sent to the 1142 // server as null. It is an error if a field in this list has a 1143 // non-empty value. This may be used to include null fields in Patch 1144 // requests. 1145 NullFields []string `json:"-"` 1146} 1147 1148func (s *DriveRestrictions) MarshalJSON() ([]byte, error) { 1149 type NoMethod DriveRestrictions 1150 raw := NoMethod(*s) 1151 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1152} 1153 1154// DriveList: A list of shared drives. 1155type DriveList struct { 1156 // Drives: The list of shared drives. If nextPageToken is populated, 1157 // then this list may be incomplete and an additional page of results 1158 // should be fetched. 1159 Drives []*Drive `json:"drives,omitempty"` 1160 1161 // Kind: Identifies what kind of resource this is. Value: the fixed 1162 // string "drive#driveList". 1163 Kind string `json:"kind,omitempty"` 1164 1165 // NextPageToken: The page token for the next page of shared drives. 1166 // This will be absent if the end of the list has been reached. If the 1167 // token is rejected for any reason, it should be discarded, and 1168 // pagination should be restarted from the first page of results. 1169 NextPageToken string `json:"nextPageToken,omitempty"` 1170 1171 // ServerResponse contains the HTTP response code and headers from the 1172 // server. 1173 googleapi.ServerResponse `json:"-"` 1174 1175 // ForceSendFields is a list of field names (e.g. "Drives") to 1176 // unconditionally include in API requests. By default, fields with 1177 // empty or default values are omitted from API requests. However, any 1178 // non-pointer, non-interface field appearing in ForceSendFields will be 1179 // sent to the server regardless of whether the field is empty or not. 1180 // This may be used to include empty fields in Patch requests. 1181 ForceSendFields []string `json:"-"` 1182 1183 // NullFields is a list of field names (e.g. "Drives") to include in API 1184 // requests with the JSON null value. By default, fields with empty 1185 // values are omitted from API requests. However, any field with an 1186 // empty value appearing in NullFields will be sent to the server as 1187 // null. It is an error if a field in this list has a non-empty value. 1188 // This may be used to include null fields in Patch requests. 1189 NullFields []string `json:"-"` 1190} 1191 1192func (s *DriveList) MarshalJSON() ([]byte, error) { 1193 type NoMethod DriveList 1194 raw := NoMethod(*s) 1195 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1196} 1197 1198// File: The metadata for a file. 1199type File struct { 1200 // AppProperties: A collection of arbitrary key-value pairs which are 1201 // private to the requesting app. 1202 // Entries with null values are cleared in update and copy requests. 1203 // These properties can only be retrieved using an authenticated 1204 // request. An authenticated request uses an access token obtained with 1205 // a OAuth 2 client ID. You cannot use an API key to retrieve private 1206 // properties. 1207 AppProperties map[string]string `json:"appProperties,omitempty"` 1208 1209 // Capabilities: Capabilities the current user has on this file. Each 1210 // capability corresponds to a fine-grained action that a user may take. 1211 Capabilities *FileCapabilities `json:"capabilities,omitempty"` 1212 1213 // ContentHints: Additional information about the content of the file. 1214 // These fields are never populated in responses. 1215 ContentHints *FileContentHints `json:"contentHints,omitempty"` 1216 1217 // ContentRestrictions: Restrictions for accessing the content of the 1218 // file. Only populated if such a restriction exists. 1219 ContentRestrictions []*ContentRestriction `json:"contentRestrictions,omitempty"` 1220 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 1225 // CreatedTime: The time at which the file was created (RFC 3339 1226 // date-time). 1227 CreatedTime string `json:"createdTime,omitempty"` 1228 1229 // Description: A short description of the file. 1230 Description string `json:"description,omitempty"` 1231 1232 // DriveId: ID of the shared drive the file resides in. Only populated 1233 // for items in shared drives. 1234 DriveId string `json:"driveId,omitempty"` 1235 1236 // ExplicitlyTrashed: Whether the file has been explicitly trashed, as 1237 // opposed to recursively trashed from a parent folder. 1238 ExplicitlyTrashed bool `json:"explicitlyTrashed,omitempty"` 1239 1240 // ExportLinks: Links for exporting Docs Editors files to specific 1241 // formats. 1242 ExportLinks map[string]string `json:"exportLinks,omitempty"` 1243 1244 // FileExtension: The final component of fullFileExtension. This is only 1245 // available for files with binary content in Google Drive. 1246 FileExtension string `json:"fileExtension,omitempty"` 1247 1248 // FolderColorRgb: The color for a folder or shortcut to a folder as an 1249 // RGB hex string. The supported colors are published in the 1250 // folderColorPalette field of the About resource. 1251 // If an unsupported color is specified, the closest color in the 1252 // palette will be used instead. 1253 FolderColorRgb string `json:"folderColorRgb,omitempty"` 1254 1255 // FullFileExtension: The full file extension extracted from the name 1256 // field. May contain multiple concatenated extensions, such as 1257 // "tar.gz". This is only available for files with binary content in 1258 // Google Drive. 1259 // This is automatically updated when the name field changes, however it 1260 // is not cleared if the new name does not contain a valid extension. 1261 FullFileExtension string `json:"fullFileExtension,omitempty"` 1262 1263 // HasAugmentedPermissions: Whether there are permissions directly on 1264 // this file. This field is only populated for items in shared drives. 1265 HasAugmentedPermissions bool `json:"hasAugmentedPermissions,omitempty"` 1266 1267 // HasThumbnail: Whether this file has a thumbnail. This does not 1268 // indicate whether the requesting app has access to the thumbnail. To 1269 // check access, look for the presence of the thumbnailLink field. 1270 HasThumbnail bool `json:"hasThumbnail,omitempty"` 1271 1272 // HeadRevisionId: The ID of the file's head revision. This is currently 1273 // only available for files with binary content in Google Drive. 1274 HeadRevisionId string `json:"headRevisionId,omitempty"` 1275 1276 // IconLink: A static, unauthenticated link to the file's icon. 1277 IconLink string `json:"iconLink,omitempty"` 1278 1279 // Id: The ID of the file. 1280 Id string `json:"id,omitempty"` 1281 1282 // ImageMediaMetadata: Additional metadata about image media, if 1283 // available. 1284 ImageMediaMetadata *FileImageMediaMetadata `json:"imageMediaMetadata,omitempty"` 1285 1286 // IsAppAuthorized: Whether the file was created or opened by the 1287 // requesting app. 1288 IsAppAuthorized bool `json:"isAppAuthorized,omitempty"` 1289 1290 // Kind: Identifies what kind of resource this is. Value: the fixed 1291 // string "drive#file". 1292 Kind string `json:"kind,omitempty"` 1293 1294 // LastModifyingUser: The last user to modify the file. 1295 LastModifyingUser *User `json:"lastModifyingUser,omitempty"` 1296 1297 // LinkShareMetadata: Contains details about the link URLs that clients 1298 // are using to refer to this item. 1299 LinkShareMetadata *FileLinkShareMetadata `json:"linkShareMetadata,omitempty"` 1300 1301 // Md5Checksum: The MD5 checksum for the content of the file. This is 1302 // only applicable to files with binary content in Google Drive. 1303 Md5Checksum string `json:"md5Checksum,omitempty"` 1304 1305 // MimeType: The MIME type of the file. 1306 // Google Drive will attempt to automatically detect an appropriate 1307 // value from uploaded content if no value is provided. The value cannot 1308 // be changed unless a new revision is uploaded. 1309 // If a file is created with a Google Doc MIME type, the uploaded 1310 // content will be imported if possible. The supported import formats 1311 // are published in the About resource. 1312 MimeType string `json:"mimeType,omitempty"` 1313 1314 // ModifiedByMe: Whether the file has been modified by this user. 1315 ModifiedByMe bool `json:"modifiedByMe,omitempty"` 1316 1317 // ModifiedByMeTime: The last time the file was modified by the user 1318 // (RFC 3339 date-time). 1319 ModifiedByMeTime string `json:"modifiedByMeTime,omitempty"` 1320 1321 // ModifiedTime: The last time the file was modified by anyone (RFC 3339 1322 // date-time). 1323 // Note that setting modifiedTime will also update modifiedByMeTime for 1324 // the user. 1325 ModifiedTime string `json:"modifiedTime,omitempty"` 1326 1327 // Name: The name of the file. This is not necessarily unique within a 1328 // folder. Note that for immutable items such as the top level folders 1329 // of shared drives, My Drive root folder, and Application Data folder 1330 // the name is constant. 1331 Name string `json:"name,omitempty"` 1332 1333 // OriginalFilename: The original filename of the uploaded content if 1334 // available, or else the original value of the name field. This is only 1335 // available for files with binary content in Google Drive. 1336 OriginalFilename string `json:"originalFilename,omitempty"` 1337 1338 // OwnedByMe: Whether the user owns the file. Not populated for items in 1339 // shared drives. 1340 OwnedByMe bool `json:"ownedByMe,omitempty"` 1341 1342 // Owners: The owner of this file. Only certain legacy files may have 1343 // more than one owner. This field isn't populated for items in shared 1344 // drives. 1345 Owners []*User `json:"owners,omitempty"` 1346 1347 // Parents: The IDs of the parent folders which contain the file. 1348 // If not specified as part of a create request, the file will be placed 1349 // directly in the user's My Drive folder. If not specified as part of a 1350 // copy request, the file will inherit any discoverable parents of the 1351 // source file. Update requests must use the addParents and 1352 // removeParents parameters to modify the parents list. 1353 Parents []string `json:"parents,omitempty"` 1354 1355 // PermissionIds: List of permission IDs for users with access to this 1356 // file. 1357 PermissionIds []string `json:"permissionIds,omitempty"` 1358 1359 // Permissions: The full list of permissions for the file. This is only 1360 // available if the requesting user can share the file. Not populated 1361 // for items in shared drives. 1362 Permissions []*Permission `json:"permissions,omitempty"` 1363 1364 // Properties: A collection of arbitrary key-value pairs which are 1365 // visible to all apps. 1366 // Entries with null values are cleared in update and copy requests. 1367 Properties map[string]string `json:"properties,omitempty"` 1368 1369 // QuotaBytesUsed: The number of storage quota bytes used by the file. 1370 // This includes the head revision as well as previous revisions with 1371 // keepForever enabled. 1372 QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"` 1373 1374 // ResourceKey: A key needed to access the item via a shared link. 1375 ResourceKey string `json:"resourceKey,omitempty"` 1376 1377 // Shared: Whether the file has been shared. Not populated for items in 1378 // shared drives. 1379 Shared bool `json:"shared,omitempty"` 1380 1381 // SharedWithMeTime: The time at which the file was shared with the 1382 // user, if applicable (RFC 3339 date-time). 1383 SharedWithMeTime string `json:"sharedWithMeTime,omitempty"` 1384 1385 // SharingUser: The user who shared the file with the requesting user, 1386 // if applicable. 1387 SharingUser *User `json:"sharingUser,omitempty"` 1388 1389 // ShortcutDetails: Shortcut file details. Only populated for shortcut 1390 // files, which have the mimeType field set to 1391 // application/vnd.google-apps.shortcut. 1392 ShortcutDetails *FileShortcutDetails `json:"shortcutDetails,omitempty"` 1393 1394 // Size: The size of the file's content in bytes. This is applicable to 1395 // binary files in Google Drive and Google Docs files. 1396 Size int64 `json:"size,omitempty,string"` 1397 1398 // Spaces: The list of spaces which contain the file. The currently 1399 // supported values are 'drive', 'appDataFolder' and 'photos'. 1400 Spaces []string `json:"spaces,omitempty"` 1401 1402 // Starred: Whether the user has starred the file. 1403 Starred bool `json:"starred,omitempty"` 1404 1405 // TeamDriveId: Deprecated - use driveId instead. 1406 TeamDriveId string `json:"teamDriveId,omitempty"` 1407 1408 // ThumbnailLink: A short-lived link to the file's thumbnail, if 1409 // available. Typically lasts on the order of hours. Only populated when 1410 // the requesting app can access the file's content. If the file isn't 1411 // shared publicly, the URL returned in Files.thumbnailLink must be 1412 // fetched using a credentialed request. 1413 ThumbnailLink string `json:"thumbnailLink,omitempty"` 1414 1415 // ThumbnailVersion: The thumbnail version for use in thumbnail cache 1416 // invalidation. 1417 ThumbnailVersion int64 `json:"thumbnailVersion,omitempty,string"` 1418 1419 // Trashed: Whether the file has been trashed, either explicitly or from 1420 // a trashed parent folder. Only the owner may trash a file. The trashed 1421 // item is excluded from all files.list responses returned for any user 1422 // who does not own the file. However, all users with access to the file 1423 // can see the trashed item metadata in an API response. All users with 1424 // access can copy, download, export, and share the file. 1425 Trashed bool `json:"trashed,omitempty"` 1426 1427 // TrashedTime: The time that the item was trashed (RFC 3339 date-time). 1428 // Only populated for items in shared drives. 1429 TrashedTime string `json:"trashedTime,omitempty"` 1430 1431 // TrashingUser: If the file has been explicitly trashed, the user who 1432 // trashed it. Only populated for items in shared drives. 1433 TrashingUser *User `json:"trashingUser,omitempty"` 1434 1435 // Version: A monotonically increasing version number for the file. This 1436 // reflects every change made to the file on the server, even those not 1437 // visible to the user. 1438 Version int64 `json:"version,omitempty,string"` 1439 1440 // VideoMediaMetadata: Additional metadata about video media. This may 1441 // not be available immediately upon upload. 1442 VideoMediaMetadata *FileVideoMediaMetadata `json:"videoMediaMetadata,omitempty"` 1443 1444 // ViewedByMe: Whether the file has been viewed by this user. 1445 ViewedByMe bool `json:"viewedByMe,omitempty"` 1446 1447 // ViewedByMeTime: The last time the file was viewed by the user (RFC 1448 // 3339 date-time). 1449 ViewedByMeTime string `json:"viewedByMeTime,omitempty"` 1450 1451 // ViewersCanCopyContent: Deprecated - use copyRequiresWriterPermission 1452 // instead. 1453 ViewersCanCopyContent bool `json:"viewersCanCopyContent,omitempty"` 1454 1455 // WebContentLink: A link for downloading the content of the file in a 1456 // browser. This is only available for files with binary content in 1457 // Google Drive. 1458 WebContentLink string `json:"webContentLink,omitempty"` 1459 1460 // WebViewLink: A link for opening the file in a relevant Google editor 1461 // or viewer in a browser. 1462 WebViewLink string `json:"webViewLink,omitempty"` 1463 1464 // WritersCanShare: Whether users with only writer permission can modify 1465 // the file's permissions. Not populated for items in shared drives. 1466 WritersCanShare bool `json:"writersCanShare,omitempty"` 1467 1468 // ServerResponse contains the HTTP response code and headers from the 1469 // server. 1470 googleapi.ServerResponse `json:"-"` 1471 1472 // ForceSendFields is a list of field names (e.g. "AppProperties") to 1473 // unconditionally include in API requests. By default, fields with 1474 // empty or default values are omitted from API requests. However, any 1475 // non-pointer, non-interface field appearing in ForceSendFields will be 1476 // sent to the server regardless of whether the field is empty or not. 1477 // This may be used to include empty fields in Patch requests. 1478 ForceSendFields []string `json:"-"` 1479 1480 // NullFields is a list of field names (e.g. "AppProperties") to include 1481 // in API requests with the JSON null value. By default, fields with 1482 // empty values are omitted from API requests. However, any field with 1483 // an empty value appearing in NullFields will be sent to the server as 1484 // null. It is an error if a field in this list has a non-empty value. 1485 // This may be used to include null fields in Patch requests. 1486 NullFields []string `json:"-"` 1487} 1488 1489func (s *File) MarshalJSON() ([]byte, error) { 1490 type NoMethod File 1491 raw := NoMethod(*s) 1492 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1493} 1494 1495// FileCapabilities: Capabilities the current user has on this file. 1496// Each capability corresponds to a fine-grained action that a user may 1497// take. 1498type FileCapabilities struct { 1499 // CanAddChildren: Whether the current user can add children to this 1500 // folder. This is always false when the item is not a folder. 1501 CanAddChildren bool `json:"canAddChildren,omitempty"` 1502 1503 // CanAddFolderFromAnotherDrive: Whether the current user can add a 1504 // folder from another drive (different shared drive or My Drive) to 1505 // this folder. This is false when the item is not a folder. Only 1506 // populated for items in shared drives. 1507 CanAddFolderFromAnotherDrive bool `json:"canAddFolderFromAnotherDrive,omitempty"` 1508 1509 // CanAddMyDriveParent: Whether the current user can add a parent for 1510 // the item without removing an existing parent in the same request. Not 1511 // populated for shared drive files. 1512 CanAddMyDriveParent bool `json:"canAddMyDriveParent,omitempty"` 1513 1514 // CanChangeCopyRequiresWriterPermission: Whether the current user can 1515 // change the copyRequiresWriterPermission restriction of this file. 1516 CanChangeCopyRequiresWriterPermission bool `json:"canChangeCopyRequiresWriterPermission,omitempty"` 1517 1518 // CanChangeSecurityUpdateEnabled: Whether the current user can change 1519 // the securityUpdateEnabled field on link share metadata. 1520 CanChangeSecurityUpdateEnabled bool `json:"canChangeSecurityUpdateEnabled,omitempty"` 1521 1522 // CanChangeViewersCanCopyContent: Deprecated 1523 CanChangeViewersCanCopyContent bool `json:"canChangeViewersCanCopyContent,omitempty"` 1524 1525 // CanComment: Whether the current user can comment on this file. 1526 CanComment bool `json:"canComment,omitempty"` 1527 1528 // CanCopy: Whether the current user can copy this file. For an item in 1529 // a shared drive, whether the current user can copy non-folder 1530 // descendants of this item, or this item itself if it is not a folder. 1531 CanCopy bool `json:"canCopy,omitempty"` 1532 1533 // CanDelete: Whether the current user can delete this file. 1534 CanDelete bool `json:"canDelete,omitempty"` 1535 1536 // CanDeleteChildren: Whether the current user can delete children of 1537 // this folder. This is false when the item is not a folder. Only 1538 // populated for items in shared drives. 1539 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"` 1540 1541 // CanDownload: Whether the current user can download this file. 1542 CanDownload bool `json:"canDownload,omitempty"` 1543 1544 // CanEdit: Whether the current user can edit this file. Other factors 1545 // may limit the type of changes a user can make to a file. For example, 1546 // see canChangeCopyRequiresWriterPermission or canModifyContent. 1547 CanEdit bool `json:"canEdit,omitempty"` 1548 1549 // CanListChildren: Whether the current user can list the children of 1550 // this folder. This is always false when the item is not a folder. 1551 CanListChildren bool `json:"canListChildren,omitempty"` 1552 1553 // CanModifyContent: Whether the current user can modify the content of 1554 // this file. 1555 CanModifyContent bool `json:"canModifyContent,omitempty"` 1556 1557 // CanModifyContentRestriction: Whether the current user can modify 1558 // restrictions on content of this file. 1559 CanModifyContentRestriction bool `json:"canModifyContentRestriction,omitempty"` 1560 1561 // CanMoveChildrenOutOfDrive: Whether the current user can move children 1562 // of this folder outside of the shared drive. This is false when the 1563 // item is not a folder. Only populated for items in shared drives. 1564 CanMoveChildrenOutOfDrive bool `json:"canMoveChildrenOutOfDrive,omitempty"` 1565 1566 // CanMoveChildrenOutOfTeamDrive: Deprecated - use 1567 // canMoveChildrenOutOfDrive instead. 1568 CanMoveChildrenOutOfTeamDrive bool `json:"canMoveChildrenOutOfTeamDrive,omitempty"` 1569 1570 // CanMoveChildrenWithinDrive: Whether the current user can move 1571 // children of this folder within this drive. This is false when the 1572 // item is not a folder. Note that a request to move the child may still 1573 // fail depending on the current user's access to the child and to the 1574 // destination folder. 1575 CanMoveChildrenWithinDrive bool `json:"canMoveChildrenWithinDrive,omitempty"` 1576 1577 // CanMoveChildrenWithinTeamDrive: Deprecated - use 1578 // canMoveChildrenWithinDrive instead. 1579 CanMoveChildrenWithinTeamDrive bool `json:"canMoveChildrenWithinTeamDrive,omitempty"` 1580 1581 // CanMoveItemIntoTeamDrive: Deprecated - use canMoveItemOutOfDrive 1582 // instead. 1583 CanMoveItemIntoTeamDrive bool `json:"canMoveItemIntoTeamDrive,omitempty"` 1584 1585 // CanMoveItemOutOfDrive: Whether the current user can move this item 1586 // outside of this drive by changing its parent. Note that a request to 1587 // change the parent of the item may still fail depending on the new 1588 // parent that is being added. 1589 CanMoveItemOutOfDrive bool `json:"canMoveItemOutOfDrive,omitempty"` 1590 1591 // CanMoveItemOutOfTeamDrive: Deprecated - use canMoveItemOutOfDrive 1592 // instead. 1593 CanMoveItemOutOfTeamDrive bool `json:"canMoveItemOutOfTeamDrive,omitempty"` 1594 1595 // CanMoveItemWithinDrive: Whether the current user can move this item 1596 // within this drive. Note that a request to change the parent of the 1597 // item may still fail depending on the new parent that is being added 1598 // and the parent that is being removed. 1599 CanMoveItemWithinDrive bool `json:"canMoveItemWithinDrive,omitempty"` 1600 1601 // CanMoveItemWithinTeamDrive: Deprecated - use canMoveItemWithinDrive 1602 // instead. 1603 CanMoveItemWithinTeamDrive bool `json:"canMoveItemWithinTeamDrive,omitempty"` 1604 1605 // CanMoveTeamDriveItem: Deprecated - use canMoveItemWithinDrive or 1606 // canMoveItemOutOfDrive instead. 1607 CanMoveTeamDriveItem bool `json:"canMoveTeamDriveItem,omitempty"` 1608 1609 // CanReadDrive: Whether the current user can read the shared drive to 1610 // which this file belongs. Only populated for items in shared drives. 1611 CanReadDrive bool `json:"canReadDrive,omitempty"` 1612 1613 // CanReadRevisions: Whether the current user can read the revisions 1614 // resource of this file. For a shared drive item, whether revisions of 1615 // non-folder descendants of this item, or this item itself if it is not 1616 // a folder, can be read. 1617 CanReadRevisions bool `json:"canReadRevisions,omitempty"` 1618 1619 // CanReadTeamDrive: Deprecated - use canReadDrive instead. 1620 CanReadTeamDrive bool `json:"canReadTeamDrive,omitempty"` 1621 1622 // CanRemoveChildren: Whether the current user can remove children from 1623 // this folder. This is always false when the item is not a folder. For 1624 // a folder in a shared drive, use canDeleteChildren or canTrashChildren 1625 // instead. 1626 CanRemoveChildren bool `json:"canRemoveChildren,omitempty"` 1627 1628 // CanRemoveMyDriveParent: Whether the current user can remove a parent 1629 // from the item without adding another parent in the same request. Not 1630 // populated for shared drive files. 1631 CanRemoveMyDriveParent bool `json:"canRemoveMyDriveParent,omitempty"` 1632 1633 // CanRename: Whether the current user can rename this file. 1634 CanRename bool `json:"canRename,omitempty"` 1635 1636 // CanShare: Whether the current user can modify the sharing settings 1637 // for this file. 1638 CanShare bool `json:"canShare,omitempty"` 1639 1640 // CanTrash: Whether the current user can move this file to trash. 1641 CanTrash bool `json:"canTrash,omitempty"` 1642 1643 // CanTrashChildren: Whether the current user can trash children of this 1644 // folder. This is false when the item is not a folder. Only populated 1645 // for items in shared drives. 1646 CanTrashChildren bool `json:"canTrashChildren,omitempty"` 1647 1648 // CanUntrash: Whether the current user can restore this file from 1649 // trash. 1650 CanUntrash bool `json:"canUntrash,omitempty"` 1651 1652 // ForceSendFields is a list of field names (e.g. "CanAddChildren") to 1653 // unconditionally include in API requests. By default, fields with 1654 // empty or default values are omitted from API requests. However, any 1655 // non-pointer, non-interface field appearing in ForceSendFields will be 1656 // sent to the server regardless of whether the field is empty or not. 1657 // This may be used to include empty fields in Patch requests. 1658 ForceSendFields []string `json:"-"` 1659 1660 // NullFields is a list of field names (e.g. "CanAddChildren") to 1661 // include in API requests with the JSON null value. By default, fields 1662 // with empty values are omitted from API requests. However, any field 1663 // with an empty value appearing in NullFields will be sent to the 1664 // server as null. It is an error if a field in this list has a 1665 // non-empty value. This may be used to include null fields in Patch 1666 // requests. 1667 NullFields []string `json:"-"` 1668} 1669 1670func (s *FileCapabilities) MarshalJSON() ([]byte, error) { 1671 type NoMethod FileCapabilities 1672 raw := NoMethod(*s) 1673 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1674} 1675 1676// FileContentHints: Additional information about the content of the 1677// file. These fields are never populated in responses. 1678type FileContentHints struct { 1679 // IndexableText: Text to be indexed for the file to improve fullText 1680 // queries. This is limited to 128KB in length and may contain HTML 1681 // elements. 1682 IndexableText string `json:"indexableText,omitempty"` 1683 1684 // Thumbnail: A thumbnail for the file. This will only be used if Google 1685 // Drive cannot generate a standard thumbnail. 1686 Thumbnail *FileContentHintsThumbnail `json:"thumbnail,omitempty"` 1687 1688 // ForceSendFields is a list of field names (e.g. "IndexableText") to 1689 // unconditionally include in API requests. By default, fields with 1690 // empty or default values are omitted from API requests. However, any 1691 // non-pointer, non-interface field appearing in ForceSendFields will be 1692 // sent to the server regardless of whether the field is empty or not. 1693 // This may be used to include empty fields in Patch requests. 1694 ForceSendFields []string `json:"-"` 1695 1696 // NullFields is a list of field names (e.g. "IndexableText") to include 1697 // in API requests with the JSON null value. By default, fields with 1698 // empty values are omitted from API requests. However, any field with 1699 // an empty value appearing in NullFields will be sent to the server as 1700 // null. It is an error if a field in this list has a non-empty value. 1701 // This may be used to include null fields in Patch requests. 1702 NullFields []string `json:"-"` 1703} 1704 1705func (s *FileContentHints) MarshalJSON() ([]byte, error) { 1706 type NoMethod FileContentHints 1707 raw := NoMethod(*s) 1708 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1709} 1710 1711// FileContentHintsThumbnail: A thumbnail for the file. This will only 1712// be used if Google Drive cannot generate a standard thumbnail. 1713type FileContentHintsThumbnail struct { 1714 // Image: The thumbnail data encoded with URL-safe Base64 (RFC 4648 1715 // section 5). 1716 Image string `json:"image,omitempty"` 1717 1718 // MimeType: The MIME type of the thumbnail. 1719 MimeType string `json:"mimeType,omitempty"` 1720 1721 // ForceSendFields is a list of field names (e.g. "Image") to 1722 // unconditionally include in API requests. By default, fields with 1723 // empty or default values are omitted from API requests. However, any 1724 // non-pointer, non-interface field appearing in ForceSendFields will be 1725 // sent to the server regardless of whether the field is empty or not. 1726 // This may be used to include empty fields in Patch requests. 1727 ForceSendFields []string `json:"-"` 1728 1729 // NullFields is a list of field names (e.g. "Image") to include in API 1730 // requests with the JSON null value. By default, fields with empty 1731 // values are omitted from API requests. However, any field with an 1732 // empty value appearing in NullFields will be sent to the server as 1733 // null. It is an error if a field in this list has a non-empty value. 1734 // This may be used to include null fields in Patch requests. 1735 NullFields []string `json:"-"` 1736} 1737 1738func (s *FileContentHintsThumbnail) MarshalJSON() ([]byte, error) { 1739 type NoMethod FileContentHintsThumbnail 1740 raw := NoMethod(*s) 1741 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1742} 1743 1744// FileImageMediaMetadata: Additional metadata about image media, if 1745// available. 1746type FileImageMediaMetadata struct { 1747 // Aperture: The aperture used to create the photo (f-number). 1748 Aperture float64 `json:"aperture,omitempty"` 1749 1750 // CameraMake: The make of the camera used to create the photo. 1751 CameraMake string `json:"cameraMake,omitempty"` 1752 1753 // CameraModel: The model of the camera used to create the photo. 1754 CameraModel string `json:"cameraModel,omitempty"` 1755 1756 // ColorSpace: The color space of the photo. 1757 ColorSpace string `json:"colorSpace,omitempty"` 1758 1759 // ExposureBias: The exposure bias of the photo (APEX value). 1760 ExposureBias float64 `json:"exposureBias,omitempty"` 1761 1762 // ExposureMode: The exposure mode used to create the photo. 1763 ExposureMode string `json:"exposureMode,omitempty"` 1764 1765 // ExposureTime: The length of the exposure, in seconds. 1766 ExposureTime float64 `json:"exposureTime,omitempty"` 1767 1768 // FlashUsed: Whether a flash was used to create the photo. 1769 FlashUsed bool `json:"flashUsed,omitempty"` 1770 1771 // FocalLength: The focal length used to create the photo, in 1772 // millimeters. 1773 FocalLength float64 `json:"focalLength,omitempty"` 1774 1775 // Height: The height of the image in pixels. 1776 Height int64 `json:"height,omitempty"` 1777 1778 // IsoSpeed: The ISO speed used to create the photo. 1779 IsoSpeed int64 `json:"isoSpeed,omitempty"` 1780 1781 // Lens: The lens used to create the photo. 1782 Lens string `json:"lens,omitempty"` 1783 1784 // Location: Geographic location information stored in the image. 1785 Location *FileImageMediaMetadataLocation `json:"location,omitempty"` 1786 1787 // MaxApertureValue: The smallest f-number of the lens at the focal 1788 // length used to create the photo (APEX value). 1789 MaxApertureValue float64 `json:"maxApertureValue,omitempty"` 1790 1791 // MeteringMode: The metering mode used to create the photo. 1792 MeteringMode string `json:"meteringMode,omitempty"` 1793 1794 // Rotation: The number of clockwise 90 degree rotations applied from 1795 // the image's original orientation. 1796 Rotation int64 `json:"rotation,omitempty"` 1797 1798 // Sensor: The type of sensor used to create the photo. 1799 Sensor string `json:"sensor,omitempty"` 1800 1801 // SubjectDistance: The distance to the subject of the photo, in meters. 1802 SubjectDistance int64 `json:"subjectDistance,omitempty"` 1803 1804 // Time: The date and time the photo was taken (EXIF DateTime). 1805 Time string `json:"time,omitempty"` 1806 1807 // WhiteBalance: The white balance mode used to create the photo. 1808 WhiteBalance string `json:"whiteBalance,omitempty"` 1809 1810 // Width: The width of the image in pixels. 1811 Width int64 `json:"width,omitempty"` 1812 1813 // ForceSendFields is a list of field names (e.g. "Aperture") to 1814 // unconditionally include in API requests. By default, fields with 1815 // empty or default values are omitted from API requests. However, any 1816 // non-pointer, non-interface field appearing in ForceSendFields will be 1817 // sent to the server regardless of whether the field is empty or not. 1818 // This may be used to include empty fields in Patch requests. 1819 ForceSendFields []string `json:"-"` 1820 1821 // NullFields is a list of field names (e.g. "Aperture") to include in 1822 // API requests with the JSON null value. By default, fields with empty 1823 // values are omitted from API requests. However, any field with an 1824 // empty value appearing in NullFields will be sent to the server as 1825 // null. It is an error if a field in this list has a non-empty value. 1826 // This may be used to include null fields in Patch requests. 1827 NullFields []string `json:"-"` 1828} 1829 1830func (s *FileImageMediaMetadata) MarshalJSON() ([]byte, error) { 1831 type NoMethod FileImageMediaMetadata 1832 raw := NoMethod(*s) 1833 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1834} 1835 1836func (s *FileImageMediaMetadata) UnmarshalJSON(data []byte) error { 1837 type NoMethod FileImageMediaMetadata 1838 var s1 struct { 1839 Aperture gensupport.JSONFloat64 `json:"aperture"` 1840 ExposureBias gensupport.JSONFloat64 `json:"exposureBias"` 1841 ExposureTime gensupport.JSONFloat64 `json:"exposureTime"` 1842 FocalLength gensupport.JSONFloat64 `json:"focalLength"` 1843 MaxApertureValue gensupport.JSONFloat64 `json:"maxApertureValue"` 1844 *NoMethod 1845 } 1846 s1.NoMethod = (*NoMethod)(s) 1847 if err := json.Unmarshal(data, &s1); err != nil { 1848 return err 1849 } 1850 s.Aperture = float64(s1.Aperture) 1851 s.ExposureBias = float64(s1.ExposureBias) 1852 s.ExposureTime = float64(s1.ExposureTime) 1853 s.FocalLength = float64(s1.FocalLength) 1854 s.MaxApertureValue = float64(s1.MaxApertureValue) 1855 return nil 1856} 1857 1858// FileImageMediaMetadataLocation: Geographic location information 1859// stored in the image. 1860type FileImageMediaMetadataLocation struct { 1861 // Altitude: The altitude stored in the image. 1862 Altitude float64 `json:"altitude,omitempty"` 1863 1864 // Latitude: The latitude stored in the image. 1865 Latitude float64 `json:"latitude,omitempty"` 1866 1867 // Longitude: The longitude stored in the image. 1868 Longitude float64 `json:"longitude,omitempty"` 1869 1870 // ForceSendFields is a list of field names (e.g. "Altitude") to 1871 // unconditionally include in API requests. By default, fields with 1872 // empty or default values are omitted from API requests. However, any 1873 // non-pointer, non-interface field appearing in ForceSendFields will be 1874 // sent to the server regardless of whether the field is empty or not. 1875 // This may be used to include empty fields in Patch requests. 1876 ForceSendFields []string `json:"-"` 1877 1878 // NullFields is a list of field names (e.g. "Altitude") to include in 1879 // API requests with the JSON null value. By default, fields with empty 1880 // values are omitted from API requests. However, any field with an 1881 // empty value appearing in NullFields will be sent to the server as 1882 // null. It is an error if a field in this list has a non-empty value. 1883 // This may be used to include null fields in Patch requests. 1884 NullFields []string `json:"-"` 1885} 1886 1887func (s *FileImageMediaMetadataLocation) MarshalJSON() ([]byte, error) { 1888 type NoMethod FileImageMediaMetadataLocation 1889 raw := NoMethod(*s) 1890 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1891} 1892 1893func (s *FileImageMediaMetadataLocation) UnmarshalJSON(data []byte) error { 1894 type NoMethod FileImageMediaMetadataLocation 1895 var s1 struct { 1896 Altitude gensupport.JSONFloat64 `json:"altitude"` 1897 Latitude gensupport.JSONFloat64 `json:"latitude"` 1898 Longitude gensupport.JSONFloat64 `json:"longitude"` 1899 *NoMethod 1900 } 1901 s1.NoMethod = (*NoMethod)(s) 1902 if err := json.Unmarshal(data, &s1); err != nil { 1903 return err 1904 } 1905 s.Altitude = float64(s1.Altitude) 1906 s.Latitude = float64(s1.Latitude) 1907 s.Longitude = float64(s1.Longitude) 1908 return nil 1909} 1910 1911// FileLinkShareMetadata: Contains details about the link URLs that 1912// clients are using to refer to this item. 1913type FileLinkShareMetadata struct { 1914 // SecurityUpdateEligible: Whether the file is eligible for security 1915 // update. 1916 SecurityUpdateEligible bool `json:"securityUpdateEligible,omitempty"` 1917 1918 // SecurityUpdateEnabled: Whether the security update is enabled for 1919 // this file. 1920 SecurityUpdateEnabled bool `json:"securityUpdateEnabled,omitempty"` 1921 1922 // ForceSendFields is a list of field names (e.g. 1923 // "SecurityUpdateEligible") to unconditionally include in API requests. 1924 // By default, fields with empty or default values are omitted from API 1925 // requests. However, any non-pointer, non-interface field appearing in 1926 // ForceSendFields will be sent to the server regardless of whether the 1927 // field is empty or not. This may be used to include empty fields in 1928 // Patch requests. 1929 ForceSendFields []string `json:"-"` 1930 1931 // NullFields is a list of field names (e.g. "SecurityUpdateEligible") 1932 // to include in API requests with the JSON null value. By default, 1933 // fields with empty values are omitted from API requests. However, any 1934 // field with an empty value appearing in NullFields will be sent to the 1935 // server as null. It is an error if a field in this list has a 1936 // non-empty value. This may be used to include null fields in Patch 1937 // requests. 1938 NullFields []string `json:"-"` 1939} 1940 1941func (s *FileLinkShareMetadata) MarshalJSON() ([]byte, error) { 1942 type NoMethod FileLinkShareMetadata 1943 raw := NoMethod(*s) 1944 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1945} 1946 1947// FileShortcutDetails: Shortcut file details. Only populated for 1948// shortcut files, which have the mimeType field set to 1949// application/vnd.google-apps.shortcut. 1950type FileShortcutDetails struct { 1951 // TargetId: The ID of the file that this shortcut points to. 1952 TargetId string `json:"targetId,omitempty"` 1953 1954 // TargetMimeType: The MIME type of the file that this shortcut points 1955 // to. The value of this field is a snapshot of the target's MIME type, 1956 // captured when the shortcut is created. 1957 TargetMimeType string `json:"targetMimeType,omitempty"` 1958 1959 // TargetResourceKey: The ResourceKey for the target file. 1960 TargetResourceKey string `json:"targetResourceKey,omitempty"` 1961 1962 // ForceSendFields is a list of field names (e.g. "TargetId") to 1963 // unconditionally include in API requests. By default, fields with 1964 // empty or default values are omitted from API requests. However, any 1965 // non-pointer, non-interface field appearing in ForceSendFields will be 1966 // sent to the server regardless of whether the field is empty or not. 1967 // This may be used to include empty fields in Patch requests. 1968 ForceSendFields []string `json:"-"` 1969 1970 // NullFields is a list of field names (e.g. "TargetId") to include in 1971 // API requests with the JSON null value. By default, fields with empty 1972 // values are omitted from API requests. However, any field with an 1973 // empty value appearing in NullFields will be sent to the server as 1974 // null. It is an error if a field in this list has a non-empty value. 1975 // This may be used to include null fields in Patch requests. 1976 NullFields []string `json:"-"` 1977} 1978 1979func (s *FileShortcutDetails) MarshalJSON() ([]byte, error) { 1980 type NoMethod FileShortcutDetails 1981 raw := NoMethod(*s) 1982 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1983} 1984 1985// FileVideoMediaMetadata: Additional metadata about video media. This 1986// may not be available immediately upon upload. 1987type FileVideoMediaMetadata struct { 1988 // DurationMillis: The duration of the video in milliseconds. 1989 DurationMillis int64 `json:"durationMillis,omitempty,string"` 1990 1991 // Height: The height of the video in pixels. 1992 Height int64 `json:"height,omitempty"` 1993 1994 // Width: The width of the video in pixels. 1995 Width int64 `json:"width,omitempty"` 1996 1997 // ForceSendFields is a list of field names (e.g. "DurationMillis") to 1998 // unconditionally include in API requests. By default, fields with 1999 // empty or default values are omitted from API requests. However, any 2000 // non-pointer, non-interface field appearing in ForceSendFields will be 2001 // sent to the server regardless of whether the field is empty or not. 2002 // This may be used to include empty fields in Patch requests. 2003 ForceSendFields []string `json:"-"` 2004 2005 // NullFields is a list of field names (e.g. "DurationMillis") to 2006 // include in API requests with the JSON null value. By default, fields 2007 // with empty values are omitted from API requests. However, any field 2008 // with an empty value appearing in NullFields will be sent to the 2009 // server as null. It is an error if a field in this list has a 2010 // non-empty value. This may be used to include null fields in Patch 2011 // requests. 2012 NullFields []string `json:"-"` 2013} 2014 2015func (s *FileVideoMediaMetadata) MarshalJSON() ([]byte, error) { 2016 type NoMethod FileVideoMediaMetadata 2017 raw := NoMethod(*s) 2018 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2019} 2020 2021// FileList: A list of files. 2022type FileList struct { 2023 // Files: The list of files. If nextPageToken is populated, then this 2024 // list may be incomplete and an additional page of results should be 2025 // fetched. 2026 Files []*File `json:"files,omitempty"` 2027 2028 // IncompleteSearch: Whether the search process was incomplete. If true, 2029 // then some search results may be missing, since all documents were not 2030 // searched. This may occur when searching multiple drives with the 2031 // "allDrives" corpora, but all corpora could not be searched. When this 2032 // happens, it is suggested that clients narrow their query by choosing 2033 // a different corpus such as "user" or "drive". 2034 IncompleteSearch bool `json:"incompleteSearch,omitempty"` 2035 2036 // Kind: Identifies what kind of resource this is. Value: the fixed 2037 // string "drive#fileList". 2038 Kind string `json:"kind,omitempty"` 2039 2040 // NextPageToken: The page token for the next page of files. This will 2041 // be absent if the end of the files list has been reached. If the token 2042 // is rejected for any reason, it should be discarded, and pagination 2043 // should be restarted from the first page of results. 2044 NextPageToken string `json:"nextPageToken,omitempty"` 2045 2046 // ServerResponse contains the HTTP response code and headers from the 2047 // server. 2048 googleapi.ServerResponse `json:"-"` 2049 2050 // ForceSendFields is a list of field names (e.g. "Files") to 2051 // unconditionally include in API requests. By default, fields with 2052 // empty or default values are omitted from API requests. However, any 2053 // non-pointer, non-interface field appearing in ForceSendFields will be 2054 // sent to the server regardless of whether the field is empty or not. 2055 // This may be used to include empty fields in Patch requests. 2056 ForceSendFields []string `json:"-"` 2057 2058 // NullFields is a list of field names (e.g. "Files") to include in API 2059 // requests with the JSON null value. By default, fields with empty 2060 // values are omitted from API requests. However, any field with an 2061 // empty value appearing in NullFields will be sent to the server as 2062 // null. It is an error if a field in this list has a non-empty value. 2063 // This may be used to include null fields in Patch requests. 2064 NullFields []string `json:"-"` 2065} 2066 2067func (s *FileList) MarshalJSON() ([]byte, error) { 2068 type NoMethod FileList 2069 raw := NoMethod(*s) 2070 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2071} 2072 2073// GeneratedIds: A list of generated file IDs which can be provided in 2074// create requests. 2075type GeneratedIds struct { 2076 // Ids: The IDs generated for the requesting user in the specified 2077 // space. 2078 Ids []string `json:"ids,omitempty"` 2079 2080 // Kind: Identifies what kind of resource this is. Value: the fixed 2081 // string "drive#generatedIds". 2082 Kind string `json:"kind,omitempty"` 2083 2084 // Space: The type of file that can be created with these IDs. 2085 Space string `json:"space,omitempty"` 2086 2087 // ServerResponse contains the HTTP response code and headers from the 2088 // server. 2089 googleapi.ServerResponse `json:"-"` 2090 2091 // ForceSendFields is a list of field names (e.g. "Ids") to 2092 // unconditionally include in API requests. By default, fields with 2093 // empty or default values are omitted from API requests. However, any 2094 // non-pointer, non-interface field appearing in ForceSendFields will be 2095 // sent to the server regardless of whether the field is empty or not. 2096 // This may be used to include empty fields in Patch requests. 2097 ForceSendFields []string `json:"-"` 2098 2099 // NullFields is a list of field names (e.g. "Ids") to include in API 2100 // requests with the JSON null value. By default, fields with empty 2101 // values are omitted from API requests. However, any field with an 2102 // empty value appearing in NullFields will be sent to the server as 2103 // null. It is an error if a field in this list has a non-empty value. 2104 // This may be used to include null fields in Patch requests. 2105 NullFields []string `json:"-"` 2106} 2107 2108func (s *GeneratedIds) MarshalJSON() ([]byte, error) { 2109 type NoMethod GeneratedIds 2110 raw := NoMethod(*s) 2111 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2112} 2113 2114// Permission: A permission for a file. A permission grants a user, 2115// group, domain or the world access to a file or a folder hierarchy. 2116type Permission struct { 2117 // AllowFileDiscovery: Whether the permission allows the file to be 2118 // discovered through search. This is only applicable for permissions of 2119 // type domain or anyone. 2120 AllowFileDiscovery bool `json:"allowFileDiscovery,omitempty"` 2121 2122 // Deleted: Whether the account associated with this permission has been 2123 // deleted. This field only pertains to user and group permissions. 2124 Deleted bool `json:"deleted,omitempty"` 2125 2126 // DisplayName: The "pretty" name of the value of the permission. The 2127 // following is a list of examples for each type of permission: 2128 // - user - User's full name, as defined for their Google account, such 2129 // as "Joe Smith." 2130 // - group - Name of the Google Group, such as "The Company 2131 // Administrators." 2132 // - domain - String domain name, such as "thecompany.com." 2133 // - anyone - No displayName is present. 2134 DisplayName string `json:"displayName,omitempty"` 2135 2136 // Domain: The domain to which this permission refers. 2137 Domain string `json:"domain,omitempty"` 2138 2139 // EmailAddress: The email address of the user or group to which this 2140 // permission refers. 2141 EmailAddress string `json:"emailAddress,omitempty"` 2142 2143 // ExpirationTime: The time at which this permission will expire (RFC 2144 // 3339 date-time). Expiration times have the following restrictions: 2145 // 2146 // - They can only be set on user and group permissions 2147 // - The time must be in the future 2148 // - The time cannot be more than a year in the future 2149 ExpirationTime string `json:"expirationTime,omitempty"` 2150 2151 // Id: The ID of this permission. This is a unique identifier for the 2152 // grantee, and is published in User resources as permissionId. IDs 2153 // should be treated as opaque values. 2154 Id string `json:"id,omitempty"` 2155 2156 // Kind: Identifies what kind of resource this is. Value: the fixed 2157 // string "drive#permission". 2158 Kind string `json:"kind,omitempty"` 2159 2160 // PermissionDetails: Details of whether the permissions on this shared 2161 // drive item are inherited or directly on this item. This is an 2162 // output-only field which is present only for shared drive items. 2163 PermissionDetails []*PermissionPermissionDetails `json:"permissionDetails,omitempty"` 2164 2165 // PhotoLink: A link to the user's profile photo, if available. 2166 PhotoLink string `json:"photoLink,omitempty"` 2167 2168 // Role: The role granted by this permission. While new values may be 2169 // supported in the future, the following are currently allowed: 2170 // - owner 2171 // - organizer 2172 // - fileOrganizer 2173 // - writer 2174 // - commenter 2175 // - reader 2176 Role string `json:"role,omitempty"` 2177 2178 // TeamDrivePermissionDetails: Deprecated - use permissionDetails 2179 // instead. 2180 TeamDrivePermissionDetails []*PermissionTeamDrivePermissionDetails `json:"teamDrivePermissionDetails,omitempty"` 2181 2182 // Type: The type of the grantee. Valid values are: 2183 // - user 2184 // - group 2185 // - domain 2186 // - anyone When creating a permission, if type is user or group, you 2187 // must provide an emailAddress for the user or group. When type is 2188 // domain, you must provide a domain. There isn't extra information 2189 // required for a anyone type. 2190 Type string `json:"type,omitempty"` 2191 2192 // View: Indicates the view for this permission. Only populated for 2193 // permissions that belong to a view. published is the only supported 2194 // value. 2195 View string `json:"view,omitempty"` 2196 2197 // ServerResponse contains the HTTP response code and headers from the 2198 // server. 2199 googleapi.ServerResponse `json:"-"` 2200 2201 // ForceSendFields is a list of field names (e.g. "AllowFileDiscovery") 2202 // to unconditionally include in API requests. By default, fields with 2203 // empty or default values are omitted from API requests. However, any 2204 // non-pointer, non-interface field appearing in ForceSendFields will be 2205 // sent to the server regardless of whether the field is empty or not. 2206 // This may be used to include empty fields in Patch requests. 2207 ForceSendFields []string `json:"-"` 2208 2209 // NullFields is a list of field names (e.g. "AllowFileDiscovery") to 2210 // include in API requests with the JSON null value. By default, fields 2211 // with empty values are omitted from API requests. However, any field 2212 // with an empty value appearing in NullFields will be sent to the 2213 // server as null. It is an error if a field in this list has a 2214 // non-empty value. This may be used to include null fields in Patch 2215 // requests. 2216 NullFields []string `json:"-"` 2217} 2218 2219func (s *Permission) MarshalJSON() ([]byte, error) { 2220 type NoMethod Permission 2221 raw := NoMethod(*s) 2222 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2223} 2224 2225type PermissionPermissionDetails struct { 2226 // Inherited: Whether this permission is inherited. This field is always 2227 // populated. This is an output-only field. 2228 Inherited bool `json:"inherited,omitempty"` 2229 2230 // InheritedFrom: The ID of the item from which this permission is 2231 // inherited. This is an output-only field. 2232 InheritedFrom string `json:"inheritedFrom,omitempty"` 2233 2234 // PermissionType: The permission type for this user. While new values 2235 // may be added in future, the following are currently possible: 2236 // - file 2237 // - member 2238 PermissionType string `json:"permissionType,omitempty"` 2239 2240 // Role: The primary role for this user. While new values may be added 2241 // in the future, the following are currently possible: 2242 // - organizer 2243 // - fileOrganizer 2244 // - writer 2245 // - commenter 2246 // - reader 2247 Role string `json:"role,omitempty"` 2248 2249 // ForceSendFields is a list of field names (e.g. "Inherited") to 2250 // unconditionally include in API requests. By default, fields with 2251 // empty or default values are omitted from API requests. However, any 2252 // non-pointer, non-interface field appearing in ForceSendFields will be 2253 // sent to the server regardless of whether the field is empty or not. 2254 // This may be used to include empty fields in Patch requests. 2255 ForceSendFields []string `json:"-"` 2256 2257 // NullFields is a list of field names (e.g. "Inherited") to include in 2258 // API requests with the JSON null value. By default, fields with empty 2259 // values are omitted from API requests. However, any field with an 2260 // empty value appearing in NullFields will be sent to the server as 2261 // null. It is an error if a field in this list has a non-empty value. 2262 // This may be used to include null fields in Patch requests. 2263 NullFields []string `json:"-"` 2264} 2265 2266func (s *PermissionPermissionDetails) MarshalJSON() ([]byte, error) { 2267 type NoMethod PermissionPermissionDetails 2268 raw := NoMethod(*s) 2269 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2270} 2271 2272type PermissionTeamDrivePermissionDetails struct { 2273 // Inherited: Deprecated - use permissionDetails/inherited instead. 2274 Inherited bool `json:"inherited,omitempty"` 2275 2276 // InheritedFrom: Deprecated - use permissionDetails/inheritedFrom 2277 // instead. 2278 InheritedFrom string `json:"inheritedFrom,omitempty"` 2279 2280 // Role: Deprecated - use permissionDetails/role instead. 2281 Role string `json:"role,omitempty"` 2282 2283 // TeamDrivePermissionType: Deprecated - use 2284 // permissionDetails/permissionType instead. 2285 TeamDrivePermissionType string `json:"teamDrivePermissionType,omitempty"` 2286 2287 // ForceSendFields is a list of field names (e.g. "Inherited") to 2288 // unconditionally include in API requests. By default, fields with 2289 // empty or default values are omitted from API requests. However, any 2290 // non-pointer, non-interface field appearing in ForceSendFields will be 2291 // sent to the server regardless of whether the field is empty or not. 2292 // This may be used to include empty fields in Patch requests. 2293 ForceSendFields []string `json:"-"` 2294 2295 // NullFields is a list of field names (e.g. "Inherited") to include in 2296 // API requests with the JSON null value. By default, fields with empty 2297 // values are omitted from API requests. However, any field with an 2298 // empty value appearing in NullFields will be sent to the server as 2299 // null. It is an error if a field in this list has a non-empty value. 2300 // This may be used to include null fields in Patch requests. 2301 NullFields []string `json:"-"` 2302} 2303 2304func (s *PermissionTeamDrivePermissionDetails) MarshalJSON() ([]byte, error) { 2305 type NoMethod PermissionTeamDrivePermissionDetails 2306 raw := NoMethod(*s) 2307 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2308} 2309 2310// PermissionList: A list of permissions for a file. 2311type PermissionList struct { 2312 // Kind: Identifies what kind of resource this is. Value: the fixed 2313 // string "drive#permissionList". 2314 Kind string `json:"kind,omitempty"` 2315 2316 // NextPageToken: The page token for the next page of permissions. This 2317 // field will be absent if the end of the permissions list has been 2318 // reached. If the token is rejected for any reason, it should be 2319 // discarded, and pagination should be restarted from the first page of 2320 // results. 2321 NextPageToken string `json:"nextPageToken,omitempty"` 2322 2323 // Permissions: The list of permissions. If nextPageToken is populated, 2324 // then this list may be incomplete and an additional page of results 2325 // should be fetched. 2326 Permissions []*Permission `json:"permissions,omitempty"` 2327 2328 // ServerResponse contains the HTTP response code and headers from the 2329 // server. 2330 googleapi.ServerResponse `json:"-"` 2331 2332 // ForceSendFields is a list of field names (e.g. "Kind") to 2333 // unconditionally include in API requests. By default, fields with 2334 // empty or default values are omitted from API requests. However, any 2335 // non-pointer, non-interface field appearing in ForceSendFields will be 2336 // sent to the server regardless of whether the field is empty or not. 2337 // This may be used to include empty fields in Patch requests. 2338 ForceSendFields []string `json:"-"` 2339 2340 // NullFields is a list of field names (e.g. "Kind") to include in API 2341 // requests with the JSON null value. By default, fields with empty 2342 // values are omitted from API requests. However, any field with an 2343 // empty value appearing in NullFields will be sent to the server as 2344 // null. It is an error if a field in this list has a non-empty value. 2345 // This may be used to include null fields in Patch requests. 2346 NullFields []string `json:"-"` 2347} 2348 2349func (s *PermissionList) MarshalJSON() ([]byte, error) { 2350 type NoMethod PermissionList 2351 raw := NoMethod(*s) 2352 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2353} 2354 2355// Reply: A reply to a comment on a file. 2356type Reply struct { 2357 // Action: The action the reply performed to the parent comment. Valid 2358 // values are: 2359 // - resolve 2360 // - reopen 2361 Action string `json:"action,omitempty"` 2362 2363 // Author: The author of the reply. The author's email address and 2364 // permission ID will not be populated. 2365 Author *User `json:"author,omitempty"` 2366 2367 // Content: The plain text content of the reply. This field is used for 2368 // setting the content, while htmlContent should be displayed. This is 2369 // required on creates if no action is specified. 2370 Content string `json:"content,omitempty"` 2371 2372 // CreatedTime: The time at which the reply was created (RFC 3339 2373 // date-time). 2374 CreatedTime string `json:"createdTime,omitempty"` 2375 2376 // Deleted: Whether the reply has been deleted. A deleted reply has no 2377 // content. 2378 Deleted bool `json:"deleted,omitempty"` 2379 2380 // HtmlContent: The content of the reply with HTML formatting. 2381 HtmlContent string `json:"htmlContent,omitempty"` 2382 2383 // Id: The ID of the reply. 2384 Id string `json:"id,omitempty"` 2385 2386 // Kind: Identifies what kind of resource this is. Value: the fixed 2387 // string "drive#reply". 2388 Kind string `json:"kind,omitempty"` 2389 2390 // ModifiedTime: The last time the reply was modified (RFC 3339 2391 // date-time). 2392 ModifiedTime string `json:"modifiedTime,omitempty"` 2393 2394 // ServerResponse contains the HTTP response code and headers from the 2395 // server. 2396 googleapi.ServerResponse `json:"-"` 2397 2398 // ForceSendFields is a list of field names (e.g. "Action") to 2399 // unconditionally include in API requests. By default, fields with 2400 // empty or default values are omitted from API requests. However, any 2401 // non-pointer, non-interface field appearing in ForceSendFields will be 2402 // sent to the server regardless of whether the field is empty or not. 2403 // This may be used to include empty fields in Patch requests. 2404 ForceSendFields []string `json:"-"` 2405 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 2408 // values are omitted from API requests. However, any field with an 2409 // empty value appearing in NullFields will be sent to the server as 2410 // null. It is an error if a field in this list has a non-empty value. 2411 // This may be used to include null fields in Patch requests. 2412 NullFields []string `json:"-"` 2413} 2414 2415func (s *Reply) MarshalJSON() ([]byte, error) { 2416 type NoMethod Reply 2417 raw := NoMethod(*s) 2418 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2419} 2420 2421// ReplyList: A list of replies to a comment on a file. 2422type ReplyList struct { 2423 // Kind: Identifies what kind of resource this is. Value: the fixed 2424 // string "drive#replyList". 2425 Kind string `json:"kind,omitempty"` 2426 2427 // NextPageToken: The page token for the next page of replies. This will 2428 // be absent if the end of the replies list has been reached. If the 2429 // token is rejected for any reason, it should be discarded, and 2430 // pagination should be restarted from the first page of results. 2431 NextPageToken string `json:"nextPageToken,omitempty"` 2432 2433 // Replies: The list of replies. If nextPageToken is populated, then 2434 // this list may be incomplete and an additional page of results should 2435 // be fetched. 2436 Replies []*Reply `json:"replies,omitempty"` 2437 2438 // ServerResponse contains the HTTP response code and headers from the 2439 // server. 2440 googleapi.ServerResponse `json:"-"` 2441 2442 // ForceSendFields is a list of field names (e.g. "Kind") to 2443 // unconditionally include in API requests. By default, fields with 2444 // empty or default values are omitted from API requests. However, any 2445 // non-pointer, non-interface field appearing in ForceSendFields will be 2446 // sent to the server regardless of whether the field is empty or not. 2447 // This may be used to include empty fields in Patch requests. 2448 ForceSendFields []string `json:"-"` 2449 2450 // NullFields is a list of field names (e.g. "Kind") to include in API 2451 // requests with the JSON null value. By default, fields with empty 2452 // values are omitted from API requests. However, any field with an 2453 // empty value appearing in NullFields will be sent to the server as 2454 // null. It is an error if a field in this list has a non-empty value. 2455 // This may be used to include null fields in Patch requests. 2456 NullFields []string `json:"-"` 2457} 2458 2459func (s *ReplyList) MarshalJSON() ([]byte, error) { 2460 type NoMethod ReplyList 2461 raw := NoMethod(*s) 2462 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2463} 2464 2465// Revision: The metadata for a revision to a file. 2466type Revision struct { 2467 // ExportLinks: Links for exporting Docs Editors files to specific 2468 // formats. 2469 ExportLinks map[string]string `json:"exportLinks,omitempty"` 2470 2471 // Id: The ID of the revision. 2472 Id string `json:"id,omitempty"` 2473 2474 // KeepForever: Whether to keep this revision forever, even if it is no 2475 // longer the head revision. If not set, the revision will be 2476 // automatically purged 30 days after newer content is uploaded. This 2477 // can be set on a maximum of 200 revisions for a file. 2478 // This field is only applicable to files with binary content in Drive. 2479 KeepForever bool `json:"keepForever,omitempty"` 2480 2481 // Kind: Identifies what kind of resource this is. Value: the fixed 2482 // string "drive#revision". 2483 Kind string `json:"kind,omitempty"` 2484 2485 // LastModifyingUser: The last user to modify this revision. 2486 LastModifyingUser *User `json:"lastModifyingUser,omitempty"` 2487 2488 // Md5Checksum: The MD5 checksum of the revision's content. This is only 2489 // applicable to files with binary content in Drive. 2490 Md5Checksum string `json:"md5Checksum,omitempty"` 2491 2492 // MimeType: The MIME type of the revision. 2493 MimeType string `json:"mimeType,omitempty"` 2494 2495 // ModifiedTime: The last time the revision was modified (RFC 3339 2496 // date-time). 2497 ModifiedTime string `json:"modifiedTime,omitempty"` 2498 2499 // OriginalFilename: The original filename used to create this revision. 2500 // This is only applicable to files with binary content in Drive. 2501 OriginalFilename string `json:"originalFilename,omitempty"` 2502 2503 // PublishAuto: Whether subsequent revisions will be automatically 2504 // republished. This is only applicable to Docs Editors files. 2505 PublishAuto bool `json:"publishAuto,omitempty"` 2506 2507 // Published: Whether this revision is published. This is only 2508 // applicable to Docs Editors files. 2509 Published bool `json:"published,omitempty"` 2510 2511 // PublishedLink: A link to the published revision. This is only 2512 // populated for Google Sites files. 2513 PublishedLink string `json:"publishedLink,omitempty"` 2514 2515 // PublishedOutsideDomain: Whether this revision is published outside 2516 // the domain. This is only applicable to Docs Editors files. 2517 PublishedOutsideDomain bool `json:"publishedOutsideDomain,omitempty"` 2518 2519 // Size: The size of the revision's content in bytes. This is only 2520 // applicable to files with binary content in Drive. 2521 Size int64 `json:"size,omitempty,string"` 2522 2523 // ServerResponse contains the HTTP response code and headers from the 2524 // server. 2525 googleapi.ServerResponse `json:"-"` 2526 2527 // ForceSendFields is a list of field names (e.g. "ExportLinks") to 2528 // unconditionally include in API requests. By default, fields with 2529 // empty or default values are omitted from API requests. However, any 2530 // non-pointer, non-interface field appearing in ForceSendFields will be 2531 // sent to the server regardless of whether the field is empty or not. 2532 // This may be used to include empty fields in Patch requests. 2533 ForceSendFields []string `json:"-"` 2534 2535 // NullFields is a list of field names (e.g. "ExportLinks") to include 2536 // in API requests with the JSON null value. By default, fields with 2537 // empty values are omitted from API requests. However, any field with 2538 // an empty value appearing in NullFields will be sent to the server as 2539 // null. It is an error if a field in this list has a non-empty value. 2540 // This may be used to include null fields in Patch requests. 2541 NullFields []string `json:"-"` 2542} 2543 2544func (s *Revision) MarshalJSON() ([]byte, error) { 2545 type NoMethod Revision 2546 raw := NoMethod(*s) 2547 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2548} 2549 2550// RevisionList: A list of revisions of a file. 2551type RevisionList struct { 2552 // Kind: Identifies what kind of resource this is. Value: the fixed 2553 // string "drive#revisionList". 2554 Kind string `json:"kind,omitempty"` 2555 2556 // NextPageToken: The page token for the next page of revisions. This 2557 // will be absent if the end of the revisions list has been reached. If 2558 // the token is rejected for any reason, it should be discarded, and 2559 // pagination should be restarted from the first page of results. 2560 NextPageToken string `json:"nextPageToken,omitempty"` 2561 2562 // Revisions: The list of revisions. If nextPageToken is populated, then 2563 // this list may be incomplete and an additional page of results should 2564 // be fetched. 2565 Revisions []*Revision `json:"revisions,omitempty"` 2566 2567 // ServerResponse contains the HTTP response code and headers from the 2568 // server. 2569 googleapi.ServerResponse `json:"-"` 2570 2571 // ForceSendFields is a list of field names (e.g. "Kind") to 2572 // unconditionally include in API requests. By default, fields with 2573 // empty or default values are omitted from API requests. However, any 2574 // non-pointer, non-interface field appearing in ForceSendFields will be 2575 // sent to the server regardless of whether the field is empty or not. 2576 // This may be used to include empty fields in Patch requests. 2577 ForceSendFields []string `json:"-"` 2578 2579 // NullFields is a list of field names (e.g. "Kind") to include in API 2580 // requests with the JSON null value. By default, fields with empty 2581 // values are omitted from API requests. However, any field with an 2582 // empty value appearing in NullFields will be sent to the server as 2583 // null. It is an error if a field in this list has a non-empty value. 2584 // This may be used to include null fields in Patch requests. 2585 NullFields []string `json:"-"` 2586} 2587 2588func (s *RevisionList) MarshalJSON() ([]byte, error) { 2589 type NoMethod RevisionList 2590 raw := NoMethod(*s) 2591 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2592} 2593 2594type StartPageToken struct { 2595 // Kind: Identifies what kind of resource this is. Value: the fixed 2596 // string "drive#startPageToken". 2597 Kind string `json:"kind,omitempty"` 2598 2599 // StartPageToken: The starting page token for listing changes. 2600 StartPageToken string `json:"startPageToken,omitempty"` 2601 2602 // ServerResponse contains the HTTP response code and headers from the 2603 // server. 2604 googleapi.ServerResponse `json:"-"` 2605 2606 // ForceSendFields is a list of field names (e.g. "Kind") to 2607 // unconditionally include in API requests. By default, fields with 2608 // empty or default values are omitted from API requests. However, any 2609 // non-pointer, non-interface field appearing in ForceSendFields will be 2610 // sent to the server regardless of whether the field is empty or not. 2611 // This may be used to include empty fields in Patch requests. 2612 ForceSendFields []string `json:"-"` 2613 2614 // NullFields is a list of field names (e.g. "Kind") to include in API 2615 // requests with the JSON null value. By default, fields with empty 2616 // values are omitted from API requests. However, any field with an 2617 // empty value appearing in NullFields will be sent to the server as 2618 // null. It is an error if a field in this list has a non-empty value. 2619 // This may be used to include null fields in Patch requests. 2620 NullFields []string `json:"-"` 2621} 2622 2623func (s *StartPageToken) MarshalJSON() ([]byte, error) { 2624 type NoMethod StartPageToken 2625 raw := NoMethod(*s) 2626 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2627} 2628 2629// TeamDrive: Deprecated: use the drive collection instead. 2630type TeamDrive struct { 2631 // BackgroundImageFile: An image file and cropping parameters from which 2632 // a background image for this Team Drive is set. This is a write only 2633 // field; it can only be set on drive.teamdrives.update requests that 2634 // don't set themeId. When specified, all fields of the 2635 // backgroundImageFile must be set. 2636 BackgroundImageFile *TeamDriveBackgroundImageFile `json:"backgroundImageFile,omitempty"` 2637 2638 // BackgroundImageLink: A short-lived link to this Team Drive's 2639 // background image. 2640 BackgroundImageLink string `json:"backgroundImageLink,omitempty"` 2641 2642 // Capabilities: Capabilities the current user has on this Team Drive. 2643 Capabilities *TeamDriveCapabilities `json:"capabilities,omitempty"` 2644 2645 // ColorRgb: The color of this Team Drive as an RGB hex string. It can 2646 // only be set on a drive.teamdrives.update request that does not set 2647 // themeId. 2648 ColorRgb string `json:"colorRgb,omitempty"` 2649 2650 // CreatedTime: The time at which the Team Drive was created (RFC 3339 2651 // date-time). 2652 CreatedTime string `json:"createdTime,omitempty"` 2653 2654 // Id: The ID of this Team Drive which is also the ID of the top level 2655 // folder of this Team Drive. 2656 Id string `json:"id,omitempty"` 2657 2658 // Kind: Identifies what kind of resource this is. Value: the fixed 2659 // string "drive#teamDrive". 2660 Kind string `json:"kind,omitempty"` 2661 2662 // Name: The name of this Team Drive. 2663 Name string `json:"name,omitempty"` 2664 2665 // Restrictions: A set of restrictions that apply to this Team Drive or 2666 // items inside this Team Drive. 2667 Restrictions *TeamDriveRestrictions `json:"restrictions,omitempty"` 2668 2669 // ThemeId: The ID of the theme from which the background image and 2670 // color will be set. The set of possible teamDriveThemes can be 2671 // retrieved from a drive.about.get response. When not specified on a 2672 // drive.teamdrives.create request, a random theme is chosen from which 2673 // the background image and color are set. This is a write-only field; 2674 // it can only be set on requests that don't set colorRgb or 2675 // backgroundImageFile. 2676 ThemeId string `json:"themeId,omitempty"` 2677 2678 // ServerResponse contains the HTTP response code and headers from the 2679 // server. 2680 googleapi.ServerResponse `json:"-"` 2681 2682 // ForceSendFields is a list of field names (e.g. "BackgroundImageFile") 2683 // to unconditionally include in API requests. By default, fields with 2684 // empty or default values are omitted from API requests. However, any 2685 // non-pointer, non-interface field appearing in ForceSendFields will be 2686 // sent to the server regardless of whether the field is empty or not. 2687 // This may be used to include empty fields in Patch requests. 2688 ForceSendFields []string `json:"-"` 2689 2690 // NullFields is a list of field names (e.g. "BackgroundImageFile") to 2691 // include in API requests with the JSON null value. By default, fields 2692 // with empty values are omitted from API requests. However, any field 2693 // with an empty value appearing in NullFields will be sent to the 2694 // server as null. It is an error if a field in this list has a 2695 // non-empty value. This may be used to include null fields in Patch 2696 // requests. 2697 NullFields []string `json:"-"` 2698} 2699 2700func (s *TeamDrive) MarshalJSON() ([]byte, error) { 2701 type NoMethod TeamDrive 2702 raw := NoMethod(*s) 2703 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2704} 2705 2706// TeamDriveBackgroundImageFile: An image file and cropping parameters 2707// from which a background image for this Team Drive is set. This is a 2708// write only field; it can only be set on drive.teamdrives.update 2709// requests that don't set themeId. When specified, all fields of the 2710// backgroundImageFile must be set. 2711type TeamDriveBackgroundImageFile struct { 2712 // Id: The ID of an image file in Drive to use for the background image. 2713 Id string `json:"id,omitempty"` 2714 2715 // Width: The width of the cropped image in the closed range of 0 to 1. 2716 // This value represents the width of the cropped image divided by the 2717 // width of the entire image. The height is computed by applying a width 2718 // to height aspect ratio of 80 to 9. The resulting image must be at 2719 // least 1280 pixels wide and 144 pixels high. 2720 Width float64 `json:"width,omitempty"` 2721 2722 // XCoordinate: The X coordinate of the upper left corner of the 2723 // cropping area in the background image. This is a value in the closed 2724 // range of 0 to 1. This value represents the horizontal distance from 2725 // the left side of the entire image to the left side of the cropping 2726 // area divided by the width of the entire image. 2727 XCoordinate float64 `json:"xCoordinate,omitempty"` 2728 2729 // YCoordinate: The Y coordinate of the upper left corner of the 2730 // cropping area in the background image. This is a value in the closed 2731 // range of 0 to 1. This value represents the vertical distance from the 2732 // top side of the entire image to the top side of the cropping area 2733 // divided by the height of the entire image. 2734 YCoordinate float64 `json:"yCoordinate,omitempty"` 2735 2736 // ForceSendFields is a list of field names (e.g. "Id") to 2737 // unconditionally include in API requests. By default, fields with 2738 // empty or default values are omitted from API requests. However, any 2739 // non-pointer, non-interface field appearing in ForceSendFields will be 2740 // sent to the server regardless of whether the field is empty or not. 2741 // This may be used to include empty fields in Patch requests. 2742 ForceSendFields []string `json:"-"` 2743 2744 // NullFields is a list of field names (e.g. "Id") to include in API 2745 // requests with the JSON null value. By default, fields with empty 2746 // values are omitted from API requests. However, any field with an 2747 // empty value appearing in NullFields will be sent to the server as 2748 // null. It is an error if a field in this list has a non-empty value. 2749 // This may be used to include null fields in Patch requests. 2750 NullFields []string `json:"-"` 2751} 2752 2753func (s *TeamDriveBackgroundImageFile) MarshalJSON() ([]byte, error) { 2754 type NoMethod TeamDriveBackgroundImageFile 2755 raw := NoMethod(*s) 2756 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2757} 2758 2759func (s *TeamDriveBackgroundImageFile) UnmarshalJSON(data []byte) error { 2760 type NoMethod TeamDriveBackgroundImageFile 2761 var s1 struct { 2762 Width gensupport.JSONFloat64 `json:"width"` 2763 XCoordinate gensupport.JSONFloat64 `json:"xCoordinate"` 2764 YCoordinate gensupport.JSONFloat64 `json:"yCoordinate"` 2765 *NoMethod 2766 } 2767 s1.NoMethod = (*NoMethod)(s) 2768 if err := json.Unmarshal(data, &s1); err != nil { 2769 return err 2770 } 2771 s.Width = float64(s1.Width) 2772 s.XCoordinate = float64(s1.XCoordinate) 2773 s.YCoordinate = float64(s1.YCoordinate) 2774 return nil 2775} 2776 2777// TeamDriveCapabilities: Capabilities the current user has on this Team 2778// Drive. 2779type TeamDriveCapabilities struct { 2780 // CanAddChildren: Whether the current user can add children to folders 2781 // in this Team Drive. 2782 CanAddChildren bool `json:"canAddChildren,omitempty"` 2783 2784 // CanChangeCopyRequiresWriterPermissionRestriction: Whether the current 2785 // user can change the copyRequiresWriterPermission restriction of this 2786 // Team Drive. 2787 CanChangeCopyRequiresWriterPermissionRestriction bool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"` 2788 2789 // CanChangeDomainUsersOnlyRestriction: Whether the current user can 2790 // change the domainUsersOnly restriction of this Team Drive. 2791 CanChangeDomainUsersOnlyRestriction bool `json:"canChangeDomainUsersOnlyRestriction,omitempty"` 2792 2793 // CanChangeTeamDriveBackground: Whether the current user can change the 2794 // background of this Team Drive. 2795 CanChangeTeamDriveBackground bool `json:"canChangeTeamDriveBackground,omitempty"` 2796 2797 // CanChangeTeamMembersOnlyRestriction: Whether the current user can 2798 // change the teamMembersOnly restriction of this Team Drive. 2799 CanChangeTeamMembersOnlyRestriction bool `json:"canChangeTeamMembersOnlyRestriction,omitempty"` 2800 2801 // CanComment: Whether the current user can comment on files in this 2802 // Team Drive. 2803 CanComment bool `json:"canComment,omitempty"` 2804 2805 // CanCopy: Whether the current user can copy files in this Team Drive. 2806 CanCopy bool `json:"canCopy,omitempty"` 2807 2808 // CanDeleteChildren: Whether the current user can delete children from 2809 // folders in this Team Drive. 2810 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"` 2811 2812 // CanDeleteTeamDrive: Whether the current user can delete this Team 2813 // Drive. Attempting to delete the Team Drive may still fail if there 2814 // are untrashed items inside the Team Drive. 2815 CanDeleteTeamDrive bool `json:"canDeleteTeamDrive,omitempty"` 2816 2817 // CanDownload: Whether the current user can download files in this Team 2818 // Drive. 2819 CanDownload bool `json:"canDownload,omitempty"` 2820 2821 // CanEdit: Whether the current user can edit files in this Team Drive 2822 CanEdit bool `json:"canEdit,omitempty"` 2823 2824 // CanListChildren: Whether the current user can list the children of 2825 // folders in this Team Drive. 2826 CanListChildren bool `json:"canListChildren,omitempty"` 2827 2828 // CanManageMembers: Whether the current user can add members to this 2829 // Team Drive or remove them or change their role. 2830 CanManageMembers bool `json:"canManageMembers,omitempty"` 2831 2832 // CanReadRevisions: Whether the current user can read the revisions 2833 // resource of files in this Team Drive. 2834 CanReadRevisions bool `json:"canReadRevisions,omitempty"` 2835 2836 // CanRemoveChildren: Deprecated - use canDeleteChildren or 2837 // canTrashChildren instead. 2838 CanRemoveChildren bool `json:"canRemoveChildren,omitempty"` 2839 2840 // CanRename: Whether the current user can rename files or folders in 2841 // this Team Drive. 2842 CanRename bool `json:"canRename,omitempty"` 2843 2844 // CanRenameTeamDrive: Whether the current user can rename this Team 2845 // Drive. 2846 CanRenameTeamDrive bool `json:"canRenameTeamDrive,omitempty"` 2847 2848 // CanShare: Whether the current user can share files or folders in this 2849 // Team Drive. 2850 CanShare bool `json:"canShare,omitempty"` 2851 2852 // CanTrashChildren: Whether the current user can trash children from 2853 // folders in this Team Drive. 2854 CanTrashChildren bool `json:"canTrashChildren,omitempty"` 2855 2856 // ForceSendFields is a list of field names (e.g. "CanAddChildren") to 2857 // unconditionally include in API requests. By default, fields with 2858 // empty or default values are omitted from API requests. However, any 2859 // non-pointer, non-interface field appearing in ForceSendFields will be 2860 // sent to the server regardless of whether the field is empty or not. 2861 // This may be used to include empty fields in Patch requests. 2862 ForceSendFields []string `json:"-"` 2863 2864 // NullFields is a list of field names (e.g. "CanAddChildren") to 2865 // include in API requests with the JSON null value. By default, fields 2866 // with empty values are omitted from API requests. However, any field 2867 // with an empty value appearing in NullFields will be sent to the 2868 // server as null. It is an error if a field in this list has a 2869 // non-empty value. This may be used to include null fields in Patch 2870 // requests. 2871 NullFields []string `json:"-"` 2872} 2873 2874func (s *TeamDriveCapabilities) MarshalJSON() ([]byte, error) { 2875 type NoMethod TeamDriveCapabilities 2876 raw := NoMethod(*s) 2877 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2878} 2879 2880// TeamDriveRestrictions: A set of restrictions that apply to this Team 2881// Drive or items inside this Team Drive. 2882type TeamDriveRestrictions struct { 2883 // AdminManagedRestrictions: Whether administrative privileges on this 2884 // Team Drive are required to modify restrictions. 2885 AdminManagedRestrictions bool `json:"adminManagedRestrictions,omitempty"` 2886 2887 // CopyRequiresWriterPermission: Whether the options to copy, print, or 2888 // download files inside this Team Drive, should be disabled for readers 2889 // and commenters. When this restriction is set to true, it will 2890 // override the similarly named field to true for any file inside this 2891 // Team Drive. 2892 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"` 2893 2894 // DomainUsersOnly: Whether access to this Team Drive and items inside 2895 // this Team Drive is restricted to users of the domain to which this 2896 // Team Drive belongs. This restriction may be overridden by other 2897 // sharing policies controlled outside of this Team Drive. 2898 DomainUsersOnly bool `json:"domainUsersOnly,omitempty"` 2899 2900 // TeamMembersOnly: Whether access to items inside this Team Drive is 2901 // restricted to members of this Team Drive. 2902 TeamMembersOnly bool `json:"teamMembersOnly,omitempty"` 2903 2904 // ForceSendFields is a list of field names (e.g. 2905 // "AdminManagedRestrictions") to unconditionally include in API 2906 // requests. By default, fields with empty or default values are omitted 2907 // from API requests. However, any non-pointer, non-interface field 2908 // appearing in ForceSendFields will be sent to the server regardless of 2909 // whether the field is empty or not. This may be used to include empty 2910 // fields in Patch requests. 2911 ForceSendFields []string `json:"-"` 2912 2913 // NullFields is a list of field names (e.g. "AdminManagedRestrictions") 2914 // to include in API requests with the JSON null value. By default, 2915 // fields with empty values are omitted from API requests. However, any 2916 // field with an empty value appearing in NullFields will be sent to the 2917 // server as null. It is an error if a field in this list has a 2918 // non-empty value. This may be used to include null fields in Patch 2919 // requests. 2920 NullFields []string `json:"-"` 2921} 2922 2923func (s *TeamDriveRestrictions) MarshalJSON() ([]byte, error) { 2924 type NoMethod TeamDriveRestrictions 2925 raw := NoMethod(*s) 2926 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2927} 2928 2929// TeamDriveList: A list of Team Drives. 2930type TeamDriveList struct { 2931 // Kind: Identifies what kind of resource this is. Value: the fixed 2932 // string "drive#teamDriveList". 2933 Kind string `json:"kind,omitempty"` 2934 2935 // NextPageToken: The page token for the next page of Team Drives. This 2936 // will be absent if the end of the Team Drives list has been reached. 2937 // If the token is rejected for any reason, it should be discarded, and 2938 // pagination should be restarted from the first page of results. 2939 NextPageToken string `json:"nextPageToken,omitempty"` 2940 2941 // TeamDrives: The list of Team Drives. If nextPageToken is populated, 2942 // then this list may be incomplete and an additional page of results 2943 // should be fetched. 2944 TeamDrives []*TeamDrive `json:"teamDrives,omitempty"` 2945 2946 // ServerResponse contains the HTTP response code and headers from the 2947 // server. 2948 googleapi.ServerResponse `json:"-"` 2949 2950 // ForceSendFields is a list of field names (e.g. "Kind") to 2951 // unconditionally include in API requests. By default, fields with 2952 // empty or default values are omitted from API requests. However, any 2953 // non-pointer, non-interface field appearing in ForceSendFields will be 2954 // sent to the server regardless of whether the field is empty or not. 2955 // This may be used to include empty fields in Patch requests. 2956 ForceSendFields []string `json:"-"` 2957 2958 // NullFields is a list of field names (e.g. "Kind") to include in API 2959 // requests with the JSON null value. By default, fields with empty 2960 // values are omitted from API requests. However, any field with an 2961 // empty value appearing in NullFields will be sent to the server as 2962 // null. It is an error if a field in this list has a non-empty value. 2963 // This may be used to include null fields in Patch requests. 2964 NullFields []string `json:"-"` 2965} 2966 2967func (s *TeamDriveList) MarshalJSON() ([]byte, error) { 2968 type NoMethod TeamDriveList 2969 raw := NoMethod(*s) 2970 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2971} 2972 2973// User: Information about a Drive user. 2974type User struct { 2975 // DisplayName: A plain text displayable name for this user. 2976 DisplayName string `json:"displayName,omitempty"` 2977 2978 // EmailAddress: The email address of the user. This may not be present 2979 // in certain contexts if the user has not made their email address 2980 // visible to the requester. 2981 EmailAddress string `json:"emailAddress,omitempty"` 2982 2983 // Kind: Identifies what kind of resource this is. Value: the fixed 2984 // string "drive#user". 2985 Kind string `json:"kind,omitempty"` 2986 2987 // Me: Whether this user is the requesting user. 2988 Me bool `json:"me,omitempty"` 2989 2990 // PermissionId: The user's ID as visible in Permission resources. 2991 PermissionId string `json:"permissionId,omitempty"` 2992 2993 // PhotoLink: A link to the user's profile photo, if available. 2994 PhotoLink string `json:"photoLink,omitempty"` 2995 2996 // ForceSendFields is a list of field names (e.g. "DisplayName") to 2997 // unconditionally include in API requests. By default, fields with 2998 // empty or default values are omitted from API requests. However, any 2999 // non-pointer, non-interface field appearing in ForceSendFields will be 3000 // sent to the server regardless of whether the field is empty or not. 3001 // This may be used to include empty fields in Patch requests. 3002 ForceSendFields []string `json:"-"` 3003 3004 // NullFields is a list of field names (e.g. "DisplayName") to include 3005 // in API requests with the JSON null value. By default, fields with 3006 // empty values are omitted from API requests. However, any field with 3007 // an empty value appearing in NullFields will be sent to the server as 3008 // null. It is an error if a field in this list has a non-empty value. 3009 // This may be used to include null fields in Patch requests. 3010 NullFields []string `json:"-"` 3011} 3012 3013func (s *User) MarshalJSON() ([]byte, error) { 3014 type NoMethod User 3015 raw := NoMethod(*s) 3016 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3017} 3018 3019// method id "drive.about.get": 3020 3021type AboutGetCall struct { 3022 s *Service 3023 urlParams_ gensupport.URLParams 3024 ifNoneMatch_ string 3025 ctx_ context.Context 3026 header_ http.Header 3027} 3028 3029// Get: Gets information about the user, the user's Drive, and system 3030// capabilities. 3031func (r *AboutService) Get() *AboutGetCall { 3032 c := &AboutGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3033 return c 3034} 3035 3036// Fields allows partial responses to be retrieved. See 3037// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3038// for more information. 3039func (c *AboutGetCall) Fields(s ...googleapi.Field) *AboutGetCall { 3040 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3041 return c 3042} 3043 3044// IfNoneMatch sets the optional parameter which makes the operation 3045// fail if the object's ETag matches the given value. This is useful for 3046// getting updates only after the object has changed since the last 3047// request. Use googleapi.IsNotModified to check whether the response 3048// error from Do is the result of In-None-Match. 3049func (c *AboutGetCall) IfNoneMatch(entityTag string) *AboutGetCall { 3050 c.ifNoneMatch_ = entityTag 3051 return c 3052} 3053 3054// Context sets the context to be used in this call's Do method. Any 3055// pending HTTP request will be aborted if the provided context is 3056// canceled. 3057func (c *AboutGetCall) Context(ctx context.Context) *AboutGetCall { 3058 c.ctx_ = ctx 3059 return c 3060} 3061 3062// Header returns an http.Header that can be modified by the caller to 3063// add HTTP headers to the request. 3064func (c *AboutGetCall) Header() http.Header { 3065 if c.header_ == nil { 3066 c.header_ = make(http.Header) 3067 } 3068 return c.header_ 3069} 3070 3071func (c *AboutGetCall) doRequest(alt string) (*http.Response, error) { 3072 reqHeaders := make(http.Header) 3073 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3074 for k, v := range c.header_ { 3075 reqHeaders[k] = v 3076 } 3077 reqHeaders.Set("User-Agent", c.s.userAgent()) 3078 if c.ifNoneMatch_ != "" { 3079 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3080 } 3081 var body io.Reader = nil 3082 c.urlParams_.Set("alt", alt) 3083 c.urlParams_.Set("prettyPrint", "false") 3084 urls := googleapi.ResolveRelative(c.s.BasePath, "about") 3085 urls += "?" + c.urlParams_.Encode() 3086 req, err := http.NewRequest("GET", urls, body) 3087 if err != nil { 3088 return nil, err 3089 } 3090 req.Header = reqHeaders 3091 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3092} 3093 3094// Do executes the "drive.about.get" call. 3095// Exactly one of *About or error will be non-nil. Any non-2xx status 3096// code is an error. Response headers are in either 3097// *About.ServerResponse.Header or (if a response was returned at all) 3098// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3099// check whether the returned error was because http.StatusNotModified 3100// was returned. 3101func (c *AboutGetCall) Do(opts ...googleapi.CallOption) (*About, error) { 3102 gensupport.SetOptions(c.urlParams_, opts...) 3103 res, err := c.doRequest("json") 3104 if res != nil && res.StatusCode == http.StatusNotModified { 3105 if res.Body != nil { 3106 res.Body.Close() 3107 } 3108 return nil, &googleapi.Error{ 3109 Code: res.StatusCode, 3110 Header: res.Header, 3111 } 3112 } 3113 if err != nil { 3114 return nil, err 3115 } 3116 defer googleapi.CloseBody(res) 3117 if err := googleapi.CheckResponse(res); err != nil { 3118 return nil, err 3119 } 3120 ret := &About{ 3121 ServerResponse: googleapi.ServerResponse{ 3122 Header: res.Header, 3123 HTTPStatusCode: res.StatusCode, 3124 }, 3125 } 3126 target := &ret 3127 if err := gensupport.DecodeResponse(target, res); err != nil { 3128 return nil, err 3129 } 3130 return ret, nil 3131 // { 3132 // "description": "Gets information about the user, the user's Drive, and system capabilities.", 3133 // "httpMethod": "GET", 3134 // "id": "drive.about.get", 3135 // "path": "about", 3136 // "response": { 3137 // "$ref": "About" 3138 // }, 3139 // "scopes": [ 3140 // "https://www.googleapis.com/auth/drive", 3141 // "https://www.googleapis.com/auth/drive.appdata", 3142 // "https://www.googleapis.com/auth/drive.file", 3143 // "https://www.googleapis.com/auth/drive.metadata", 3144 // "https://www.googleapis.com/auth/drive.metadata.readonly", 3145 // "https://www.googleapis.com/auth/drive.photos.readonly", 3146 // "https://www.googleapis.com/auth/drive.readonly" 3147 // ] 3148 // } 3149 3150} 3151 3152// method id "drive.changes.getStartPageToken": 3153 3154type ChangesGetStartPageTokenCall struct { 3155 s *Service 3156 urlParams_ gensupport.URLParams 3157 ifNoneMatch_ string 3158 ctx_ context.Context 3159 header_ http.Header 3160} 3161 3162// GetStartPageToken: Gets the starting pageToken for listing future 3163// changes. 3164func (r *ChangesService) GetStartPageToken() *ChangesGetStartPageTokenCall { 3165 c := &ChangesGetStartPageTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3166 return c 3167} 3168 3169// DriveId sets the optional parameter "driveId": The ID of the shared 3170// drive for which the starting pageToken for listing future changes 3171// from that shared drive is returned. 3172func (c *ChangesGetStartPageTokenCall) DriveId(driveId string) *ChangesGetStartPageTokenCall { 3173 c.urlParams_.Set("driveId", driveId) 3174 return c 3175} 3176 3177// SupportsAllDrives sets the optional parameter "supportsAllDrives": 3178// Whether the requesting application supports both My Drives and shared 3179// drives. 3180func (c *ChangesGetStartPageTokenCall) SupportsAllDrives(supportsAllDrives bool) *ChangesGetStartPageTokenCall { 3181 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 3182 return c 3183} 3184 3185// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 3186// Deprecated use supportsAllDrives instead. 3187func (c *ChangesGetStartPageTokenCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesGetStartPageTokenCall { 3188 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 3189 return c 3190} 3191 3192// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 3193// driveId instead. 3194func (c *ChangesGetStartPageTokenCall) TeamDriveId(teamDriveId string) *ChangesGetStartPageTokenCall { 3195 c.urlParams_.Set("teamDriveId", teamDriveId) 3196 return c 3197} 3198 3199// Fields allows partial responses to be retrieved. See 3200// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3201// for more information. 3202func (c *ChangesGetStartPageTokenCall) Fields(s ...googleapi.Field) *ChangesGetStartPageTokenCall { 3203 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3204 return c 3205} 3206 3207// IfNoneMatch sets the optional parameter which makes the operation 3208// fail if the object's ETag matches the given value. This is useful for 3209// getting updates only after the object has changed since the last 3210// request. Use googleapi.IsNotModified to check whether the response 3211// error from Do is the result of In-None-Match. 3212func (c *ChangesGetStartPageTokenCall) IfNoneMatch(entityTag string) *ChangesGetStartPageTokenCall { 3213 c.ifNoneMatch_ = entityTag 3214 return c 3215} 3216 3217// Context sets the context to be used in this call's Do method. Any 3218// pending HTTP request will be aborted if the provided context is 3219// canceled. 3220func (c *ChangesGetStartPageTokenCall) Context(ctx context.Context) *ChangesGetStartPageTokenCall { 3221 c.ctx_ = ctx 3222 return c 3223} 3224 3225// Header returns an http.Header that can be modified by the caller to 3226// add HTTP headers to the request. 3227func (c *ChangesGetStartPageTokenCall) Header() http.Header { 3228 if c.header_ == nil { 3229 c.header_ = make(http.Header) 3230 } 3231 return c.header_ 3232} 3233 3234func (c *ChangesGetStartPageTokenCall) doRequest(alt string) (*http.Response, error) { 3235 reqHeaders := make(http.Header) 3236 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3237 for k, v := range c.header_ { 3238 reqHeaders[k] = v 3239 } 3240 reqHeaders.Set("User-Agent", c.s.userAgent()) 3241 if c.ifNoneMatch_ != "" { 3242 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3243 } 3244 var body io.Reader = nil 3245 c.urlParams_.Set("alt", alt) 3246 c.urlParams_.Set("prettyPrint", "false") 3247 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/startPageToken") 3248 urls += "?" + c.urlParams_.Encode() 3249 req, err := http.NewRequest("GET", urls, body) 3250 if err != nil { 3251 return nil, err 3252 } 3253 req.Header = reqHeaders 3254 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3255} 3256 3257// Do executes the "drive.changes.getStartPageToken" call. 3258// Exactly one of *StartPageToken or error will be non-nil. Any non-2xx 3259// status code is an error. Response headers are in either 3260// *StartPageToken.ServerResponse.Header or (if a response was returned 3261// at all) in error.(*googleapi.Error).Header. Use 3262// googleapi.IsNotModified to check whether the returned error was 3263// because http.StatusNotModified was returned. 3264func (c *ChangesGetStartPageTokenCall) Do(opts ...googleapi.CallOption) (*StartPageToken, error) { 3265 gensupport.SetOptions(c.urlParams_, opts...) 3266 res, err := c.doRequest("json") 3267 if res != nil && res.StatusCode == http.StatusNotModified { 3268 if res.Body != nil { 3269 res.Body.Close() 3270 } 3271 return nil, &googleapi.Error{ 3272 Code: res.StatusCode, 3273 Header: res.Header, 3274 } 3275 } 3276 if err != nil { 3277 return nil, err 3278 } 3279 defer googleapi.CloseBody(res) 3280 if err := googleapi.CheckResponse(res); err != nil { 3281 return nil, err 3282 } 3283 ret := &StartPageToken{ 3284 ServerResponse: googleapi.ServerResponse{ 3285 Header: res.Header, 3286 HTTPStatusCode: res.StatusCode, 3287 }, 3288 } 3289 target := &ret 3290 if err := gensupport.DecodeResponse(target, res); err != nil { 3291 return nil, err 3292 } 3293 return ret, nil 3294 // { 3295 // "description": "Gets the starting pageToken for listing future changes.", 3296 // "httpMethod": "GET", 3297 // "id": "drive.changes.getStartPageToken", 3298 // "parameters": { 3299 // "driveId": { 3300 // "description": "The ID of the shared drive for which the starting pageToken for listing future changes from that shared drive is returned.", 3301 // "location": "query", 3302 // "type": "string" 3303 // }, 3304 // "supportsAllDrives": { 3305 // "default": "false", 3306 // "description": "Whether the requesting application supports both My Drives and shared drives.", 3307 // "location": "query", 3308 // "type": "boolean" 3309 // }, 3310 // "supportsTeamDrives": { 3311 // "default": "false", 3312 // "description": "Deprecated use supportsAllDrives instead.", 3313 // "location": "query", 3314 // "type": "boolean" 3315 // }, 3316 // "teamDriveId": { 3317 // "description": "Deprecated use driveId instead.", 3318 // "location": "query", 3319 // "type": "string" 3320 // } 3321 // }, 3322 // "path": "changes/startPageToken", 3323 // "response": { 3324 // "$ref": "StartPageToken" 3325 // }, 3326 // "scopes": [ 3327 // "https://www.googleapis.com/auth/drive", 3328 // "https://www.googleapis.com/auth/drive.appdata", 3329 // "https://www.googleapis.com/auth/drive.file", 3330 // "https://www.googleapis.com/auth/drive.metadata", 3331 // "https://www.googleapis.com/auth/drive.metadata.readonly", 3332 // "https://www.googleapis.com/auth/drive.photos.readonly", 3333 // "https://www.googleapis.com/auth/drive.readonly" 3334 // ] 3335 // } 3336 3337} 3338 3339// method id "drive.changes.list": 3340 3341type ChangesListCall struct { 3342 s *Service 3343 urlParams_ gensupport.URLParams 3344 ifNoneMatch_ string 3345 ctx_ context.Context 3346 header_ http.Header 3347} 3348 3349// List: Lists the changes for a user or shared drive. 3350// 3351// - pageToken: The token for continuing a previous list request on the 3352// next page. This should be set to the value of 'nextPageToken' from 3353// the previous response or to the response from the getStartPageToken 3354// method. 3355func (r *ChangesService) List(pageToken string) *ChangesListCall { 3356 c := &ChangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3357 c.urlParams_.Set("pageToken", pageToken) 3358 return c 3359} 3360 3361// DriveId sets the optional parameter "driveId": The shared drive from 3362// which changes are returned. If specified the change IDs will be 3363// reflective of the shared drive; use the combined drive ID and change 3364// ID as an identifier. 3365func (c *ChangesListCall) DriveId(driveId string) *ChangesListCall { 3366 c.urlParams_.Set("driveId", driveId) 3367 return c 3368} 3369 3370// IncludeCorpusRemovals sets the optional parameter 3371// "includeCorpusRemovals": Whether changes should include the file 3372// resource if the file is still accessible by the user at the time of 3373// the request, even when a file was removed from the list of changes 3374// and there will be no further change entries for this file. 3375func (c *ChangesListCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesListCall { 3376 c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals)) 3377 return c 3378} 3379 3380// IncludeItemsFromAllDrives sets the optional parameter 3381// "includeItemsFromAllDrives": Whether both My Drive and shared drive 3382// items should be included in results. 3383func (c *ChangesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesListCall { 3384 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives)) 3385 return c 3386} 3387 3388// IncludePermissionsForView sets the optional parameter 3389// "includePermissionsForView": Specifies which additional view's 3390// permissions to include in the response. Only 'published' is 3391// supported. 3392func (c *ChangesListCall) IncludePermissionsForView(includePermissionsForView string) *ChangesListCall { 3393 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 3394 return c 3395} 3396 3397// IncludeRemoved sets the optional parameter "includeRemoved": Whether 3398// to include changes indicating that items have been removed from the 3399// list of changes, for example by deletion or loss of access. 3400func (c *ChangesListCall) IncludeRemoved(includeRemoved bool) *ChangesListCall { 3401 c.urlParams_.Set("includeRemoved", fmt.Sprint(includeRemoved)) 3402 return c 3403} 3404 3405// IncludeTeamDriveItems sets the optional parameter 3406// "includeTeamDriveItems": Deprecated use includeItemsFromAllDrives 3407// instead. 3408func (c *ChangesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesListCall { 3409 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems)) 3410 return c 3411} 3412 3413// PageSize sets the optional parameter "pageSize": The maximum number 3414// of changes to return per page. 3415func (c *ChangesListCall) PageSize(pageSize int64) *ChangesListCall { 3416 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3417 return c 3418} 3419 3420// RestrictToMyDrive sets the optional parameter "restrictToMyDrive": 3421// Whether to restrict the results to changes inside the My Drive 3422// hierarchy. This omits changes to files such as those in the 3423// Application Data folder or shared files which have not been added to 3424// My Drive. 3425func (c *ChangesListCall) RestrictToMyDrive(restrictToMyDrive bool) *ChangesListCall { 3426 c.urlParams_.Set("restrictToMyDrive", fmt.Sprint(restrictToMyDrive)) 3427 return c 3428} 3429 3430// Spaces sets the optional parameter "spaces": A comma-separated list 3431// of spaces to query within the user corpus. Supported values are 3432// 'drive', 'appDataFolder' and 'photos'. 3433func (c *ChangesListCall) Spaces(spaces string) *ChangesListCall { 3434 c.urlParams_.Set("spaces", spaces) 3435 return c 3436} 3437 3438// SupportsAllDrives sets the optional parameter "supportsAllDrives": 3439// Whether the requesting application supports both My Drives and shared 3440// drives. 3441func (c *ChangesListCall) SupportsAllDrives(supportsAllDrives bool) *ChangesListCall { 3442 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 3443 return c 3444} 3445 3446// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 3447// Deprecated use supportsAllDrives instead. 3448func (c *ChangesListCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesListCall { 3449 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 3450 return c 3451} 3452 3453// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 3454// driveId instead. 3455func (c *ChangesListCall) TeamDriveId(teamDriveId string) *ChangesListCall { 3456 c.urlParams_.Set("teamDriveId", teamDriveId) 3457 return c 3458} 3459 3460// Fields allows partial responses to be retrieved. See 3461// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3462// for more information. 3463func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall { 3464 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3465 return c 3466} 3467 3468// IfNoneMatch sets the optional parameter which makes the operation 3469// fail if the object's ETag matches the given value. This is useful for 3470// getting updates only after the object has changed since the last 3471// request. Use googleapi.IsNotModified to check whether the response 3472// error from Do is the result of In-None-Match. 3473func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall { 3474 c.ifNoneMatch_ = entityTag 3475 return c 3476} 3477 3478// Context sets the context to be used in this call's Do method. Any 3479// pending HTTP request will be aborted if the provided context is 3480// canceled. 3481func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall { 3482 c.ctx_ = ctx 3483 return c 3484} 3485 3486// Header returns an http.Header that can be modified by the caller to 3487// add HTTP headers to the request. 3488func (c *ChangesListCall) Header() http.Header { 3489 if c.header_ == nil { 3490 c.header_ = make(http.Header) 3491 } 3492 return c.header_ 3493} 3494 3495func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) { 3496 reqHeaders := make(http.Header) 3497 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3498 for k, v := range c.header_ { 3499 reqHeaders[k] = v 3500 } 3501 reqHeaders.Set("User-Agent", c.s.userAgent()) 3502 if c.ifNoneMatch_ != "" { 3503 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3504 } 3505 var body io.Reader = nil 3506 c.urlParams_.Set("alt", alt) 3507 c.urlParams_.Set("prettyPrint", "false") 3508 urls := googleapi.ResolveRelative(c.s.BasePath, "changes") 3509 urls += "?" + c.urlParams_.Encode() 3510 req, err := http.NewRequest("GET", urls, body) 3511 if err != nil { 3512 return nil, err 3513 } 3514 req.Header = reqHeaders 3515 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3516} 3517 3518// Do executes the "drive.changes.list" call. 3519// Exactly one of *ChangeList or error will be non-nil. Any non-2xx 3520// status code is an error. Response headers are in either 3521// *ChangeList.ServerResponse.Header or (if a response was returned at 3522// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3523// to check whether the returned error was because 3524// http.StatusNotModified was returned. 3525func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangeList, error) { 3526 gensupport.SetOptions(c.urlParams_, opts...) 3527 res, err := c.doRequest("json") 3528 if res != nil && res.StatusCode == http.StatusNotModified { 3529 if res.Body != nil { 3530 res.Body.Close() 3531 } 3532 return nil, &googleapi.Error{ 3533 Code: res.StatusCode, 3534 Header: res.Header, 3535 } 3536 } 3537 if err != nil { 3538 return nil, err 3539 } 3540 defer googleapi.CloseBody(res) 3541 if err := googleapi.CheckResponse(res); err != nil { 3542 return nil, err 3543 } 3544 ret := &ChangeList{ 3545 ServerResponse: googleapi.ServerResponse{ 3546 Header: res.Header, 3547 HTTPStatusCode: res.StatusCode, 3548 }, 3549 } 3550 target := &ret 3551 if err := gensupport.DecodeResponse(target, res); err != nil { 3552 return nil, err 3553 } 3554 return ret, nil 3555 // { 3556 // "description": "Lists the changes for a user or shared drive.", 3557 // "httpMethod": "GET", 3558 // "id": "drive.changes.list", 3559 // "parameterOrder": [ 3560 // "pageToken" 3561 // ], 3562 // "parameters": { 3563 // "driveId": { 3564 // "description": "The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier.", 3565 // "location": "query", 3566 // "type": "string" 3567 // }, 3568 // "includeCorpusRemovals": { 3569 // "default": "false", 3570 // "description": "Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file.", 3571 // "location": "query", 3572 // "type": "boolean" 3573 // }, 3574 // "includeItemsFromAllDrives": { 3575 // "default": "false", 3576 // "description": "Whether both My Drive and shared drive items should be included in results.", 3577 // "location": "query", 3578 // "type": "boolean" 3579 // }, 3580 // "includePermissionsForView": { 3581 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 3582 // "location": "query", 3583 // "type": "string" 3584 // }, 3585 // "includeRemoved": { 3586 // "default": "true", 3587 // "description": "Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.", 3588 // "location": "query", 3589 // "type": "boolean" 3590 // }, 3591 // "includeTeamDriveItems": { 3592 // "default": "false", 3593 // "description": "Deprecated use includeItemsFromAllDrives instead.", 3594 // "location": "query", 3595 // "type": "boolean" 3596 // }, 3597 // "pageSize": { 3598 // "default": "100", 3599 // "description": "The maximum number of changes to return per page.", 3600 // "format": "int32", 3601 // "location": "query", 3602 // "maximum": "1000", 3603 // "minimum": "1", 3604 // "type": "integer" 3605 // }, 3606 // "pageToken": { 3607 // "description": "The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method.", 3608 // "location": "query", 3609 // "required": true, 3610 // "type": "string" 3611 // }, 3612 // "restrictToMyDrive": { 3613 // "default": "false", 3614 // "description": "Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive.", 3615 // "location": "query", 3616 // "type": "boolean" 3617 // }, 3618 // "spaces": { 3619 // "default": "drive", 3620 // "description": "A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.", 3621 // "location": "query", 3622 // "type": "string" 3623 // }, 3624 // "supportsAllDrives": { 3625 // "default": "false", 3626 // "description": "Whether the requesting application supports both My Drives and shared drives.", 3627 // "location": "query", 3628 // "type": "boolean" 3629 // }, 3630 // "supportsTeamDrives": { 3631 // "default": "false", 3632 // "description": "Deprecated use supportsAllDrives instead.", 3633 // "location": "query", 3634 // "type": "boolean" 3635 // }, 3636 // "teamDriveId": { 3637 // "description": "Deprecated use driveId instead.", 3638 // "location": "query", 3639 // "type": "string" 3640 // } 3641 // }, 3642 // "path": "changes", 3643 // "response": { 3644 // "$ref": "ChangeList" 3645 // }, 3646 // "scopes": [ 3647 // "https://www.googleapis.com/auth/drive", 3648 // "https://www.googleapis.com/auth/drive.appdata", 3649 // "https://www.googleapis.com/auth/drive.file", 3650 // "https://www.googleapis.com/auth/drive.metadata", 3651 // "https://www.googleapis.com/auth/drive.metadata.readonly", 3652 // "https://www.googleapis.com/auth/drive.photos.readonly", 3653 // "https://www.googleapis.com/auth/drive.readonly" 3654 // ], 3655 // "supportsSubscription": true 3656 // } 3657 3658} 3659 3660// method id "drive.changes.watch": 3661 3662type ChangesWatchCall struct { 3663 s *Service 3664 channel *Channel 3665 urlParams_ gensupport.URLParams 3666 ctx_ context.Context 3667 header_ http.Header 3668} 3669 3670// Watch: Subscribes to changes for a user. 3671// 3672// - pageToken: The token for continuing a previous list request on the 3673// next page. This should be set to the value of 'nextPageToken' from 3674// the previous response or to the response from the getStartPageToken 3675// method. 3676func (r *ChangesService) Watch(pageToken string, channel *Channel) *ChangesWatchCall { 3677 c := &ChangesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3678 c.urlParams_.Set("pageToken", pageToken) 3679 c.channel = channel 3680 return c 3681} 3682 3683// DriveId sets the optional parameter "driveId": The shared drive from 3684// which changes are returned. If specified the change IDs will be 3685// reflective of the shared drive; use the combined drive ID and change 3686// ID as an identifier. 3687func (c *ChangesWatchCall) DriveId(driveId string) *ChangesWatchCall { 3688 c.urlParams_.Set("driveId", driveId) 3689 return c 3690} 3691 3692// IncludeCorpusRemovals sets the optional parameter 3693// "includeCorpusRemovals": Whether changes should include the file 3694// resource if the file is still accessible by the user at the time of 3695// the request, even when a file was removed from the list of changes 3696// and there will be no further change entries for this file. 3697func (c *ChangesWatchCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesWatchCall { 3698 c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals)) 3699 return c 3700} 3701 3702// IncludeItemsFromAllDrives sets the optional parameter 3703// "includeItemsFromAllDrives": Whether both My Drive and shared drive 3704// items should be included in results. 3705func (c *ChangesWatchCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesWatchCall { 3706 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives)) 3707 return c 3708} 3709 3710// IncludePermissionsForView sets the optional parameter 3711// "includePermissionsForView": Specifies which additional view's 3712// permissions to include in the response. Only 'published' is 3713// supported. 3714func (c *ChangesWatchCall) IncludePermissionsForView(includePermissionsForView string) *ChangesWatchCall { 3715 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 3716 return c 3717} 3718 3719// IncludeRemoved sets the optional parameter "includeRemoved": Whether 3720// to include changes indicating that items have been removed from the 3721// list of changes, for example by deletion or loss of access. 3722func (c *ChangesWatchCall) IncludeRemoved(includeRemoved bool) *ChangesWatchCall { 3723 c.urlParams_.Set("includeRemoved", fmt.Sprint(includeRemoved)) 3724 return c 3725} 3726 3727// IncludeTeamDriveItems sets the optional parameter 3728// "includeTeamDriveItems": Deprecated use includeItemsFromAllDrives 3729// instead. 3730func (c *ChangesWatchCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesWatchCall { 3731 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems)) 3732 return c 3733} 3734 3735// PageSize sets the optional parameter "pageSize": The maximum number 3736// of changes to return per page. 3737func (c *ChangesWatchCall) PageSize(pageSize int64) *ChangesWatchCall { 3738 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3739 return c 3740} 3741 3742// RestrictToMyDrive sets the optional parameter "restrictToMyDrive": 3743// Whether to restrict the results to changes inside the My Drive 3744// hierarchy. This omits changes to files such as those in the 3745// Application Data folder or shared files which have not been added to 3746// My Drive. 3747func (c *ChangesWatchCall) RestrictToMyDrive(restrictToMyDrive bool) *ChangesWatchCall { 3748 c.urlParams_.Set("restrictToMyDrive", fmt.Sprint(restrictToMyDrive)) 3749 return c 3750} 3751 3752// Spaces sets the optional parameter "spaces": A comma-separated list 3753// of spaces to query within the user corpus. Supported values are 3754// 'drive', 'appDataFolder' and 'photos'. 3755func (c *ChangesWatchCall) Spaces(spaces string) *ChangesWatchCall { 3756 c.urlParams_.Set("spaces", spaces) 3757 return c 3758} 3759 3760// SupportsAllDrives sets the optional parameter "supportsAllDrives": 3761// Whether the requesting application supports both My Drives and shared 3762// drives. 3763func (c *ChangesWatchCall) SupportsAllDrives(supportsAllDrives bool) *ChangesWatchCall { 3764 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 3765 return c 3766} 3767 3768// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 3769// Deprecated use supportsAllDrives instead. 3770func (c *ChangesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesWatchCall { 3771 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 3772 return c 3773} 3774 3775// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 3776// driveId instead. 3777func (c *ChangesWatchCall) TeamDriveId(teamDriveId string) *ChangesWatchCall { 3778 c.urlParams_.Set("teamDriveId", teamDriveId) 3779 return c 3780} 3781 3782// Fields allows partial responses to be retrieved. See 3783// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3784// for more information. 3785func (c *ChangesWatchCall) Fields(s ...googleapi.Field) *ChangesWatchCall { 3786 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3787 return c 3788} 3789 3790// Context sets the context to be used in this call's Do method. Any 3791// pending HTTP request will be aborted if the provided context is 3792// canceled. 3793func (c *ChangesWatchCall) Context(ctx context.Context) *ChangesWatchCall { 3794 c.ctx_ = ctx 3795 return c 3796} 3797 3798// Header returns an http.Header that can be modified by the caller to 3799// add HTTP headers to the request. 3800func (c *ChangesWatchCall) Header() http.Header { 3801 if c.header_ == nil { 3802 c.header_ = make(http.Header) 3803 } 3804 return c.header_ 3805} 3806 3807func (c *ChangesWatchCall) doRequest(alt string) (*http.Response, error) { 3808 reqHeaders := make(http.Header) 3809 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3810 for k, v := range c.header_ { 3811 reqHeaders[k] = v 3812 } 3813 reqHeaders.Set("User-Agent", c.s.userAgent()) 3814 var body io.Reader = nil 3815 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 3816 if err != nil { 3817 return nil, err 3818 } 3819 reqHeaders.Set("Content-Type", "application/json") 3820 c.urlParams_.Set("alt", alt) 3821 c.urlParams_.Set("prettyPrint", "false") 3822 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/watch") 3823 urls += "?" + c.urlParams_.Encode() 3824 req, err := http.NewRequest("POST", urls, body) 3825 if err != nil { 3826 return nil, err 3827 } 3828 req.Header = reqHeaders 3829 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3830} 3831 3832// Do executes the "drive.changes.watch" call. 3833// Exactly one of *Channel or error will be non-nil. Any non-2xx status 3834// code is an error. Response headers are in either 3835// *Channel.ServerResponse.Header or (if a response was returned at all) 3836// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3837// check whether the returned error was because http.StatusNotModified 3838// was returned. 3839func (c *ChangesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 3840 gensupport.SetOptions(c.urlParams_, opts...) 3841 res, err := c.doRequest("json") 3842 if res != nil && res.StatusCode == http.StatusNotModified { 3843 if res.Body != nil { 3844 res.Body.Close() 3845 } 3846 return nil, &googleapi.Error{ 3847 Code: res.StatusCode, 3848 Header: res.Header, 3849 } 3850 } 3851 if err != nil { 3852 return nil, err 3853 } 3854 defer googleapi.CloseBody(res) 3855 if err := googleapi.CheckResponse(res); err != nil { 3856 return nil, err 3857 } 3858 ret := &Channel{ 3859 ServerResponse: googleapi.ServerResponse{ 3860 Header: res.Header, 3861 HTTPStatusCode: res.StatusCode, 3862 }, 3863 } 3864 target := &ret 3865 if err := gensupport.DecodeResponse(target, res); err != nil { 3866 return nil, err 3867 } 3868 return ret, nil 3869 // { 3870 // "description": "Subscribes to changes for a user.", 3871 // "httpMethod": "POST", 3872 // "id": "drive.changes.watch", 3873 // "parameterOrder": [ 3874 // "pageToken" 3875 // ], 3876 // "parameters": { 3877 // "driveId": { 3878 // "description": "The shared drive from which changes are returned. If specified the change IDs will be reflective of the shared drive; use the combined drive ID and change ID as an identifier.", 3879 // "location": "query", 3880 // "type": "string" 3881 // }, 3882 // "includeCorpusRemovals": { 3883 // "default": "false", 3884 // "description": "Whether changes should include the file resource if the file is still accessible by the user at the time of the request, even when a file was removed from the list of changes and there will be no further change entries for this file.", 3885 // "location": "query", 3886 // "type": "boolean" 3887 // }, 3888 // "includeItemsFromAllDrives": { 3889 // "default": "false", 3890 // "description": "Whether both My Drive and shared drive items should be included in results.", 3891 // "location": "query", 3892 // "type": "boolean" 3893 // }, 3894 // "includePermissionsForView": { 3895 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 3896 // "location": "query", 3897 // "type": "string" 3898 // }, 3899 // "includeRemoved": { 3900 // "default": "true", 3901 // "description": "Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.", 3902 // "location": "query", 3903 // "type": "boolean" 3904 // }, 3905 // "includeTeamDriveItems": { 3906 // "default": "false", 3907 // "description": "Deprecated use includeItemsFromAllDrives instead.", 3908 // "location": "query", 3909 // "type": "boolean" 3910 // }, 3911 // "pageSize": { 3912 // "default": "100", 3913 // "description": "The maximum number of changes to return per page.", 3914 // "format": "int32", 3915 // "location": "query", 3916 // "maximum": "1000", 3917 // "minimum": "1", 3918 // "type": "integer" 3919 // }, 3920 // "pageToken": { 3921 // "description": "The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response or to the response from the getStartPageToken method.", 3922 // "location": "query", 3923 // "required": true, 3924 // "type": "string" 3925 // }, 3926 // "restrictToMyDrive": { 3927 // "default": "false", 3928 // "description": "Whether to restrict the results to changes inside the My Drive hierarchy. This omits changes to files such as those in the Application Data folder or shared files which have not been added to My Drive.", 3929 // "location": "query", 3930 // "type": "boolean" 3931 // }, 3932 // "spaces": { 3933 // "default": "drive", 3934 // "description": "A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.", 3935 // "location": "query", 3936 // "type": "string" 3937 // }, 3938 // "supportsAllDrives": { 3939 // "default": "false", 3940 // "description": "Whether the requesting application supports both My Drives and shared drives.", 3941 // "location": "query", 3942 // "type": "boolean" 3943 // }, 3944 // "supportsTeamDrives": { 3945 // "default": "false", 3946 // "description": "Deprecated use supportsAllDrives instead.", 3947 // "location": "query", 3948 // "type": "boolean" 3949 // }, 3950 // "teamDriveId": { 3951 // "description": "Deprecated use driveId instead.", 3952 // "location": "query", 3953 // "type": "string" 3954 // } 3955 // }, 3956 // "path": "changes/watch", 3957 // "request": { 3958 // "$ref": "Channel", 3959 // "parameterName": "resource" 3960 // }, 3961 // "response": { 3962 // "$ref": "Channel" 3963 // }, 3964 // "scopes": [ 3965 // "https://www.googleapis.com/auth/drive", 3966 // "https://www.googleapis.com/auth/drive.appdata", 3967 // "https://www.googleapis.com/auth/drive.file", 3968 // "https://www.googleapis.com/auth/drive.metadata", 3969 // "https://www.googleapis.com/auth/drive.metadata.readonly", 3970 // "https://www.googleapis.com/auth/drive.photos.readonly", 3971 // "https://www.googleapis.com/auth/drive.readonly" 3972 // ], 3973 // "supportsSubscription": true 3974 // } 3975 3976} 3977 3978// method id "drive.channels.stop": 3979 3980type ChannelsStopCall struct { 3981 s *Service 3982 channel *Channel 3983 urlParams_ gensupport.URLParams 3984 ctx_ context.Context 3985 header_ http.Header 3986} 3987 3988// Stop: Stop watching resources through this channel 3989func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { 3990 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3991 c.channel = channel 3992 return c 3993} 3994 3995// Fields allows partial responses to be retrieved. See 3996// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3997// for more information. 3998func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { 3999 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4000 return c 4001} 4002 4003// Context sets the context to be used in this call's Do method. Any 4004// pending HTTP request will be aborted if the provided context is 4005// canceled. 4006func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { 4007 c.ctx_ = ctx 4008 return c 4009} 4010 4011// Header returns an http.Header that can be modified by the caller to 4012// add HTTP headers to the request. 4013func (c *ChannelsStopCall) Header() http.Header { 4014 if c.header_ == nil { 4015 c.header_ = make(http.Header) 4016 } 4017 return c.header_ 4018} 4019 4020func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { 4021 reqHeaders := make(http.Header) 4022 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4023 for k, v := range c.header_ { 4024 reqHeaders[k] = v 4025 } 4026 reqHeaders.Set("User-Agent", c.s.userAgent()) 4027 var body io.Reader = nil 4028 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 4029 if err != nil { 4030 return nil, err 4031 } 4032 reqHeaders.Set("Content-Type", "application/json") 4033 c.urlParams_.Set("alt", alt) 4034 c.urlParams_.Set("prettyPrint", "false") 4035 urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop") 4036 urls += "?" + c.urlParams_.Encode() 4037 req, err := http.NewRequest("POST", urls, body) 4038 if err != nil { 4039 return nil, err 4040 } 4041 req.Header = reqHeaders 4042 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4043} 4044 4045// Do executes the "drive.channels.stop" call. 4046func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error { 4047 gensupport.SetOptions(c.urlParams_, opts...) 4048 res, err := c.doRequest("json") 4049 if err != nil { 4050 return err 4051 } 4052 defer googleapi.CloseBody(res) 4053 if err := googleapi.CheckResponse(res); err != nil { 4054 return err 4055 } 4056 return nil 4057 // { 4058 // "description": "Stop watching resources through this channel", 4059 // "httpMethod": "POST", 4060 // "id": "drive.channels.stop", 4061 // "path": "channels/stop", 4062 // "request": { 4063 // "$ref": "Channel", 4064 // "parameterName": "resource" 4065 // }, 4066 // "scopes": [ 4067 // "https://www.googleapis.com/auth/drive", 4068 // "https://www.googleapis.com/auth/drive.appdata", 4069 // "https://www.googleapis.com/auth/drive.file", 4070 // "https://www.googleapis.com/auth/drive.metadata", 4071 // "https://www.googleapis.com/auth/drive.metadata.readonly", 4072 // "https://www.googleapis.com/auth/drive.photos.readonly", 4073 // "https://www.googleapis.com/auth/drive.readonly" 4074 // ] 4075 // } 4076 4077} 4078 4079// method id "drive.comments.create": 4080 4081type CommentsCreateCall struct { 4082 s *Service 4083 fileId string 4084 comment *Comment 4085 urlParams_ gensupport.URLParams 4086 ctx_ context.Context 4087 header_ http.Header 4088} 4089 4090// Create: Creates a new comment on a file. 4091// 4092// - fileId: The ID of the file. 4093func (r *CommentsService) Create(fileId string, comment *Comment) *CommentsCreateCall { 4094 c := &CommentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4095 c.fileId = fileId 4096 c.comment = comment 4097 return c 4098} 4099 4100// Fields allows partial responses to be retrieved. See 4101// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4102// for more information. 4103func (c *CommentsCreateCall) Fields(s ...googleapi.Field) *CommentsCreateCall { 4104 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4105 return c 4106} 4107 4108// Context sets the context to be used in this call's Do method. Any 4109// pending HTTP request will be aborted if the provided context is 4110// canceled. 4111func (c *CommentsCreateCall) Context(ctx context.Context) *CommentsCreateCall { 4112 c.ctx_ = ctx 4113 return c 4114} 4115 4116// Header returns an http.Header that can be modified by the caller to 4117// add HTTP headers to the request. 4118func (c *CommentsCreateCall) Header() http.Header { 4119 if c.header_ == nil { 4120 c.header_ = make(http.Header) 4121 } 4122 return c.header_ 4123} 4124 4125func (c *CommentsCreateCall) doRequest(alt string) (*http.Response, error) { 4126 reqHeaders := make(http.Header) 4127 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4128 for k, v := range c.header_ { 4129 reqHeaders[k] = v 4130 } 4131 reqHeaders.Set("User-Agent", c.s.userAgent()) 4132 var body io.Reader = nil 4133 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) 4134 if err != nil { 4135 return nil, err 4136 } 4137 reqHeaders.Set("Content-Type", "application/json") 4138 c.urlParams_.Set("alt", alt) 4139 c.urlParams_.Set("prettyPrint", "false") 4140 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") 4141 urls += "?" + c.urlParams_.Encode() 4142 req, err := http.NewRequest("POST", urls, body) 4143 if err != nil { 4144 return nil, err 4145 } 4146 req.Header = reqHeaders 4147 googleapi.Expand(req.URL, map[string]string{ 4148 "fileId": c.fileId, 4149 }) 4150 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4151} 4152 4153// Do executes the "drive.comments.create" call. 4154// Exactly one of *Comment or error will be non-nil. Any non-2xx status 4155// code is an error. Response headers are in either 4156// *Comment.ServerResponse.Header or (if a response was returned at all) 4157// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4158// check whether the returned error was because http.StatusNotModified 4159// was returned. 4160func (c *CommentsCreateCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 4161 gensupport.SetOptions(c.urlParams_, opts...) 4162 res, err := c.doRequest("json") 4163 if res != nil && res.StatusCode == http.StatusNotModified { 4164 if res.Body != nil { 4165 res.Body.Close() 4166 } 4167 return nil, &googleapi.Error{ 4168 Code: res.StatusCode, 4169 Header: res.Header, 4170 } 4171 } 4172 if err != nil { 4173 return nil, err 4174 } 4175 defer googleapi.CloseBody(res) 4176 if err := googleapi.CheckResponse(res); err != nil { 4177 return nil, err 4178 } 4179 ret := &Comment{ 4180 ServerResponse: googleapi.ServerResponse{ 4181 Header: res.Header, 4182 HTTPStatusCode: res.StatusCode, 4183 }, 4184 } 4185 target := &ret 4186 if err := gensupport.DecodeResponse(target, res); err != nil { 4187 return nil, err 4188 } 4189 return ret, nil 4190 // { 4191 // "description": "Creates a new comment on a file.", 4192 // "httpMethod": "POST", 4193 // "id": "drive.comments.create", 4194 // "parameterOrder": [ 4195 // "fileId" 4196 // ], 4197 // "parameters": { 4198 // "fileId": { 4199 // "description": "The ID of the file.", 4200 // "location": "path", 4201 // "required": true, 4202 // "type": "string" 4203 // } 4204 // }, 4205 // "path": "files/{fileId}/comments", 4206 // "request": { 4207 // "$ref": "Comment" 4208 // }, 4209 // "response": { 4210 // "$ref": "Comment" 4211 // }, 4212 // "scopes": [ 4213 // "https://www.googleapis.com/auth/drive", 4214 // "https://www.googleapis.com/auth/drive.file" 4215 // ] 4216 // } 4217 4218} 4219 4220// method id "drive.comments.delete": 4221 4222type CommentsDeleteCall struct { 4223 s *Service 4224 fileId string 4225 commentId string 4226 urlParams_ gensupport.URLParams 4227 ctx_ context.Context 4228 header_ http.Header 4229} 4230 4231// Delete: Deletes a comment. 4232// 4233// - commentId: The ID of the comment. 4234// - fileId: The ID of the file. 4235func (r *CommentsService) Delete(fileId string, commentId string) *CommentsDeleteCall { 4236 c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4237 c.fileId = fileId 4238 c.commentId = commentId 4239 return c 4240} 4241 4242// Fields allows partial responses to be retrieved. See 4243// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4244// for more information. 4245func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall { 4246 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4247 return c 4248} 4249 4250// Context sets the context to be used in this call's Do method. Any 4251// pending HTTP request will be aborted if the provided context is 4252// canceled. 4253func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall { 4254 c.ctx_ = ctx 4255 return c 4256} 4257 4258// Header returns an http.Header that can be modified by the caller to 4259// add HTTP headers to the request. 4260func (c *CommentsDeleteCall) Header() http.Header { 4261 if c.header_ == nil { 4262 c.header_ = make(http.Header) 4263 } 4264 return c.header_ 4265} 4266 4267func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { 4268 reqHeaders := make(http.Header) 4269 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4270 for k, v := range c.header_ { 4271 reqHeaders[k] = v 4272 } 4273 reqHeaders.Set("User-Agent", c.s.userAgent()) 4274 var body io.Reader = nil 4275 c.urlParams_.Set("alt", alt) 4276 c.urlParams_.Set("prettyPrint", "false") 4277 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") 4278 urls += "?" + c.urlParams_.Encode() 4279 req, err := http.NewRequest("DELETE", urls, body) 4280 if err != nil { 4281 return nil, err 4282 } 4283 req.Header = reqHeaders 4284 googleapi.Expand(req.URL, map[string]string{ 4285 "fileId": c.fileId, 4286 "commentId": c.commentId, 4287 }) 4288 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4289} 4290 4291// Do executes the "drive.comments.delete" call. 4292func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error { 4293 gensupport.SetOptions(c.urlParams_, opts...) 4294 res, err := c.doRequest("json") 4295 if err != nil { 4296 return err 4297 } 4298 defer googleapi.CloseBody(res) 4299 if err := googleapi.CheckResponse(res); err != nil { 4300 return err 4301 } 4302 return nil 4303 // { 4304 // "description": "Deletes a comment.", 4305 // "httpMethod": "DELETE", 4306 // "id": "drive.comments.delete", 4307 // "parameterOrder": [ 4308 // "fileId", 4309 // "commentId" 4310 // ], 4311 // "parameters": { 4312 // "commentId": { 4313 // "description": "The ID of the comment.", 4314 // "location": "path", 4315 // "required": true, 4316 // "type": "string" 4317 // }, 4318 // "fileId": { 4319 // "description": "The ID of the file.", 4320 // "location": "path", 4321 // "required": true, 4322 // "type": "string" 4323 // } 4324 // }, 4325 // "path": "files/{fileId}/comments/{commentId}", 4326 // "scopes": [ 4327 // "https://www.googleapis.com/auth/drive", 4328 // "https://www.googleapis.com/auth/drive.file" 4329 // ] 4330 // } 4331 4332} 4333 4334// method id "drive.comments.get": 4335 4336type CommentsGetCall struct { 4337 s *Service 4338 fileId string 4339 commentId string 4340 urlParams_ gensupport.URLParams 4341 ifNoneMatch_ string 4342 ctx_ context.Context 4343 header_ http.Header 4344} 4345 4346// Get: Gets a comment by ID. 4347// 4348// - commentId: The ID of the comment. 4349// - fileId: The ID of the file. 4350func (r *CommentsService) Get(fileId string, commentId string) *CommentsGetCall { 4351 c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4352 c.fileId = fileId 4353 c.commentId = commentId 4354 return c 4355} 4356 4357// IncludeDeleted sets the optional parameter "includeDeleted": Whether 4358// to return deleted comments. Deleted comments will not include their 4359// original content. 4360func (c *CommentsGetCall) IncludeDeleted(includeDeleted bool) *CommentsGetCall { 4361 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 4362 return c 4363} 4364 4365// Fields allows partial responses to be retrieved. See 4366// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4367// for more information. 4368func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { 4369 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4370 return c 4371} 4372 4373// IfNoneMatch sets the optional parameter which makes the operation 4374// fail if the object's ETag matches the given value. This is useful for 4375// getting updates only after the object has changed since the last 4376// request. Use googleapi.IsNotModified to check whether the response 4377// error from Do is the result of In-None-Match. 4378func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { 4379 c.ifNoneMatch_ = entityTag 4380 return c 4381} 4382 4383// Context sets the context to be used in this call's Do method. Any 4384// pending HTTP request will be aborted if the provided context is 4385// canceled. 4386func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { 4387 c.ctx_ = ctx 4388 return c 4389} 4390 4391// Header returns an http.Header that can be modified by the caller to 4392// add HTTP headers to the request. 4393func (c *CommentsGetCall) Header() http.Header { 4394 if c.header_ == nil { 4395 c.header_ = make(http.Header) 4396 } 4397 return c.header_ 4398} 4399 4400func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { 4401 reqHeaders := make(http.Header) 4402 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4403 for k, v := range c.header_ { 4404 reqHeaders[k] = v 4405 } 4406 reqHeaders.Set("User-Agent", c.s.userAgent()) 4407 if c.ifNoneMatch_ != "" { 4408 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4409 } 4410 var body io.Reader = nil 4411 c.urlParams_.Set("alt", alt) 4412 c.urlParams_.Set("prettyPrint", "false") 4413 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") 4414 urls += "?" + c.urlParams_.Encode() 4415 req, err := http.NewRequest("GET", urls, body) 4416 if err != nil { 4417 return nil, err 4418 } 4419 req.Header = reqHeaders 4420 googleapi.Expand(req.URL, map[string]string{ 4421 "fileId": c.fileId, 4422 "commentId": c.commentId, 4423 }) 4424 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4425} 4426 4427// Do executes the "drive.comments.get" call. 4428// Exactly one of *Comment or error will be non-nil. Any non-2xx status 4429// code is an error. Response headers are in either 4430// *Comment.ServerResponse.Header or (if a response was returned at all) 4431// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4432// check whether the returned error was because http.StatusNotModified 4433// was returned. 4434func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 4435 gensupport.SetOptions(c.urlParams_, opts...) 4436 res, err := c.doRequest("json") 4437 if res != nil && res.StatusCode == http.StatusNotModified { 4438 if res.Body != nil { 4439 res.Body.Close() 4440 } 4441 return nil, &googleapi.Error{ 4442 Code: res.StatusCode, 4443 Header: res.Header, 4444 } 4445 } 4446 if err != nil { 4447 return nil, err 4448 } 4449 defer googleapi.CloseBody(res) 4450 if err := googleapi.CheckResponse(res); err != nil { 4451 return nil, err 4452 } 4453 ret := &Comment{ 4454 ServerResponse: googleapi.ServerResponse{ 4455 Header: res.Header, 4456 HTTPStatusCode: res.StatusCode, 4457 }, 4458 } 4459 target := &ret 4460 if err := gensupport.DecodeResponse(target, res); err != nil { 4461 return nil, err 4462 } 4463 return ret, nil 4464 // { 4465 // "description": "Gets a comment by ID.", 4466 // "httpMethod": "GET", 4467 // "id": "drive.comments.get", 4468 // "parameterOrder": [ 4469 // "fileId", 4470 // "commentId" 4471 // ], 4472 // "parameters": { 4473 // "commentId": { 4474 // "description": "The ID of the comment.", 4475 // "location": "path", 4476 // "required": true, 4477 // "type": "string" 4478 // }, 4479 // "fileId": { 4480 // "description": "The ID of the file.", 4481 // "location": "path", 4482 // "required": true, 4483 // "type": "string" 4484 // }, 4485 // "includeDeleted": { 4486 // "default": "false", 4487 // "description": "Whether to return deleted comments. Deleted comments will not include their original content.", 4488 // "location": "query", 4489 // "type": "boolean" 4490 // } 4491 // }, 4492 // "path": "files/{fileId}/comments/{commentId}", 4493 // "response": { 4494 // "$ref": "Comment" 4495 // }, 4496 // "scopes": [ 4497 // "https://www.googleapis.com/auth/drive", 4498 // "https://www.googleapis.com/auth/drive.file", 4499 // "https://www.googleapis.com/auth/drive.readonly" 4500 // ] 4501 // } 4502 4503} 4504 4505// method id "drive.comments.list": 4506 4507type CommentsListCall struct { 4508 s *Service 4509 fileId string 4510 urlParams_ gensupport.URLParams 4511 ifNoneMatch_ string 4512 ctx_ context.Context 4513 header_ http.Header 4514} 4515 4516// List: Lists a file's comments. 4517// 4518// - fileId: The ID of the file. 4519func (r *CommentsService) List(fileId string) *CommentsListCall { 4520 c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4521 c.fileId = fileId 4522 return c 4523} 4524 4525// IncludeDeleted sets the optional parameter "includeDeleted": Whether 4526// to include deleted comments. Deleted comments will not include their 4527// original content. 4528func (c *CommentsListCall) IncludeDeleted(includeDeleted bool) *CommentsListCall { 4529 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 4530 return c 4531} 4532 4533// PageSize sets the optional parameter "pageSize": The maximum number 4534// of comments to return per page. 4535func (c *CommentsListCall) PageSize(pageSize int64) *CommentsListCall { 4536 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4537 return c 4538} 4539 4540// PageToken sets the optional parameter "pageToken": The token for 4541// continuing a previous list request on the next page. This should be 4542// set to the value of 'nextPageToken' from the previous response. 4543func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { 4544 c.urlParams_.Set("pageToken", pageToken) 4545 return c 4546} 4547 4548// StartModifiedTime sets the optional parameter "startModifiedTime": 4549// The minimum value of 'modifiedTime' for the result comments (RFC 3339 4550// date-time). 4551func (c *CommentsListCall) StartModifiedTime(startModifiedTime string) *CommentsListCall { 4552 c.urlParams_.Set("startModifiedTime", startModifiedTime) 4553 return c 4554} 4555 4556// Fields allows partial responses to be retrieved. See 4557// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4558// for more information. 4559func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { 4560 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4561 return c 4562} 4563 4564// IfNoneMatch sets the optional parameter which makes the operation 4565// fail if the object's ETag matches the given value. This is useful for 4566// getting updates only after the object has changed since the last 4567// request. Use googleapi.IsNotModified to check whether the response 4568// error from Do is the result of In-None-Match. 4569func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { 4570 c.ifNoneMatch_ = entityTag 4571 return c 4572} 4573 4574// Context sets the context to be used in this call's Do method. Any 4575// pending HTTP request will be aborted if the provided context is 4576// canceled. 4577func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { 4578 c.ctx_ = ctx 4579 return c 4580} 4581 4582// Header returns an http.Header that can be modified by the caller to 4583// add HTTP headers to the request. 4584func (c *CommentsListCall) Header() http.Header { 4585 if c.header_ == nil { 4586 c.header_ = make(http.Header) 4587 } 4588 return c.header_ 4589} 4590 4591func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { 4592 reqHeaders := make(http.Header) 4593 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4594 for k, v := range c.header_ { 4595 reqHeaders[k] = v 4596 } 4597 reqHeaders.Set("User-Agent", c.s.userAgent()) 4598 if c.ifNoneMatch_ != "" { 4599 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4600 } 4601 var body io.Reader = nil 4602 c.urlParams_.Set("alt", alt) 4603 c.urlParams_.Set("prettyPrint", "false") 4604 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") 4605 urls += "?" + c.urlParams_.Encode() 4606 req, err := http.NewRequest("GET", urls, body) 4607 if err != nil { 4608 return nil, err 4609 } 4610 req.Header = reqHeaders 4611 googleapi.Expand(req.URL, map[string]string{ 4612 "fileId": c.fileId, 4613 }) 4614 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4615} 4616 4617// Do executes the "drive.comments.list" call. 4618// Exactly one of *CommentList or error will be non-nil. Any non-2xx 4619// status code is an error. Response headers are in either 4620// *CommentList.ServerResponse.Header or (if a response was returned at 4621// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4622// to check whether the returned error was because 4623// http.StatusNotModified was returned. 4624func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) { 4625 gensupport.SetOptions(c.urlParams_, opts...) 4626 res, err := c.doRequest("json") 4627 if res != nil && res.StatusCode == http.StatusNotModified { 4628 if res.Body != nil { 4629 res.Body.Close() 4630 } 4631 return nil, &googleapi.Error{ 4632 Code: res.StatusCode, 4633 Header: res.Header, 4634 } 4635 } 4636 if err != nil { 4637 return nil, err 4638 } 4639 defer googleapi.CloseBody(res) 4640 if err := googleapi.CheckResponse(res); err != nil { 4641 return nil, err 4642 } 4643 ret := &CommentList{ 4644 ServerResponse: googleapi.ServerResponse{ 4645 Header: res.Header, 4646 HTTPStatusCode: res.StatusCode, 4647 }, 4648 } 4649 target := &ret 4650 if err := gensupport.DecodeResponse(target, res); err != nil { 4651 return nil, err 4652 } 4653 return ret, nil 4654 // { 4655 // "description": "Lists a file's comments.", 4656 // "httpMethod": "GET", 4657 // "id": "drive.comments.list", 4658 // "parameterOrder": [ 4659 // "fileId" 4660 // ], 4661 // "parameters": { 4662 // "fileId": { 4663 // "description": "The ID of the file.", 4664 // "location": "path", 4665 // "required": true, 4666 // "type": "string" 4667 // }, 4668 // "includeDeleted": { 4669 // "default": "false", 4670 // "description": "Whether to include deleted comments. Deleted comments will not include their original content.", 4671 // "location": "query", 4672 // "type": "boolean" 4673 // }, 4674 // "pageSize": { 4675 // "default": "20", 4676 // "description": "The maximum number of comments to return per page.", 4677 // "format": "int32", 4678 // "location": "query", 4679 // "maximum": "100", 4680 // "minimum": "1", 4681 // "type": "integer" 4682 // }, 4683 // "pageToken": { 4684 // "description": "The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.", 4685 // "location": "query", 4686 // "type": "string" 4687 // }, 4688 // "startModifiedTime": { 4689 // "description": "The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time).", 4690 // "location": "query", 4691 // "type": "string" 4692 // } 4693 // }, 4694 // "path": "files/{fileId}/comments", 4695 // "response": { 4696 // "$ref": "CommentList" 4697 // }, 4698 // "scopes": [ 4699 // "https://www.googleapis.com/auth/drive", 4700 // "https://www.googleapis.com/auth/drive.file", 4701 // "https://www.googleapis.com/auth/drive.readonly" 4702 // ] 4703 // } 4704 4705} 4706 4707// Pages invokes f for each page of results. 4708// A non-nil error returned from f will halt the iteration. 4709// The provided context supersedes any context provided to the Context method. 4710func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error { 4711 c.ctx_ = ctx 4712 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4713 for { 4714 x, err := c.Do() 4715 if err != nil { 4716 return err 4717 } 4718 if err := f(x); err != nil { 4719 return err 4720 } 4721 if x.NextPageToken == "" { 4722 return nil 4723 } 4724 c.PageToken(x.NextPageToken) 4725 } 4726} 4727 4728// method id "drive.comments.update": 4729 4730type CommentsUpdateCall struct { 4731 s *Service 4732 fileId string 4733 commentId string 4734 comment *Comment 4735 urlParams_ gensupport.URLParams 4736 ctx_ context.Context 4737 header_ http.Header 4738} 4739 4740// Update: Updates a comment with patch semantics. 4741// 4742// - commentId: The ID of the comment. 4743// - fileId: The ID of the file. 4744func (r *CommentsService) Update(fileId string, commentId string, comment *Comment) *CommentsUpdateCall { 4745 c := &CommentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4746 c.fileId = fileId 4747 c.commentId = commentId 4748 c.comment = comment 4749 return c 4750} 4751 4752// Fields allows partial responses to be retrieved. See 4753// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4754// for more information. 4755func (c *CommentsUpdateCall) Fields(s ...googleapi.Field) *CommentsUpdateCall { 4756 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4757 return c 4758} 4759 4760// Context sets the context to be used in this call's Do method. Any 4761// pending HTTP request will be aborted if the provided context is 4762// canceled. 4763func (c *CommentsUpdateCall) Context(ctx context.Context) *CommentsUpdateCall { 4764 c.ctx_ = ctx 4765 return c 4766} 4767 4768// Header returns an http.Header that can be modified by the caller to 4769// add HTTP headers to the request. 4770func (c *CommentsUpdateCall) Header() http.Header { 4771 if c.header_ == nil { 4772 c.header_ = make(http.Header) 4773 } 4774 return c.header_ 4775} 4776 4777func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) { 4778 reqHeaders := make(http.Header) 4779 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4780 for k, v := range c.header_ { 4781 reqHeaders[k] = v 4782 } 4783 reqHeaders.Set("User-Agent", c.s.userAgent()) 4784 var body io.Reader = nil 4785 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) 4786 if err != nil { 4787 return nil, err 4788 } 4789 reqHeaders.Set("Content-Type", "application/json") 4790 c.urlParams_.Set("alt", alt) 4791 c.urlParams_.Set("prettyPrint", "false") 4792 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") 4793 urls += "?" + c.urlParams_.Encode() 4794 req, err := http.NewRequest("PATCH", urls, body) 4795 if err != nil { 4796 return nil, err 4797 } 4798 req.Header = reqHeaders 4799 googleapi.Expand(req.URL, map[string]string{ 4800 "fileId": c.fileId, 4801 "commentId": c.commentId, 4802 }) 4803 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4804} 4805 4806// Do executes the "drive.comments.update" call. 4807// Exactly one of *Comment or error will be non-nil. Any non-2xx status 4808// code is an error. Response headers are in either 4809// *Comment.ServerResponse.Header or (if a response was returned at all) 4810// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4811// check whether the returned error was because http.StatusNotModified 4812// was returned. 4813func (c *CommentsUpdateCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 4814 gensupport.SetOptions(c.urlParams_, opts...) 4815 res, err := c.doRequest("json") 4816 if res != nil && res.StatusCode == http.StatusNotModified { 4817 if res.Body != nil { 4818 res.Body.Close() 4819 } 4820 return nil, &googleapi.Error{ 4821 Code: res.StatusCode, 4822 Header: res.Header, 4823 } 4824 } 4825 if err != nil { 4826 return nil, err 4827 } 4828 defer googleapi.CloseBody(res) 4829 if err := googleapi.CheckResponse(res); err != nil { 4830 return nil, err 4831 } 4832 ret := &Comment{ 4833 ServerResponse: googleapi.ServerResponse{ 4834 Header: res.Header, 4835 HTTPStatusCode: res.StatusCode, 4836 }, 4837 } 4838 target := &ret 4839 if err := gensupport.DecodeResponse(target, res); err != nil { 4840 return nil, err 4841 } 4842 return ret, nil 4843 // { 4844 // "description": "Updates a comment with patch semantics.", 4845 // "httpMethod": "PATCH", 4846 // "id": "drive.comments.update", 4847 // "parameterOrder": [ 4848 // "fileId", 4849 // "commentId" 4850 // ], 4851 // "parameters": { 4852 // "commentId": { 4853 // "description": "The ID of the comment.", 4854 // "location": "path", 4855 // "required": true, 4856 // "type": "string" 4857 // }, 4858 // "fileId": { 4859 // "description": "The ID of the file.", 4860 // "location": "path", 4861 // "required": true, 4862 // "type": "string" 4863 // } 4864 // }, 4865 // "path": "files/{fileId}/comments/{commentId}", 4866 // "request": { 4867 // "$ref": "Comment" 4868 // }, 4869 // "response": { 4870 // "$ref": "Comment" 4871 // }, 4872 // "scopes": [ 4873 // "https://www.googleapis.com/auth/drive", 4874 // "https://www.googleapis.com/auth/drive.file" 4875 // ] 4876 // } 4877 4878} 4879 4880// method id "drive.drives.create": 4881 4882type DrivesCreateCall struct { 4883 s *Service 4884 drive *Drive 4885 urlParams_ gensupport.URLParams 4886 ctx_ context.Context 4887 header_ http.Header 4888} 4889 4890// Create: Creates a new shared drive. 4891// 4892// - requestId: An ID, such as a random UUID, which uniquely identifies 4893// this user's request for idempotent creation of a shared drive. A 4894// repeated request by the same user and with the same request ID will 4895// avoid creating duplicates by attempting to create the same shared 4896// drive. If the shared drive already exists a 409 error will be 4897// returned. 4898func (r *DrivesService) Create(requestId string, drive *Drive) *DrivesCreateCall { 4899 c := &DrivesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4900 c.urlParams_.Set("requestId", requestId) 4901 c.drive = drive 4902 return c 4903} 4904 4905// Fields allows partial responses to be retrieved. See 4906// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4907// for more information. 4908func (c *DrivesCreateCall) Fields(s ...googleapi.Field) *DrivesCreateCall { 4909 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4910 return c 4911} 4912 4913// Context sets the context to be used in this call's Do method. Any 4914// pending HTTP request will be aborted if the provided context is 4915// canceled. 4916func (c *DrivesCreateCall) Context(ctx context.Context) *DrivesCreateCall { 4917 c.ctx_ = ctx 4918 return c 4919} 4920 4921// Header returns an http.Header that can be modified by the caller to 4922// add HTTP headers to the request. 4923func (c *DrivesCreateCall) Header() http.Header { 4924 if c.header_ == nil { 4925 c.header_ = make(http.Header) 4926 } 4927 return c.header_ 4928} 4929 4930func (c *DrivesCreateCall) doRequest(alt string) (*http.Response, error) { 4931 reqHeaders := make(http.Header) 4932 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 4933 for k, v := range c.header_ { 4934 reqHeaders[k] = v 4935 } 4936 reqHeaders.Set("User-Agent", c.s.userAgent()) 4937 var body io.Reader = nil 4938 body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive) 4939 if err != nil { 4940 return nil, err 4941 } 4942 reqHeaders.Set("Content-Type", "application/json") 4943 c.urlParams_.Set("alt", alt) 4944 c.urlParams_.Set("prettyPrint", "false") 4945 urls := googleapi.ResolveRelative(c.s.BasePath, "drives") 4946 urls += "?" + c.urlParams_.Encode() 4947 req, err := http.NewRequest("POST", urls, body) 4948 if err != nil { 4949 return nil, err 4950 } 4951 req.Header = reqHeaders 4952 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4953} 4954 4955// Do executes the "drive.drives.create" call. 4956// Exactly one of *Drive or error will be non-nil. Any non-2xx status 4957// code is an error. Response headers are in either 4958// *Drive.ServerResponse.Header or (if a response was returned at all) 4959// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4960// check whether the returned error was because http.StatusNotModified 4961// was returned. 4962func (c *DrivesCreateCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 4963 gensupport.SetOptions(c.urlParams_, opts...) 4964 res, err := c.doRequest("json") 4965 if res != nil && res.StatusCode == http.StatusNotModified { 4966 if res.Body != nil { 4967 res.Body.Close() 4968 } 4969 return nil, &googleapi.Error{ 4970 Code: res.StatusCode, 4971 Header: res.Header, 4972 } 4973 } 4974 if err != nil { 4975 return nil, err 4976 } 4977 defer googleapi.CloseBody(res) 4978 if err := googleapi.CheckResponse(res); err != nil { 4979 return nil, err 4980 } 4981 ret := &Drive{ 4982 ServerResponse: googleapi.ServerResponse{ 4983 Header: res.Header, 4984 HTTPStatusCode: res.StatusCode, 4985 }, 4986 } 4987 target := &ret 4988 if err := gensupport.DecodeResponse(target, res); err != nil { 4989 return nil, err 4990 } 4991 return ret, nil 4992 // { 4993 // "description": "Creates a new shared drive.", 4994 // "httpMethod": "POST", 4995 // "id": "drive.drives.create", 4996 // "parameterOrder": [ 4997 // "requestId" 4998 // ], 4999 // "parameters": { 5000 // "requestId": { 5001 // "description": "An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a shared drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same shared drive. If the shared drive already exists a 409 error will be returned.", 5002 // "location": "query", 5003 // "required": true, 5004 // "type": "string" 5005 // } 5006 // }, 5007 // "path": "drives", 5008 // "request": { 5009 // "$ref": "Drive" 5010 // }, 5011 // "response": { 5012 // "$ref": "Drive" 5013 // }, 5014 // "scopes": [ 5015 // "https://www.googleapis.com/auth/drive" 5016 // ] 5017 // } 5018 5019} 5020 5021// method id "drive.drives.delete": 5022 5023type DrivesDeleteCall struct { 5024 s *Service 5025 driveId string 5026 urlParams_ gensupport.URLParams 5027 ctx_ context.Context 5028 header_ http.Header 5029} 5030 5031// Delete: Permanently deletes a shared drive for which the user is an 5032// organizer. The shared drive cannot contain any untrashed items. 5033// 5034// - driveId: The ID of the shared drive. 5035func (r *DrivesService) Delete(driveId string) *DrivesDeleteCall { 5036 c := &DrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5037 c.driveId = driveId 5038 return c 5039} 5040 5041// Fields allows partial responses to be retrieved. See 5042// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5043// for more information. 5044func (c *DrivesDeleteCall) Fields(s ...googleapi.Field) *DrivesDeleteCall { 5045 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5046 return c 5047} 5048 5049// Context sets the context to be used in this call's Do method. Any 5050// pending HTTP request will be aborted if the provided context is 5051// canceled. 5052func (c *DrivesDeleteCall) Context(ctx context.Context) *DrivesDeleteCall { 5053 c.ctx_ = ctx 5054 return c 5055} 5056 5057// Header returns an http.Header that can be modified by the caller to 5058// add HTTP headers to the request. 5059func (c *DrivesDeleteCall) Header() http.Header { 5060 if c.header_ == nil { 5061 c.header_ = make(http.Header) 5062 } 5063 return c.header_ 5064} 5065 5066func (c *DrivesDeleteCall) doRequest(alt string) (*http.Response, error) { 5067 reqHeaders := make(http.Header) 5068 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5069 for k, v := range c.header_ { 5070 reqHeaders[k] = v 5071 } 5072 reqHeaders.Set("User-Agent", c.s.userAgent()) 5073 var body io.Reader = nil 5074 c.urlParams_.Set("alt", alt) 5075 c.urlParams_.Set("prettyPrint", "false") 5076 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") 5077 urls += "?" + c.urlParams_.Encode() 5078 req, err := http.NewRequest("DELETE", urls, body) 5079 if err != nil { 5080 return nil, err 5081 } 5082 req.Header = reqHeaders 5083 googleapi.Expand(req.URL, map[string]string{ 5084 "driveId": c.driveId, 5085 }) 5086 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5087} 5088 5089// Do executes the "drive.drives.delete" call. 5090func (c *DrivesDeleteCall) Do(opts ...googleapi.CallOption) error { 5091 gensupport.SetOptions(c.urlParams_, opts...) 5092 res, err := c.doRequest("json") 5093 if err != nil { 5094 return err 5095 } 5096 defer googleapi.CloseBody(res) 5097 if err := googleapi.CheckResponse(res); err != nil { 5098 return err 5099 } 5100 return nil 5101 // { 5102 // "description": "Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.", 5103 // "httpMethod": "DELETE", 5104 // "id": "drive.drives.delete", 5105 // "parameterOrder": [ 5106 // "driveId" 5107 // ], 5108 // "parameters": { 5109 // "driveId": { 5110 // "description": "The ID of the shared drive.", 5111 // "location": "path", 5112 // "required": true, 5113 // "type": "string" 5114 // } 5115 // }, 5116 // "path": "drives/{driveId}", 5117 // "scopes": [ 5118 // "https://www.googleapis.com/auth/drive" 5119 // ] 5120 // } 5121 5122} 5123 5124// method id "drive.drives.get": 5125 5126type DrivesGetCall struct { 5127 s *Service 5128 driveId string 5129 urlParams_ gensupport.URLParams 5130 ifNoneMatch_ string 5131 ctx_ context.Context 5132 header_ http.Header 5133} 5134 5135// Get: Gets a shared drive's metadata by ID. 5136// 5137// - driveId: The ID of the shared drive. 5138func (r *DrivesService) Get(driveId string) *DrivesGetCall { 5139 c := &DrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5140 c.driveId = driveId 5141 return c 5142} 5143 5144// UseDomainAdminAccess sets the optional parameter 5145// "useDomainAdminAccess": Issue the request as a domain administrator; 5146// if set to true, then the requester will be granted access if they are 5147// an administrator of the domain to which the shared drive belongs. 5148func (c *DrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesGetCall { 5149 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 5150 return c 5151} 5152 5153// Fields allows partial responses to be retrieved. See 5154// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5155// for more information. 5156func (c *DrivesGetCall) Fields(s ...googleapi.Field) *DrivesGetCall { 5157 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5158 return c 5159} 5160 5161// IfNoneMatch sets the optional parameter which makes the operation 5162// fail if the object's ETag matches the given value. This is useful for 5163// getting updates only after the object has changed since the last 5164// request. Use googleapi.IsNotModified to check whether the response 5165// error from Do is the result of In-None-Match. 5166func (c *DrivesGetCall) IfNoneMatch(entityTag string) *DrivesGetCall { 5167 c.ifNoneMatch_ = entityTag 5168 return c 5169} 5170 5171// Context sets the context to be used in this call's Do method. Any 5172// pending HTTP request will be aborted if the provided context is 5173// canceled. 5174func (c *DrivesGetCall) Context(ctx context.Context) *DrivesGetCall { 5175 c.ctx_ = ctx 5176 return c 5177} 5178 5179// Header returns an http.Header that can be modified by the caller to 5180// add HTTP headers to the request. 5181func (c *DrivesGetCall) Header() http.Header { 5182 if c.header_ == nil { 5183 c.header_ = make(http.Header) 5184 } 5185 return c.header_ 5186} 5187 5188func (c *DrivesGetCall) doRequest(alt string) (*http.Response, error) { 5189 reqHeaders := make(http.Header) 5190 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5191 for k, v := range c.header_ { 5192 reqHeaders[k] = v 5193 } 5194 reqHeaders.Set("User-Agent", c.s.userAgent()) 5195 if c.ifNoneMatch_ != "" { 5196 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5197 } 5198 var body io.Reader = nil 5199 c.urlParams_.Set("alt", alt) 5200 c.urlParams_.Set("prettyPrint", "false") 5201 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") 5202 urls += "?" + c.urlParams_.Encode() 5203 req, err := http.NewRequest("GET", urls, body) 5204 if err != nil { 5205 return nil, err 5206 } 5207 req.Header = reqHeaders 5208 googleapi.Expand(req.URL, map[string]string{ 5209 "driveId": c.driveId, 5210 }) 5211 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5212} 5213 5214// Do executes the "drive.drives.get" call. 5215// Exactly one of *Drive or error will be non-nil. Any non-2xx status 5216// code is an error. Response headers are in either 5217// *Drive.ServerResponse.Header or (if a response was returned at all) 5218// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5219// check whether the returned error was because http.StatusNotModified 5220// was returned. 5221func (c *DrivesGetCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 5222 gensupport.SetOptions(c.urlParams_, opts...) 5223 res, err := c.doRequest("json") 5224 if res != nil && res.StatusCode == http.StatusNotModified { 5225 if res.Body != nil { 5226 res.Body.Close() 5227 } 5228 return nil, &googleapi.Error{ 5229 Code: res.StatusCode, 5230 Header: res.Header, 5231 } 5232 } 5233 if err != nil { 5234 return nil, err 5235 } 5236 defer googleapi.CloseBody(res) 5237 if err := googleapi.CheckResponse(res); err != nil { 5238 return nil, err 5239 } 5240 ret := &Drive{ 5241 ServerResponse: googleapi.ServerResponse{ 5242 Header: res.Header, 5243 HTTPStatusCode: res.StatusCode, 5244 }, 5245 } 5246 target := &ret 5247 if err := gensupport.DecodeResponse(target, res); err != nil { 5248 return nil, err 5249 } 5250 return ret, nil 5251 // { 5252 // "description": "Gets a shared drive's metadata by ID.", 5253 // "httpMethod": "GET", 5254 // "id": "drive.drives.get", 5255 // "parameterOrder": [ 5256 // "driveId" 5257 // ], 5258 // "parameters": { 5259 // "driveId": { 5260 // "description": "The ID of the shared drive.", 5261 // "location": "path", 5262 // "required": true, 5263 // "type": "string" 5264 // }, 5265 // "useDomainAdminAccess": { 5266 // "default": "false", 5267 // "description": "Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs.", 5268 // "location": "query", 5269 // "type": "boolean" 5270 // } 5271 // }, 5272 // "path": "drives/{driveId}", 5273 // "response": { 5274 // "$ref": "Drive" 5275 // }, 5276 // "scopes": [ 5277 // "https://www.googleapis.com/auth/drive", 5278 // "https://www.googleapis.com/auth/drive.readonly" 5279 // ] 5280 // } 5281 5282} 5283 5284// method id "drive.drives.hide": 5285 5286type DrivesHideCall struct { 5287 s *Service 5288 driveId string 5289 urlParams_ gensupport.URLParams 5290 ctx_ context.Context 5291 header_ http.Header 5292} 5293 5294// Hide: Hides a shared drive from the default view. 5295// 5296// - driveId: The ID of the shared drive. 5297func (r *DrivesService) Hide(driveId string) *DrivesHideCall { 5298 c := &DrivesHideCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5299 c.driveId = driveId 5300 return c 5301} 5302 5303// Fields allows partial responses to be retrieved. See 5304// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5305// for more information. 5306func (c *DrivesHideCall) Fields(s ...googleapi.Field) *DrivesHideCall { 5307 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5308 return c 5309} 5310 5311// Context sets the context to be used in this call's Do method. Any 5312// pending HTTP request will be aborted if the provided context is 5313// canceled. 5314func (c *DrivesHideCall) Context(ctx context.Context) *DrivesHideCall { 5315 c.ctx_ = ctx 5316 return c 5317} 5318 5319// Header returns an http.Header that can be modified by the caller to 5320// add HTTP headers to the request. 5321func (c *DrivesHideCall) Header() http.Header { 5322 if c.header_ == nil { 5323 c.header_ = make(http.Header) 5324 } 5325 return c.header_ 5326} 5327 5328func (c *DrivesHideCall) doRequest(alt string) (*http.Response, error) { 5329 reqHeaders := make(http.Header) 5330 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5331 for k, v := range c.header_ { 5332 reqHeaders[k] = v 5333 } 5334 reqHeaders.Set("User-Agent", c.s.userAgent()) 5335 var body io.Reader = nil 5336 c.urlParams_.Set("alt", alt) 5337 c.urlParams_.Set("prettyPrint", "false") 5338 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/hide") 5339 urls += "?" + c.urlParams_.Encode() 5340 req, err := http.NewRequest("POST", urls, body) 5341 if err != nil { 5342 return nil, err 5343 } 5344 req.Header = reqHeaders 5345 googleapi.Expand(req.URL, map[string]string{ 5346 "driveId": c.driveId, 5347 }) 5348 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5349} 5350 5351// Do executes the "drive.drives.hide" call. 5352// Exactly one of *Drive or error will be non-nil. Any non-2xx status 5353// code is an error. Response headers are in either 5354// *Drive.ServerResponse.Header or (if a response was returned at all) 5355// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5356// check whether the returned error was because http.StatusNotModified 5357// was returned. 5358func (c *DrivesHideCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 5359 gensupport.SetOptions(c.urlParams_, opts...) 5360 res, err := c.doRequest("json") 5361 if res != nil && res.StatusCode == http.StatusNotModified { 5362 if res.Body != nil { 5363 res.Body.Close() 5364 } 5365 return nil, &googleapi.Error{ 5366 Code: res.StatusCode, 5367 Header: res.Header, 5368 } 5369 } 5370 if err != nil { 5371 return nil, err 5372 } 5373 defer googleapi.CloseBody(res) 5374 if err := googleapi.CheckResponse(res); err != nil { 5375 return nil, err 5376 } 5377 ret := &Drive{ 5378 ServerResponse: googleapi.ServerResponse{ 5379 Header: res.Header, 5380 HTTPStatusCode: res.StatusCode, 5381 }, 5382 } 5383 target := &ret 5384 if err := gensupport.DecodeResponse(target, res); err != nil { 5385 return nil, err 5386 } 5387 return ret, nil 5388 // { 5389 // "description": "Hides a shared drive from the default view.", 5390 // "httpMethod": "POST", 5391 // "id": "drive.drives.hide", 5392 // "parameterOrder": [ 5393 // "driveId" 5394 // ], 5395 // "parameters": { 5396 // "driveId": { 5397 // "description": "The ID of the shared drive.", 5398 // "location": "path", 5399 // "required": true, 5400 // "type": "string" 5401 // } 5402 // }, 5403 // "path": "drives/{driveId}/hide", 5404 // "response": { 5405 // "$ref": "Drive" 5406 // }, 5407 // "scopes": [ 5408 // "https://www.googleapis.com/auth/drive" 5409 // ] 5410 // } 5411 5412} 5413 5414// method id "drive.drives.list": 5415 5416type DrivesListCall struct { 5417 s *Service 5418 urlParams_ gensupport.URLParams 5419 ifNoneMatch_ string 5420 ctx_ context.Context 5421 header_ http.Header 5422} 5423 5424// List: Lists the user's shared drives. 5425func (r *DrivesService) List() *DrivesListCall { 5426 c := &DrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5427 return c 5428} 5429 5430// PageSize sets the optional parameter "pageSize": Maximum number of 5431// shared drives to return per page. 5432func (c *DrivesListCall) PageSize(pageSize int64) *DrivesListCall { 5433 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5434 return c 5435} 5436 5437// PageToken sets the optional parameter "pageToken": Page token for 5438// shared drives. 5439func (c *DrivesListCall) PageToken(pageToken string) *DrivesListCall { 5440 c.urlParams_.Set("pageToken", pageToken) 5441 return c 5442} 5443 5444// Q sets the optional parameter "q": Query string for searching shared 5445// drives. 5446func (c *DrivesListCall) Q(q string) *DrivesListCall { 5447 c.urlParams_.Set("q", q) 5448 return c 5449} 5450 5451// UseDomainAdminAccess sets the optional parameter 5452// "useDomainAdminAccess": Issue the request as a domain administrator; 5453// if set to true, then all shared drives of the domain in which the 5454// requester is an administrator are returned. 5455func (c *DrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesListCall { 5456 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 5457 return c 5458} 5459 5460// Fields allows partial responses to be retrieved. See 5461// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5462// for more information. 5463func (c *DrivesListCall) Fields(s ...googleapi.Field) *DrivesListCall { 5464 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5465 return c 5466} 5467 5468// IfNoneMatch sets the optional parameter which makes the operation 5469// fail if the object's ETag matches the given value. This is useful for 5470// getting updates only after the object has changed since the last 5471// request. Use googleapi.IsNotModified to check whether the response 5472// error from Do is the result of In-None-Match. 5473func (c *DrivesListCall) IfNoneMatch(entityTag string) *DrivesListCall { 5474 c.ifNoneMatch_ = entityTag 5475 return c 5476} 5477 5478// Context sets the context to be used in this call's Do method. Any 5479// pending HTTP request will be aborted if the provided context is 5480// canceled. 5481func (c *DrivesListCall) Context(ctx context.Context) *DrivesListCall { 5482 c.ctx_ = ctx 5483 return c 5484} 5485 5486// Header returns an http.Header that can be modified by the caller to 5487// add HTTP headers to the request. 5488func (c *DrivesListCall) Header() http.Header { 5489 if c.header_ == nil { 5490 c.header_ = make(http.Header) 5491 } 5492 return c.header_ 5493} 5494 5495func (c *DrivesListCall) doRequest(alt string) (*http.Response, error) { 5496 reqHeaders := make(http.Header) 5497 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5498 for k, v := range c.header_ { 5499 reqHeaders[k] = v 5500 } 5501 reqHeaders.Set("User-Agent", c.s.userAgent()) 5502 if c.ifNoneMatch_ != "" { 5503 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5504 } 5505 var body io.Reader = nil 5506 c.urlParams_.Set("alt", alt) 5507 c.urlParams_.Set("prettyPrint", "false") 5508 urls := googleapi.ResolveRelative(c.s.BasePath, "drives") 5509 urls += "?" + c.urlParams_.Encode() 5510 req, err := http.NewRequest("GET", urls, body) 5511 if err != nil { 5512 return nil, err 5513 } 5514 req.Header = reqHeaders 5515 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5516} 5517 5518// Do executes the "drive.drives.list" call. 5519// Exactly one of *DriveList or error will be non-nil. Any non-2xx 5520// status code is an error. Response headers are in either 5521// *DriveList.ServerResponse.Header or (if a response was returned at 5522// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5523// to check whether the returned error was because 5524// http.StatusNotModified was returned. 5525func (c *DrivesListCall) Do(opts ...googleapi.CallOption) (*DriveList, error) { 5526 gensupport.SetOptions(c.urlParams_, opts...) 5527 res, err := c.doRequest("json") 5528 if res != nil && res.StatusCode == http.StatusNotModified { 5529 if res.Body != nil { 5530 res.Body.Close() 5531 } 5532 return nil, &googleapi.Error{ 5533 Code: res.StatusCode, 5534 Header: res.Header, 5535 } 5536 } 5537 if err != nil { 5538 return nil, err 5539 } 5540 defer googleapi.CloseBody(res) 5541 if err := googleapi.CheckResponse(res); err != nil { 5542 return nil, err 5543 } 5544 ret := &DriveList{ 5545 ServerResponse: googleapi.ServerResponse{ 5546 Header: res.Header, 5547 HTTPStatusCode: res.StatusCode, 5548 }, 5549 } 5550 target := &ret 5551 if err := gensupport.DecodeResponse(target, res); err != nil { 5552 return nil, err 5553 } 5554 return ret, nil 5555 // { 5556 // "description": "Lists the user's shared drives.", 5557 // "httpMethod": "GET", 5558 // "id": "drive.drives.list", 5559 // "parameters": { 5560 // "pageSize": { 5561 // "default": "10", 5562 // "description": "Maximum number of shared drives to return per page.", 5563 // "format": "int32", 5564 // "location": "query", 5565 // "maximum": "100", 5566 // "minimum": "1", 5567 // "type": "integer" 5568 // }, 5569 // "pageToken": { 5570 // "description": "Page token for shared drives.", 5571 // "location": "query", 5572 // "type": "string" 5573 // }, 5574 // "q": { 5575 // "description": "Query string for searching shared drives.", 5576 // "location": "query", 5577 // "type": "string" 5578 // }, 5579 // "useDomainAdminAccess": { 5580 // "default": "false", 5581 // "description": "Issue the request as a domain administrator; if set to true, then all shared drives of the domain in which the requester is an administrator are returned.", 5582 // "location": "query", 5583 // "type": "boolean" 5584 // } 5585 // }, 5586 // "path": "drives", 5587 // "response": { 5588 // "$ref": "DriveList" 5589 // }, 5590 // "scopes": [ 5591 // "https://www.googleapis.com/auth/drive", 5592 // "https://www.googleapis.com/auth/drive.readonly" 5593 // ] 5594 // } 5595 5596} 5597 5598// Pages invokes f for each page of results. 5599// A non-nil error returned from f will halt the iteration. 5600// The provided context supersedes any context provided to the Context method. 5601func (c *DrivesListCall) Pages(ctx context.Context, f func(*DriveList) error) error { 5602 c.ctx_ = ctx 5603 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5604 for { 5605 x, err := c.Do() 5606 if err != nil { 5607 return err 5608 } 5609 if err := f(x); err != nil { 5610 return err 5611 } 5612 if x.NextPageToken == "" { 5613 return nil 5614 } 5615 c.PageToken(x.NextPageToken) 5616 } 5617} 5618 5619// method id "drive.drives.unhide": 5620 5621type DrivesUnhideCall struct { 5622 s *Service 5623 driveId string 5624 urlParams_ gensupport.URLParams 5625 ctx_ context.Context 5626 header_ http.Header 5627} 5628 5629// Unhide: Restores a shared drive to the default view. 5630// 5631// - driveId: The ID of the shared drive. 5632func (r *DrivesService) Unhide(driveId string) *DrivesUnhideCall { 5633 c := &DrivesUnhideCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5634 c.driveId = driveId 5635 return c 5636} 5637 5638// Fields allows partial responses to be retrieved. See 5639// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5640// for more information. 5641func (c *DrivesUnhideCall) Fields(s ...googleapi.Field) *DrivesUnhideCall { 5642 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5643 return c 5644} 5645 5646// Context sets the context to be used in this call's Do method. Any 5647// pending HTTP request will be aborted if the provided context is 5648// canceled. 5649func (c *DrivesUnhideCall) Context(ctx context.Context) *DrivesUnhideCall { 5650 c.ctx_ = ctx 5651 return c 5652} 5653 5654// Header returns an http.Header that can be modified by the caller to 5655// add HTTP headers to the request. 5656func (c *DrivesUnhideCall) Header() http.Header { 5657 if c.header_ == nil { 5658 c.header_ = make(http.Header) 5659 } 5660 return c.header_ 5661} 5662 5663func (c *DrivesUnhideCall) doRequest(alt string) (*http.Response, error) { 5664 reqHeaders := make(http.Header) 5665 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5666 for k, v := range c.header_ { 5667 reqHeaders[k] = v 5668 } 5669 reqHeaders.Set("User-Agent", c.s.userAgent()) 5670 var body io.Reader = nil 5671 c.urlParams_.Set("alt", alt) 5672 c.urlParams_.Set("prettyPrint", "false") 5673 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/unhide") 5674 urls += "?" + c.urlParams_.Encode() 5675 req, err := http.NewRequest("POST", urls, body) 5676 if err != nil { 5677 return nil, err 5678 } 5679 req.Header = reqHeaders 5680 googleapi.Expand(req.URL, map[string]string{ 5681 "driveId": c.driveId, 5682 }) 5683 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5684} 5685 5686// Do executes the "drive.drives.unhide" call. 5687// Exactly one of *Drive or error will be non-nil. Any non-2xx status 5688// code is an error. Response headers are in either 5689// *Drive.ServerResponse.Header or (if a response was returned at all) 5690// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5691// check whether the returned error was because http.StatusNotModified 5692// was returned. 5693func (c *DrivesUnhideCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 5694 gensupport.SetOptions(c.urlParams_, opts...) 5695 res, err := c.doRequest("json") 5696 if res != nil && res.StatusCode == http.StatusNotModified { 5697 if res.Body != nil { 5698 res.Body.Close() 5699 } 5700 return nil, &googleapi.Error{ 5701 Code: res.StatusCode, 5702 Header: res.Header, 5703 } 5704 } 5705 if err != nil { 5706 return nil, err 5707 } 5708 defer googleapi.CloseBody(res) 5709 if err := googleapi.CheckResponse(res); err != nil { 5710 return nil, err 5711 } 5712 ret := &Drive{ 5713 ServerResponse: googleapi.ServerResponse{ 5714 Header: res.Header, 5715 HTTPStatusCode: res.StatusCode, 5716 }, 5717 } 5718 target := &ret 5719 if err := gensupport.DecodeResponse(target, res); err != nil { 5720 return nil, err 5721 } 5722 return ret, nil 5723 // { 5724 // "description": "Restores a shared drive to the default view.", 5725 // "httpMethod": "POST", 5726 // "id": "drive.drives.unhide", 5727 // "parameterOrder": [ 5728 // "driveId" 5729 // ], 5730 // "parameters": { 5731 // "driveId": { 5732 // "description": "The ID of the shared drive.", 5733 // "location": "path", 5734 // "required": true, 5735 // "type": "string" 5736 // } 5737 // }, 5738 // "path": "drives/{driveId}/unhide", 5739 // "response": { 5740 // "$ref": "Drive" 5741 // }, 5742 // "scopes": [ 5743 // "https://www.googleapis.com/auth/drive" 5744 // ] 5745 // } 5746 5747} 5748 5749// method id "drive.drives.update": 5750 5751type DrivesUpdateCall struct { 5752 s *Service 5753 driveId string 5754 drive *Drive 5755 urlParams_ gensupport.URLParams 5756 ctx_ context.Context 5757 header_ http.Header 5758} 5759 5760// Update: Updates the metadate for a shared drive. 5761// 5762// - driveId: The ID of the shared drive. 5763func (r *DrivesService) Update(driveId string, drive *Drive) *DrivesUpdateCall { 5764 c := &DrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5765 c.driveId = driveId 5766 c.drive = drive 5767 return c 5768} 5769 5770// UseDomainAdminAccess sets the optional parameter 5771// "useDomainAdminAccess": Issue the request as a domain administrator; 5772// if set to true, then the requester will be granted access if they are 5773// an administrator of the domain to which the shared drive belongs. 5774func (c *DrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesUpdateCall { 5775 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 5776 return c 5777} 5778 5779// Fields allows partial responses to be retrieved. See 5780// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5781// for more information. 5782func (c *DrivesUpdateCall) Fields(s ...googleapi.Field) *DrivesUpdateCall { 5783 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5784 return c 5785} 5786 5787// Context sets the context to be used in this call's Do method. Any 5788// pending HTTP request will be aborted if the provided context is 5789// canceled. 5790func (c *DrivesUpdateCall) Context(ctx context.Context) *DrivesUpdateCall { 5791 c.ctx_ = ctx 5792 return c 5793} 5794 5795// Header returns an http.Header that can be modified by the caller to 5796// add HTTP headers to the request. 5797func (c *DrivesUpdateCall) Header() http.Header { 5798 if c.header_ == nil { 5799 c.header_ = make(http.Header) 5800 } 5801 return c.header_ 5802} 5803 5804func (c *DrivesUpdateCall) doRequest(alt string) (*http.Response, error) { 5805 reqHeaders := make(http.Header) 5806 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 5807 for k, v := range c.header_ { 5808 reqHeaders[k] = v 5809 } 5810 reqHeaders.Set("User-Agent", c.s.userAgent()) 5811 var body io.Reader = nil 5812 body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive) 5813 if err != nil { 5814 return nil, err 5815 } 5816 reqHeaders.Set("Content-Type", "application/json") 5817 c.urlParams_.Set("alt", alt) 5818 c.urlParams_.Set("prettyPrint", "false") 5819 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") 5820 urls += "?" + c.urlParams_.Encode() 5821 req, err := http.NewRequest("PATCH", urls, body) 5822 if err != nil { 5823 return nil, err 5824 } 5825 req.Header = reqHeaders 5826 googleapi.Expand(req.URL, map[string]string{ 5827 "driveId": c.driveId, 5828 }) 5829 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5830} 5831 5832// Do executes the "drive.drives.update" call. 5833// Exactly one of *Drive or error will be non-nil. Any non-2xx status 5834// code is an error. Response headers are in either 5835// *Drive.ServerResponse.Header or (if a response was returned at all) 5836// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5837// check whether the returned error was because http.StatusNotModified 5838// was returned. 5839func (c *DrivesUpdateCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 5840 gensupport.SetOptions(c.urlParams_, opts...) 5841 res, err := c.doRequest("json") 5842 if res != nil && res.StatusCode == http.StatusNotModified { 5843 if res.Body != nil { 5844 res.Body.Close() 5845 } 5846 return nil, &googleapi.Error{ 5847 Code: res.StatusCode, 5848 Header: res.Header, 5849 } 5850 } 5851 if err != nil { 5852 return nil, err 5853 } 5854 defer googleapi.CloseBody(res) 5855 if err := googleapi.CheckResponse(res); err != nil { 5856 return nil, err 5857 } 5858 ret := &Drive{ 5859 ServerResponse: googleapi.ServerResponse{ 5860 Header: res.Header, 5861 HTTPStatusCode: res.StatusCode, 5862 }, 5863 } 5864 target := &ret 5865 if err := gensupport.DecodeResponse(target, res); err != nil { 5866 return nil, err 5867 } 5868 return ret, nil 5869 // { 5870 // "description": "Updates the metadate for a shared drive.", 5871 // "httpMethod": "PATCH", 5872 // "id": "drive.drives.update", 5873 // "parameterOrder": [ 5874 // "driveId" 5875 // ], 5876 // "parameters": { 5877 // "driveId": { 5878 // "description": "The ID of the shared drive.", 5879 // "location": "path", 5880 // "required": true, 5881 // "type": "string" 5882 // }, 5883 // "useDomainAdminAccess": { 5884 // "default": "false", 5885 // "description": "Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the shared drive belongs.", 5886 // "location": "query", 5887 // "type": "boolean" 5888 // } 5889 // }, 5890 // "path": "drives/{driveId}", 5891 // "request": { 5892 // "$ref": "Drive" 5893 // }, 5894 // "response": { 5895 // "$ref": "Drive" 5896 // }, 5897 // "scopes": [ 5898 // "https://www.googleapis.com/auth/drive" 5899 // ] 5900 // } 5901 5902} 5903 5904// method id "drive.files.copy": 5905 5906type FilesCopyCall struct { 5907 s *Service 5908 fileId string 5909 file *File 5910 urlParams_ gensupport.URLParams 5911 ctx_ context.Context 5912 header_ http.Header 5913} 5914 5915// Copy: Creates a copy of a file and applies any requested updates with 5916// patch semantics. Folders cannot be copied. 5917// 5918// - fileId: The ID of the file. 5919func (r *FilesService) Copy(fileId string, file *File) *FilesCopyCall { 5920 c := &FilesCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5921 c.fileId = fileId 5922 c.file = file 5923 return c 5924} 5925 5926// EnforceSingleParent sets the optional parameter 5927// "enforceSingleParent": Deprecated. Copying files into multiple 5928// folders is no longer supported. Use shortcuts instead. 5929func (c *FilesCopyCall) EnforceSingleParent(enforceSingleParent bool) *FilesCopyCall { 5930 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 5931 return c 5932} 5933 5934// IgnoreDefaultVisibility sets the optional parameter 5935// "ignoreDefaultVisibility": Whether to ignore the domain's default 5936// visibility settings for the created file. Domain administrators can 5937// choose to make all uploaded files visible to the domain by default; 5938// this parameter bypasses that behavior for the request. Permissions 5939// are still inherited from parent folders. 5940func (c *FilesCopyCall) IgnoreDefaultVisibility(ignoreDefaultVisibility bool) *FilesCopyCall { 5941 c.urlParams_.Set("ignoreDefaultVisibility", fmt.Sprint(ignoreDefaultVisibility)) 5942 return c 5943} 5944 5945// IncludePermissionsForView sets the optional parameter 5946// "includePermissionsForView": Specifies which additional view's 5947// permissions to include in the response. Only 'published' is 5948// supported. 5949func (c *FilesCopyCall) IncludePermissionsForView(includePermissionsForView string) *FilesCopyCall { 5950 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 5951 return c 5952} 5953 5954// KeepRevisionForever sets the optional parameter 5955// "keepRevisionForever": Whether to set the 'keepForever' field in the 5956// new head revision. This is only applicable to files with binary 5957// content in Google Drive. Only 200 revisions for the file can be kept 5958// forever. If the limit is reached, try deleting pinned revisions. 5959func (c *FilesCopyCall) KeepRevisionForever(keepRevisionForever bool) *FilesCopyCall { 5960 c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever)) 5961 return c 5962} 5963 5964// OcrLanguage sets the optional parameter "ocrLanguage": A language 5965// hint for OCR processing during image import (ISO 639-1 code). 5966func (c *FilesCopyCall) OcrLanguage(ocrLanguage string) *FilesCopyCall { 5967 c.urlParams_.Set("ocrLanguage", ocrLanguage) 5968 return c 5969} 5970 5971// SupportsAllDrives sets the optional parameter "supportsAllDrives": 5972// Whether the requesting application supports both My Drives and shared 5973// drives. 5974func (c *FilesCopyCall) SupportsAllDrives(supportsAllDrives bool) *FilesCopyCall { 5975 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 5976 return c 5977} 5978 5979// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 5980// Deprecated use supportsAllDrives instead. 5981func (c *FilesCopyCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesCopyCall { 5982 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 5983 return c 5984} 5985 5986// Fields allows partial responses to be retrieved. See 5987// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5988// for more information. 5989func (c *FilesCopyCall) Fields(s ...googleapi.Field) *FilesCopyCall { 5990 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5991 return c 5992} 5993 5994// Context sets the context to be used in this call's Do method. Any 5995// pending HTTP request will be aborted if the provided context is 5996// canceled. 5997func (c *FilesCopyCall) Context(ctx context.Context) *FilesCopyCall { 5998 c.ctx_ = ctx 5999 return c 6000} 6001 6002// Header returns an http.Header that can be modified by the caller to 6003// add HTTP headers to the request. 6004func (c *FilesCopyCall) Header() http.Header { 6005 if c.header_ == nil { 6006 c.header_ = make(http.Header) 6007 } 6008 return c.header_ 6009} 6010 6011func (c *FilesCopyCall) doRequest(alt string) (*http.Response, error) { 6012 reqHeaders := make(http.Header) 6013 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6014 for k, v := range c.header_ { 6015 reqHeaders[k] = v 6016 } 6017 reqHeaders.Set("User-Agent", c.s.userAgent()) 6018 var body io.Reader = nil 6019 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 6020 if err != nil { 6021 return nil, err 6022 } 6023 reqHeaders.Set("Content-Type", "application/json") 6024 c.urlParams_.Set("alt", alt) 6025 c.urlParams_.Set("prettyPrint", "false") 6026 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/copy") 6027 urls += "?" + c.urlParams_.Encode() 6028 req, err := http.NewRequest("POST", urls, body) 6029 if err != nil { 6030 return nil, err 6031 } 6032 req.Header = reqHeaders 6033 googleapi.Expand(req.URL, map[string]string{ 6034 "fileId": c.fileId, 6035 }) 6036 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6037} 6038 6039// Do executes the "drive.files.copy" call. 6040// Exactly one of *File or error will be non-nil. Any non-2xx status 6041// code is an error. Response headers are in either 6042// *File.ServerResponse.Header or (if a response was returned at all) in 6043// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6044// whether the returned error was because http.StatusNotModified was 6045// returned. 6046func (c *FilesCopyCall) Do(opts ...googleapi.CallOption) (*File, error) { 6047 gensupport.SetOptions(c.urlParams_, opts...) 6048 res, err := c.doRequest("json") 6049 if res != nil && res.StatusCode == http.StatusNotModified { 6050 if res.Body != nil { 6051 res.Body.Close() 6052 } 6053 return nil, &googleapi.Error{ 6054 Code: res.StatusCode, 6055 Header: res.Header, 6056 } 6057 } 6058 if err != nil { 6059 return nil, err 6060 } 6061 defer googleapi.CloseBody(res) 6062 if err := googleapi.CheckResponse(res); err != nil { 6063 return nil, err 6064 } 6065 ret := &File{ 6066 ServerResponse: googleapi.ServerResponse{ 6067 Header: res.Header, 6068 HTTPStatusCode: res.StatusCode, 6069 }, 6070 } 6071 target := &ret 6072 if err := gensupport.DecodeResponse(target, res); err != nil { 6073 return nil, err 6074 } 6075 return ret, nil 6076 // { 6077 // "description": "Creates a copy of a file and applies any requested updates with patch semantics. Folders cannot be copied.", 6078 // "httpMethod": "POST", 6079 // "id": "drive.files.copy", 6080 // "parameterOrder": [ 6081 // "fileId" 6082 // ], 6083 // "parameters": { 6084 // "enforceSingleParent": { 6085 // "default": "false", 6086 // "description": "Deprecated. Copying files into multiple folders is no longer supported. Use shortcuts instead.", 6087 // "location": "query", 6088 // "type": "boolean" 6089 // }, 6090 // "fileId": { 6091 // "description": "The ID of the file.", 6092 // "location": "path", 6093 // "required": true, 6094 // "type": "string" 6095 // }, 6096 // "ignoreDefaultVisibility": { 6097 // "default": "false", 6098 // "description": "Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.", 6099 // "location": "query", 6100 // "type": "boolean" 6101 // }, 6102 // "includePermissionsForView": { 6103 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 6104 // "location": "query", 6105 // "type": "string" 6106 // }, 6107 // "keepRevisionForever": { 6108 // "default": "false", 6109 // "description": "Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.", 6110 // "location": "query", 6111 // "type": "boolean" 6112 // }, 6113 // "ocrLanguage": { 6114 // "description": "A language hint for OCR processing during image import (ISO 639-1 code).", 6115 // "location": "query", 6116 // "type": "string" 6117 // }, 6118 // "supportsAllDrives": { 6119 // "default": "false", 6120 // "description": "Whether the requesting application supports both My Drives and shared drives.", 6121 // "location": "query", 6122 // "type": "boolean" 6123 // }, 6124 // "supportsTeamDrives": { 6125 // "default": "false", 6126 // "description": "Deprecated use supportsAllDrives instead.", 6127 // "location": "query", 6128 // "type": "boolean" 6129 // } 6130 // }, 6131 // "path": "files/{fileId}/copy", 6132 // "request": { 6133 // "$ref": "File" 6134 // }, 6135 // "response": { 6136 // "$ref": "File" 6137 // }, 6138 // "scopes": [ 6139 // "https://www.googleapis.com/auth/drive", 6140 // "https://www.googleapis.com/auth/drive.appdata", 6141 // "https://www.googleapis.com/auth/drive.file", 6142 // "https://www.googleapis.com/auth/drive.photos.readonly" 6143 // ] 6144 // } 6145 6146} 6147 6148// method id "drive.files.create": 6149 6150type FilesCreateCall struct { 6151 s *Service 6152 file *File 6153 urlParams_ gensupport.URLParams 6154 mediaInfo_ *gensupport.MediaInfo 6155 ctx_ context.Context 6156 header_ http.Header 6157} 6158 6159// Create: Creates a new file. 6160func (r *FilesService) Create(file *File) *FilesCreateCall { 6161 c := &FilesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6162 c.file = file 6163 return c 6164} 6165 6166// EnforceSingleParent sets the optional parameter 6167// "enforceSingleParent": Deprecated. Creating files in multiple folders 6168// is no longer supported. 6169func (c *FilesCreateCall) EnforceSingleParent(enforceSingleParent bool) *FilesCreateCall { 6170 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 6171 return c 6172} 6173 6174// IgnoreDefaultVisibility sets the optional parameter 6175// "ignoreDefaultVisibility": Whether to ignore the domain's default 6176// visibility settings for the created file. Domain administrators can 6177// choose to make all uploaded files visible to the domain by default; 6178// this parameter bypasses that behavior for the request. Permissions 6179// are still inherited from parent folders. 6180func (c *FilesCreateCall) IgnoreDefaultVisibility(ignoreDefaultVisibility bool) *FilesCreateCall { 6181 c.urlParams_.Set("ignoreDefaultVisibility", fmt.Sprint(ignoreDefaultVisibility)) 6182 return c 6183} 6184 6185// IncludePermissionsForView sets the optional parameter 6186// "includePermissionsForView": Specifies which additional view's 6187// permissions to include in the response. Only 'published' is 6188// supported. 6189func (c *FilesCreateCall) IncludePermissionsForView(includePermissionsForView string) *FilesCreateCall { 6190 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 6191 return c 6192} 6193 6194// KeepRevisionForever sets the optional parameter 6195// "keepRevisionForever": Whether to set the 'keepForever' field in the 6196// new head revision. This is only applicable to files with binary 6197// content in Google Drive. Only 200 revisions for the file can be kept 6198// forever. If the limit is reached, try deleting pinned revisions. 6199func (c *FilesCreateCall) KeepRevisionForever(keepRevisionForever bool) *FilesCreateCall { 6200 c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever)) 6201 return c 6202} 6203 6204// OcrLanguage sets the optional parameter "ocrLanguage": A language 6205// hint for OCR processing during image import (ISO 639-1 code). 6206func (c *FilesCreateCall) OcrLanguage(ocrLanguage string) *FilesCreateCall { 6207 c.urlParams_.Set("ocrLanguage", ocrLanguage) 6208 return c 6209} 6210 6211// SupportsAllDrives sets the optional parameter "supportsAllDrives": 6212// Whether the requesting application supports both My Drives and shared 6213// drives. 6214func (c *FilesCreateCall) SupportsAllDrives(supportsAllDrives bool) *FilesCreateCall { 6215 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 6216 return c 6217} 6218 6219// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 6220// Deprecated use supportsAllDrives instead. 6221func (c *FilesCreateCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesCreateCall { 6222 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 6223 return c 6224} 6225 6226// UseContentAsIndexableText sets the optional parameter 6227// "useContentAsIndexableText": Whether to use the uploaded content as 6228// indexable text. 6229func (c *FilesCreateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesCreateCall { 6230 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText)) 6231 return c 6232} 6233 6234// Media specifies the media to upload in one or more chunks. The chunk 6235// size may be controlled by supplying a MediaOption generated by 6236// googleapi.ChunkSize. The chunk size defaults to 6237// googleapi.DefaultUploadChunkSize.The Content-Type header used in the 6238// upload request will be determined by sniffing the contents of r, 6239// unless a MediaOption generated by googleapi.ContentType is 6240// supplied. 6241// At most one of Media and ResumableMedia may be set. 6242func (c *FilesCreateCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesCreateCall { 6243 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) 6244 return c 6245} 6246 6247// ResumableMedia specifies the media to upload in chunks and can be 6248// canceled with ctx. 6249// 6250// Deprecated: use Media instead. 6251// 6252// At most one of Media and ResumableMedia may be set. mediaType 6253// identifies the MIME media type of the upload, such as "image/png". If 6254// mediaType is "", it will be auto-detected. The provided ctx will 6255// supersede any context previously provided to the Context method. 6256func (c *FilesCreateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesCreateCall { 6257 c.ctx_ = ctx 6258 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) 6259 return c 6260} 6261 6262// ProgressUpdater provides a callback function that will be called 6263// after every chunk. It should be a low-latency function in order to 6264// not slow down the upload operation. This should only be called when 6265// using ResumableMedia (as opposed to Media). 6266func (c *FilesCreateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesCreateCall { 6267 c.mediaInfo_.SetProgressUpdater(pu) 6268 return c 6269} 6270 6271// Fields allows partial responses to be retrieved. See 6272// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6273// for more information. 6274func (c *FilesCreateCall) Fields(s ...googleapi.Field) *FilesCreateCall { 6275 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6276 return c 6277} 6278 6279// Context sets the context to be used in this call's Do method. Any 6280// pending HTTP request will be aborted if the provided context is 6281// canceled. 6282// This context will supersede any context previously provided to the 6283// ResumableMedia method. 6284func (c *FilesCreateCall) Context(ctx context.Context) *FilesCreateCall { 6285 c.ctx_ = ctx 6286 return c 6287} 6288 6289// Header returns an http.Header that can be modified by the caller to 6290// add HTTP headers to the request. 6291func (c *FilesCreateCall) Header() http.Header { 6292 if c.header_ == nil { 6293 c.header_ = make(http.Header) 6294 } 6295 return c.header_ 6296} 6297 6298func (c *FilesCreateCall) doRequest(alt string) (*http.Response, error) { 6299 reqHeaders := make(http.Header) 6300 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6301 for k, v := range c.header_ { 6302 reqHeaders[k] = v 6303 } 6304 reqHeaders.Set("User-Agent", c.s.userAgent()) 6305 var body io.Reader = nil 6306 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 6307 if err != nil { 6308 return nil, err 6309 } 6310 reqHeaders.Set("Content-Type", "application/json") 6311 c.urlParams_.Set("alt", alt) 6312 c.urlParams_.Set("prettyPrint", "false") 6313 urls := googleapi.ResolveRelative(c.s.BasePath, "files") 6314 if c.mediaInfo_ != nil { 6315 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v3/files") 6316 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) 6317 } 6318 if body == nil { 6319 body = new(bytes.Buffer) 6320 reqHeaders.Set("Content-Type", "application/json") 6321 } 6322 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) 6323 defer cleanup() 6324 urls += "?" + c.urlParams_.Encode() 6325 req, err := http.NewRequest("POST", urls, body) 6326 if err != nil { 6327 return nil, err 6328 } 6329 req.Header = reqHeaders 6330 req.GetBody = getBody 6331 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6332} 6333 6334// Do executes the "drive.files.create" call. 6335// Exactly one of *File or error will be non-nil. Any non-2xx status 6336// code is an error. Response headers are in either 6337// *File.ServerResponse.Header or (if a response was returned at all) in 6338// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6339// whether the returned error was because http.StatusNotModified was 6340// returned. 6341func (c *FilesCreateCall) Do(opts ...googleapi.CallOption) (*File, error) { 6342 gensupport.SetOptions(c.urlParams_, opts...) 6343 res, err := c.doRequest("json") 6344 if res != nil && res.StatusCode == http.StatusNotModified { 6345 if res.Body != nil { 6346 res.Body.Close() 6347 } 6348 return nil, &googleapi.Error{ 6349 Code: res.StatusCode, 6350 Header: res.Header, 6351 } 6352 } 6353 if err != nil { 6354 return nil, err 6355 } 6356 defer googleapi.CloseBody(res) 6357 if err := googleapi.CheckResponse(res); err != nil { 6358 return nil, err 6359 } 6360 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) 6361 if rx != nil { 6362 rx.Client = c.s.client 6363 rx.UserAgent = c.s.userAgent() 6364 ctx := c.ctx_ 6365 if ctx == nil { 6366 ctx = context.TODO() 6367 } 6368 res, err = rx.Upload(ctx) 6369 if err != nil { 6370 return nil, err 6371 } 6372 defer res.Body.Close() 6373 if err := googleapi.CheckResponse(res); err != nil { 6374 return nil, err 6375 } 6376 } 6377 ret := &File{ 6378 ServerResponse: googleapi.ServerResponse{ 6379 Header: res.Header, 6380 HTTPStatusCode: res.StatusCode, 6381 }, 6382 } 6383 target := &ret 6384 if err := gensupport.DecodeResponse(target, res); err != nil { 6385 return nil, err 6386 } 6387 return ret, nil 6388 // { 6389 // "description": "Creates a new file.", 6390 // "httpMethod": "POST", 6391 // "id": "drive.files.create", 6392 // "mediaUpload": { 6393 // "accept": [ 6394 // "*/*" 6395 // ], 6396 // "maxSize": "5120GB", 6397 // "protocols": { 6398 // "resumable": { 6399 // "multipart": true, 6400 // "path": "/resumable/upload/drive/v3/files" 6401 // }, 6402 // "simple": { 6403 // "multipart": true, 6404 // "path": "/upload/drive/v3/files" 6405 // } 6406 // } 6407 // }, 6408 // "parameters": { 6409 // "enforceSingleParent": { 6410 // "default": "false", 6411 // "description": "Deprecated. Creating files in multiple folders is no longer supported.", 6412 // "location": "query", 6413 // "type": "boolean" 6414 // }, 6415 // "ignoreDefaultVisibility": { 6416 // "default": "false", 6417 // "description": "Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders.", 6418 // "location": "query", 6419 // "type": "boolean" 6420 // }, 6421 // "includePermissionsForView": { 6422 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 6423 // "location": "query", 6424 // "type": "string" 6425 // }, 6426 // "keepRevisionForever": { 6427 // "default": "false", 6428 // "description": "Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.", 6429 // "location": "query", 6430 // "type": "boolean" 6431 // }, 6432 // "ocrLanguage": { 6433 // "description": "A language hint for OCR processing during image import (ISO 639-1 code).", 6434 // "location": "query", 6435 // "type": "string" 6436 // }, 6437 // "supportsAllDrives": { 6438 // "default": "false", 6439 // "description": "Whether the requesting application supports both My Drives and shared drives.", 6440 // "location": "query", 6441 // "type": "boolean" 6442 // }, 6443 // "supportsTeamDrives": { 6444 // "default": "false", 6445 // "description": "Deprecated use supportsAllDrives instead.", 6446 // "location": "query", 6447 // "type": "boolean" 6448 // }, 6449 // "useContentAsIndexableText": { 6450 // "default": "false", 6451 // "description": "Whether to use the uploaded content as indexable text.", 6452 // "location": "query", 6453 // "type": "boolean" 6454 // } 6455 // }, 6456 // "path": "files", 6457 // "request": { 6458 // "$ref": "File" 6459 // }, 6460 // "response": { 6461 // "$ref": "File" 6462 // }, 6463 // "scopes": [ 6464 // "https://www.googleapis.com/auth/drive", 6465 // "https://www.googleapis.com/auth/drive.appdata", 6466 // "https://www.googleapis.com/auth/drive.file" 6467 // ], 6468 // "supportsMediaUpload": true, 6469 // "supportsSubscription": true 6470 // } 6471 6472} 6473 6474// method id "drive.files.delete": 6475 6476type FilesDeleteCall struct { 6477 s *Service 6478 fileId string 6479 urlParams_ gensupport.URLParams 6480 ctx_ context.Context 6481 header_ http.Header 6482} 6483 6484// Delete: Permanently deletes a file owned by the user without moving 6485// it to the trash. If the file belongs to a shared drive the user must 6486// be an organizer on the parent. If the target is a folder, all 6487// descendants owned by the user are also deleted. 6488// 6489// - fileId: The ID of the file. 6490func (r *FilesService) Delete(fileId string) *FilesDeleteCall { 6491 c := &FilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6492 c.fileId = fileId 6493 return c 6494} 6495 6496// EnforceSingleParent sets the optional parameter 6497// "enforceSingleParent": Deprecated. If an item is not in a shared 6498// drive and its last parent is deleted but the item itself is not, the 6499// item will be placed under its owner's root. 6500func (c *FilesDeleteCall) EnforceSingleParent(enforceSingleParent bool) *FilesDeleteCall { 6501 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 6502 return c 6503} 6504 6505// SupportsAllDrives sets the optional parameter "supportsAllDrives": 6506// Whether the requesting application supports both My Drives and shared 6507// drives. 6508func (c *FilesDeleteCall) SupportsAllDrives(supportsAllDrives bool) *FilesDeleteCall { 6509 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 6510 return c 6511} 6512 6513// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 6514// Deprecated use supportsAllDrives instead. 6515func (c *FilesDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesDeleteCall { 6516 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 6517 return c 6518} 6519 6520// Fields allows partial responses to be retrieved. See 6521// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6522// for more information. 6523func (c *FilesDeleteCall) Fields(s ...googleapi.Field) *FilesDeleteCall { 6524 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6525 return c 6526} 6527 6528// Context sets the context to be used in this call's Do method. Any 6529// pending HTTP request will be aborted if the provided context is 6530// canceled. 6531func (c *FilesDeleteCall) Context(ctx context.Context) *FilesDeleteCall { 6532 c.ctx_ = ctx 6533 return c 6534} 6535 6536// Header returns an http.Header that can be modified by the caller to 6537// add HTTP headers to the request. 6538func (c *FilesDeleteCall) Header() http.Header { 6539 if c.header_ == nil { 6540 c.header_ = make(http.Header) 6541 } 6542 return c.header_ 6543} 6544 6545func (c *FilesDeleteCall) doRequest(alt string) (*http.Response, error) { 6546 reqHeaders := make(http.Header) 6547 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6548 for k, v := range c.header_ { 6549 reqHeaders[k] = v 6550 } 6551 reqHeaders.Set("User-Agent", c.s.userAgent()) 6552 var body io.Reader = nil 6553 c.urlParams_.Set("alt", alt) 6554 c.urlParams_.Set("prettyPrint", "false") 6555 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") 6556 urls += "?" + c.urlParams_.Encode() 6557 req, err := http.NewRequest("DELETE", urls, body) 6558 if err != nil { 6559 return nil, err 6560 } 6561 req.Header = reqHeaders 6562 googleapi.Expand(req.URL, map[string]string{ 6563 "fileId": c.fileId, 6564 }) 6565 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6566} 6567 6568// Do executes the "drive.files.delete" call. 6569func (c *FilesDeleteCall) Do(opts ...googleapi.CallOption) error { 6570 gensupport.SetOptions(c.urlParams_, opts...) 6571 res, err := c.doRequest("json") 6572 if err != nil { 6573 return err 6574 } 6575 defer googleapi.CloseBody(res) 6576 if err := googleapi.CheckResponse(res); err != nil { 6577 return err 6578 } 6579 return nil 6580 // { 6581 // "description": "Permanently deletes a file owned by the user without moving it to the trash. If the file belongs to a shared drive the user must be an organizer on the parent. If the target is a folder, all descendants owned by the user are also deleted.", 6582 // "httpMethod": "DELETE", 6583 // "id": "drive.files.delete", 6584 // "parameterOrder": [ 6585 // "fileId" 6586 // ], 6587 // "parameters": { 6588 // "enforceSingleParent": { 6589 // "default": "false", 6590 // "description": "Deprecated. If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root.", 6591 // "location": "query", 6592 // "type": "boolean" 6593 // }, 6594 // "fileId": { 6595 // "description": "The ID of the file.", 6596 // "location": "path", 6597 // "required": true, 6598 // "type": "string" 6599 // }, 6600 // "supportsAllDrives": { 6601 // "default": "false", 6602 // "description": "Whether the requesting application supports both My Drives and shared drives.", 6603 // "location": "query", 6604 // "type": "boolean" 6605 // }, 6606 // "supportsTeamDrives": { 6607 // "default": "false", 6608 // "description": "Deprecated use supportsAllDrives instead.", 6609 // "location": "query", 6610 // "type": "boolean" 6611 // } 6612 // }, 6613 // "path": "files/{fileId}", 6614 // "scopes": [ 6615 // "https://www.googleapis.com/auth/drive", 6616 // "https://www.googleapis.com/auth/drive.appdata", 6617 // "https://www.googleapis.com/auth/drive.file" 6618 // ] 6619 // } 6620 6621} 6622 6623// method id "drive.files.emptyTrash": 6624 6625type FilesEmptyTrashCall struct { 6626 s *Service 6627 urlParams_ gensupport.URLParams 6628 ctx_ context.Context 6629 header_ http.Header 6630} 6631 6632// EmptyTrash: Permanently deletes all of the user's trashed files. 6633func (r *FilesService) EmptyTrash() *FilesEmptyTrashCall { 6634 c := &FilesEmptyTrashCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6635 return c 6636} 6637 6638// EnforceSingleParent sets the optional parameter 6639// "enforceSingleParent": Deprecated. If an item is not in a shared 6640// drive and its last parent is deleted but the item itself is not, the 6641// item will be placed under its owner's root. 6642func (c *FilesEmptyTrashCall) EnforceSingleParent(enforceSingleParent bool) *FilesEmptyTrashCall { 6643 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 6644 return c 6645} 6646 6647// Fields allows partial responses to be retrieved. See 6648// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6649// for more information. 6650func (c *FilesEmptyTrashCall) Fields(s ...googleapi.Field) *FilesEmptyTrashCall { 6651 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6652 return c 6653} 6654 6655// Context sets the context to be used in this call's Do method. Any 6656// pending HTTP request will be aborted if the provided context is 6657// canceled. 6658func (c *FilesEmptyTrashCall) Context(ctx context.Context) *FilesEmptyTrashCall { 6659 c.ctx_ = ctx 6660 return c 6661} 6662 6663// Header returns an http.Header that can be modified by the caller to 6664// add HTTP headers to the request. 6665func (c *FilesEmptyTrashCall) Header() http.Header { 6666 if c.header_ == nil { 6667 c.header_ = make(http.Header) 6668 } 6669 return c.header_ 6670} 6671 6672func (c *FilesEmptyTrashCall) doRequest(alt string) (*http.Response, error) { 6673 reqHeaders := make(http.Header) 6674 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6675 for k, v := range c.header_ { 6676 reqHeaders[k] = v 6677 } 6678 reqHeaders.Set("User-Agent", c.s.userAgent()) 6679 var body io.Reader = nil 6680 c.urlParams_.Set("alt", alt) 6681 c.urlParams_.Set("prettyPrint", "false") 6682 urls := googleapi.ResolveRelative(c.s.BasePath, "files/trash") 6683 urls += "?" + c.urlParams_.Encode() 6684 req, err := http.NewRequest("DELETE", urls, body) 6685 if err != nil { 6686 return nil, err 6687 } 6688 req.Header = reqHeaders 6689 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6690} 6691 6692// Do executes the "drive.files.emptyTrash" call. 6693func (c *FilesEmptyTrashCall) Do(opts ...googleapi.CallOption) error { 6694 gensupport.SetOptions(c.urlParams_, opts...) 6695 res, err := c.doRequest("json") 6696 if err != nil { 6697 return err 6698 } 6699 defer googleapi.CloseBody(res) 6700 if err := googleapi.CheckResponse(res); err != nil { 6701 return err 6702 } 6703 return nil 6704 // { 6705 // "description": "Permanently deletes all of the user's trashed files.", 6706 // "httpMethod": "DELETE", 6707 // "id": "drive.files.emptyTrash", 6708 // "parameters": { 6709 // "enforceSingleParent": { 6710 // "default": "false", 6711 // "description": "Deprecated. If an item is not in a shared drive and its last parent is deleted but the item itself is not, the item will be placed under its owner's root.", 6712 // "location": "query", 6713 // "type": "boolean" 6714 // } 6715 // }, 6716 // "path": "files/trash", 6717 // "scopes": [ 6718 // "https://www.googleapis.com/auth/drive" 6719 // ] 6720 // } 6721 6722} 6723 6724// method id "drive.files.export": 6725 6726type FilesExportCall struct { 6727 s *Service 6728 fileId string 6729 urlParams_ gensupport.URLParams 6730 ifNoneMatch_ string 6731 ctx_ context.Context 6732 header_ http.Header 6733} 6734 6735// Export: Exports a Google Doc to the requested MIME type and returns 6736// the exported content. Please note that the exported content is 6737// limited to 10MB. 6738// 6739// - fileId: The ID of the file. 6740// - mimeType: The MIME type of the format requested for this export. 6741func (r *FilesService) Export(fileId string, mimeType string) *FilesExportCall { 6742 c := &FilesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6743 c.fileId = fileId 6744 c.urlParams_.Set("mimeType", mimeType) 6745 return c 6746} 6747 6748// Fields allows partial responses to be retrieved. See 6749// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6750// for more information. 6751func (c *FilesExportCall) Fields(s ...googleapi.Field) *FilesExportCall { 6752 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6753 return c 6754} 6755 6756// IfNoneMatch sets the optional parameter which makes the operation 6757// fail if the object's ETag matches the given value. This is useful for 6758// getting updates only after the object has changed since the last 6759// request. Use googleapi.IsNotModified to check whether the response 6760// error from Do is the result of In-None-Match. 6761func (c *FilesExportCall) IfNoneMatch(entityTag string) *FilesExportCall { 6762 c.ifNoneMatch_ = entityTag 6763 return c 6764} 6765 6766// Context sets the context to be used in this call's Do and Download 6767// methods. Any pending HTTP request will be aborted if the provided 6768// context is canceled. 6769func (c *FilesExportCall) Context(ctx context.Context) *FilesExportCall { 6770 c.ctx_ = ctx 6771 return c 6772} 6773 6774// Header returns an http.Header that can be modified by the caller to 6775// add HTTP headers to the request. 6776func (c *FilesExportCall) Header() http.Header { 6777 if c.header_ == nil { 6778 c.header_ = make(http.Header) 6779 } 6780 return c.header_ 6781} 6782 6783func (c *FilesExportCall) doRequest(alt string) (*http.Response, error) { 6784 reqHeaders := make(http.Header) 6785 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6786 for k, v := range c.header_ { 6787 reqHeaders[k] = v 6788 } 6789 reqHeaders.Set("User-Agent", c.s.userAgent()) 6790 if c.ifNoneMatch_ != "" { 6791 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6792 } 6793 var body io.Reader = nil 6794 c.urlParams_.Set("alt", alt) 6795 c.urlParams_.Set("prettyPrint", "false") 6796 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/export") 6797 urls += "?" + c.urlParams_.Encode() 6798 req, err := http.NewRequest("GET", urls, body) 6799 if err != nil { 6800 return nil, err 6801 } 6802 req.Header = reqHeaders 6803 googleapi.Expand(req.URL, map[string]string{ 6804 "fileId": c.fileId, 6805 }) 6806 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6807} 6808 6809// Download fetches the API endpoint's "media" value, instead of the normal 6810// API response value. If the returned error is nil, the Response is guaranteed to 6811// have a 2xx status code. Callers must close the Response.Body as usual. 6812func (c *FilesExportCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 6813 gensupport.SetOptions(c.urlParams_, opts...) 6814 res, err := c.doRequest("media") 6815 if err != nil { 6816 return nil, err 6817 } 6818 if err := googleapi.CheckResponse(res); err != nil { 6819 res.Body.Close() 6820 return nil, err 6821 } 6822 return res, nil 6823} 6824 6825// Do executes the "drive.files.export" call. 6826func (c *FilesExportCall) Do(opts ...googleapi.CallOption) error { 6827 gensupport.SetOptions(c.urlParams_, opts...) 6828 res, err := c.doRequest("json") 6829 if err != nil { 6830 return err 6831 } 6832 defer googleapi.CloseBody(res) 6833 if err := googleapi.CheckResponse(res); err != nil { 6834 return err 6835 } 6836 return nil 6837 // { 6838 // "description": "Exports a Google Doc to the requested MIME type and returns the exported content. Please note that the exported content is limited to 10MB.", 6839 // "httpMethod": "GET", 6840 // "id": "drive.files.export", 6841 // "parameterOrder": [ 6842 // "fileId", 6843 // "mimeType" 6844 // ], 6845 // "parameters": { 6846 // "fileId": { 6847 // "description": "The ID of the file.", 6848 // "location": "path", 6849 // "required": true, 6850 // "type": "string" 6851 // }, 6852 // "mimeType": { 6853 // "description": "The MIME type of the format requested for this export.", 6854 // "location": "query", 6855 // "required": true, 6856 // "type": "string" 6857 // } 6858 // }, 6859 // "path": "files/{fileId}/export", 6860 // "scopes": [ 6861 // "https://www.googleapis.com/auth/drive", 6862 // "https://www.googleapis.com/auth/drive.file", 6863 // "https://www.googleapis.com/auth/drive.readonly" 6864 // ], 6865 // "supportsMediaDownload": true 6866 // } 6867 6868} 6869 6870// method id "drive.files.generateIds": 6871 6872type FilesGenerateIdsCall struct { 6873 s *Service 6874 urlParams_ gensupport.URLParams 6875 ifNoneMatch_ string 6876 ctx_ context.Context 6877 header_ http.Header 6878} 6879 6880// GenerateIds: Generates a set of file IDs which can be provided in 6881// create or copy requests. 6882func (r *FilesService) GenerateIds() *FilesGenerateIdsCall { 6883 c := &FilesGenerateIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6884 return c 6885} 6886 6887// Count sets the optional parameter "count": The number of IDs to 6888// return. 6889func (c *FilesGenerateIdsCall) Count(count int64) *FilesGenerateIdsCall { 6890 c.urlParams_.Set("count", fmt.Sprint(count)) 6891 return c 6892} 6893 6894// Space sets the optional parameter "space": The space in which the IDs 6895// can be used to create new files. Supported values are 'drive' and 6896// 'appDataFolder'. (Default: 'drive') 6897func (c *FilesGenerateIdsCall) Space(space string) *FilesGenerateIdsCall { 6898 c.urlParams_.Set("space", space) 6899 return c 6900} 6901 6902// Type sets the optional parameter "type": The type of items which the 6903// IDs can be used for. Supported values are 'files' and 'shortcuts'. 6904// Note that 'shortcuts' are only supported in the drive 'space'. 6905// (Default: 'files') 6906func (c *FilesGenerateIdsCall) Type(type_ string) *FilesGenerateIdsCall { 6907 c.urlParams_.Set("type", type_) 6908 return c 6909} 6910 6911// Fields allows partial responses to be retrieved. See 6912// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6913// for more information. 6914func (c *FilesGenerateIdsCall) Fields(s ...googleapi.Field) *FilesGenerateIdsCall { 6915 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6916 return c 6917} 6918 6919// IfNoneMatch sets the optional parameter which makes the operation 6920// fail if the object's ETag matches the given value. This is useful for 6921// getting updates only after the object has changed since the last 6922// request. Use googleapi.IsNotModified to check whether the response 6923// error from Do is the result of In-None-Match. 6924func (c *FilesGenerateIdsCall) IfNoneMatch(entityTag string) *FilesGenerateIdsCall { 6925 c.ifNoneMatch_ = entityTag 6926 return c 6927} 6928 6929// Context sets the context to be used in this call's Do method. Any 6930// pending HTTP request will be aborted if the provided context is 6931// canceled. 6932func (c *FilesGenerateIdsCall) Context(ctx context.Context) *FilesGenerateIdsCall { 6933 c.ctx_ = ctx 6934 return c 6935} 6936 6937// Header returns an http.Header that can be modified by the caller to 6938// add HTTP headers to the request. 6939func (c *FilesGenerateIdsCall) Header() http.Header { 6940 if c.header_ == nil { 6941 c.header_ = make(http.Header) 6942 } 6943 return c.header_ 6944} 6945 6946func (c *FilesGenerateIdsCall) doRequest(alt string) (*http.Response, error) { 6947 reqHeaders := make(http.Header) 6948 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 6949 for k, v := range c.header_ { 6950 reqHeaders[k] = v 6951 } 6952 reqHeaders.Set("User-Agent", c.s.userAgent()) 6953 if c.ifNoneMatch_ != "" { 6954 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6955 } 6956 var body io.Reader = nil 6957 c.urlParams_.Set("alt", alt) 6958 c.urlParams_.Set("prettyPrint", "false") 6959 urls := googleapi.ResolveRelative(c.s.BasePath, "files/generateIds") 6960 urls += "?" + c.urlParams_.Encode() 6961 req, err := http.NewRequest("GET", urls, body) 6962 if err != nil { 6963 return nil, err 6964 } 6965 req.Header = reqHeaders 6966 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6967} 6968 6969// Do executes the "drive.files.generateIds" call. 6970// Exactly one of *GeneratedIds or error will be non-nil. Any non-2xx 6971// status code is an error. Response headers are in either 6972// *GeneratedIds.ServerResponse.Header or (if a response was returned at 6973// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6974// to check whether the returned error was because 6975// http.StatusNotModified was returned. 6976func (c *FilesGenerateIdsCall) Do(opts ...googleapi.CallOption) (*GeneratedIds, error) { 6977 gensupport.SetOptions(c.urlParams_, opts...) 6978 res, err := c.doRequest("json") 6979 if res != nil && res.StatusCode == http.StatusNotModified { 6980 if res.Body != nil { 6981 res.Body.Close() 6982 } 6983 return nil, &googleapi.Error{ 6984 Code: res.StatusCode, 6985 Header: res.Header, 6986 } 6987 } 6988 if err != nil { 6989 return nil, err 6990 } 6991 defer googleapi.CloseBody(res) 6992 if err := googleapi.CheckResponse(res); err != nil { 6993 return nil, err 6994 } 6995 ret := &GeneratedIds{ 6996 ServerResponse: googleapi.ServerResponse{ 6997 Header: res.Header, 6998 HTTPStatusCode: res.StatusCode, 6999 }, 7000 } 7001 target := &ret 7002 if err := gensupport.DecodeResponse(target, res); err != nil { 7003 return nil, err 7004 } 7005 return ret, nil 7006 // { 7007 // "description": "Generates a set of file IDs which can be provided in create or copy requests.", 7008 // "httpMethod": "GET", 7009 // "id": "drive.files.generateIds", 7010 // "parameters": { 7011 // "count": { 7012 // "default": "10", 7013 // "description": "The number of IDs to return.", 7014 // "format": "int32", 7015 // "location": "query", 7016 // "maximum": "1000", 7017 // "minimum": "1", 7018 // "type": "integer" 7019 // }, 7020 // "space": { 7021 // "default": "drive", 7022 // "description": "The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'. (Default: 'drive')", 7023 // "location": "query", 7024 // "type": "string" 7025 // }, 7026 // "type": { 7027 // "default": "files", 7028 // "description": "The type of items which the IDs can be used for. Supported values are 'files' and 'shortcuts'. Note that 'shortcuts' are only supported in the drive 'space'. (Default: 'files')", 7029 // "location": "query", 7030 // "type": "string" 7031 // } 7032 // }, 7033 // "path": "files/generateIds", 7034 // "response": { 7035 // "$ref": "GeneratedIds" 7036 // }, 7037 // "scopes": [ 7038 // "https://www.googleapis.com/auth/drive", 7039 // "https://www.googleapis.com/auth/drive.appdata", 7040 // "https://www.googleapis.com/auth/drive.file" 7041 // ] 7042 // } 7043 7044} 7045 7046// method id "drive.files.get": 7047 7048type FilesGetCall struct { 7049 s *Service 7050 fileId string 7051 urlParams_ gensupport.URLParams 7052 ifNoneMatch_ string 7053 ctx_ context.Context 7054 header_ http.Header 7055} 7056 7057// Get: Gets a file's metadata or content by ID. 7058// 7059// - fileId: The ID of the file. 7060func (r *FilesService) Get(fileId string) *FilesGetCall { 7061 c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7062 c.fileId = fileId 7063 return c 7064} 7065 7066// AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": 7067// Whether the user is acknowledging the risk of downloading known 7068// malware or other abusive files. This is only applicable when 7069// alt=media. 7070func (c *FilesGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesGetCall { 7071 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse)) 7072 return c 7073} 7074 7075// IncludePermissionsForView sets the optional parameter 7076// "includePermissionsForView": Specifies which additional view's 7077// permissions to include in the response. Only 'published' is 7078// supported. 7079func (c *FilesGetCall) IncludePermissionsForView(includePermissionsForView string) *FilesGetCall { 7080 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 7081 return c 7082} 7083 7084// SupportsAllDrives sets the optional parameter "supportsAllDrives": 7085// Whether the requesting application supports both My Drives and shared 7086// drives. 7087func (c *FilesGetCall) SupportsAllDrives(supportsAllDrives bool) *FilesGetCall { 7088 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 7089 return c 7090} 7091 7092// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 7093// Deprecated use supportsAllDrives instead. 7094func (c *FilesGetCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesGetCall { 7095 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 7096 return c 7097} 7098 7099// Fields allows partial responses to be retrieved. See 7100// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7101// for more information. 7102func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall { 7103 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7104 return c 7105} 7106 7107// IfNoneMatch sets the optional parameter which makes the operation 7108// fail if the object's ETag matches the given value. This is useful for 7109// getting updates only after the object has changed since the last 7110// request. Use googleapi.IsNotModified to check whether the response 7111// error from Do is the result of In-None-Match. 7112func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall { 7113 c.ifNoneMatch_ = entityTag 7114 return c 7115} 7116 7117// Context sets the context to be used in this call's Do and Download 7118// methods. Any pending HTTP request will be aborted if the provided 7119// context is canceled. 7120func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall { 7121 c.ctx_ = ctx 7122 return c 7123} 7124 7125// Header returns an http.Header that can be modified by the caller to 7126// add HTTP headers to the request. 7127func (c *FilesGetCall) Header() http.Header { 7128 if c.header_ == nil { 7129 c.header_ = make(http.Header) 7130 } 7131 return c.header_ 7132} 7133 7134func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { 7135 reqHeaders := make(http.Header) 7136 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 7137 for k, v := range c.header_ { 7138 reqHeaders[k] = v 7139 } 7140 reqHeaders.Set("User-Agent", c.s.userAgent()) 7141 if c.ifNoneMatch_ != "" { 7142 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7143 } 7144 var body io.Reader = nil 7145 c.urlParams_.Set("alt", alt) 7146 c.urlParams_.Set("prettyPrint", "false") 7147 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") 7148 urls += "?" + c.urlParams_.Encode() 7149 req, err := http.NewRequest("GET", urls, body) 7150 if err != nil { 7151 return nil, err 7152 } 7153 req.Header = reqHeaders 7154 googleapi.Expand(req.URL, map[string]string{ 7155 "fileId": c.fileId, 7156 }) 7157 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7158} 7159 7160// Download fetches the API endpoint's "media" value, instead of the normal 7161// API response value. If the returned error is nil, the Response is guaranteed to 7162// have a 2xx status code. Callers must close the Response.Body as usual. 7163func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 7164 gensupport.SetOptions(c.urlParams_, opts...) 7165 res, err := c.doRequest("media") 7166 if err != nil { 7167 return nil, err 7168 } 7169 if err := googleapi.CheckResponse(res); err != nil { 7170 res.Body.Close() 7171 return nil, err 7172 } 7173 return res, nil 7174} 7175 7176// Do executes the "drive.files.get" call. 7177// Exactly one of *File or error will be non-nil. Any non-2xx status 7178// code is an error. Response headers are in either 7179// *File.ServerResponse.Header or (if a response was returned at all) in 7180// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7181// whether the returned error was because http.StatusNotModified was 7182// returned. 7183func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) { 7184 gensupport.SetOptions(c.urlParams_, opts...) 7185 res, err := c.doRequest("json") 7186 if res != nil && res.StatusCode == http.StatusNotModified { 7187 if res.Body != nil { 7188 res.Body.Close() 7189 } 7190 return nil, &googleapi.Error{ 7191 Code: res.StatusCode, 7192 Header: res.Header, 7193 } 7194 } 7195 if err != nil { 7196 return nil, err 7197 } 7198 defer googleapi.CloseBody(res) 7199 if err := googleapi.CheckResponse(res); err != nil { 7200 return nil, err 7201 } 7202 ret := &File{ 7203 ServerResponse: googleapi.ServerResponse{ 7204 Header: res.Header, 7205 HTTPStatusCode: res.StatusCode, 7206 }, 7207 } 7208 target := &ret 7209 if err := gensupport.DecodeResponse(target, res); err != nil { 7210 return nil, err 7211 } 7212 return ret, nil 7213 // { 7214 // "description": "Gets a file's metadata or content by ID.", 7215 // "httpMethod": "GET", 7216 // "id": "drive.files.get", 7217 // "parameterOrder": [ 7218 // "fileId" 7219 // ], 7220 // "parameters": { 7221 // "acknowledgeAbuse": { 7222 // "default": "false", 7223 // "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.", 7224 // "location": "query", 7225 // "type": "boolean" 7226 // }, 7227 // "fileId": { 7228 // "description": "The ID of the file.", 7229 // "location": "path", 7230 // "required": true, 7231 // "type": "string" 7232 // }, 7233 // "includePermissionsForView": { 7234 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 7235 // "location": "query", 7236 // "type": "string" 7237 // }, 7238 // "supportsAllDrives": { 7239 // "default": "false", 7240 // "description": "Whether the requesting application supports both My Drives and shared drives.", 7241 // "location": "query", 7242 // "type": "boolean" 7243 // }, 7244 // "supportsTeamDrives": { 7245 // "default": "false", 7246 // "description": "Deprecated use supportsAllDrives instead.", 7247 // "location": "query", 7248 // "type": "boolean" 7249 // } 7250 // }, 7251 // "path": "files/{fileId}", 7252 // "response": { 7253 // "$ref": "File" 7254 // }, 7255 // "scopes": [ 7256 // "https://www.googleapis.com/auth/drive", 7257 // "https://www.googleapis.com/auth/drive.appdata", 7258 // "https://www.googleapis.com/auth/drive.file", 7259 // "https://www.googleapis.com/auth/drive.metadata", 7260 // "https://www.googleapis.com/auth/drive.metadata.readonly", 7261 // "https://www.googleapis.com/auth/drive.photos.readonly", 7262 // "https://www.googleapis.com/auth/drive.readonly" 7263 // ], 7264 // "supportsMediaDownload": true, 7265 // "supportsSubscription": true, 7266 // "useMediaDownloadService": true 7267 // } 7268 7269} 7270 7271// method id "drive.files.list": 7272 7273type FilesListCall struct { 7274 s *Service 7275 urlParams_ gensupport.URLParams 7276 ifNoneMatch_ string 7277 ctx_ context.Context 7278 header_ http.Header 7279} 7280 7281// List: Lists or searches files. 7282func (r *FilesService) List() *FilesListCall { 7283 c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7284 return c 7285} 7286 7287// Corpora sets the optional parameter "corpora": Groupings of files to 7288// which the query applies. Supported groupings are: 'user' (files 7289// created by, opened by, or shared directly with the user), 'drive' 7290// (files in the specified shared drive as indicated by the 'driveId'), 7291// 'domain' (files shared to the user's domain), and 'allDrives' (A 7292// combination of 'user' and 'drive' for all drives where the user is a 7293// member). When able, use 'user' or 'drive', instead of 'allDrives', 7294// for efficiency. 7295func (c *FilesListCall) Corpora(corpora string) *FilesListCall { 7296 c.urlParams_.Set("corpora", corpora) 7297 return c 7298} 7299 7300// Corpus sets the optional parameter "corpus": The source of files to 7301// list. Deprecated: use 'corpora' instead. 7302// 7303// Possible values: 7304// "domain" - Files shared to the user's domain. 7305// "user" - Files owned by or shared to the user. If a user has 7306// permissions on a Shared Drive, the files inside it won't be retrieved 7307// unless the user has created, opened, or shared the file. 7308func (c *FilesListCall) Corpus(corpus string) *FilesListCall { 7309 c.urlParams_.Set("corpus", corpus) 7310 return c 7311} 7312 7313// DriveId sets the optional parameter "driveId": ID of the shared drive 7314// to search. 7315func (c *FilesListCall) DriveId(driveId string) *FilesListCall { 7316 c.urlParams_.Set("driveId", driveId) 7317 return c 7318} 7319 7320// IncludeItemsFromAllDrives sets the optional parameter 7321// "includeItemsFromAllDrives": Whether both My Drive and shared drive 7322// items should be included in results. 7323func (c *FilesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *FilesListCall { 7324 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives)) 7325 return c 7326} 7327 7328// IncludePermissionsForView sets the optional parameter 7329// "includePermissionsForView": Specifies which additional view's 7330// permissions to include in the response. Only 'published' is 7331// supported. 7332func (c *FilesListCall) IncludePermissionsForView(includePermissionsForView string) *FilesListCall { 7333 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 7334 return c 7335} 7336 7337// IncludeTeamDriveItems sets the optional parameter 7338// "includeTeamDriveItems": Deprecated use includeItemsFromAllDrives 7339// instead. 7340func (c *FilesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *FilesListCall { 7341 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems)) 7342 return c 7343} 7344 7345// OrderBy sets the optional parameter "orderBy": A comma-separated list 7346// of sort keys. Valid keys are 'createdTime', 'folder', 7347// 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 7348// 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 7349// 'viewedByMeTime'. Each key sorts ascending by default, but may be 7350// reversed with the 'desc' modifier. Example usage: 7351// ?orderBy=folder,modifiedTime desc,name. Please note that there is a 7352// current limitation for users with approximately one million files in 7353// which the requested sort order is ignored. 7354func (c *FilesListCall) OrderBy(orderBy string) *FilesListCall { 7355 c.urlParams_.Set("orderBy", orderBy) 7356 return c 7357} 7358 7359// PageSize sets the optional parameter "pageSize": The maximum number 7360// of files to return per page. Partial or empty result pages are 7361// possible even before the end of the files list has been reached. 7362func (c *FilesListCall) PageSize(pageSize int64) *FilesListCall { 7363 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7364 return c 7365} 7366 7367// PageToken sets the optional parameter "pageToken": The token for 7368// continuing a previous list request on the next page. This should be 7369// set to the value of 'nextPageToken' from the previous response. 7370func (c *FilesListCall) PageToken(pageToken string) *FilesListCall { 7371 c.urlParams_.Set("pageToken", pageToken) 7372 return c 7373} 7374 7375// Q sets the optional parameter "q": A query for filtering the file 7376// results. See the "Search for Files" guide for supported syntax. 7377func (c *FilesListCall) Q(q string) *FilesListCall { 7378 c.urlParams_.Set("q", q) 7379 return c 7380} 7381 7382// Spaces sets the optional parameter "spaces": A comma-separated list 7383// of spaces to query within the corpus. Supported values are 'drive' 7384// and 'appDataFolder'. 7385func (c *FilesListCall) Spaces(spaces string) *FilesListCall { 7386 c.urlParams_.Set("spaces", spaces) 7387 return c 7388} 7389 7390// SupportsAllDrives sets the optional parameter "supportsAllDrives": 7391// Whether the requesting application supports both My Drives and shared 7392// drives. 7393func (c *FilesListCall) SupportsAllDrives(supportsAllDrives bool) *FilesListCall { 7394 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 7395 return c 7396} 7397 7398// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 7399// Deprecated use supportsAllDrives instead. 7400func (c *FilesListCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesListCall { 7401 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 7402 return c 7403} 7404 7405// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 7406// driveId instead. 7407func (c *FilesListCall) TeamDriveId(teamDriveId string) *FilesListCall { 7408 c.urlParams_.Set("teamDriveId", teamDriveId) 7409 return c 7410} 7411 7412// Fields allows partial responses to be retrieved. See 7413// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7414// for more information. 7415func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall { 7416 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7417 return c 7418} 7419 7420// IfNoneMatch sets the optional parameter which makes the operation 7421// fail if the object's ETag matches the given value. This is useful for 7422// getting updates only after the object has changed since the last 7423// request. Use googleapi.IsNotModified to check whether the response 7424// error from Do is the result of In-None-Match. 7425func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall { 7426 c.ifNoneMatch_ = entityTag 7427 return c 7428} 7429 7430// Context sets the context to be used in this call's Do method. Any 7431// pending HTTP request will be aborted if the provided context is 7432// canceled. 7433func (c *FilesListCall) Context(ctx context.Context) *FilesListCall { 7434 c.ctx_ = ctx 7435 return c 7436} 7437 7438// Header returns an http.Header that can be modified by the caller to 7439// add HTTP headers to the request. 7440func (c *FilesListCall) Header() http.Header { 7441 if c.header_ == nil { 7442 c.header_ = make(http.Header) 7443 } 7444 return c.header_ 7445} 7446 7447func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { 7448 reqHeaders := make(http.Header) 7449 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 7450 for k, v := range c.header_ { 7451 reqHeaders[k] = v 7452 } 7453 reqHeaders.Set("User-Agent", c.s.userAgent()) 7454 if c.ifNoneMatch_ != "" { 7455 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7456 } 7457 var body io.Reader = nil 7458 c.urlParams_.Set("alt", alt) 7459 c.urlParams_.Set("prettyPrint", "false") 7460 urls := googleapi.ResolveRelative(c.s.BasePath, "files") 7461 urls += "?" + c.urlParams_.Encode() 7462 req, err := http.NewRequest("GET", urls, body) 7463 if err != nil { 7464 return nil, err 7465 } 7466 req.Header = reqHeaders 7467 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7468} 7469 7470// Do executes the "drive.files.list" call. 7471// Exactly one of *FileList or error will be non-nil. Any non-2xx status 7472// code is an error. Response headers are in either 7473// *FileList.ServerResponse.Header or (if a response was returned at 7474// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7475// to check whether the returned error was because 7476// http.StatusNotModified was returned. 7477func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) { 7478 gensupport.SetOptions(c.urlParams_, opts...) 7479 res, err := c.doRequest("json") 7480 if res != nil && res.StatusCode == http.StatusNotModified { 7481 if res.Body != nil { 7482 res.Body.Close() 7483 } 7484 return nil, &googleapi.Error{ 7485 Code: res.StatusCode, 7486 Header: res.Header, 7487 } 7488 } 7489 if err != nil { 7490 return nil, err 7491 } 7492 defer googleapi.CloseBody(res) 7493 if err := googleapi.CheckResponse(res); err != nil { 7494 return nil, err 7495 } 7496 ret := &FileList{ 7497 ServerResponse: googleapi.ServerResponse{ 7498 Header: res.Header, 7499 HTTPStatusCode: res.StatusCode, 7500 }, 7501 } 7502 target := &ret 7503 if err := gensupport.DecodeResponse(target, res); err != nil { 7504 return nil, err 7505 } 7506 return ret, nil 7507 // { 7508 // "description": "Lists or searches files.", 7509 // "httpMethod": "GET", 7510 // "id": "drive.files.list", 7511 // "parameters": { 7512 // "corpora": { 7513 // "description": "Groupings of files to which the query applies. Supported groupings are: 'user' (files created by, opened by, or shared directly with the user), 'drive' (files in the specified shared drive as indicated by the 'driveId'), 'domain' (files shared to the user's domain), and 'allDrives' (A combination of 'user' and 'drive' for all drives where the user is a member). When able, use 'user' or 'drive', instead of 'allDrives', for efficiency.", 7514 // "location": "query", 7515 // "type": "string" 7516 // }, 7517 // "corpus": { 7518 // "description": "The source of files to list. Deprecated: use 'corpora' instead.", 7519 // "enum": [ 7520 // "domain", 7521 // "user" 7522 // ], 7523 // "enumDescriptions": [ 7524 // "Files shared to the user's domain.", 7525 // "Files owned by or shared to the user. If a user has permissions on a Shared Drive, the files inside it won't be retrieved unless the user has created, opened, or shared the file." 7526 // ], 7527 // "location": "query", 7528 // "type": "string" 7529 // }, 7530 // "driveId": { 7531 // "description": "ID of the shared drive to search.", 7532 // "location": "query", 7533 // "type": "string" 7534 // }, 7535 // "includeItemsFromAllDrives": { 7536 // "default": "false", 7537 // "description": "Whether both My Drive and shared drive items should be included in results.", 7538 // "location": "query", 7539 // "type": "boolean" 7540 // }, 7541 // "includePermissionsForView": { 7542 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 7543 // "location": "query", 7544 // "type": "string" 7545 // }, 7546 // "includeTeamDriveItems": { 7547 // "default": "false", 7548 // "description": "Deprecated use includeItemsFromAllDrives instead.", 7549 // "location": "query", 7550 // "type": "boolean" 7551 // }, 7552 // "orderBy": { 7553 // "description": "A comma-separated list of sort keys. Valid keys are 'createdTime', 'folder', 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 'viewedByMeTime'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedTime desc,name. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.", 7554 // "location": "query", 7555 // "type": "string" 7556 // }, 7557 // "pageSize": { 7558 // "default": "100", 7559 // "description": "The maximum number of files to return per page. Partial or empty result pages are possible even before the end of the files list has been reached.", 7560 // "format": "int32", 7561 // "location": "query", 7562 // "maximum": "1000", 7563 // "minimum": "1", 7564 // "type": "integer" 7565 // }, 7566 // "pageToken": { 7567 // "description": "The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.", 7568 // "location": "query", 7569 // "type": "string" 7570 // }, 7571 // "q": { 7572 // "description": "A query for filtering the file results. See the \"Search for Files\" guide for supported syntax.", 7573 // "location": "query", 7574 // "type": "string" 7575 // }, 7576 // "spaces": { 7577 // "default": "drive", 7578 // "description": "A comma-separated list of spaces to query within the corpus. Supported values are 'drive' and 'appDataFolder'.", 7579 // "location": "query", 7580 // "type": "string" 7581 // }, 7582 // "supportsAllDrives": { 7583 // "default": "false", 7584 // "description": "Whether the requesting application supports both My Drives and shared drives.", 7585 // "location": "query", 7586 // "type": "boolean" 7587 // }, 7588 // "supportsTeamDrives": { 7589 // "default": "false", 7590 // "description": "Deprecated use supportsAllDrives instead.", 7591 // "location": "query", 7592 // "type": "boolean" 7593 // }, 7594 // "teamDriveId": { 7595 // "description": "Deprecated use driveId instead.", 7596 // "location": "query", 7597 // "type": "string" 7598 // } 7599 // }, 7600 // "path": "files", 7601 // "response": { 7602 // "$ref": "FileList" 7603 // }, 7604 // "scopes": [ 7605 // "https://www.googleapis.com/auth/drive", 7606 // "https://www.googleapis.com/auth/drive.appdata", 7607 // "https://www.googleapis.com/auth/drive.file", 7608 // "https://www.googleapis.com/auth/drive.metadata", 7609 // "https://www.googleapis.com/auth/drive.metadata.readonly", 7610 // "https://www.googleapis.com/auth/drive.photos.readonly", 7611 // "https://www.googleapis.com/auth/drive.readonly" 7612 // ] 7613 // } 7614 7615} 7616 7617// Pages invokes f for each page of results. 7618// A non-nil error returned from f will halt the iteration. 7619// The provided context supersedes any context provided to the Context method. 7620func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error { 7621 c.ctx_ = ctx 7622 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7623 for { 7624 x, err := c.Do() 7625 if err != nil { 7626 return err 7627 } 7628 if err := f(x); err != nil { 7629 return err 7630 } 7631 if x.NextPageToken == "" { 7632 return nil 7633 } 7634 c.PageToken(x.NextPageToken) 7635 } 7636} 7637 7638// method id "drive.files.update": 7639 7640type FilesUpdateCall struct { 7641 s *Service 7642 fileId string 7643 file *File 7644 urlParams_ gensupport.URLParams 7645 mediaInfo_ *gensupport.MediaInfo 7646 ctx_ context.Context 7647 header_ http.Header 7648} 7649 7650// Update: Updates a file's metadata and/or content. This method 7651// supports patch semantics. 7652// 7653// - fileId: The ID of the file. 7654func (r *FilesService) Update(fileId string, file *File) *FilesUpdateCall { 7655 c := &FilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7656 c.fileId = fileId 7657 c.file = file 7658 return c 7659} 7660 7661// AddParents sets the optional parameter "addParents": A 7662// comma-separated list of parent IDs to add. 7663func (c *FilesUpdateCall) AddParents(addParents string) *FilesUpdateCall { 7664 c.urlParams_.Set("addParents", addParents) 7665 return c 7666} 7667 7668// EnforceSingleParent sets the optional parameter 7669// "enforceSingleParent": Deprecated. Adding files to multiple folders 7670// is no longer supported. Use shortcuts instead. 7671func (c *FilesUpdateCall) EnforceSingleParent(enforceSingleParent bool) *FilesUpdateCall { 7672 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 7673 return c 7674} 7675 7676// IncludePermissionsForView sets the optional parameter 7677// "includePermissionsForView": Specifies which additional view's 7678// permissions to include in the response. Only 'published' is 7679// supported. 7680func (c *FilesUpdateCall) IncludePermissionsForView(includePermissionsForView string) *FilesUpdateCall { 7681 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 7682 return c 7683} 7684 7685// KeepRevisionForever sets the optional parameter 7686// "keepRevisionForever": Whether to set the 'keepForever' field in the 7687// new head revision. This is only applicable to files with binary 7688// content in Google Drive. Only 200 revisions for the file can be kept 7689// forever. If the limit is reached, try deleting pinned revisions. 7690func (c *FilesUpdateCall) KeepRevisionForever(keepRevisionForever bool) *FilesUpdateCall { 7691 c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever)) 7692 return c 7693} 7694 7695// OcrLanguage sets the optional parameter "ocrLanguage": A language 7696// hint for OCR processing during image import (ISO 639-1 code). 7697func (c *FilesUpdateCall) OcrLanguage(ocrLanguage string) *FilesUpdateCall { 7698 c.urlParams_.Set("ocrLanguage", ocrLanguage) 7699 return c 7700} 7701 7702// RemoveParents sets the optional parameter "removeParents": A 7703// comma-separated list of parent IDs to remove. 7704func (c *FilesUpdateCall) RemoveParents(removeParents string) *FilesUpdateCall { 7705 c.urlParams_.Set("removeParents", removeParents) 7706 return c 7707} 7708 7709// SupportsAllDrives sets the optional parameter "supportsAllDrives": 7710// Whether the requesting application supports both My Drives and shared 7711// drives. 7712func (c *FilesUpdateCall) SupportsAllDrives(supportsAllDrives bool) *FilesUpdateCall { 7713 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 7714 return c 7715} 7716 7717// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 7718// Deprecated use supportsAllDrives instead. 7719func (c *FilesUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesUpdateCall { 7720 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 7721 return c 7722} 7723 7724// UseContentAsIndexableText sets the optional parameter 7725// "useContentAsIndexableText": Whether to use the uploaded content as 7726// indexable text. 7727func (c *FilesUpdateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesUpdateCall { 7728 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText)) 7729 return c 7730} 7731 7732// Media specifies the media to upload in one or more chunks. The chunk 7733// size may be controlled by supplying a MediaOption generated by 7734// googleapi.ChunkSize. The chunk size defaults to 7735// googleapi.DefaultUploadChunkSize.The Content-Type header used in the 7736// upload request will be determined by sniffing the contents of r, 7737// unless a MediaOption generated by googleapi.ContentType is 7738// supplied. 7739// At most one of Media and ResumableMedia may be set. 7740func (c *FilesUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesUpdateCall { 7741 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) 7742 return c 7743} 7744 7745// ResumableMedia specifies the media to upload in chunks and can be 7746// canceled with ctx. 7747// 7748// Deprecated: use Media instead. 7749// 7750// At most one of Media and ResumableMedia may be set. mediaType 7751// identifies the MIME media type of the upload, such as "image/png". If 7752// mediaType is "", it will be auto-detected. The provided ctx will 7753// supersede any context previously provided to the Context method. 7754func (c *FilesUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesUpdateCall { 7755 c.ctx_ = ctx 7756 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) 7757 return c 7758} 7759 7760// ProgressUpdater provides a callback function that will be called 7761// after every chunk. It should be a low-latency function in order to 7762// not slow down the upload operation. This should only be called when 7763// using ResumableMedia (as opposed to Media). 7764func (c *FilesUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesUpdateCall { 7765 c.mediaInfo_.SetProgressUpdater(pu) 7766 return c 7767} 7768 7769// Fields allows partial responses to be retrieved. See 7770// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7771// for more information. 7772func (c *FilesUpdateCall) Fields(s ...googleapi.Field) *FilesUpdateCall { 7773 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7774 return c 7775} 7776 7777// Context sets the context to be used in this call's Do method. Any 7778// pending HTTP request will be aborted if the provided context is 7779// canceled. 7780// This context will supersede any context previously provided to the 7781// ResumableMedia method. 7782func (c *FilesUpdateCall) Context(ctx context.Context) *FilesUpdateCall { 7783 c.ctx_ = ctx 7784 return c 7785} 7786 7787// Header returns an http.Header that can be modified by the caller to 7788// add HTTP headers to the request. 7789func (c *FilesUpdateCall) Header() http.Header { 7790 if c.header_ == nil { 7791 c.header_ = make(http.Header) 7792 } 7793 return c.header_ 7794} 7795 7796func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) { 7797 reqHeaders := make(http.Header) 7798 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 7799 for k, v := range c.header_ { 7800 reqHeaders[k] = v 7801 } 7802 reqHeaders.Set("User-Agent", c.s.userAgent()) 7803 var body io.Reader = nil 7804 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 7805 if err != nil { 7806 return nil, err 7807 } 7808 reqHeaders.Set("Content-Type", "application/json") 7809 c.urlParams_.Set("alt", alt) 7810 c.urlParams_.Set("prettyPrint", "false") 7811 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") 7812 if c.mediaInfo_ != nil { 7813 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v3/files/{fileId}") 7814 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) 7815 } 7816 if body == nil { 7817 body = new(bytes.Buffer) 7818 reqHeaders.Set("Content-Type", "application/json") 7819 } 7820 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) 7821 defer cleanup() 7822 urls += "?" + c.urlParams_.Encode() 7823 req, err := http.NewRequest("PATCH", urls, body) 7824 if err != nil { 7825 return nil, err 7826 } 7827 req.Header = reqHeaders 7828 req.GetBody = getBody 7829 googleapi.Expand(req.URL, map[string]string{ 7830 "fileId": c.fileId, 7831 }) 7832 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7833} 7834 7835// Do executes the "drive.files.update" call. 7836// Exactly one of *File or error will be non-nil. Any non-2xx status 7837// code is an error. Response headers are in either 7838// *File.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 7841// returned. 7842func (c *FilesUpdateCall) Do(opts ...googleapi.CallOption) (*File, error) { 7843 gensupport.SetOptions(c.urlParams_, opts...) 7844 res, err := c.doRequest("json") 7845 if res != nil && res.StatusCode == http.StatusNotModified { 7846 if res.Body != nil { 7847 res.Body.Close() 7848 } 7849 return nil, &googleapi.Error{ 7850 Code: res.StatusCode, 7851 Header: res.Header, 7852 } 7853 } 7854 if err != nil { 7855 return nil, err 7856 } 7857 defer googleapi.CloseBody(res) 7858 if err := googleapi.CheckResponse(res); err != nil { 7859 return nil, err 7860 } 7861 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) 7862 if rx != nil { 7863 rx.Client = c.s.client 7864 rx.UserAgent = c.s.userAgent() 7865 ctx := c.ctx_ 7866 if ctx == nil { 7867 ctx = context.TODO() 7868 } 7869 res, err = rx.Upload(ctx) 7870 if err != nil { 7871 return nil, err 7872 } 7873 defer res.Body.Close() 7874 if err := googleapi.CheckResponse(res); err != nil { 7875 return nil, err 7876 } 7877 } 7878 ret := &File{ 7879 ServerResponse: googleapi.ServerResponse{ 7880 Header: res.Header, 7881 HTTPStatusCode: res.StatusCode, 7882 }, 7883 } 7884 target := &ret 7885 if err := gensupport.DecodeResponse(target, res); err != nil { 7886 return nil, err 7887 } 7888 return ret, nil 7889 // { 7890 // "description": "Updates a file's metadata and/or content. This method supports patch semantics.", 7891 // "httpMethod": "PATCH", 7892 // "id": "drive.files.update", 7893 // "mediaUpload": { 7894 // "accept": [ 7895 // "*/*" 7896 // ], 7897 // "maxSize": "5120GB", 7898 // "protocols": { 7899 // "resumable": { 7900 // "multipart": true, 7901 // "path": "/resumable/upload/drive/v3/files/{fileId}" 7902 // }, 7903 // "simple": { 7904 // "multipart": true, 7905 // "path": "/upload/drive/v3/files/{fileId}" 7906 // } 7907 // } 7908 // }, 7909 // "parameterOrder": [ 7910 // "fileId" 7911 // ], 7912 // "parameters": { 7913 // "addParents": { 7914 // "description": "A comma-separated list of parent IDs to add.", 7915 // "location": "query", 7916 // "type": "string" 7917 // }, 7918 // "enforceSingleParent": { 7919 // "default": "false", 7920 // "description": "Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead.", 7921 // "location": "query", 7922 // "type": "boolean" 7923 // }, 7924 // "fileId": { 7925 // "description": "The ID of the file.", 7926 // "location": "path", 7927 // "required": true, 7928 // "type": "string" 7929 // }, 7930 // "includePermissionsForView": { 7931 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 7932 // "location": "query", 7933 // "type": "string" 7934 // }, 7935 // "keepRevisionForever": { 7936 // "default": "false", 7937 // "description": "Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions.", 7938 // "location": "query", 7939 // "type": "boolean" 7940 // }, 7941 // "ocrLanguage": { 7942 // "description": "A language hint for OCR processing during image import (ISO 639-1 code).", 7943 // "location": "query", 7944 // "type": "string" 7945 // }, 7946 // "removeParents": { 7947 // "description": "A comma-separated list of parent IDs to remove.", 7948 // "location": "query", 7949 // "type": "string" 7950 // }, 7951 // "supportsAllDrives": { 7952 // "default": "false", 7953 // "description": "Whether the requesting application supports both My Drives and shared drives.", 7954 // "location": "query", 7955 // "type": "boolean" 7956 // }, 7957 // "supportsTeamDrives": { 7958 // "default": "false", 7959 // "description": "Deprecated use supportsAllDrives instead.", 7960 // "location": "query", 7961 // "type": "boolean" 7962 // }, 7963 // "useContentAsIndexableText": { 7964 // "default": "false", 7965 // "description": "Whether to use the uploaded content as indexable text.", 7966 // "location": "query", 7967 // "type": "boolean" 7968 // } 7969 // }, 7970 // "path": "files/{fileId}", 7971 // "request": { 7972 // "$ref": "File" 7973 // }, 7974 // "response": { 7975 // "$ref": "File" 7976 // }, 7977 // "scopes": [ 7978 // "https://www.googleapis.com/auth/drive", 7979 // "https://www.googleapis.com/auth/drive.appdata", 7980 // "https://www.googleapis.com/auth/drive.file", 7981 // "https://www.googleapis.com/auth/drive.metadata", 7982 // "https://www.googleapis.com/auth/drive.scripts" 7983 // ], 7984 // "supportsMediaUpload": true 7985 // } 7986 7987} 7988 7989// method id "drive.files.watch": 7990 7991type FilesWatchCall struct { 7992 s *Service 7993 fileId string 7994 channel *Channel 7995 urlParams_ gensupport.URLParams 7996 ctx_ context.Context 7997 header_ http.Header 7998} 7999 8000// Watch: Subscribes to changes to a file 8001// 8002// - fileId: The ID of the file. 8003func (r *FilesService) Watch(fileId string, channel *Channel) *FilesWatchCall { 8004 c := &FilesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8005 c.fileId = fileId 8006 c.channel = channel 8007 return c 8008} 8009 8010// AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": 8011// Whether the user is acknowledging the risk of downloading known 8012// malware or other abusive files. This is only applicable when 8013// alt=media. 8014func (c *FilesWatchCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesWatchCall { 8015 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse)) 8016 return c 8017} 8018 8019// IncludePermissionsForView sets the optional parameter 8020// "includePermissionsForView": Specifies which additional view's 8021// permissions to include in the response. Only 'published' is 8022// supported. 8023func (c *FilesWatchCall) IncludePermissionsForView(includePermissionsForView string) *FilesWatchCall { 8024 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 8025 return c 8026} 8027 8028// SupportsAllDrives sets the optional parameter "supportsAllDrives": 8029// Whether the requesting application supports both My Drives and shared 8030// drives. 8031func (c *FilesWatchCall) SupportsAllDrives(supportsAllDrives bool) *FilesWatchCall { 8032 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 8033 return c 8034} 8035 8036// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 8037// Deprecated use supportsAllDrives instead. 8038func (c *FilesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesWatchCall { 8039 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 8040 return c 8041} 8042 8043// Fields allows partial responses to be retrieved. See 8044// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8045// for more information. 8046func (c *FilesWatchCall) Fields(s ...googleapi.Field) *FilesWatchCall { 8047 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8048 return c 8049} 8050 8051// Context sets the context to be used in this call's Do and Download 8052// methods. Any pending HTTP request will be aborted if the provided 8053// context is canceled. 8054func (c *FilesWatchCall) Context(ctx context.Context) *FilesWatchCall { 8055 c.ctx_ = ctx 8056 return c 8057} 8058 8059// Header returns an http.Header that can be modified by the caller to 8060// add HTTP headers to the request. 8061func (c *FilesWatchCall) Header() http.Header { 8062 if c.header_ == nil { 8063 c.header_ = make(http.Header) 8064 } 8065 return c.header_ 8066} 8067 8068func (c *FilesWatchCall) doRequest(alt string) (*http.Response, error) { 8069 reqHeaders := make(http.Header) 8070 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 8071 for k, v := range c.header_ { 8072 reqHeaders[k] = v 8073 } 8074 reqHeaders.Set("User-Agent", c.s.userAgent()) 8075 var body io.Reader = nil 8076 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 8077 if err != nil { 8078 return nil, err 8079 } 8080 reqHeaders.Set("Content-Type", "application/json") 8081 c.urlParams_.Set("alt", alt) 8082 c.urlParams_.Set("prettyPrint", "false") 8083 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/watch") 8084 urls += "?" + c.urlParams_.Encode() 8085 req, err := http.NewRequest("POST", urls, body) 8086 if err != nil { 8087 return nil, err 8088 } 8089 req.Header = reqHeaders 8090 googleapi.Expand(req.URL, map[string]string{ 8091 "fileId": c.fileId, 8092 }) 8093 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8094} 8095 8096// Download fetches the API endpoint's "media" value, instead of the normal 8097// API response value. If the returned error is nil, the Response is guaranteed to 8098// have a 2xx status code. Callers must close the Response.Body as usual. 8099func (c *FilesWatchCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 8100 gensupport.SetOptions(c.urlParams_, opts...) 8101 res, err := c.doRequest("media") 8102 if err != nil { 8103 return nil, err 8104 } 8105 if err := googleapi.CheckResponse(res); err != nil { 8106 res.Body.Close() 8107 return nil, err 8108 } 8109 return res, nil 8110} 8111 8112// Do executes the "drive.files.watch" call. 8113// Exactly one of *Channel or error will be non-nil. Any non-2xx status 8114// code is an error. Response headers are in either 8115// *Channel.ServerResponse.Header or (if a response was returned at all) 8116// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8117// check whether the returned error was because http.StatusNotModified 8118// was returned. 8119func (c *FilesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 8120 gensupport.SetOptions(c.urlParams_, opts...) 8121 res, err := c.doRequest("json") 8122 if res != nil && res.StatusCode == http.StatusNotModified { 8123 if res.Body != nil { 8124 res.Body.Close() 8125 } 8126 return nil, &googleapi.Error{ 8127 Code: res.StatusCode, 8128 Header: res.Header, 8129 } 8130 } 8131 if err != nil { 8132 return nil, err 8133 } 8134 defer googleapi.CloseBody(res) 8135 if err := googleapi.CheckResponse(res); err != nil { 8136 return nil, err 8137 } 8138 ret := &Channel{ 8139 ServerResponse: googleapi.ServerResponse{ 8140 Header: res.Header, 8141 HTTPStatusCode: res.StatusCode, 8142 }, 8143 } 8144 target := &ret 8145 if err := gensupport.DecodeResponse(target, res); err != nil { 8146 return nil, err 8147 } 8148 return ret, nil 8149 // { 8150 // "description": "Subscribes to changes to a file", 8151 // "httpMethod": "POST", 8152 // "id": "drive.files.watch", 8153 // "parameterOrder": [ 8154 // "fileId" 8155 // ], 8156 // "parameters": { 8157 // "acknowledgeAbuse": { 8158 // "default": "false", 8159 // "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.", 8160 // "location": "query", 8161 // "type": "boolean" 8162 // }, 8163 // "fileId": { 8164 // "description": "The ID of the file.", 8165 // "location": "path", 8166 // "required": true, 8167 // "type": "string" 8168 // }, 8169 // "includePermissionsForView": { 8170 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 8171 // "location": "query", 8172 // "type": "string" 8173 // }, 8174 // "supportsAllDrives": { 8175 // "default": "false", 8176 // "description": "Whether the requesting application supports both My Drives and shared drives.", 8177 // "location": "query", 8178 // "type": "boolean" 8179 // }, 8180 // "supportsTeamDrives": { 8181 // "default": "false", 8182 // "description": "Deprecated use supportsAllDrives instead.", 8183 // "location": "query", 8184 // "type": "boolean" 8185 // } 8186 // }, 8187 // "path": "files/{fileId}/watch", 8188 // "request": { 8189 // "$ref": "Channel", 8190 // "parameterName": "resource" 8191 // }, 8192 // "response": { 8193 // "$ref": "Channel" 8194 // }, 8195 // "scopes": [ 8196 // "https://www.googleapis.com/auth/drive", 8197 // "https://www.googleapis.com/auth/drive.appdata", 8198 // "https://www.googleapis.com/auth/drive.file", 8199 // "https://www.googleapis.com/auth/drive.metadata", 8200 // "https://www.googleapis.com/auth/drive.metadata.readonly", 8201 // "https://www.googleapis.com/auth/drive.photos.readonly", 8202 // "https://www.googleapis.com/auth/drive.readonly" 8203 // ], 8204 // "supportsMediaDownload": true, 8205 // "supportsSubscription": true, 8206 // "useMediaDownloadService": true 8207 // } 8208 8209} 8210 8211// method id "drive.permissions.create": 8212 8213type PermissionsCreateCall struct { 8214 s *Service 8215 fileId string 8216 permission *Permission 8217 urlParams_ gensupport.URLParams 8218 ctx_ context.Context 8219 header_ http.Header 8220} 8221 8222// Create: Creates a permission for a file or shared drive. 8223// 8224// - fileId: The ID of the file or shared drive. 8225func (r *PermissionsService) Create(fileId string, permission *Permission) *PermissionsCreateCall { 8226 c := &PermissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8227 c.fileId = fileId 8228 c.permission = permission 8229 return c 8230} 8231 8232// EmailMessage sets the optional parameter "emailMessage": A plain text 8233// custom message to include in the notification email. 8234func (c *PermissionsCreateCall) EmailMessage(emailMessage string) *PermissionsCreateCall { 8235 c.urlParams_.Set("emailMessage", emailMessage) 8236 return c 8237} 8238 8239// EnforceSingleParent sets the optional parameter 8240// "enforceSingleParent": Deprecated. See moveToNewOwnersRoot for 8241// details. 8242func (c *PermissionsCreateCall) EnforceSingleParent(enforceSingleParent bool) *PermissionsCreateCall { 8243 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 8244 return c 8245} 8246 8247// MoveToNewOwnersRoot sets the optional parameter 8248// "moveToNewOwnersRoot": This parameter will only take effect if the 8249// item is not in a shared drive and the request is attempting to 8250// transfer the ownership of the item. If set to true, the item will be 8251// moved to the new owner's My Drive root folder and all prior parents 8252// removed. If set to false, parents are not changed. 8253func (c *PermissionsCreateCall) MoveToNewOwnersRoot(moveToNewOwnersRoot bool) *PermissionsCreateCall { 8254 c.urlParams_.Set("moveToNewOwnersRoot", fmt.Sprint(moveToNewOwnersRoot)) 8255 return c 8256} 8257 8258// SendNotificationEmail sets the optional parameter 8259// "sendNotificationEmail": Whether to send a notification email when 8260// sharing to users or groups. This defaults to true for users and 8261// groups, and is not allowed for other requests. It must not be 8262// disabled for ownership transfers. 8263func (c *PermissionsCreateCall) SendNotificationEmail(sendNotificationEmail bool) *PermissionsCreateCall { 8264 c.urlParams_.Set("sendNotificationEmail", fmt.Sprint(sendNotificationEmail)) 8265 return c 8266} 8267 8268// SupportsAllDrives sets the optional parameter "supportsAllDrives": 8269// Whether the requesting application supports both My Drives and shared 8270// drives. 8271func (c *PermissionsCreateCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsCreateCall { 8272 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 8273 return c 8274} 8275 8276// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 8277// Deprecated use supportsAllDrives instead. 8278func (c *PermissionsCreateCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsCreateCall { 8279 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 8280 return c 8281} 8282 8283// TransferOwnership sets the optional parameter "transferOwnership": 8284// Whether to transfer ownership to the specified user and downgrade the 8285// current owner to a writer. This parameter is required as an 8286// acknowledgement of the side effect. File owners can only transfer 8287// ownership of files existing on My Drive. Files existing in a shared 8288// drive are owned by the organization that owns that shared drive. 8289// Ownership transfers are not supported for files and folders in shared 8290// drives. Organizers of a shared drive can move items from that shared 8291// drive into their My Drive which transfers the ownership to them. 8292func (c *PermissionsCreateCall) TransferOwnership(transferOwnership bool) *PermissionsCreateCall { 8293 c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership)) 8294 return c 8295} 8296 8297// UseDomainAdminAccess sets the optional parameter 8298// "useDomainAdminAccess": Issue the request as a domain administrator; 8299// if set to true, then the requester will be granted access if the file 8300// ID parameter refers to a shared drive and the requester is an 8301// administrator of the domain to which the shared drive belongs. 8302func (c *PermissionsCreateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsCreateCall { 8303 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 8304 return c 8305} 8306 8307// Fields allows partial responses to be retrieved. See 8308// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8309// for more information. 8310func (c *PermissionsCreateCall) Fields(s ...googleapi.Field) *PermissionsCreateCall { 8311 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8312 return c 8313} 8314 8315// Context sets the context to be used in this call's Do method. Any 8316// pending HTTP request will be aborted if the provided context is 8317// canceled. 8318func (c *PermissionsCreateCall) Context(ctx context.Context) *PermissionsCreateCall { 8319 c.ctx_ = ctx 8320 return c 8321} 8322 8323// Header returns an http.Header that can be modified by the caller to 8324// add HTTP headers to the request. 8325func (c *PermissionsCreateCall) Header() http.Header { 8326 if c.header_ == nil { 8327 c.header_ = make(http.Header) 8328 } 8329 return c.header_ 8330} 8331 8332func (c *PermissionsCreateCall) doRequest(alt string) (*http.Response, error) { 8333 reqHeaders := make(http.Header) 8334 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 8335 for k, v := range c.header_ { 8336 reqHeaders[k] = v 8337 } 8338 reqHeaders.Set("User-Agent", c.s.userAgent()) 8339 var body io.Reader = nil 8340 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) 8341 if err != nil { 8342 return nil, err 8343 } 8344 reqHeaders.Set("Content-Type", "application/json") 8345 c.urlParams_.Set("alt", alt) 8346 c.urlParams_.Set("prettyPrint", "false") 8347 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") 8348 urls += "?" + c.urlParams_.Encode() 8349 req, err := http.NewRequest("POST", urls, body) 8350 if err != nil { 8351 return nil, err 8352 } 8353 req.Header = reqHeaders 8354 googleapi.Expand(req.URL, map[string]string{ 8355 "fileId": c.fileId, 8356 }) 8357 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8358} 8359 8360// Do executes the "drive.permissions.create" call. 8361// Exactly one of *Permission or error will be non-nil. Any non-2xx 8362// status code is an error. Response headers are in either 8363// *Permission.ServerResponse.Header or (if a response was returned at 8364// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8365// to check whether the returned error was because 8366// http.StatusNotModified was returned. 8367func (c *PermissionsCreateCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 8368 gensupport.SetOptions(c.urlParams_, opts...) 8369 res, err := c.doRequest("json") 8370 if res != nil && res.StatusCode == http.StatusNotModified { 8371 if res.Body != nil { 8372 res.Body.Close() 8373 } 8374 return nil, &googleapi.Error{ 8375 Code: res.StatusCode, 8376 Header: res.Header, 8377 } 8378 } 8379 if err != nil { 8380 return nil, err 8381 } 8382 defer googleapi.CloseBody(res) 8383 if err := googleapi.CheckResponse(res); err != nil { 8384 return nil, err 8385 } 8386 ret := &Permission{ 8387 ServerResponse: googleapi.ServerResponse{ 8388 Header: res.Header, 8389 HTTPStatusCode: res.StatusCode, 8390 }, 8391 } 8392 target := &ret 8393 if err := gensupport.DecodeResponse(target, res); err != nil { 8394 return nil, err 8395 } 8396 return ret, nil 8397 // { 8398 // "description": "Creates a permission for a file or shared drive.", 8399 // "httpMethod": "POST", 8400 // "id": "drive.permissions.create", 8401 // "parameterOrder": [ 8402 // "fileId" 8403 // ], 8404 // "parameters": { 8405 // "emailMessage": { 8406 // "description": "A plain text custom message to include in the notification email.", 8407 // "location": "query", 8408 // "type": "string" 8409 // }, 8410 // "enforceSingleParent": { 8411 // "default": "false", 8412 // "description": "Deprecated. See moveToNewOwnersRoot for details.", 8413 // "location": "query", 8414 // "type": "boolean" 8415 // }, 8416 // "fileId": { 8417 // "description": "The ID of the file or shared drive.", 8418 // "location": "path", 8419 // "required": true, 8420 // "type": "string" 8421 // }, 8422 // "moveToNewOwnersRoot": { 8423 // "default": "false", 8424 // "description": "This parameter will only take effect if the item is not in a shared drive and the request is attempting to transfer the ownership of the item. If set to true, the item will be moved to the new owner's My Drive root folder and all prior parents removed. If set to false, parents are not changed.", 8425 // "location": "query", 8426 // "type": "boolean" 8427 // }, 8428 // "sendNotificationEmail": { 8429 // "description": "Whether to send a notification email when sharing to users or groups. This defaults to true for users and groups, and is not allowed for other requests. It must not be disabled for ownership transfers.", 8430 // "location": "query", 8431 // "type": "boolean" 8432 // }, 8433 // "supportsAllDrives": { 8434 // "default": "false", 8435 // "description": "Whether the requesting application supports both My Drives and shared drives.", 8436 // "location": "query", 8437 // "type": "boolean" 8438 // }, 8439 // "supportsTeamDrives": { 8440 // "default": "false", 8441 // "description": "Deprecated use supportsAllDrives instead.", 8442 // "location": "query", 8443 // "type": "boolean" 8444 // }, 8445 // "transferOwnership": { 8446 // "default": "false", 8447 // "description": "Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. File owners can only transfer ownership of files existing on My Drive. Files existing in a shared drive are owned by the organization that owns that shared drive. Ownership transfers are not supported for files and folders in shared drives. Organizers of a shared drive can move items from that shared drive into their My Drive which transfers the ownership to them.", 8448 // "location": "query", 8449 // "type": "boolean" 8450 // }, 8451 // "useDomainAdminAccess": { 8452 // "default": "false", 8453 // "description": "Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.", 8454 // "location": "query", 8455 // "type": "boolean" 8456 // } 8457 // }, 8458 // "path": "files/{fileId}/permissions", 8459 // "request": { 8460 // "$ref": "Permission" 8461 // }, 8462 // "response": { 8463 // "$ref": "Permission" 8464 // }, 8465 // "scopes": [ 8466 // "https://www.googleapis.com/auth/drive", 8467 // "https://www.googleapis.com/auth/drive.file" 8468 // ] 8469 // } 8470 8471} 8472 8473// method id "drive.permissions.delete": 8474 8475type PermissionsDeleteCall struct { 8476 s *Service 8477 fileId string 8478 permissionId string 8479 urlParams_ gensupport.URLParams 8480 ctx_ context.Context 8481 header_ http.Header 8482} 8483 8484// Delete: Deletes a permission. 8485// 8486// - fileId: The ID of the file or shared drive. 8487// - permissionId: The ID of the permission. 8488func (r *PermissionsService) Delete(fileId string, permissionId string) *PermissionsDeleteCall { 8489 c := &PermissionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8490 c.fileId = fileId 8491 c.permissionId = permissionId 8492 return c 8493} 8494 8495// SupportsAllDrives sets the optional parameter "supportsAllDrives": 8496// Whether the requesting application supports both My Drives and shared 8497// drives. 8498func (c *PermissionsDeleteCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsDeleteCall { 8499 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 8500 return c 8501} 8502 8503// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 8504// Deprecated use supportsAllDrives instead. 8505func (c *PermissionsDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsDeleteCall { 8506 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 8507 return c 8508} 8509 8510// UseDomainAdminAccess sets the optional parameter 8511// "useDomainAdminAccess": Issue the request as a domain administrator; 8512// if set to true, then the requester will be granted access if the file 8513// ID parameter refers to a shared drive and the requester is an 8514// administrator of the domain to which the shared drive belongs. 8515func (c *PermissionsDeleteCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsDeleteCall { 8516 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 8517 return c 8518} 8519 8520// Fields allows partial responses to be retrieved. See 8521// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8522// for more information. 8523func (c *PermissionsDeleteCall) Fields(s ...googleapi.Field) *PermissionsDeleteCall { 8524 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8525 return c 8526} 8527 8528// Context sets the context to be used in this call's Do method. Any 8529// pending HTTP request will be aborted if the provided context is 8530// canceled. 8531func (c *PermissionsDeleteCall) Context(ctx context.Context) *PermissionsDeleteCall { 8532 c.ctx_ = ctx 8533 return c 8534} 8535 8536// Header returns an http.Header that can be modified by the caller to 8537// add HTTP headers to the request. 8538func (c *PermissionsDeleteCall) Header() http.Header { 8539 if c.header_ == nil { 8540 c.header_ = make(http.Header) 8541 } 8542 return c.header_ 8543} 8544 8545func (c *PermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { 8546 reqHeaders := make(http.Header) 8547 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 8548 for k, v := range c.header_ { 8549 reqHeaders[k] = v 8550 } 8551 reqHeaders.Set("User-Agent", c.s.userAgent()) 8552 var body io.Reader = nil 8553 c.urlParams_.Set("alt", alt) 8554 c.urlParams_.Set("prettyPrint", "false") 8555 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") 8556 urls += "?" + c.urlParams_.Encode() 8557 req, err := http.NewRequest("DELETE", urls, body) 8558 if err != nil { 8559 return nil, err 8560 } 8561 req.Header = reqHeaders 8562 googleapi.Expand(req.URL, map[string]string{ 8563 "fileId": c.fileId, 8564 "permissionId": c.permissionId, 8565 }) 8566 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8567} 8568 8569// Do executes the "drive.permissions.delete" call. 8570func (c *PermissionsDeleteCall) Do(opts ...googleapi.CallOption) error { 8571 gensupport.SetOptions(c.urlParams_, opts...) 8572 res, err := c.doRequest("json") 8573 if err != nil { 8574 return err 8575 } 8576 defer googleapi.CloseBody(res) 8577 if err := googleapi.CheckResponse(res); err != nil { 8578 return err 8579 } 8580 return nil 8581 // { 8582 // "description": "Deletes a permission.", 8583 // "httpMethod": "DELETE", 8584 // "id": "drive.permissions.delete", 8585 // "parameterOrder": [ 8586 // "fileId", 8587 // "permissionId" 8588 // ], 8589 // "parameters": { 8590 // "fileId": { 8591 // "description": "The ID of the file or shared drive.", 8592 // "location": "path", 8593 // "required": true, 8594 // "type": "string" 8595 // }, 8596 // "permissionId": { 8597 // "description": "The ID of the permission.", 8598 // "location": "path", 8599 // "required": true, 8600 // "type": "string" 8601 // }, 8602 // "supportsAllDrives": { 8603 // "default": "false", 8604 // "description": "Whether the requesting application supports both My Drives and shared drives.", 8605 // "location": "query", 8606 // "type": "boolean" 8607 // }, 8608 // "supportsTeamDrives": { 8609 // "default": "false", 8610 // "description": "Deprecated use supportsAllDrives instead.", 8611 // "location": "query", 8612 // "type": "boolean" 8613 // }, 8614 // "useDomainAdminAccess": { 8615 // "default": "false", 8616 // "description": "Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.", 8617 // "location": "query", 8618 // "type": "boolean" 8619 // } 8620 // }, 8621 // "path": "files/{fileId}/permissions/{permissionId}", 8622 // "scopes": [ 8623 // "https://www.googleapis.com/auth/drive", 8624 // "https://www.googleapis.com/auth/drive.file" 8625 // ] 8626 // } 8627 8628} 8629 8630// method id "drive.permissions.get": 8631 8632type PermissionsGetCall struct { 8633 s *Service 8634 fileId string 8635 permissionId string 8636 urlParams_ gensupport.URLParams 8637 ifNoneMatch_ string 8638 ctx_ context.Context 8639 header_ http.Header 8640} 8641 8642// Get: Gets a permission by ID. 8643// 8644// - fileId: The ID of the file. 8645// - permissionId: The ID of the permission. 8646func (r *PermissionsService) Get(fileId string, permissionId string) *PermissionsGetCall { 8647 c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8648 c.fileId = fileId 8649 c.permissionId = permissionId 8650 return c 8651} 8652 8653// SupportsAllDrives sets the optional parameter "supportsAllDrives": 8654// Whether the requesting application supports both My Drives and shared 8655// drives. 8656func (c *PermissionsGetCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsGetCall { 8657 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 8658 return c 8659} 8660 8661// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 8662// Deprecated use supportsAllDrives instead. 8663func (c *PermissionsGetCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsGetCall { 8664 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 8665 return c 8666} 8667 8668// UseDomainAdminAccess sets the optional parameter 8669// "useDomainAdminAccess": Issue the request as a domain administrator; 8670// if set to true, then the requester will be granted access if the file 8671// ID parameter refers to a shared drive and the requester is an 8672// administrator of the domain to which the shared drive belongs. 8673func (c *PermissionsGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsGetCall { 8674 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 8675 return c 8676} 8677 8678// Fields allows partial responses to be retrieved. See 8679// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8680// for more information. 8681func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall { 8682 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8683 return c 8684} 8685 8686// IfNoneMatch sets the optional parameter which makes the operation 8687// fail if the object's ETag matches the given value. This is useful for 8688// getting updates only after the object has changed since the last 8689// request. Use googleapi.IsNotModified to check whether the response 8690// error from Do is the result of In-None-Match. 8691func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall { 8692 c.ifNoneMatch_ = entityTag 8693 return c 8694} 8695 8696// Context sets the context to be used in this call's Do method. Any 8697// pending HTTP request will be aborted if the provided context is 8698// canceled. 8699func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall { 8700 c.ctx_ = ctx 8701 return c 8702} 8703 8704// Header returns an http.Header that can be modified by the caller to 8705// add HTTP headers to the request. 8706func (c *PermissionsGetCall) Header() http.Header { 8707 if c.header_ == nil { 8708 c.header_ = make(http.Header) 8709 } 8710 return c.header_ 8711} 8712 8713func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { 8714 reqHeaders := make(http.Header) 8715 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 8716 for k, v := range c.header_ { 8717 reqHeaders[k] = v 8718 } 8719 reqHeaders.Set("User-Agent", c.s.userAgent()) 8720 if c.ifNoneMatch_ != "" { 8721 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8722 } 8723 var body io.Reader = nil 8724 c.urlParams_.Set("alt", alt) 8725 c.urlParams_.Set("prettyPrint", "false") 8726 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") 8727 urls += "?" + c.urlParams_.Encode() 8728 req, err := http.NewRequest("GET", urls, body) 8729 if err != nil { 8730 return nil, err 8731 } 8732 req.Header = reqHeaders 8733 googleapi.Expand(req.URL, map[string]string{ 8734 "fileId": c.fileId, 8735 "permissionId": c.permissionId, 8736 }) 8737 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8738} 8739 8740// Do executes the "drive.permissions.get" call. 8741// Exactly one of *Permission or error will be non-nil. Any non-2xx 8742// status code is an error. Response headers are in either 8743// *Permission.ServerResponse.Header or (if a response was returned at 8744// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8745// to check whether the returned error was because 8746// http.StatusNotModified was returned. 8747func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 8748 gensupport.SetOptions(c.urlParams_, opts...) 8749 res, err := c.doRequest("json") 8750 if res != nil && res.StatusCode == http.StatusNotModified { 8751 if res.Body != nil { 8752 res.Body.Close() 8753 } 8754 return nil, &googleapi.Error{ 8755 Code: res.StatusCode, 8756 Header: res.Header, 8757 } 8758 } 8759 if err != nil { 8760 return nil, err 8761 } 8762 defer googleapi.CloseBody(res) 8763 if err := googleapi.CheckResponse(res); err != nil { 8764 return nil, err 8765 } 8766 ret := &Permission{ 8767 ServerResponse: googleapi.ServerResponse{ 8768 Header: res.Header, 8769 HTTPStatusCode: res.StatusCode, 8770 }, 8771 } 8772 target := &ret 8773 if err := gensupport.DecodeResponse(target, res); err != nil { 8774 return nil, err 8775 } 8776 return ret, nil 8777 // { 8778 // "description": "Gets a permission by ID.", 8779 // "httpMethod": "GET", 8780 // "id": "drive.permissions.get", 8781 // "parameterOrder": [ 8782 // "fileId", 8783 // "permissionId" 8784 // ], 8785 // "parameters": { 8786 // "fileId": { 8787 // "description": "The ID of the file.", 8788 // "location": "path", 8789 // "required": true, 8790 // "type": "string" 8791 // }, 8792 // "permissionId": { 8793 // "description": "The ID of the permission.", 8794 // "location": "path", 8795 // "required": true, 8796 // "type": "string" 8797 // }, 8798 // "supportsAllDrives": { 8799 // "default": "false", 8800 // "description": "Whether the requesting application supports both My Drives and shared drives.", 8801 // "location": "query", 8802 // "type": "boolean" 8803 // }, 8804 // "supportsTeamDrives": { 8805 // "default": "false", 8806 // "description": "Deprecated use supportsAllDrives instead.", 8807 // "location": "query", 8808 // "type": "boolean" 8809 // }, 8810 // "useDomainAdminAccess": { 8811 // "default": "false", 8812 // "description": "Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.", 8813 // "location": "query", 8814 // "type": "boolean" 8815 // } 8816 // }, 8817 // "path": "files/{fileId}/permissions/{permissionId}", 8818 // "response": { 8819 // "$ref": "Permission" 8820 // }, 8821 // "scopes": [ 8822 // "https://www.googleapis.com/auth/drive", 8823 // "https://www.googleapis.com/auth/drive.file", 8824 // "https://www.googleapis.com/auth/drive.metadata", 8825 // "https://www.googleapis.com/auth/drive.metadata.readonly", 8826 // "https://www.googleapis.com/auth/drive.photos.readonly", 8827 // "https://www.googleapis.com/auth/drive.readonly" 8828 // ] 8829 // } 8830 8831} 8832 8833// method id "drive.permissions.list": 8834 8835type PermissionsListCall struct { 8836 s *Service 8837 fileId string 8838 urlParams_ gensupport.URLParams 8839 ifNoneMatch_ string 8840 ctx_ context.Context 8841 header_ http.Header 8842} 8843 8844// List: Lists a file's or shared drive's permissions. 8845// 8846// - fileId: The ID of the file or shared drive. 8847func (r *PermissionsService) List(fileId string) *PermissionsListCall { 8848 c := &PermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8849 c.fileId = fileId 8850 return c 8851} 8852 8853// IncludePermissionsForView sets the optional parameter 8854// "includePermissionsForView": Specifies which additional view's 8855// permissions to include in the response. Only 'published' is 8856// supported. 8857func (c *PermissionsListCall) IncludePermissionsForView(includePermissionsForView string) *PermissionsListCall { 8858 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 8859 return c 8860} 8861 8862// PageSize sets the optional parameter "pageSize": The maximum number 8863// of permissions to return per page. When not set for files in a shared 8864// drive, at most 100 results will be returned. When not set for files 8865// that are not in a shared drive, the entire list will be returned. 8866func (c *PermissionsListCall) PageSize(pageSize int64) *PermissionsListCall { 8867 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8868 return c 8869} 8870 8871// PageToken sets the optional parameter "pageToken": The token for 8872// continuing a previous list request on the next page. This should be 8873// set to the value of 'nextPageToken' from the previous response. 8874func (c *PermissionsListCall) PageToken(pageToken string) *PermissionsListCall { 8875 c.urlParams_.Set("pageToken", pageToken) 8876 return c 8877} 8878 8879// SupportsAllDrives sets the optional parameter "supportsAllDrives": 8880// Whether the requesting application supports both My Drives and shared 8881// drives. 8882func (c *PermissionsListCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsListCall { 8883 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 8884 return c 8885} 8886 8887// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 8888// Deprecated use supportsAllDrives instead. 8889func (c *PermissionsListCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsListCall { 8890 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 8891 return c 8892} 8893 8894// UseDomainAdminAccess sets the optional parameter 8895// "useDomainAdminAccess": Issue the request as a domain administrator; 8896// if set to true, then the requester will be granted access if the file 8897// ID parameter refers to a shared drive and the requester is an 8898// administrator of the domain to which the shared drive belongs. 8899func (c *PermissionsListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsListCall { 8900 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 8901 return c 8902} 8903 8904// Fields allows partial responses to be retrieved. See 8905// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8906// for more information. 8907func (c *PermissionsListCall) Fields(s ...googleapi.Field) *PermissionsListCall { 8908 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8909 return c 8910} 8911 8912// IfNoneMatch sets the optional parameter which makes the operation 8913// fail if the object's ETag matches the given value. This is useful for 8914// getting updates only after the object has changed since the last 8915// request. Use googleapi.IsNotModified to check whether the response 8916// error from Do is the result of In-None-Match. 8917func (c *PermissionsListCall) IfNoneMatch(entityTag string) *PermissionsListCall { 8918 c.ifNoneMatch_ = entityTag 8919 return c 8920} 8921 8922// Context sets the context to be used in this call's Do method. Any 8923// pending HTTP request will be aborted if the provided context is 8924// canceled. 8925func (c *PermissionsListCall) Context(ctx context.Context) *PermissionsListCall { 8926 c.ctx_ = ctx 8927 return c 8928} 8929 8930// Header returns an http.Header that can be modified by the caller to 8931// add HTTP headers to the request. 8932func (c *PermissionsListCall) Header() http.Header { 8933 if c.header_ == nil { 8934 c.header_ = make(http.Header) 8935 } 8936 return c.header_ 8937} 8938 8939func (c *PermissionsListCall) doRequest(alt string) (*http.Response, error) { 8940 reqHeaders := make(http.Header) 8941 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 8942 for k, v := range c.header_ { 8943 reqHeaders[k] = v 8944 } 8945 reqHeaders.Set("User-Agent", c.s.userAgent()) 8946 if c.ifNoneMatch_ != "" { 8947 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8948 } 8949 var body io.Reader = nil 8950 c.urlParams_.Set("alt", alt) 8951 c.urlParams_.Set("prettyPrint", "false") 8952 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") 8953 urls += "?" + c.urlParams_.Encode() 8954 req, err := http.NewRequest("GET", urls, body) 8955 if err != nil { 8956 return nil, err 8957 } 8958 req.Header = reqHeaders 8959 googleapi.Expand(req.URL, map[string]string{ 8960 "fileId": c.fileId, 8961 }) 8962 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8963} 8964 8965// Do executes the "drive.permissions.list" call. 8966// Exactly one of *PermissionList or error will be non-nil. Any non-2xx 8967// status code is an error. Response headers are in either 8968// *PermissionList.ServerResponse.Header or (if a response was returned 8969// at all) in error.(*googleapi.Error).Header. Use 8970// googleapi.IsNotModified to check whether the returned error was 8971// because http.StatusNotModified was returned. 8972func (c *PermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionList, error) { 8973 gensupport.SetOptions(c.urlParams_, opts...) 8974 res, err := c.doRequest("json") 8975 if res != nil && res.StatusCode == http.StatusNotModified { 8976 if res.Body != nil { 8977 res.Body.Close() 8978 } 8979 return nil, &googleapi.Error{ 8980 Code: res.StatusCode, 8981 Header: res.Header, 8982 } 8983 } 8984 if err != nil { 8985 return nil, err 8986 } 8987 defer googleapi.CloseBody(res) 8988 if err := googleapi.CheckResponse(res); err != nil { 8989 return nil, err 8990 } 8991 ret := &PermissionList{ 8992 ServerResponse: googleapi.ServerResponse{ 8993 Header: res.Header, 8994 HTTPStatusCode: res.StatusCode, 8995 }, 8996 } 8997 target := &ret 8998 if err := gensupport.DecodeResponse(target, res); err != nil { 8999 return nil, err 9000 } 9001 return ret, nil 9002 // { 9003 // "description": "Lists a file's or shared drive's permissions.", 9004 // "httpMethod": "GET", 9005 // "id": "drive.permissions.list", 9006 // "parameterOrder": [ 9007 // "fileId" 9008 // ], 9009 // "parameters": { 9010 // "fileId": { 9011 // "description": "The ID of the file or shared drive.", 9012 // "location": "path", 9013 // "required": true, 9014 // "type": "string" 9015 // }, 9016 // "includePermissionsForView": { 9017 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 9018 // "location": "query", 9019 // "type": "string" 9020 // }, 9021 // "pageSize": { 9022 // "description": "The maximum number of permissions to return per page. When not set for files in a shared drive, at most 100 results will be returned. When not set for files that are not in a shared drive, the entire list will be returned.", 9023 // "format": "int32", 9024 // "location": "query", 9025 // "maximum": "100", 9026 // "minimum": "1", 9027 // "type": "integer" 9028 // }, 9029 // "pageToken": { 9030 // "description": "The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.", 9031 // "location": "query", 9032 // "type": "string" 9033 // }, 9034 // "supportsAllDrives": { 9035 // "default": "false", 9036 // "description": "Whether the requesting application supports both My Drives and shared drives.", 9037 // "location": "query", 9038 // "type": "boolean" 9039 // }, 9040 // "supportsTeamDrives": { 9041 // "default": "false", 9042 // "description": "Deprecated use supportsAllDrives instead.", 9043 // "location": "query", 9044 // "type": "boolean" 9045 // }, 9046 // "useDomainAdminAccess": { 9047 // "default": "false", 9048 // "description": "Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.", 9049 // "location": "query", 9050 // "type": "boolean" 9051 // } 9052 // }, 9053 // "path": "files/{fileId}/permissions", 9054 // "response": { 9055 // "$ref": "PermissionList" 9056 // }, 9057 // "scopes": [ 9058 // "https://www.googleapis.com/auth/drive", 9059 // "https://www.googleapis.com/auth/drive.file", 9060 // "https://www.googleapis.com/auth/drive.metadata", 9061 // "https://www.googleapis.com/auth/drive.metadata.readonly", 9062 // "https://www.googleapis.com/auth/drive.photos.readonly", 9063 // "https://www.googleapis.com/auth/drive.readonly" 9064 // ] 9065 // } 9066 9067} 9068 9069// Pages invokes f for each page of results. 9070// A non-nil error returned from f will halt the iteration. 9071// The provided context supersedes any context provided to the Context method. 9072func (c *PermissionsListCall) Pages(ctx context.Context, f func(*PermissionList) error) error { 9073 c.ctx_ = ctx 9074 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9075 for { 9076 x, err := c.Do() 9077 if err != nil { 9078 return err 9079 } 9080 if err := f(x); err != nil { 9081 return err 9082 } 9083 if x.NextPageToken == "" { 9084 return nil 9085 } 9086 c.PageToken(x.NextPageToken) 9087 } 9088} 9089 9090// method id "drive.permissions.update": 9091 9092type PermissionsUpdateCall struct { 9093 s *Service 9094 fileId string 9095 permissionId string 9096 permission *Permission 9097 urlParams_ gensupport.URLParams 9098 ctx_ context.Context 9099 header_ http.Header 9100} 9101 9102// Update: Updates a permission with patch semantics. 9103// 9104// - fileId: The ID of the file or shared drive. 9105// - permissionId: The ID of the permission. 9106func (r *PermissionsService) Update(fileId string, permissionId string, permission *Permission) *PermissionsUpdateCall { 9107 c := &PermissionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9108 c.fileId = fileId 9109 c.permissionId = permissionId 9110 c.permission = permission 9111 return c 9112} 9113 9114// RemoveExpiration sets the optional parameter "removeExpiration": 9115// Whether to remove the expiration date. 9116func (c *PermissionsUpdateCall) RemoveExpiration(removeExpiration bool) *PermissionsUpdateCall { 9117 c.urlParams_.Set("removeExpiration", fmt.Sprint(removeExpiration)) 9118 return c 9119} 9120 9121// SupportsAllDrives sets the optional parameter "supportsAllDrives": 9122// Whether the requesting application supports both My Drives and shared 9123// drives. 9124func (c *PermissionsUpdateCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsUpdateCall { 9125 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 9126 return c 9127} 9128 9129// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 9130// Deprecated use supportsAllDrives instead. 9131func (c *PermissionsUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsUpdateCall { 9132 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 9133 return c 9134} 9135 9136// TransferOwnership sets the optional parameter "transferOwnership": 9137// Whether to transfer ownership to the specified user and downgrade the 9138// current owner to a writer. This parameter is required as an 9139// acknowledgement of the side effect. File owners can only transfer 9140// ownership of files existing on My Drive. Files existing in a shared 9141// drive are owned by the organization that owns that shared drive. 9142// Ownership transfers are not supported for files and folders in shared 9143// drives. Organizers of a shared drive can move items from that shared 9144// drive into their My Drive which transfers the ownership to them. 9145func (c *PermissionsUpdateCall) TransferOwnership(transferOwnership bool) *PermissionsUpdateCall { 9146 c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership)) 9147 return c 9148} 9149 9150// UseDomainAdminAccess sets the optional parameter 9151// "useDomainAdminAccess": Issue the request as a domain administrator; 9152// if set to true, then the requester will be granted access if the file 9153// ID parameter refers to a shared drive and the requester is an 9154// administrator of the domain to which the shared drive belongs. 9155func (c *PermissionsUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsUpdateCall { 9156 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 9157 return c 9158} 9159 9160// Fields allows partial responses to be retrieved. See 9161// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9162// for more information. 9163func (c *PermissionsUpdateCall) Fields(s ...googleapi.Field) *PermissionsUpdateCall { 9164 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9165 return c 9166} 9167 9168// Context sets the context to be used in this call's Do method. Any 9169// pending HTTP request will be aborted if the provided context is 9170// canceled. 9171func (c *PermissionsUpdateCall) Context(ctx context.Context) *PermissionsUpdateCall { 9172 c.ctx_ = ctx 9173 return c 9174} 9175 9176// Header returns an http.Header that can be modified by the caller to 9177// add HTTP headers to the request. 9178func (c *PermissionsUpdateCall) Header() http.Header { 9179 if c.header_ == nil { 9180 c.header_ = make(http.Header) 9181 } 9182 return c.header_ 9183} 9184 9185func (c *PermissionsUpdateCall) doRequest(alt string) (*http.Response, error) { 9186 reqHeaders := make(http.Header) 9187 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 9188 for k, v := range c.header_ { 9189 reqHeaders[k] = v 9190 } 9191 reqHeaders.Set("User-Agent", c.s.userAgent()) 9192 var body io.Reader = nil 9193 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) 9194 if err != nil { 9195 return nil, err 9196 } 9197 reqHeaders.Set("Content-Type", "application/json") 9198 c.urlParams_.Set("alt", alt) 9199 c.urlParams_.Set("prettyPrint", "false") 9200 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") 9201 urls += "?" + c.urlParams_.Encode() 9202 req, err := http.NewRequest("PATCH", urls, body) 9203 if err != nil { 9204 return nil, err 9205 } 9206 req.Header = reqHeaders 9207 googleapi.Expand(req.URL, map[string]string{ 9208 "fileId": c.fileId, 9209 "permissionId": c.permissionId, 9210 }) 9211 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9212} 9213 9214// Do executes the "drive.permissions.update" call. 9215// Exactly one of *Permission or error will be non-nil. Any non-2xx 9216// status code is an error. Response headers are in either 9217// *Permission.ServerResponse.Header or (if a response was returned at 9218// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9219// to check whether the returned error was because 9220// http.StatusNotModified was returned. 9221func (c *PermissionsUpdateCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 9222 gensupport.SetOptions(c.urlParams_, opts...) 9223 res, err := c.doRequest("json") 9224 if res != nil && res.StatusCode == http.StatusNotModified { 9225 if res.Body != nil { 9226 res.Body.Close() 9227 } 9228 return nil, &googleapi.Error{ 9229 Code: res.StatusCode, 9230 Header: res.Header, 9231 } 9232 } 9233 if err != nil { 9234 return nil, err 9235 } 9236 defer googleapi.CloseBody(res) 9237 if err := googleapi.CheckResponse(res); err != nil { 9238 return nil, err 9239 } 9240 ret := &Permission{ 9241 ServerResponse: googleapi.ServerResponse{ 9242 Header: res.Header, 9243 HTTPStatusCode: res.StatusCode, 9244 }, 9245 } 9246 target := &ret 9247 if err := gensupport.DecodeResponse(target, res); err != nil { 9248 return nil, err 9249 } 9250 return ret, nil 9251 // { 9252 // "description": "Updates a permission with patch semantics.", 9253 // "httpMethod": "PATCH", 9254 // "id": "drive.permissions.update", 9255 // "parameterOrder": [ 9256 // "fileId", 9257 // "permissionId" 9258 // ], 9259 // "parameters": { 9260 // "fileId": { 9261 // "description": "The ID of the file or shared drive.", 9262 // "location": "path", 9263 // "required": true, 9264 // "type": "string" 9265 // }, 9266 // "permissionId": { 9267 // "description": "The ID of the permission.", 9268 // "location": "path", 9269 // "required": true, 9270 // "type": "string" 9271 // }, 9272 // "removeExpiration": { 9273 // "default": "false", 9274 // "description": "Whether to remove the expiration date.", 9275 // "location": "query", 9276 // "type": "boolean" 9277 // }, 9278 // "supportsAllDrives": { 9279 // "default": "false", 9280 // "description": "Whether the requesting application supports both My Drives and shared drives.", 9281 // "location": "query", 9282 // "type": "boolean" 9283 // }, 9284 // "supportsTeamDrives": { 9285 // "default": "false", 9286 // "description": "Deprecated use supportsAllDrives instead.", 9287 // "location": "query", 9288 // "type": "boolean" 9289 // }, 9290 // "transferOwnership": { 9291 // "default": "false", 9292 // "description": "Whether to transfer ownership to the specified user and downgrade the current owner to a writer. This parameter is required as an acknowledgement of the side effect. File owners can only transfer ownership of files existing on My Drive. Files existing in a shared drive are owned by the organization that owns that shared drive. Ownership transfers are not supported for files and folders in shared drives. Organizers of a shared drive can move items from that shared drive into their My Drive which transfers the ownership to them.", 9293 // "location": "query", 9294 // "type": "boolean" 9295 // }, 9296 // "useDomainAdminAccess": { 9297 // "default": "false", 9298 // "description": "Issue the request as a domain administrator; if set to true, then the requester will be granted access if the file ID parameter refers to a shared drive and the requester is an administrator of the domain to which the shared drive belongs.", 9299 // "location": "query", 9300 // "type": "boolean" 9301 // } 9302 // }, 9303 // "path": "files/{fileId}/permissions/{permissionId}", 9304 // "request": { 9305 // "$ref": "Permission" 9306 // }, 9307 // "response": { 9308 // "$ref": "Permission" 9309 // }, 9310 // "scopes": [ 9311 // "https://www.googleapis.com/auth/drive", 9312 // "https://www.googleapis.com/auth/drive.file" 9313 // ] 9314 // } 9315 9316} 9317 9318// method id "drive.replies.create": 9319 9320type RepliesCreateCall struct { 9321 s *Service 9322 fileId string 9323 commentId string 9324 reply *Reply 9325 urlParams_ gensupport.URLParams 9326 ctx_ context.Context 9327 header_ http.Header 9328} 9329 9330// Create: Creates a new reply to a comment. 9331// 9332// - commentId: The ID of the comment. 9333// - fileId: The ID of the file. 9334func (r *RepliesService) Create(fileId string, commentId string, reply *Reply) *RepliesCreateCall { 9335 c := &RepliesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9336 c.fileId = fileId 9337 c.commentId = commentId 9338 c.reply = reply 9339 return c 9340} 9341 9342// Fields allows partial responses to be retrieved. See 9343// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9344// for more information. 9345func (c *RepliesCreateCall) Fields(s ...googleapi.Field) *RepliesCreateCall { 9346 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9347 return c 9348} 9349 9350// Context sets the context to be used in this call's Do method. Any 9351// pending HTTP request will be aborted if the provided context is 9352// canceled. 9353func (c *RepliesCreateCall) Context(ctx context.Context) *RepliesCreateCall { 9354 c.ctx_ = ctx 9355 return c 9356} 9357 9358// Header returns an http.Header that can be modified by the caller to 9359// add HTTP headers to the request. 9360func (c *RepliesCreateCall) Header() http.Header { 9361 if c.header_ == nil { 9362 c.header_ = make(http.Header) 9363 } 9364 return c.header_ 9365} 9366 9367func (c *RepliesCreateCall) doRequest(alt string) (*http.Response, error) { 9368 reqHeaders := make(http.Header) 9369 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 9370 for k, v := range c.header_ { 9371 reqHeaders[k] = v 9372 } 9373 reqHeaders.Set("User-Agent", c.s.userAgent()) 9374 var body io.Reader = nil 9375 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reply) 9376 if err != nil { 9377 return nil, err 9378 } 9379 reqHeaders.Set("Content-Type", "application/json") 9380 c.urlParams_.Set("alt", alt) 9381 c.urlParams_.Set("prettyPrint", "false") 9382 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") 9383 urls += "?" + c.urlParams_.Encode() 9384 req, err := http.NewRequest("POST", urls, body) 9385 if err != nil { 9386 return nil, err 9387 } 9388 req.Header = reqHeaders 9389 googleapi.Expand(req.URL, map[string]string{ 9390 "fileId": c.fileId, 9391 "commentId": c.commentId, 9392 }) 9393 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9394} 9395 9396// Do executes the "drive.replies.create" call. 9397// Exactly one of *Reply or error will be non-nil. Any non-2xx status 9398// code is an error. Response headers are in either 9399// *Reply.ServerResponse.Header or (if a response was returned at all) 9400// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9401// check whether the returned error was because http.StatusNotModified 9402// was returned. 9403func (c *RepliesCreateCall) Do(opts ...googleapi.CallOption) (*Reply, error) { 9404 gensupport.SetOptions(c.urlParams_, opts...) 9405 res, err := c.doRequest("json") 9406 if res != nil && res.StatusCode == http.StatusNotModified { 9407 if res.Body != nil { 9408 res.Body.Close() 9409 } 9410 return nil, &googleapi.Error{ 9411 Code: res.StatusCode, 9412 Header: res.Header, 9413 } 9414 } 9415 if err != nil { 9416 return nil, err 9417 } 9418 defer googleapi.CloseBody(res) 9419 if err := googleapi.CheckResponse(res); err != nil { 9420 return nil, err 9421 } 9422 ret := &Reply{ 9423 ServerResponse: googleapi.ServerResponse{ 9424 Header: res.Header, 9425 HTTPStatusCode: res.StatusCode, 9426 }, 9427 } 9428 target := &ret 9429 if err := gensupport.DecodeResponse(target, res); err != nil { 9430 return nil, err 9431 } 9432 return ret, nil 9433 // { 9434 // "description": "Creates a new reply to a comment.", 9435 // "httpMethod": "POST", 9436 // "id": "drive.replies.create", 9437 // "parameterOrder": [ 9438 // "fileId", 9439 // "commentId" 9440 // ], 9441 // "parameters": { 9442 // "commentId": { 9443 // "description": "The ID of the comment.", 9444 // "location": "path", 9445 // "required": true, 9446 // "type": "string" 9447 // }, 9448 // "fileId": { 9449 // "description": "The ID of the file.", 9450 // "location": "path", 9451 // "required": true, 9452 // "type": "string" 9453 // } 9454 // }, 9455 // "path": "files/{fileId}/comments/{commentId}/replies", 9456 // "request": { 9457 // "$ref": "Reply" 9458 // }, 9459 // "response": { 9460 // "$ref": "Reply" 9461 // }, 9462 // "scopes": [ 9463 // "https://www.googleapis.com/auth/drive", 9464 // "https://www.googleapis.com/auth/drive.file" 9465 // ] 9466 // } 9467 9468} 9469 9470// method id "drive.replies.delete": 9471 9472type RepliesDeleteCall struct { 9473 s *Service 9474 fileId string 9475 commentId string 9476 replyId string 9477 urlParams_ gensupport.URLParams 9478 ctx_ context.Context 9479 header_ http.Header 9480} 9481 9482// Delete: Deletes a reply. 9483// 9484// - commentId: The ID of the comment. 9485// - fileId: The ID of the file. 9486// - replyId: The ID of the reply. 9487func (r *RepliesService) Delete(fileId string, commentId string, replyId string) *RepliesDeleteCall { 9488 c := &RepliesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9489 c.fileId = fileId 9490 c.commentId = commentId 9491 c.replyId = replyId 9492 return c 9493} 9494 9495// Fields allows partial responses to be retrieved. See 9496// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9497// for more information. 9498func (c *RepliesDeleteCall) Fields(s ...googleapi.Field) *RepliesDeleteCall { 9499 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9500 return c 9501} 9502 9503// Context sets the context to be used in this call's Do method. Any 9504// pending HTTP request will be aborted if the provided context is 9505// canceled. 9506func (c *RepliesDeleteCall) Context(ctx context.Context) *RepliesDeleteCall { 9507 c.ctx_ = ctx 9508 return c 9509} 9510 9511// Header returns an http.Header that can be modified by the caller to 9512// add HTTP headers to the request. 9513func (c *RepliesDeleteCall) Header() http.Header { 9514 if c.header_ == nil { 9515 c.header_ = make(http.Header) 9516 } 9517 return c.header_ 9518} 9519 9520func (c *RepliesDeleteCall) doRequest(alt string) (*http.Response, error) { 9521 reqHeaders := make(http.Header) 9522 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 9523 for k, v := range c.header_ { 9524 reqHeaders[k] = v 9525 } 9526 reqHeaders.Set("User-Agent", c.s.userAgent()) 9527 var body io.Reader = nil 9528 c.urlParams_.Set("alt", alt) 9529 c.urlParams_.Set("prettyPrint", "false") 9530 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") 9531 urls += "?" + c.urlParams_.Encode() 9532 req, err := http.NewRequest("DELETE", urls, body) 9533 if err != nil { 9534 return nil, err 9535 } 9536 req.Header = reqHeaders 9537 googleapi.Expand(req.URL, map[string]string{ 9538 "fileId": c.fileId, 9539 "commentId": c.commentId, 9540 "replyId": c.replyId, 9541 }) 9542 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9543} 9544 9545// Do executes the "drive.replies.delete" call. 9546func (c *RepliesDeleteCall) Do(opts ...googleapi.CallOption) error { 9547 gensupport.SetOptions(c.urlParams_, opts...) 9548 res, err := c.doRequest("json") 9549 if err != nil { 9550 return err 9551 } 9552 defer googleapi.CloseBody(res) 9553 if err := googleapi.CheckResponse(res); err != nil { 9554 return err 9555 } 9556 return nil 9557 // { 9558 // "description": "Deletes a reply.", 9559 // "httpMethod": "DELETE", 9560 // "id": "drive.replies.delete", 9561 // "parameterOrder": [ 9562 // "fileId", 9563 // "commentId", 9564 // "replyId" 9565 // ], 9566 // "parameters": { 9567 // "commentId": { 9568 // "description": "The ID of the comment.", 9569 // "location": "path", 9570 // "required": true, 9571 // "type": "string" 9572 // }, 9573 // "fileId": { 9574 // "description": "The ID of the file.", 9575 // "location": "path", 9576 // "required": true, 9577 // "type": "string" 9578 // }, 9579 // "replyId": { 9580 // "description": "The ID of the reply.", 9581 // "location": "path", 9582 // "required": true, 9583 // "type": "string" 9584 // } 9585 // }, 9586 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 9587 // "scopes": [ 9588 // "https://www.googleapis.com/auth/drive", 9589 // "https://www.googleapis.com/auth/drive.file" 9590 // ] 9591 // } 9592 9593} 9594 9595// method id "drive.replies.get": 9596 9597type RepliesGetCall struct { 9598 s *Service 9599 fileId string 9600 commentId string 9601 replyId string 9602 urlParams_ gensupport.URLParams 9603 ifNoneMatch_ string 9604 ctx_ context.Context 9605 header_ http.Header 9606} 9607 9608// Get: Gets a reply by ID. 9609// 9610// - commentId: The ID of the comment. 9611// - fileId: The ID of the file. 9612// - replyId: The ID of the reply. 9613func (r *RepliesService) Get(fileId string, commentId string, replyId string) *RepliesGetCall { 9614 c := &RepliesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9615 c.fileId = fileId 9616 c.commentId = commentId 9617 c.replyId = replyId 9618 return c 9619} 9620 9621// IncludeDeleted sets the optional parameter "includeDeleted": Whether 9622// to return deleted replies. Deleted replies will not include their 9623// original content. 9624func (c *RepliesGetCall) IncludeDeleted(includeDeleted bool) *RepliesGetCall { 9625 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 9626 return c 9627} 9628 9629// Fields allows partial responses to be retrieved. See 9630// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9631// for more information. 9632func (c *RepliesGetCall) Fields(s ...googleapi.Field) *RepliesGetCall { 9633 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9634 return c 9635} 9636 9637// IfNoneMatch sets the optional parameter which makes the operation 9638// fail if the object's ETag matches the given value. This is useful for 9639// getting updates only after the object has changed since the last 9640// request. Use googleapi.IsNotModified to check whether the response 9641// error from Do is the result of In-None-Match. 9642func (c *RepliesGetCall) IfNoneMatch(entityTag string) *RepliesGetCall { 9643 c.ifNoneMatch_ = entityTag 9644 return c 9645} 9646 9647// Context sets the context to be used in this call's Do method. Any 9648// pending HTTP request will be aborted if the provided context is 9649// canceled. 9650func (c *RepliesGetCall) Context(ctx context.Context) *RepliesGetCall { 9651 c.ctx_ = ctx 9652 return c 9653} 9654 9655// Header returns an http.Header that can be modified by the caller to 9656// add HTTP headers to the request. 9657func (c *RepliesGetCall) Header() http.Header { 9658 if c.header_ == nil { 9659 c.header_ = make(http.Header) 9660 } 9661 return c.header_ 9662} 9663 9664func (c *RepliesGetCall) doRequest(alt string) (*http.Response, error) { 9665 reqHeaders := make(http.Header) 9666 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 9667 for k, v := range c.header_ { 9668 reqHeaders[k] = v 9669 } 9670 reqHeaders.Set("User-Agent", c.s.userAgent()) 9671 if c.ifNoneMatch_ != "" { 9672 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9673 } 9674 var body io.Reader = nil 9675 c.urlParams_.Set("alt", alt) 9676 c.urlParams_.Set("prettyPrint", "false") 9677 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") 9678 urls += "?" + c.urlParams_.Encode() 9679 req, err := http.NewRequest("GET", urls, body) 9680 if err != nil { 9681 return nil, err 9682 } 9683 req.Header = reqHeaders 9684 googleapi.Expand(req.URL, map[string]string{ 9685 "fileId": c.fileId, 9686 "commentId": c.commentId, 9687 "replyId": c.replyId, 9688 }) 9689 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9690} 9691 9692// Do executes the "drive.replies.get" call. 9693// Exactly one of *Reply or error will be non-nil. Any non-2xx status 9694// code is an error. Response headers are in either 9695// *Reply.ServerResponse.Header or (if a response was returned at all) 9696// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9697// check whether the returned error was because http.StatusNotModified 9698// was returned. 9699func (c *RepliesGetCall) Do(opts ...googleapi.CallOption) (*Reply, error) { 9700 gensupport.SetOptions(c.urlParams_, opts...) 9701 res, err := c.doRequest("json") 9702 if res != nil && res.StatusCode == http.StatusNotModified { 9703 if res.Body != nil { 9704 res.Body.Close() 9705 } 9706 return nil, &googleapi.Error{ 9707 Code: res.StatusCode, 9708 Header: res.Header, 9709 } 9710 } 9711 if err != nil { 9712 return nil, err 9713 } 9714 defer googleapi.CloseBody(res) 9715 if err := googleapi.CheckResponse(res); err != nil { 9716 return nil, err 9717 } 9718 ret := &Reply{ 9719 ServerResponse: googleapi.ServerResponse{ 9720 Header: res.Header, 9721 HTTPStatusCode: res.StatusCode, 9722 }, 9723 } 9724 target := &ret 9725 if err := gensupport.DecodeResponse(target, res); err != nil { 9726 return nil, err 9727 } 9728 return ret, nil 9729 // { 9730 // "description": "Gets a reply by ID.", 9731 // "httpMethod": "GET", 9732 // "id": "drive.replies.get", 9733 // "parameterOrder": [ 9734 // "fileId", 9735 // "commentId", 9736 // "replyId" 9737 // ], 9738 // "parameters": { 9739 // "commentId": { 9740 // "description": "The ID of the comment.", 9741 // "location": "path", 9742 // "required": true, 9743 // "type": "string" 9744 // }, 9745 // "fileId": { 9746 // "description": "The ID of the file.", 9747 // "location": "path", 9748 // "required": true, 9749 // "type": "string" 9750 // }, 9751 // "includeDeleted": { 9752 // "default": "false", 9753 // "description": "Whether to return deleted replies. Deleted replies will not include their original content.", 9754 // "location": "query", 9755 // "type": "boolean" 9756 // }, 9757 // "replyId": { 9758 // "description": "The ID of the reply.", 9759 // "location": "path", 9760 // "required": true, 9761 // "type": "string" 9762 // } 9763 // }, 9764 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 9765 // "response": { 9766 // "$ref": "Reply" 9767 // }, 9768 // "scopes": [ 9769 // "https://www.googleapis.com/auth/drive", 9770 // "https://www.googleapis.com/auth/drive.file", 9771 // "https://www.googleapis.com/auth/drive.readonly" 9772 // ] 9773 // } 9774 9775} 9776 9777// method id "drive.replies.list": 9778 9779type RepliesListCall struct { 9780 s *Service 9781 fileId string 9782 commentId string 9783 urlParams_ gensupport.URLParams 9784 ifNoneMatch_ string 9785 ctx_ context.Context 9786 header_ http.Header 9787} 9788 9789// List: Lists a comment's replies. 9790// 9791// - commentId: The ID of the comment. 9792// - fileId: The ID of the file. 9793func (r *RepliesService) List(fileId string, commentId string) *RepliesListCall { 9794 c := &RepliesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9795 c.fileId = fileId 9796 c.commentId = commentId 9797 return c 9798} 9799 9800// IncludeDeleted sets the optional parameter "includeDeleted": Whether 9801// to include deleted replies. Deleted replies will not include their 9802// original content. 9803func (c *RepliesListCall) IncludeDeleted(includeDeleted bool) *RepliesListCall { 9804 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 9805 return c 9806} 9807 9808// PageSize sets the optional parameter "pageSize": The maximum number 9809// of replies to return per page. 9810func (c *RepliesListCall) PageSize(pageSize int64) *RepliesListCall { 9811 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9812 return c 9813} 9814 9815// PageToken sets the optional parameter "pageToken": The token for 9816// continuing a previous list request on the next page. This should be 9817// set to the value of 'nextPageToken' from the previous response. 9818func (c *RepliesListCall) PageToken(pageToken string) *RepliesListCall { 9819 c.urlParams_.Set("pageToken", pageToken) 9820 return c 9821} 9822 9823// Fields allows partial responses to be retrieved. See 9824// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9825// for more information. 9826func (c *RepliesListCall) Fields(s ...googleapi.Field) *RepliesListCall { 9827 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9828 return c 9829} 9830 9831// IfNoneMatch sets the optional parameter which makes the operation 9832// fail if the object's ETag matches the given value. This is useful for 9833// getting updates only after the object has changed since the last 9834// request. Use googleapi.IsNotModified to check whether the response 9835// error from Do is the result of In-None-Match. 9836func (c *RepliesListCall) IfNoneMatch(entityTag string) *RepliesListCall { 9837 c.ifNoneMatch_ = entityTag 9838 return c 9839} 9840 9841// Context sets the context to be used in this call's Do method. Any 9842// pending HTTP request will be aborted if the provided context is 9843// canceled. 9844func (c *RepliesListCall) Context(ctx context.Context) *RepliesListCall { 9845 c.ctx_ = ctx 9846 return c 9847} 9848 9849// Header returns an http.Header that can be modified by the caller to 9850// add HTTP headers to the request. 9851func (c *RepliesListCall) Header() http.Header { 9852 if c.header_ == nil { 9853 c.header_ = make(http.Header) 9854 } 9855 return c.header_ 9856} 9857 9858func (c *RepliesListCall) doRequest(alt string) (*http.Response, error) { 9859 reqHeaders := make(http.Header) 9860 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 9861 for k, v := range c.header_ { 9862 reqHeaders[k] = v 9863 } 9864 reqHeaders.Set("User-Agent", c.s.userAgent()) 9865 if c.ifNoneMatch_ != "" { 9866 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9867 } 9868 var body io.Reader = nil 9869 c.urlParams_.Set("alt", alt) 9870 c.urlParams_.Set("prettyPrint", "false") 9871 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") 9872 urls += "?" + c.urlParams_.Encode() 9873 req, err := http.NewRequest("GET", urls, body) 9874 if err != nil { 9875 return nil, err 9876 } 9877 req.Header = reqHeaders 9878 googleapi.Expand(req.URL, map[string]string{ 9879 "fileId": c.fileId, 9880 "commentId": c.commentId, 9881 }) 9882 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9883} 9884 9885// Do executes the "drive.replies.list" call. 9886// Exactly one of *ReplyList or error will be non-nil. Any non-2xx 9887// status code is an error. Response headers are in either 9888// *ReplyList.ServerResponse.Header or (if a response was returned at 9889// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9890// to check whether the returned error was because 9891// http.StatusNotModified was returned. 9892func (c *RepliesListCall) Do(opts ...googleapi.CallOption) (*ReplyList, error) { 9893 gensupport.SetOptions(c.urlParams_, opts...) 9894 res, err := c.doRequest("json") 9895 if res != nil && res.StatusCode == http.StatusNotModified { 9896 if res.Body != nil { 9897 res.Body.Close() 9898 } 9899 return nil, &googleapi.Error{ 9900 Code: res.StatusCode, 9901 Header: res.Header, 9902 } 9903 } 9904 if err != nil { 9905 return nil, err 9906 } 9907 defer googleapi.CloseBody(res) 9908 if err := googleapi.CheckResponse(res); err != nil { 9909 return nil, err 9910 } 9911 ret := &ReplyList{ 9912 ServerResponse: googleapi.ServerResponse{ 9913 Header: res.Header, 9914 HTTPStatusCode: res.StatusCode, 9915 }, 9916 } 9917 target := &ret 9918 if err := gensupport.DecodeResponse(target, res); err != nil { 9919 return nil, err 9920 } 9921 return ret, nil 9922 // { 9923 // "description": "Lists a comment's replies.", 9924 // "httpMethod": "GET", 9925 // "id": "drive.replies.list", 9926 // "parameterOrder": [ 9927 // "fileId", 9928 // "commentId" 9929 // ], 9930 // "parameters": { 9931 // "commentId": { 9932 // "description": "The ID of the comment.", 9933 // "location": "path", 9934 // "required": true, 9935 // "type": "string" 9936 // }, 9937 // "fileId": { 9938 // "description": "The ID of the file.", 9939 // "location": "path", 9940 // "required": true, 9941 // "type": "string" 9942 // }, 9943 // "includeDeleted": { 9944 // "default": "false", 9945 // "description": "Whether to include deleted replies. Deleted replies will not include their original content.", 9946 // "location": "query", 9947 // "type": "boolean" 9948 // }, 9949 // "pageSize": { 9950 // "default": "20", 9951 // "description": "The maximum number of replies to return per page.", 9952 // "format": "int32", 9953 // "location": "query", 9954 // "maximum": "100", 9955 // "minimum": "1", 9956 // "type": "integer" 9957 // }, 9958 // "pageToken": { 9959 // "description": "The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.", 9960 // "location": "query", 9961 // "type": "string" 9962 // } 9963 // }, 9964 // "path": "files/{fileId}/comments/{commentId}/replies", 9965 // "response": { 9966 // "$ref": "ReplyList" 9967 // }, 9968 // "scopes": [ 9969 // "https://www.googleapis.com/auth/drive", 9970 // "https://www.googleapis.com/auth/drive.file", 9971 // "https://www.googleapis.com/auth/drive.readonly" 9972 // ] 9973 // } 9974 9975} 9976 9977// Pages invokes f for each page of results. 9978// A non-nil error returned from f will halt the iteration. 9979// The provided context supersedes any context provided to the Context method. 9980func (c *RepliesListCall) Pages(ctx context.Context, f func(*ReplyList) error) error { 9981 c.ctx_ = ctx 9982 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9983 for { 9984 x, err := c.Do() 9985 if err != nil { 9986 return err 9987 } 9988 if err := f(x); err != nil { 9989 return err 9990 } 9991 if x.NextPageToken == "" { 9992 return nil 9993 } 9994 c.PageToken(x.NextPageToken) 9995 } 9996} 9997 9998// method id "drive.replies.update": 9999 10000type RepliesUpdateCall struct { 10001 s *Service 10002 fileId string 10003 commentId string 10004 replyId string 10005 reply *Reply 10006 urlParams_ gensupport.URLParams 10007 ctx_ context.Context 10008 header_ http.Header 10009} 10010 10011// Update: Updates a reply with patch semantics. 10012// 10013// - commentId: The ID of the comment. 10014// - fileId: The ID of the file. 10015// - replyId: The ID of the reply. 10016func (r *RepliesService) Update(fileId string, commentId string, replyId string, reply *Reply) *RepliesUpdateCall { 10017 c := &RepliesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10018 c.fileId = fileId 10019 c.commentId = commentId 10020 c.replyId = replyId 10021 c.reply = reply 10022 return c 10023} 10024 10025// Fields allows partial responses to be retrieved. See 10026// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10027// for more information. 10028func (c *RepliesUpdateCall) Fields(s ...googleapi.Field) *RepliesUpdateCall { 10029 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10030 return c 10031} 10032 10033// Context sets the context to be used in this call's Do method. Any 10034// pending HTTP request will be aborted if the provided context is 10035// canceled. 10036func (c *RepliesUpdateCall) Context(ctx context.Context) *RepliesUpdateCall { 10037 c.ctx_ = ctx 10038 return c 10039} 10040 10041// Header returns an http.Header that can be modified by the caller to 10042// add HTTP headers to the request. 10043func (c *RepliesUpdateCall) Header() http.Header { 10044 if c.header_ == nil { 10045 c.header_ = make(http.Header) 10046 } 10047 return c.header_ 10048} 10049 10050func (c *RepliesUpdateCall) doRequest(alt string) (*http.Response, error) { 10051 reqHeaders := make(http.Header) 10052 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 10053 for k, v := range c.header_ { 10054 reqHeaders[k] = v 10055 } 10056 reqHeaders.Set("User-Agent", c.s.userAgent()) 10057 var body io.Reader = nil 10058 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reply) 10059 if err != nil { 10060 return nil, err 10061 } 10062 reqHeaders.Set("Content-Type", "application/json") 10063 c.urlParams_.Set("alt", alt) 10064 c.urlParams_.Set("prettyPrint", "false") 10065 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") 10066 urls += "?" + c.urlParams_.Encode() 10067 req, err := http.NewRequest("PATCH", urls, body) 10068 if err != nil { 10069 return nil, err 10070 } 10071 req.Header = reqHeaders 10072 googleapi.Expand(req.URL, map[string]string{ 10073 "fileId": c.fileId, 10074 "commentId": c.commentId, 10075 "replyId": c.replyId, 10076 }) 10077 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10078} 10079 10080// Do executes the "drive.replies.update" call. 10081// Exactly one of *Reply or error will be non-nil. Any non-2xx status 10082// code is an error. Response headers are in either 10083// *Reply.ServerResponse.Header or (if a response was returned at all) 10084// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10085// check whether the returned error was because http.StatusNotModified 10086// was returned. 10087func (c *RepliesUpdateCall) Do(opts ...googleapi.CallOption) (*Reply, error) { 10088 gensupport.SetOptions(c.urlParams_, opts...) 10089 res, err := c.doRequest("json") 10090 if res != nil && res.StatusCode == http.StatusNotModified { 10091 if res.Body != nil { 10092 res.Body.Close() 10093 } 10094 return nil, &googleapi.Error{ 10095 Code: res.StatusCode, 10096 Header: res.Header, 10097 } 10098 } 10099 if err != nil { 10100 return nil, err 10101 } 10102 defer googleapi.CloseBody(res) 10103 if err := googleapi.CheckResponse(res); err != nil { 10104 return nil, err 10105 } 10106 ret := &Reply{ 10107 ServerResponse: googleapi.ServerResponse{ 10108 Header: res.Header, 10109 HTTPStatusCode: res.StatusCode, 10110 }, 10111 } 10112 target := &ret 10113 if err := gensupport.DecodeResponse(target, res); err != nil { 10114 return nil, err 10115 } 10116 return ret, nil 10117 // { 10118 // "description": "Updates a reply with patch semantics.", 10119 // "httpMethod": "PATCH", 10120 // "id": "drive.replies.update", 10121 // "parameterOrder": [ 10122 // "fileId", 10123 // "commentId", 10124 // "replyId" 10125 // ], 10126 // "parameters": { 10127 // "commentId": { 10128 // "description": "The ID of the comment.", 10129 // "location": "path", 10130 // "required": true, 10131 // "type": "string" 10132 // }, 10133 // "fileId": { 10134 // "description": "The ID of the file.", 10135 // "location": "path", 10136 // "required": true, 10137 // "type": "string" 10138 // }, 10139 // "replyId": { 10140 // "description": "The ID of the reply.", 10141 // "location": "path", 10142 // "required": true, 10143 // "type": "string" 10144 // } 10145 // }, 10146 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 10147 // "request": { 10148 // "$ref": "Reply" 10149 // }, 10150 // "response": { 10151 // "$ref": "Reply" 10152 // }, 10153 // "scopes": [ 10154 // "https://www.googleapis.com/auth/drive", 10155 // "https://www.googleapis.com/auth/drive.file" 10156 // ] 10157 // } 10158 10159} 10160 10161// method id "drive.revisions.delete": 10162 10163type RevisionsDeleteCall struct { 10164 s *Service 10165 fileId string 10166 revisionId string 10167 urlParams_ gensupport.URLParams 10168 ctx_ context.Context 10169 header_ http.Header 10170} 10171 10172// Delete: Permanently deletes a file version. You can only delete 10173// revisions for files with binary content in Google Drive, like images 10174// or videos. Revisions for other files, like Google Docs or Sheets, and 10175// the last remaining file version can't be deleted. 10176// 10177// - fileId: The ID of the file. 10178// - revisionId: The ID of the revision. 10179func (r *RevisionsService) Delete(fileId string, revisionId string) *RevisionsDeleteCall { 10180 c := &RevisionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10181 c.fileId = fileId 10182 c.revisionId = revisionId 10183 return c 10184} 10185 10186// Fields allows partial responses to be retrieved. See 10187// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10188// for more information. 10189func (c *RevisionsDeleteCall) Fields(s ...googleapi.Field) *RevisionsDeleteCall { 10190 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10191 return c 10192} 10193 10194// Context sets the context to be used in this call's Do method. Any 10195// pending HTTP request will be aborted if the provided context is 10196// canceled. 10197func (c *RevisionsDeleteCall) Context(ctx context.Context) *RevisionsDeleteCall { 10198 c.ctx_ = ctx 10199 return c 10200} 10201 10202// Header returns an http.Header that can be modified by the caller to 10203// add HTTP headers to the request. 10204func (c *RevisionsDeleteCall) Header() http.Header { 10205 if c.header_ == nil { 10206 c.header_ = make(http.Header) 10207 } 10208 return c.header_ 10209} 10210 10211func (c *RevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { 10212 reqHeaders := make(http.Header) 10213 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 10214 for k, v := range c.header_ { 10215 reqHeaders[k] = v 10216 } 10217 reqHeaders.Set("User-Agent", c.s.userAgent()) 10218 var body io.Reader = nil 10219 c.urlParams_.Set("alt", alt) 10220 c.urlParams_.Set("prettyPrint", "false") 10221 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") 10222 urls += "?" + c.urlParams_.Encode() 10223 req, err := http.NewRequest("DELETE", urls, body) 10224 if err != nil { 10225 return nil, err 10226 } 10227 req.Header = reqHeaders 10228 googleapi.Expand(req.URL, map[string]string{ 10229 "fileId": c.fileId, 10230 "revisionId": c.revisionId, 10231 }) 10232 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10233} 10234 10235// Do executes the "drive.revisions.delete" call. 10236func (c *RevisionsDeleteCall) Do(opts ...googleapi.CallOption) error { 10237 gensupport.SetOptions(c.urlParams_, opts...) 10238 res, err := c.doRequest("json") 10239 if err != nil { 10240 return err 10241 } 10242 defer googleapi.CloseBody(res) 10243 if err := googleapi.CheckResponse(res); err != nil { 10244 return err 10245 } 10246 return nil 10247 // { 10248 // "description": "Permanently deletes a file version. You can only delete revisions for files with binary content in Google Drive, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.", 10249 // "httpMethod": "DELETE", 10250 // "id": "drive.revisions.delete", 10251 // "parameterOrder": [ 10252 // "fileId", 10253 // "revisionId" 10254 // ], 10255 // "parameters": { 10256 // "fileId": { 10257 // "description": "The ID of the file.", 10258 // "location": "path", 10259 // "required": true, 10260 // "type": "string" 10261 // }, 10262 // "revisionId": { 10263 // "description": "The ID of the revision.", 10264 // "location": "path", 10265 // "required": true, 10266 // "type": "string" 10267 // } 10268 // }, 10269 // "path": "files/{fileId}/revisions/{revisionId}", 10270 // "scopes": [ 10271 // "https://www.googleapis.com/auth/drive", 10272 // "https://www.googleapis.com/auth/drive.appdata", 10273 // "https://www.googleapis.com/auth/drive.file" 10274 // ] 10275 // } 10276 10277} 10278 10279// method id "drive.revisions.get": 10280 10281type RevisionsGetCall struct { 10282 s *Service 10283 fileId string 10284 revisionId string 10285 urlParams_ gensupport.URLParams 10286 ifNoneMatch_ string 10287 ctx_ context.Context 10288 header_ http.Header 10289} 10290 10291// Get: Gets a revision's metadata or content by ID. 10292// 10293// - fileId: The ID of the file. 10294// - revisionId: The ID of the revision. 10295func (r *RevisionsService) Get(fileId string, revisionId string) *RevisionsGetCall { 10296 c := &RevisionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10297 c.fileId = fileId 10298 c.revisionId = revisionId 10299 return c 10300} 10301 10302// AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": 10303// Whether the user is acknowledging the risk of downloading known 10304// malware or other abusive files. This is only applicable when 10305// alt=media. 10306func (c *RevisionsGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *RevisionsGetCall { 10307 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse)) 10308 return c 10309} 10310 10311// Fields allows partial responses to be retrieved. See 10312// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10313// for more information. 10314func (c *RevisionsGetCall) Fields(s ...googleapi.Field) *RevisionsGetCall { 10315 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10316 return c 10317} 10318 10319// IfNoneMatch sets the optional parameter which makes the operation 10320// fail if the object's ETag matches the given value. This is useful for 10321// getting updates only after the object has changed since the last 10322// request. Use googleapi.IsNotModified to check whether the response 10323// error from Do is the result of In-None-Match. 10324func (c *RevisionsGetCall) IfNoneMatch(entityTag string) *RevisionsGetCall { 10325 c.ifNoneMatch_ = entityTag 10326 return c 10327} 10328 10329// Context sets the context to be used in this call's Do and Download 10330// methods. Any pending HTTP request will be aborted if the provided 10331// context is canceled. 10332func (c *RevisionsGetCall) Context(ctx context.Context) *RevisionsGetCall { 10333 c.ctx_ = ctx 10334 return c 10335} 10336 10337// Header returns an http.Header that can be modified by the caller to 10338// add HTTP headers to the request. 10339func (c *RevisionsGetCall) Header() http.Header { 10340 if c.header_ == nil { 10341 c.header_ = make(http.Header) 10342 } 10343 return c.header_ 10344} 10345 10346func (c *RevisionsGetCall) doRequest(alt string) (*http.Response, error) { 10347 reqHeaders := make(http.Header) 10348 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 10349 for k, v := range c.header_ { 10350 reqHeaders[k] = v 10351 } 10352 reqHeaders.Set("User-Agent", c.s.userAgent()) 10353 if c.ifNoneMatch_ != "" { 10354 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10355 } 10356 var body io.Reader = nil 10357 c.urlParams_.Set("alt", alt) 10358 c.urlParams_.Set("prettyPrint", "false") 10359 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") 10360 urls += "?" + c.urlParams_.Encode() 10361 req, err := http.NewRequest("GET", urls, body) 10362 if err != nil { 10363 return nil, err 10364 } 10365 req.Header = reqHeaders 10366 googleapi.Expand(req.URL, map[string]string{ 10367 "fileId": c.fileId, 10368 "revisionId": c.revisionId, 10369 }) 10370 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10371} 10372 10373// Download fetches the API endpoint's "media" value, instead of the normal 10374// API response value. If the returned error is nil, the Response is guaranteed to 10375// have a 2xx status code. Callers must close the Response.Body as usual. 10376func (c *RevisionsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 10377 gensupport.SetOptions(c.urlParams_, opts...) 10378 res, err := c.doRequest("media") 10379 if err != nil { 10380 return nil, err 10381 } 10382 if err := googleapi.CheckResponse(res); err != nil { 10383 res.Body.Close() 10384 return nil, err 10385 } 10386 return res, nil 10387} 10388 10389// Do executes the "drive.revisions.get" call. 10390// Exactly one of *Revision or error will be non-nil. Any non-2xx status 10391// code is an error. Response headers are in either 10392// *Revision.ServerResponse.Header or (if a response was returned at 10393// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10394// to check whether the returned error was because 10395// http.StatusNotModified was returned. 10396func (c *RevisionsGetCall) Do(opts ...googleapi.CallOption) (*Revision, error) { 10397 gensupport.SetOptions(c.urlParams_, opts...) 10398 res, err := c.doRequest("json") 10399 if res != nil && res.StatusCode == http.StatusNotModified { 10400 if res.Body != nil { 10401 res.Body.Close() 10402 } 10403 return nil, &googleapi.Error{ 10404 Code: res.StatusCode, 10405 Header: res.Header, 10406 } 10407 } 10408 if err != nil { 10409 return nil, err 10410 } 10411 defer googleapi.CloseBody(res) 10412 if err := googleapi.CheckResponse(res); err != nil { 10413 return nil, err 10414 } 10415 ret := &Revision{ 10416 ServerResponse: googleapi.ServerResponse{ 10417 Header: res.Header, 10418 HTTPStatusCode: res.StatusCode, 10419 }, 10420 } 10421 target := &ret 10422 if err := gensupport.DecodeResponse(target, res); err != nil { 10423 return nil, err 10424 } 10425 return ret, nil 10426 // { 10427 // "description": "Gets a revision's metadata or content by ID.", 10428 // "httpMethod": "GET", 10429 // "id": "drive.revisions.get", 10430 // "parameterOrder": [ 10431 // "fileId", 10432 // "revisionId" 10433 // ], 10434 // "parameters": { 10435 // "acknowledgeAbuse": { 10436 // "default": "false", 10437 // "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.", 10438 // "location": "query", 10439 // "type": "boolean" 10440 // }, 10441 // "fileId": { 10442 // "description": "The ID of the file.", 10443 // "location": "path", 10444 // "required": true, 10445 // "type": "string" 10446 // }, 10447 // "revisionId": { 10448 // "description": "The ID of the revision.", 10449 // "location": "path", 10450 // "required": true, 10451 // "type": "string" 10452 // } 10453 // }, 10454 // "path": "files/{fileId}/revisions/{revisionId}", 10455 // "response": { 10456 // "$ref": "Revision" 10457 // }, 10458 // "scopes": [ 10459 // "https://www.googleapis.com/auth/drive", 10460 // "https://www.googleapis.com/auth/drive.appdata", 10461 // "https://www.googleapis.com/auth/drive.file", 10462 // "https://www.googleapis.com/auth/drive.metadata", 10463 // "https://www.googleapis.com/auth/drive.metadata.readonly", 10464 // "https://www.googleapis.com/auth/drive.photos.readonly", 10465 // "https://www.googleapis.com/auth/drive.readonly" 10466 // ], 10467 // "supportsMediaDownload": true, 10468 // "useMediaDownloadService": true 10469 // } 10470 10471} 10472 10473// method id "drive.revisions.list": 10474 10475type RevisionsListCall struct { 10476 s *Service 10477 fileId string 10478 urlParams_ gensupport.URLParams 10479 ifNoneMatch_ string 10480 ctx_ context.Context 10481 header_ http.Header 10482} 10483 10484// List: Lists a file's revisions. 10485// 10486// - fileId: The ID of the file. 10487func (r *RevisionsService) List(fileId string) *RevisionsListCall { 10488 c := &RevisionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10489 c.fileId = fileId 10490 return c 10491} 10492 10493// PageSize sets the optional parameter "pageSize": The maximum number 10494// of revisions to return per page. 10495func (c *RevisionsListCall) PageSize(pageSize int64) *RevisionsListCall { 10496 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 10497 return c 10498} 10499 10500// PageToken sets the optional parameter "pageToken": The token for 10501// continuing a previous list request on the next page. This should be 10502// set to the value of 'nextPageToken' from the previous response. 10503func (c *RevisionsListCall) PageToken(pageToken string) *RevisionsListCall { 10504 c.urlParams_.Set("pageToken", pageToken) 10505 return c 10506} 10507 10508// Fields allows partial responses to be retrieved. See 10509// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10510// for more information. 10511func (c *RevisionsListCall) Fields(s ...googleapi.Field) *RevisionsListCall { 10512 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10513 return c 10514} 10515 10516// IfNoneMatch sets the optional parameter which makes the operation 10517// fail if the object's ETag matches the given value. This is useful for 10518// getting updates only after the object has changed since the last 10519// request. Use googleapi.IsNotModified to check whether the response 10520// error from Do is the result of In-None-Match. 10521func (c *RevisionsListCall) IfNoneMatch(entityTag string) *RevisionsListCall { 10522 c.ifNoneMatch_ = entityTag 10523 return c 10524} 10525 10526// Context sets the context to be used in this call's Do method. Any 10527// pending HTTP request will be aborted if the provided context is 10528// canceled. 10529func (c *RevisionsListCall) Context(ctx context.Context) *RevisionsListCall { 10530 c.ctx_ = ctx 10531 return c 10532} 10533 10534// Header returns an http.Header that can be modified by the caller to 10535// add HTTP headers to the request. 10536func (c *RevisionsListCall) Header() http.Header { 10537 if c.header_ == nil { 10538 c.header_ = make(http.Header) 10539 } 10540 return c.header_ 10541} 10542 10543func (c *RevisionsListCall) doRequest(alt string) (*http.Response, error) { 10544 reqHeaders := make(http.Header) 10545 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 10546 for k, v := range c.header_ { 10547 reqHeaders[k] = v 10548 } 10549 reqHeaders.Set("User-Agent", c.s.userAgent()) 10550 if c.ifNoneMatch_ != "" { 10551 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10552 } 10553 var body io.Reader = nil 10554 c.urlParams_.Set("alt", alt) 10555 c.urlParams_.Set("prettyPrint", "false") 10556 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions") 10557 urls += "?" + c.urlParams_.Encode() 10558 req, err := http.NewRequest("GET", urls, body) 10559 if err != nil { 10560 return nil, err 10561 } 10562 req.Header = reqHeaders 10563 googleapi.Expand(req.URL, map[string]string{ 10564 "fileId": c.fileId, 10565 }) 10566 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10567} 10568 10569// Do executes the "drive.revisions.list" call. 10570// Exactly one of *RevisionList or error will be non-nil. Any non-2xx 10571// status code is an error. Response headers are in either 10572// *RevisionList.ServerResponse.Header or (if a response was returned at 10573// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10574// to check whether the returned error was because 10575// http.StatusNotModified was returned. 10576func (c *RevisionsListCall) Do(opts ...googleapi.CallOption) (*RevisionList, error) { 10577 gensupport.SetOptions(c.urlParams_, opts...) 10578 res, err := c.doRequest("json") 10579 if res != nil && res.StatusCode == http.StatusNotModified { 10580 if res.Body != nil { 10581 res.Body.Close() 10582 } 10583 return nil, &googleapi.Error{ 10584 Code: res.StatusCode, 10585 Header: res.Header, 10586 } 10587 } 10588 if err != nil { 10589 return nil, err 10590 } 10591 defer googleapi.CloseBody(res) 10592 if err := googleapi.CheckResponse(res); err != nil { 10593 return nil, err 10594 } 10595 ret := &RevisionList{ 10596 ServerResponse: googleapi.ServerResponse{ 10597 Header: res.Header, 10598 HTTPStatusCode: res.StatusCode, 10599 }, 10600 } 10601 target := &ret 10602 if err := gensupport.DecodeResponse(target, res); err != nil { 10603 return nil, err 10604 } 10605 return ret, nil 10606 // { 10607 // "description": "Lists a file's revisions.", 10608 // "httpMethod": "GET", 10609 // "id": "drive.revisions.list", 10610 // "parameterOrder": [ 10611 // "fileId" 10612 // ], 10613 // "parameters": { 10614 // "fileId": { 10615 // "description": "The ID of the file.", 10616 // "location": "path", 10617 // "required": true, 10618 // "type": "string" 10619 // }, 10620 // "pageSize": { 10621 // "default": "200", 10622 // "description": "The maximum number of revisions to return per page.", 10623 // "format": "int32", 10624 // "location": "query", 10625 // "maximum": "1000", 10626 // "minimum": "1", 10627 // "type": "integer" 10628 // }, 10629 // "pageToken": { 10630 // "description": "The token for continuing a previous list request on the next page. This should be set to the value of 'nextPageToken' from the previous response.", 10631 // "location": "query", 10632 // "type": "string" 10633 // } 10634 // }, 10635 // "path": "files/{fileId}/revisions", 10636 // "response": { 10637 // "$ref": "RevisionList" 10638 // }, 10639 // "scopes": [ 10640 // "https://www.googleapis.com/auth/drive", 10641 // "https://www.googleapis.com/auth/drive.appdata", 10642 // "https://www.googleapis.com/auth/drive.file", 10643 // "https://www.googleapis.com/auth/drive.metadata", 10644 // "https://www.googleapis.com/auth/drive.metadata.readonly", 10645 // "https://www.googleapis.com/auth/drive.photos.readonly", 10646 // "https://www.googleapis.com/auth/drive.readonly" 10647 // ] 10648 // } 10649 10650} 10651 10652// Pages invokes f for each page of results. 10653// A non-nil error returned from f will halt the iteration. 10654// The provided context supersedes any context provided to the Context method. 10655func (c *RevisionsListCall) Pages(ctx context.Context, f func(*RevisionList) error) error { 10656 c.ctx_ = ctx 10657 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10658 for { 10659 x, err := c.Do() 10660 if err != nil { 10661 return err 10662 } 10663 if err := f(x); err != nil { 10664 return err 10665 } 10666 if x.NextPageToken == "" { 10667 return nil 10668 } 10669 c.PageToken(x.NextPageToken) 10670 } 10671} 10672 10673// method id "drive.revisions.update": 10674 10675type RevisionsUpdateCall struct { 10676 s *Service 10677 fileId string 10678 revisionId string 10679 revision *Revision 10680 urlParams_ gensupport.URLParams 10681 ctx_ context.Context 10682 header_ http.Header 10683} 10684 10685// Update: Updates a revision with patch semantics. 10686// 10687// - fileId: The ID of the file. 10688// - revisionId: The ID of the revision. 10689func (r *RevisionsService) Update(fileId string, revisionId string, revision *Revision) *RevisionsUpdateCall { 10690 c := &RevisionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10691 c.fileId = fileId 10692 c.revisionId = revisionId 10693 c.revision = revision 10694 return c 10695} 10696 10697// Fields allows partial responses to be retrieved. See 10698// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10699// for more information. 10700func (c *RevisionsUpdateCall) Fields(s ...googleapi.Field) *RevisionsUpdateCall { 10701 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10702 return c 10703} 10704 10705// Context sets the context to be used in this call's Do method. Any 10706// pending HTTP request will be aborted if the provided context is 10707// canceled. 10708func (c *RevisionsUpdateCall) Context(ctx context.Context) *RevisionsUpdateCall { 10709 c.ctx_ = ctx 10710 return c 10711} 10712 10713// Header returns an http.Header that can be modified by the caller to 10714// add HTTP headers to the request. 10715func (c *RevisionsUpdateCall) Header() http.Header { 10716 if c.header_ == nil { 10717 c.header_ = make(http.Header) 10718 } 10719 return c.header_ 10720} 10721 10722func (c *RevisionsUpdateCall) doRequest(alt string) (*http.Response, error) { 10723 reqHeaders := make(http.Header) 10724 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 10725 for k, v := range c.header_ { 10726 reqHeaders[k] = v 10727 } 10728 reqHeaders.Set("User-Agent", c.s.userAgent()) 10729 var body io.Reader = nil 10730 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision) 10731 if err != nil { 10732 return nil, err 10733 } 10734 reqHeaders.Set("Content-Type", "application/json") 10735 c.urlParams_.Set("alt", alt) 10736 c.urlParams_.Set("prettyPrint", "false") 10737 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") 10738 urls += "?" + c.urlParams_.Encode() 10739 req, err := http.NewRequest("PATCH", urls, body) 10740 if err != nil { 10741 return nil, err 10742 } 10743 req.Header = reqHeaders 10744 googleapi.Expand(req.URL, map[string]string{ 10745 "fileId": c.fileId, 10746 "revisionId": c.revisionId, 10747 }) 10748 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10749} 10750 10751// Do executes the "drive.revisions.update" call. 10752// Exactly one of *Revision or error will be non-nil. Any non-2xx status 10753// code is an error. Response headers are in either 10754// *Revision.ServerResponse.Header or (if a response was returned at 10755// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10756// to check whether the returned error was because 10757// http.StatusNotModified was returned. 10758func (c *RevisionsUpdateCall) Do(opts ...googleapi.CallOption) (*Revision, error) { 10759 gensupport.SetOptions(c.urlParams_, opts...) 10760 res, err := c.doRequest("json") 10761 if res != nil && res.StatusCode == http.StatusNotModified { 10762 if res.Body != nil { 10763 res.Body.Close() 10764 } 10765 return nil, &googleapi.Error{ 10766 Code: res.StatusCode, 10767 Header: res.Header, 10768 } 10769 } 10770 if err != nil { 10771 return nil, err 10772 } 10773 defer googleapi.CloseBody(res) 10774 if err := googleapi.CheckResponse(res); err != nil { 10775 return nil, err 10776 } 10777 ret := &Revision{ 10778 ServerResponse: googleapi.ServerResponse{ 10779 Header: res.Header, 10780 HTTPStatusCode: res.StatusCode, 10781 }, 10782 } 10783 target := &ret 10784 if err := gensupport.DecodeResponse(target, res); err != nil { 10785 return nil, err 10786 } 10787 return ret, nil 10788 // { 10789 // "description": "Updates a revision with patch semantics.", 10790 // "httpMethod": "PATCH", 10791 // "id": "drive.revisions.update", 10792 // "parameterOrder": [ 10793 // "fileId", 10794 // "revisionId" 10795 // ], 10796 // "parameters": { 10797 // "fileId": { 10798 // "description": "The ID of the file.", 10799 // "location": "path", 10800 // "required": true, 10801 // "type": "string" 10802 // }, 10803 // "revisionId": { 10804 // "description": "The ID of the revision.", 10805 // "location": "path", 10806 // "required": true, 10807 // "type": "string" 10808 // } 10809 // }, 10810 // "path": "files/{fileId}/revisions/{revisionId}", 10811 // "request": { 10812 // "$ref": "Revision" 10813 // }, 10814 // "response": { 10815 // "$ref": "Revision" 10816 // }, 10817 // "scopes": [ 10818 // "https://www.googleapis.com/auth/drive", 10819 // "https://www.googleapis.com/auth/drive.appdata", 10820 // "https://www.googleapis.com/auth/drive.file" 10821 // ] 10822 // } 10823 10824} 10825 10826// method id "drive.teamdrives.create": 10827 10828type TeamdrivesCreateCall struct { 10829 s *Service 10830 teamdrive *TeamDrive 10831 urlParams_ gensupport.URLParams 10832 ctx_ context.Context 10833 header_ http.Header 10834} 10835 10836// Create: Deprecated use drives.create instead. 10837// 10838// - requestId: An ID, such as a random UUID, which uniquely identifies 10839// this user's request for idempotent creation of a Team Drive. A 10840// repeated request by the same user and with the same request ID will 10841// avoid creating duplicates by attempting to create the same Team 10842// Drive. If the Team Drive already exists a 409 error will be 10843// returned. 10844func (r *TeamdrivesService) Create(requestId string, teamdrive *TeamDrive) *TeamdrivesCreateCall { 10845 c := &TeamdrivesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10846 c.urlParams_.Set("requestId", requestId) 10847 c.teamdrive = teamdrive 10848 return c 10849} 10850 10851// Fields allows partial responses to be retrieved. See 10852// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10853// for more information. 10854func (c *TeamdrivesCreateCall) Fields(s ...googleapi.Field) *TeamdrivesCreateCall { 10855 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10856 return c 10857} 10858 10859// Context sets the context to be used in this call's Do method. Any 10860// pending HTTP request will be aborted if the provided context is 10861// canceled. 10862func (c *TeamdrivesCreateCall) Context(ctx context.Context) *TeamdrivesCreateCall { 10863 c.ctx_ = ctx 10864 return c 10865} 10866 10867// Header returns an http.Header that can be modified by the caller to 10868// add HTTP headers to the request. 10869func (c *TeamdrivesCreateCall) Header() http.Header { 10870 if c.header_ == nil { 10871 c.header_ = make(http.Header) 10872 } 10873 return c.header_ 10874} 10875 10876func (c *TeamdrivesCreateCall) doRequest(alt string) (*http.Response, error) { 10877 reqHeaders := make(http.Header) 10878 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 10879 for k, v := range c.header_ { 10880 reqHeaders[k] = v 10881 } 10882 reqHeaders.Set("User-Agent", c.s.userAgent()) 10883 var body io.Reader = nil 10884 body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive) 10885 if err != nil { 10886 return nil, err 10887 } 10888 reqHeaders.Set("Content-Type", "application/json") 10889 c.urlParams_.Set("alt", alt) 10890 c.urlParams_.Set("prettyPrint", "false") 10891 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives") 10892 urls += "?" + c.urlParams_.Encode() 10893 req, err := http.NewRequest("POST", urls, body) 10894 if err != nil { 10895 return nil, err 10896 } 10897 req.Header = reqHeaders 10898 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10899} 10900 10901// Do executes the "drive.teamdrives.create" call. 10902// Exactly one of *TeamDrive or error will be non-nil. Any non-2xx 10903// status code is an error. Response headers are in either 10904// *TeamDrive.ServerResponse.Header or (if a response was returned at 10905// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10906// to check whether the returned error was because 10907// http.StatusNotModified was returned. 10908func (c *TeamdrivesCreateCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) { 10909 gensupport.SetOptions(c.urlParams_, opts...) 10910 res, err := c.doRequest("json") 10911 if res != nil && res.StatusCode == http.StatusNotModified { 10912 if res.Body != nil { 10913 res.Body.Close() 10914 } 10915 return nil, &googleapi.Error{ 10916 Code: res.StatusCode, 10917 Header: res.Header, 10918 } 10919 } 10920 if err != nil { 10921 return nil, err 10922 } 10923 defer googleapi.CloseBody(res) 10924 if err := googleapi.CheckResponse(res); err != nil { 10925 return nil, err 10926 } 10927 ret := &TeamDrive{ 10928 ServerResponse: googleapi.ServerResponse{ 10929 Header: res.Header, 10930 HTTPStatusCode: res.StatusCode, 10931 }, 10932 } 10933 target := &ret 10934 if err := gensupport.DecodeResponse(target, res); err != nil { 10935 return nil, err 10936 } 10937 return ret, nil 10938 // { 10939 // "description": "Deprecated use drives.create instead.", 10940 // "httpMethod": "POST", 10941 // "id": "drive.teamdrives.create", 10942 // "parameterOrder": [ 10943 // "requestId" 10944 // ], 10945 // "parameters": { 10946 // "requestId": { 10947 // "description": "An ID, such as a random UUID, which uniquely identifies this user's request for idempotent creation of a Team Drive. A repeated request by the same user and with the same request ID will avoid creating duplicates by attempting to create the same Team Drive. If the Team Drive already exists a 409 error will be returned.", 10948 // "location": "query", 10949 // "required": true, 10950 // "type": "string" 10951 // } 10952 // }, 10953 // "path": "teamdrives", 10954 // "request": { 10955 // "$ref": "TeamDrive" 10956 // }, 10957 // "response": { 10958 // "$ref": "TeamDrive" 10959 // }, 10960 // "scopes": [ 10961 // "https://www.googleapis.com/auth/drive" 10962 // ] 10963 // } 10964 10965} 10966 10967// method id "drive.teamdrives.delete": 10968 10969type TeamdrivesDeleteCall struct { 10970 s *Service 10971 teamDriveId string 10972 urlParams_ gensupport.URLParams 10973 ctx_ context.Context 10974 header_ http.Header 10975} 10976 10977// Delete: Deprecated use drives.delete instead. 10978// 10979// - teamDriveId: The ID of the Team Drive. 10980func (r *TeamdrivesService) Delete(teamDriveId string) *TeamdrivesDeleteCall { 10981 c := &TeamdrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10982 c.teamDriveId = teamDriveId 10983 return c 10984} 10985 10986// Fields allows partial responses to be retrieved. See 10987// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10988// for more information. 10989func (c *TeamdrivesDeleteCall) Fields(s ...googleapi.Field) *TeamdrivesDeleteCall { 10990 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10991 return c 10992} 10993 10994// Context sets the context to be used in this call's Do method. Any 10995// pending HTTP request will be aborted if the provided context is 10996// canceled. 10997func (c *TeamdrivesDeleteCall) Context(ctx context.Context) *TeamdrivesDeleteCall { 10998 c.ctx_ = ctx 10999 return c 11000} 11001 11002// Header returns an http.Header that can be modified by the caller to 11003// add HTTP headers to the request. 11004func (c *TeamdrivesDeleteCall) Header() http.Header { 11005 if c.header_ == nil { 11006 c.header_ = make(http.Header) 11007 } 11008 return c.header_ 11009} 11010 11011func (c *TeamdrivesDeleteCall) doRequest(alt string) (*http.Response, error) { 11012 reqHeaders := make(http.Header) 11013 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 11014 for k, v := range c.header_ { 11015 reqHeaders[k] = v 11016 } 11017 reqHeaders.Set("User-Agent", c.s.userAgent()) 11018 var body io.Reader = nil 11019 c.urlParams_.Set("alt", alt) 11020 c.urlParams_.Set("prettyPrint", "false") 11021 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") 11022 urls += "?" + c.urlParams_.Encode() 11023 req, err := http.NewRequest("DELETE", urls, body) 11024 if err != nil { 11025 return nil, err 11026 } 11027 req.Header = reqHeaders 11028 googleapi.Expand(req.URL, map[string]string{ 11029 "teamDriveId": c.teamDriveId, 11030 }) 11031 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11032} 11033 11034// Do executes the "drive.teamdrives.delete" call. 11035func (c *TeamdrivesDeleteCall) Do(opts ...googleapi.CallOption) error { 11036 gensupport.SetOptions(c.urlParams_, opts...) 11037 res, err := c.doRequest("json") 11038 if err != nil { 11039 return err 11040 } 11041 defer googleapi.CloseBody(res) 11042 if err := googleapi.CheckResponse(res); err != nil { 11043 return err 11044 } 11045 return nil 11046 // { 11047 // "description": "Deprecated use drives.delete instead.", 11048 // "httpMethod": "DELETE", 11049 // "id": "drive.teamdrives.delete", 11050 // "parameterOrder": [ 11051 // "teamDriveId" 11052 // ], 11053 // "parameters": { 11054 // "teamDriveId": { 11055 // "description": "The ID of the Team Drive", 11056 // "location": "path", 11057 // "required": true, 11058 // "type": "string" 11059 // } 11060 // }, 11061 // "path": "teamdrives/{teamDriveId}", 11062 // "scopes": [ 11063 // "https://www.googleapis.com/auth/drive" 11064 // ] 11065 // } 11066 11067} 11068 11069// method id "drive.teamdrives.get": 11070 11071type TeamdrivesGetCall struct { 11072 s *Service 11073 teamDriveId string 11074 urlParams_ gensupport.URLParams 11075 ifNoneMatch_ string 11076 ctx_ context.Context 11077 header_ http.Header 11078} 11079 11080// Get: Deprecated use drives.get instead. 11081// 11082// - teamDriveId: The ID of the Team Drive. 11083func (r *TeamdrivesService) Get(teamDriveId string) *TeamdrivesGetCall { 11084 c := &TeamdrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11085 c.teamDriveId = teamDriveId 11086 return c 11087} 11088 11089// UseDomainAdminAccess sets the optional parameter 11090// "useDomainAdminAccess": Issue the request as a domain administrator; 11091// if set to true, then the requester will be granted access if they are 11092// an administrator of the domain to which the Team Drive belongs. 11093func (c *TeamdrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesGetCall { 11094 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 11095 return c 11096} 11097 11098// Fields allows partial responses to be retrieved. See 11099// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11100// for more information. 11101func (c *TeamdrivesGetCall) Fields(s ...googleapi.Field) *TeamdrivesGetCall { 11102 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11103 return c 11104} 11105 11106// IfNoneMatch sets the optional parameter which makes the operation 11107// fail if the object's ETag matches the given value. This is useful for 11108// getting updates only after the object has changed since the last 11109// request. Use googleapi.IsNotModified to check whether the response 11110// error from Do is the result of In-None-Match. 11111func (c *TeamdrivesGetCall) IfNoneMatch(entityTag string) *TeamdrivesGetCall { 11112 c.ifNoneMatch_ = entityTag 11113 return c 11114} 11115 11116// Context sets the context to be used in this call's Do method. Any 11117// pending HTTP request will be aborted if the provided context is 11118// canceled. 11119func (c *TeamdrivesGetCall) Context(ctx context.Context) *TeamdrivesGetCall { 11120 c.ctx_ = ctx 11121 return c 11122} 11123 11124// Header returns an http.Header that can be modified by the caller to 11125// add HTTP headers to the request. 11126func (c *TeamdrivesGetCall) Header() http.Header { 11127 if c.header_ == nil { 11128 c.header_ = make(http.Header) 11129 } 11130 return c.header_ 11131} 11132 11133func (c *TeamdrivesGetCall) doRequest(alt string) (*http.Response, error) { 11134 reqHeaders := make(http.Header) 11135 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 11136 for k, v := range c.header_ { 11137 reqHeaders[k] = v 11138 } 11139 reqHeaders.Set("User-Agent", c.s.userAgent()) 11140 if c.ifNoneMatch_ != "" { 11141 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11142 } 11143 var body io.Reader = nil 11144 c.urlParams_.Set("alt", alt) 11145 c.urlParams_.Set("prettyPrint", "false") 11146 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") 11147 urls += "?" + c.urlParams_.Encode() 11148 req, err := http.NewRequest("GET", urls, body) 11149 if err != nil { 11150 return nil, err 11151 } 11152 req.Header = reqHeaders 11153 googleapi.Expand(req.URL, map[string]string{ 11154 "teamDriveId": c.teamDriveId, 11155 }) 11156 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11157} 11158 11159// Do executes the "drive.teamdrives.get" call. 11160// Exactly one of *TeamDrive or error will be non-nil. Any non-2xx 11161// status code is an error. Response headers are in either 11162// *TeamDrive.ServerResponse.Header or (if a response was returned at 11163// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11164// to check whether the returned error was because 11165// http.StatusNotModified was returned. 11166func (c *TeamdrivesGetCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) { 11167 gensupport.SetOptions(c.urlParams_, opts...) 11168 res, err := c.doRequest("json") 11169 if res != nil && res.StatusCode == http.StatusNotModified { 11170 if res.Body != nil { 11171 res.Body.Close() 11172 } 11173 return nil, &googleapi.Error{ 11174 Code: res.StatusCode, 11175 Header: res.Header, 11176 } 11177 } 11178 if err != nil { 11179 return nil, err 11180 } 11181 defer googleapi.CloseBody(res) 11182 if err := googleapi.CheckResponse(res); err != nil { 11183 return nil, err 11184 } 11185 ret := &TeamDrive{ 11186 ServerResponse: googleapi.ServerResponse{ 11187 Header: res.Header, 11188 HTTPStatusCode: res.StatusCode, 11189 }, 11190 } 11191 target := &ret 11192 if err := gensupport.DecodeResponse(target, res); err != nil { 11193 return nil, err 11194 } 11195 return ret, nil 11196 // { 11197 // "description": "Deprecated use drives.get instead.", 11198 // "httpMethod": "GET", 11199 // "id": "drive.teamdrives.get", 11200 // "parameterOrder": [ 11201 // "teamDriveId" 11202 // ], 11203 // "parameters": { 11204 // "teamDriveId": { 11205 // "description": "The ID of the Team Drive", 11206 // "location": "path", 11207 // "required": true, 11208 // "type": "string" 11209 // }, 11210 // "useDomainAdminAccess": { 11211 // "default": "false", 11212 // "description": "Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs.", 11213 // "location": "query", 11214 // "type": "boolean" 11215 // } 11216 // }, 11217 // "path": "teamdrives/{teamDriveId}", 11218 // "response": { 11219 // "$ref": "TeamDrive" 11220 // }, 11221 // "scopes": [ 11222 // "https://www.googleapis.com/auth/drive", 11223 // "https://www.googleapis.com/auth/drive.readonly" 11224 // ] 11225 // } 11226 11227} 11228 11229// method id "drive.teamdrives.list": 11230 11231type TeamdrivesListCall struct { 11232 s *Service 11233 urlParams_ gensupport.URLParams 11234 ifNoneMatch_ string 11235 ctx_ context.Context 11236 header_ http.Header 11237} 11238 11239// List: Deprecated use drives.list instead. 11240func (r *TeamdrivesService) List() *TeamdrivesListCall { 11241 c := &TeamdrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11242 return c 11243} 11244 11245// PageSize sets the optional parameter "pageSize": Maximum number of 11246// Team Drives to return. 11247func (c *TeamdrivesListCall) PageSize(pageSize int64) *TeamdrivesListCall { 11248 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 11249 return c 11250} 11251 11252// PageToken sets the optional parameter "pageToken": Page token for 11253// Team Drives. 11254func (c *TeamdrivesListCall) PageToken(pageToken string) *TeamdrivesListCall { 11255 c.urlParams_.Set("pageToken", pageToken) 11256 return c 11257} 11258 11259// Q sets the optional parameter "q": Query string for searching Team 11260// Drives. 11261func (c *TeamdrivesListCall) Q(q string) *TeamdrivesListCall { 11262 c.urlParams_.Set("q", q) 11263 return c 11264} 11265 11266// UseDomainAdminAccess sets the optional parameter 11267// "useDomainAdminAccess": Issue the request as a domain administrator; 11268// if set to true, then all Team Drives of the domain in which the 11269// requester is an administrator are returned. 11270func (c *TeamdrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesListCall { 11271 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 11272 return c 11273} 11274 11275// Fields allows partial responses to be retrieved. See 11276// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11277// for more information. 11278func (c *TeamdrivesListCall) Fields(s ...googleapi.Field) *TeamdrivesListCall { 11279 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11280 return c 11281} 11282 11283// IfNoneMatch sets the optional parameter which makes the operation 11284// fail if the object's ETag matches the given value. This is useful for 11285// getting updates only after the object has changed since the last 11286// request. Use googleapi.IsNotModified to check whether the response 11287// error from Do is the result of In-None-Match. 11288func (c *TeamdrivesListCall) IfNoneMatch(entityTag string) *TeamdrivesListCall { 11289 c.ifNoneMatch_ = entityTag 11290 return c 11291} 11292 11293// Context sets the context to be used in this call's Do method. Any 11294// pending HTTP request will be aborted if the provided context is 11295// canceled. 11296func (c *TeamdrivesListCall) Context(ctx context.Context) *TeamdrivesListCall { 11297 c.ctx_ = ctx 11298 return c 11299} 11300 11301// Header returns an http.Header that can be modified by the caller to 11302// add HTTP headers to the request. 11303func (c *TeamdrivesListCall) Header() http.Header { 11304 if c.header_ == nil { 11305 c.header_ = make(http.Header) 11306 } 11307 return c.header_ 11308} 11309 11310func (c *TeamdrivesListCall) doRequest(alt string) (*http.Response, error) { 11311 reqHeaders := make(http.Header) 11312 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 11313 for k, v := range c.header_ { 11314 reqHeaders[k] = v 11315 } 11316 reqHeaders.Set("User-Agent", c.s.userAgent()) 11317 if c.ifNoneMatch_ != "" { 11318 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11319 } 11320 var body io.Reader = nil 11321 c.urlParams_.Set("alt", alt) 11322 c.urlParams_.Set("prettyPrint", "false") 11323 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives") 11324 urls += "?" + c.urlParams_.Encode() 11325 req, err := http.NewRequest("GET", urls, body) 11326 if err != nil { 11327 return nil, err 11328 } 11329 req.Header = reqHeaders 11330 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11331} 11332 11333// Do executes the "drive.teamdrives.list" call. 11334// Exactly one of *TeamDriveList or error will be non-nil. Any non-2xx 11335// status code is an error. Response headers are in either 11336// *TeamDriveList.ServerResponse.Header or (if a response was returned 11337// at all) in error.(*googleapi.Error).Header. Use 11338// googleapi.IsNotModified to check whether the returned error was 11339// because http.StatusNotModified was returned. 11340func (c *TeamdrivesListCall) Do(opts ...googleapi.CallOption) (*TeamDriveList, error) { 11341 gensupport.SetOptions(c.urlParams_, opts...) 11342 res, err := c.doRequest("json") 11343 if res != nil && res.StatusCode == http.StatusNotModified { 11344 if res.Body != nil { 11345 res.Body.Close() 11346 } 11347 return nil, &googleapi.Error{ 11348 Code: res.StatusCode, 11349 Header: res.Header, 11350 } 11351 } 11352 if err != nil { 11353 return nil, err 11354 } 11355 defer googleapi.CloseBody(res) 11356 if err := googleapi.CheckResponse(res); err != nil { 11357 return nil, err 11358 } 11359 ret := &TeamDriveList{ 11360 ServerResponse: googleapi.ServerResponse{ 11361 Header: res.Header, 11362 HTTPStatusCode: res.StatusCode, 11363 }, 11364 } 11365 target := &ret 11366 if err := gensupport.DecodeResponse(target, res); err != nil { 11367 return nil, err 11368 } 11369 return ret, nil 11370 // { 11371 // "description": "Deprecated use drives.list instead.", 11372 // "httpMethod": "GET", 11373 // "id": "drive.teamdrives.list", 11374 // "parameters": { 11375 // "pageSize": { 11376 // "default": "10", 11377 // "description": "Maximum number of Team Drives to return.", 11378 // "format": "int32", 11379 // "location": "query", 11380 // "maximum": "100", 11381 // "minimum": "1", 11382 // "type": "integer" 11383 // }, 11384 // "pageToken": { 11385 // "description": "Page token for Team Drives.", 11386 // "location": "query", 11387 // "type": "string" 11388 // }, 11389 // "q": { 11390 // "description": "Query string for searching Team Drives.", 11391 // "location": "query", 11392 // "type": "string" 11393 // }, 11394 // "useDomainAdminAccess": { 11395 // "default": "false", 11396 // "description": "Issue the request as a domain administrator; if set to true, then all Team Drives of the domain in which the requester is an administrator are returned.", 11397 // "location": "query", 11398 // "type": "boolean" 11399 // } 11400 // }, 11401 // "path": "teamdrives", 11402 // "response": { 11403 // "$ref": "TeamDriveList" 11404 // }, 11405 // "scopes": [ 11406 // "https://www.googleapis.com/auth/drive", 11407 // "https://www.googleapis.com/auth/drive.readonly" 11408 // ] 11409 // } 11410 11411} 11412 11413// Pages invokes f for each page of results. 11414// A non-nil error returned from f will halt the iteration. 11415// The provided context supersedes any context provided to the Context method. 11416func (c *TeamdrivesListCall) Pages(ctx context.Context, f func(*TeamDriveList) error) error { 11417 c.ctx_ = ctx 11418 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 11419 for { 11420 x, err := c.Do() 11421 if err != nil { 11422 return err 11423 } 11424 if err := f(x); err != nil { 11425 return err 11426 } 11427 if x.NextPageToken == "" { 11428 return nil 11429 } 11430 c.PageToken(x.NextPageToken) 11431 } 11432} 11433 11434// method id "drive.teamdrives.update": 11435 11436type TeamdrivesUpdateCall struct { 11437 s *Service 11438 teamDriveId string 11439 teamdrive *TeamDrive 11440 urlParams_ gensupport.URLParams 11441 ctx_ context.Context 11442 header_ http.Header 11443} 11444 11445// Update: Deprecated use drives.update instead 11446// 11447// - teamDriveId: The ID of the Team Drive. 11448func (r *TeamdrivesService) Update(teamDriveId string, teamdrive *TeamDrive) *TeamdrivesUpdateCall { 11449 c := &TeamdrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11450 c.teamDriveId = teamDriveId 11451 c.teamdrive = teamdrive 11452 return c 11453} 11454 11455// UseDomainAdminAccess sets the optional parameter 11456// "useDomainAdminAccess": Issue the request as a domain administrator; 11457// if set to true, then the requester will be granted access if they are 11458// an administrator of the domain to which the Team Drive belongs. 11459func (c *TeamdrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesUpdateCall { 11460 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 11461 return c 11462} 11463 11464// Fields allows partial responses to be retrieved. See 11465// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11466// for more information. 11467func (c *TeamdrivesUpdateCall) Fields(s ...googleapi.Field) *TeamdrivesUpdateCall { 11468 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11469 return c 11470} 11471 11472// Context sets the context to be used in this call's Do method. Any 11473// pending HTTP request will be aborted if the provided context is 11474// canceled. 11475func (c *TeamdrivesUpdateCall) Context(ctx context.Context) *TeamdrivesUpdateCall { 11476 c.ctx_ = ctx 11477 return c 11478} 11479 11480// Header returns an http.Header that can be modified by the caller to 11481// add HTTP headers to the request. 11482func (c *TeamdrivesUpdateCall) Header() http.Header { 11483 if c.header_ == nil { 11484 c.header_ = make(http.Header) 11485 } 11486 return c.header_ 11487} 11488 11489func (c *TeamdrivesUpdateCall) doRequest(alt string) (*http.Response, error) { 11490 reqHeaders := make(http.Header) 11491 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 11492 for k, v := range c.header_ { 11493 reqHeaders[k] = v 11494 } 11495 reqHeaders.Set("User-Agent", c.s.userAgent()) 11496 var body io.Reader = nil 11497 body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive) 11498 if err != nil { 11499 return nil, err 11500 } 11501 reqHeaders.Set("Content-Type", "application/json") 11502 c.urlParams_.Set("alt", alt) 11503 c.urlParams_.Set("prettyPrint", "false") 11504 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") 11505 urls += "?" + c.urlParams_.Encode() 11506 req, err := http.NewRequest("PATCH", urls, body) 11507 if err != nil { 11508 return nil, err 11509 } 11510 req.Header = reqHeaders 11511 googleapi.Expand(req.URL, map[string]string{ 11512 "teamDriveId": c.teamDriveId, 11513 }) 11514 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11515} 11516 11517// Do executes the "drive.teamdrives.update" call. 11518// Exactly one of *TeamDrive or error will be non-nil. Any non-2xx 11519// status code is an error. Response headers are in either 11520// *TeamDrive.ServerResponse.Header or (if a response was returned at 11521// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11522// to check whether the returned error was because 11523// http.StatusNotModified was returned. 11524func (c *TeamdrivesUpdateCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) { 11525 gensupport.SetOptions(c.urlParams_, opts...) 11526 res, err := c.doRequest("json") 11527 if res != nil && res.StatusCode == http.StatusNotModified { 11528 if res.Body != nil { 11529 res.Body.Close() 11530 } 11531 return nil, &googleapi.Error{ 11532 Code: res.StatusCode, 11533 Header: res.Header, 11534 } 11535 } 11536 if err != nil { 11537 return nil, err 11538 } 11539 defer googleapi.CloseBody(res) 11540 if err := googleapi.CheckResponse(res); err != nil { 11541 return nil, err 11542 } 11543 ret := &TeamDrive{ 11544 ServerResponse: googleapi.ServerResponse{ 11545 Header: res.Header, 11546 HTTPStatusCode: res.StatusCode, 11547 }, 11548 } 11549 target := &ret 11550 if err := gensupport.DecodeResponse(target, res); err != nil { 11551 return nil, err 11552 } 11553 return ret, nil 11554 // { 11555 // "description": "Deprecated use drives.update instead", 11556 // "httpMethod": "PATCH", 11557 // "id": "drive.teamdrives.update", 11558 // "parameterOrder": [ 11559 // "teamDriveId" 11560 // ], 11561 // "parameters": { 11562 // "teamDriveId": { 11563 // "description": "The ID of the Team Drive", 11564 // "location": "path", 11565 // "required": true, 11566 // "type": "string" 11567 // }, 11568 // "useDomainAdminAccess": { 11569 // "default": "false", 11570 // "description": "Issue the request as a domain administrator; if set to true, then the requester will be granted access if they are an administrator of the domain to which the Team Drive belongs.", 11571 // "location": "query", 11572 // "type": "boolean" 11573 // } 11574 // }, 11575 // "path": "teamdrives/{teamDriveId}", 11576 // "request": { 11577 // "$ref": "TeamDrive" 11578 // }, 11579 // "response": { 11580 // "$ref": "TeamDrive" 11581 // }, 11582 // "scopes": [ 11583 // "https://www.googleapis.com/auth/drive" 11584 // ] 11585 // } 11586 11587} 11588