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 values are omitted from API requests. However, any non-pointer, 341 // non-interface field appearing in ForceSendFields will be sent to the 342 // server regardless of whether the field is empty or not. This may be 343 // 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 values are omitted from API requests. However, any non-pointer, 374 // non-interface field appearing in ForceSendFields will be sent to the 375 // server regardless of whether the field is empty or not. This may be 376 // 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 values are omitted from API requests. However, any non-pointer, 414 // non-interface field appearing in ForceSendFields will be sent to the 415 // server regardless of whether the field is empty or not. This may be 416 // 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 values are omitted from API requests. However, any non-pointer, 448 // non-interface field appearing in ForceSendFields will be sent to the 449 // server regardless of whether the field is empty or not. This may be 450 // 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 values are omitted from API requests. However, any non-pointer, 513 // non-interface field appearing in ForceSendFields will be sent to the 514 // server regardless of whether the field is empty or not. This may be 515 // 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 values are omitted from API requests. However, any non-pointer, 562 // non-interface field appearing in ForceSendFields will be sent to the 563 // server regardless of whether the field is empty or not. This may be 564 // 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 values are omitted from API requests. However, any non-pointer, 630 // non-interface field appearing in ForceSendFields will be sent to the 631 // server regardless of whether the field is empty or not. This may be 632 // 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. See 653 // anchor documentation for details on how to define and interpret 654 // anchor properties. 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 values are omitted from API requests. However, any non-pointer, 707 // non-interface field appearing in ForceSendFields will be sent to the 708 // server regardless of whether the field is empty or not. This may be 709 // 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 values are omitted from API requests. However, any non-pointer, 741 // non-interface field appearing in ForceSendFields will be sent to the 742 // server regardless of whether the field is empty or not. This may be 743 // 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 values are omitted from API requests. However, any non-pointer, 785 // non-interface field appearing in ForceSendFields will be sent to the 786 // server regardless of whether the field is empty or not. This may be 787 // 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 values are omitted from API requests. However, any non-pointer, 833 // non-interface field appearing in ForceSendFields will be sent to the 834 // server regardless of whether the field is empty or not. This may be 835 // 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 values are omitted from API requests. However, any non-pointer, 912 // non-interface field appearing in ForceSendFields will be sent to the 913 // server regardless of whether the field is empty or not. This may be 914 // 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 values are omitted from API requests. However, any non-pointer, 967 // non-interface field appearing in ForceSendFields will be sent to the 968 // server regardless of whether the field is empty or not. This may be 969 // 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 values are omitted from API requests. However, any non-pointer, 1084 // non-interface field appearing in ForceSendFields will be sent to the 1085 // server regardless of whether the field is empty or not. This may be 1086 // 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 values are omitted from API 1132 // requests. However, any non-pointer, non-interface field appearing in 1133 // ForceSendFields will be sent to the server regardless of whether the 1134 // field is empty or not. This may be used to include empty fields in 1135 // 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 values are omitted from API requests. However, any non-pointer, 1178 // non-interface field appearing in ForceSendFields will be sent to the 1179 // server regardless of whether the field is empty or not. This may be 1180 // 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 as an RGB hex string. The 1249 // supported colors are published in the folderColorPalette field of the 1250 // 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 // Md5Checksum: The MD5 checksum for the content of the file. This is 1298 // only applicable to files with binary content in Google Drive. 1299 Md5Checksum string `json:"md5Checksum,omitempty"` 1300 1301 // MimeType: The MIME type of the file. 1302 // Google Drive will attempt to automatically detect an appropriate 1303 // value from uploaded content if no value is provided. The value cannot 1304 // be changed unless a new revision is uploaded. 1305 // If a file is created with a Google Doc MIME type, the uploaded 1306 // content will be imported if possible. The supported import formats 1307 // are published in the About resource. 1308 MimeType string `json:"mimeType,omitempty"` 1309 1310 // ModifiedByMe: Whether the file has been modified by this user. 1311 ModifiedByMe bool `json:"modifiedByMe,omitempty"` 1312 1313 // ModifiedByMeTime: The last time the file was modified by the user 1314 // (RFC 3339 date-time). 1315 ModifiedByMeTime string `json:"modifiedByMeTime,omitempty"` 1316 1317 // ModifiedTime: The last time the file was modified by anyone (RFC 3339 1318 // date-time). 1319 // Note that setting modifiedTime will also update modifiedByMeTime for 1320 // the user. 1321 ModifiedTime string `json:"modifiedTime,omitempty"` 1322 1323 // Name: The name of the file. This is not necessarily unique within a 1324 // folder. Note that for immutable items such as the top level folders 1325 // of shared drives, My Drive root folder, and Application Data folder 1326 // the name is constant. 1327 Name string `json:"name,omitempty"` 1328 1329 // OriginalFilename: The original filename of the uploaded content if 1330 // available, or else the original value of the name field. This is only 1331 // available for files with binary content in Google Drive. 1332 OriginalFilename string `json:"originalFilename,omitempty"` 1333 1334 // OwnedByMe: Whether the user owns the file. Not populated for items in 1335 // shared drives. 1336 OwnedByMe bool `json:"ownedByMe,omitempty"` 1337 1338 // Owners: The owners of the file. Currently, only certain legacy files 1339 // may have more than one owner. Not populated for items in shared 1340 // drives. 1341 Owners []*User `json:"owners,omitempty"` 1342 1343 // Parents: The IDs of the parent folders which contain the file. 1344 // If not specified as part of a create request, the file will be placed 1345 // directly in the user's My Drive folder. If not specified as part of a 1346 // copy request, the file will inherit any discoverable parents of the 1347 // source file. Update requests must use the addParents and 1348 // removeParents parameters to modify the parents list. 1349 Parents []string `json:"parents,omitempty"` 1350 1351 // PermissionIds: List of permission IDs for users with access to this 1352 // file. 1353 PermissionIds []string `json:"permissionIds,omitempty"` 1354 1355 // Permissions: The full list of permissions for the file. This is only 1356 // available if the requesting user can share the file. Not populated 1357 // for items in shared drives. 1358 Permissions []*Permission `json:"permissions,omitempty"` 1359 1360 // Properties: A collection of arbitrary key-value pairs which are 1361 // visible to all apps. 1362 // Entries with null values are cleared in update and copy requests. 1363 Properties map[string]string `json:"properties,omitempty"` 1364 1365 // QuotaBytesUsed: The number of storage quota bytes used by the file. 1366 // This includes the head revision as well as previous revisions with 1367 // keepForever enabled. 1368 QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"` 1369 1370 // Shared: Whether the file has been shared. Not populated for items in 1371 // shared drives. 1372 Shared bool `json:"shared,omitempty"` 1373 1374 // SharedWithMeTime: The time at which the file was shared with the 1375 // user, if applicable (RFC 3339 date-time). 1376 SharedWithMeTime string `json:"sharedWithMeTime,omitempty"` 1377 1378 // SharingUser: The user who shared the file with the requesting user, 1379 // if applicable. 1380 SharingUser *User `json:"sharingUser,omitempty"` 1381 1382 // ShortcutDetails: Shortcut file details. Only populated for shortcut 1383 // files, which have the mimeType field set to 1384 // application/vnd.google-apps.shortcut. 1385 ShortcutDetails *FileShortcutDetails `json:"shortcutDetails,omitempty"` 1386 1387 // Size: The size of the file's content in bytes. This is applicable to 1388 // binary files in Google Drive and Google Docs files. 1389 Size int64 `json:"size,omitempty,string"` 1390 1391 // Spaces: The list of spaces which contain the file. The currently 1392 // supported values are 'drive', 'appDataFolder' and 'photos'. 1393 Spaces []string `json:"spaces,omitempty"` 1394 1395 // Starred: Whether the user has starred the file. 1396 Starred bool `json:"starred,omitempty"` 1397 1398 // TeamDriveId: Deprecated - use driveId instead. 1399 TeamDriveId string `json:"teamDriveId,omitempty"` 1400 1401 // ThumbnailLink: A short-lived link to the file's thumbnail, if 1402 // available. Typically lasts on the order of hours. Only populated when 1403 // the requesting app can access the file's content. If the file isn't 1404 // shared publicly, the URL returned in Files.thumbnailLink must be 1405 // fetched using a credentialed request. 1406 ThumbnailLink string `json:"thumbnailLink,omitempty"` 1407 1408 // ThumbnailVersion: The thumbnail version for use in thumbnail cache 1409 // invalidation. 1410 ThumbnailVersion int64 `json:"thumbnailVersion,omitempty,string"` 1411 1412 // Trashed: Whether the file has been trashed, either explicitly or from 1413 // a trashed parent folder. Only the owner may trash a file. The trashed 1414 // item is excluded from all files.list responses returned for any user 1415 // who does not own the file. However, all users with access to the file 1416 // can see the trashed item metadata in an API response. All users with 1417 // access can copy, download, export, and share the file. 1418 Trashed bool `json:"trashed,omitempty"` 1419 1420 // TrashedTime: The time that the item was trashed (RFC 3339 date-time). 1421 // Only populated for items in shared drives. 1422 TrashedTime string `json:"trashedTime,omitempty"` 1423 1424 // TrashingUser: If the file has been explicitly trashed, the user who 1425 // trashed it. Only populated for items in shared drives. 1426 TrashingUser *User `json:"trashingUser,omitempty"` 1427 1428 // Version: A monotonically increasing version number for the file. This 1429 // reflects every change made to the file on the server, even those not 1430 // visible to the user. 1431 Version int64 `json:"version,omitempty,string"` 1432 1433 // VideoMediaMetadata: Additional metadata about video media. This may 1434 // not be available immediately upon upload. 1435 VideoMediaMetadata *FileVideoMediaMetadata `json:"videoMediaMetadata,omitempty"` 1436 1437 // ViewedByMe: Whether the file has been viewed by this user. 1438 ViewedByMe bool `json:"viewedByMe,omitempty"` 1439 1440 // ViewedByMeTime: The last time the file was viewed by the user (RFC 1441 // 3339 date-time). 1442 ViewedByMeTime string `json:"viewedByMeTime,omitempty"` 1443 1444 // ViewersCanCopyContent: Deprecated - use copyRequiresWriterPermission 1445 // instead. 1446 ViewersCanCopyContent bool `json:"viewersCanCopyContent,omitempty"` 1447 1448 // WebContentLink: A link for downloading the content of the file in a 1449 // browser. This is only available for files with binary content in 1450 // Google Drive. 1451 WebContentLink string `json:"webContentLink,omitempty"` 1452 1453 // WebViewLink: A link for opening the file in a relevant Google editor 1454 // or viewer in a browser. 1455 WebViewLink string `json:"webViewLink,omitempty"` 1456 1457 // WritersCanShare: Whether users with only writer permission can modify 1458 // the file's permissions. Not populated for items in shared drives. 1459 WritersCanShare bool `json:"writersCanShare,omitempty"` 1460 1461 // ServerResponse contains the HTTP response code and headers from the 1462 // server. 1463 googleapi.ServerResponse `json:"-"` 1464 1465 // ForceSendFields is a list of field names (e.g. "AppProperties") to 1466 // unconditionally include in API requests. By default, fields with 1467 // empty values are omitted from API requests. However, any non-pointer, 1468 // non-interface field appearing in ForceSendFields will be sent to the 1469 // server regardless of whether the field is empty or not. This may be 1470 // used to include empty fields in Patch requests. 1471 ForceSendFields []string `json:"-"` 1472 1473 // NullFields is a list of field names (e.g. "AppProperties") to include 1474 // in API requests with the JSON null value. By default, fields with 1475 // empty values are omitted from API requests. However, any field with 1476 // an empty value appearing in NullFields will be sent to the server as 1477 // null. It is an error if a field in this list has a non-empty value. 1478 // This may be used to include null fields in Patch requests. 1479 NullFields []string `json:"-"` 1480} 1481 1482func (s *File) MarshalJSON() ([]byte, error) { 1483 type NoMethod File 1484 raw := NoMethod(*s) 1485 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1486} 1487 1488// FileCapabilities: Capabilities the current user has on this file. 1489// Each capability corresponds to a fine-grained action that a user may 1490// take. 1491type FileCapabilities struct { 1492 // CanAddChildren: Whether the current user can add children to this 1493 // folder. This is always false when the item is not a folder. 1494 CanAddChildren bool `json:"canAddChildren,omitempty"` 1495 1496 // CanAddFolderFromAnotherDrive: Whether the current user can add a 1497 // folder from another drive (different shared drive or My Drive) to 1498 // this folder. This is false when the item is not a folder. Only 1499 // populated for items in shared drives. 1500 CanAddFolderFromAnotherDrive bool `json:"canAddFolderFromAnotherDrive,omitempty"` 1501 1502 // CanAddMyDriveParent: Whether the current user can add a parent for 1503 // the item without removing an existing parent in the same request. Not 1504 // populated for shared drive files. 1505 CanAddMyDriveParent bool `json:"canAddMyDriveParent,omitempty"` 1506 1507 // CanChangeCopyRequiresWriterPermission: Whether the current user can 1508 // change the copyRequiresWriterPermission restriction of this file. 1509 CanChangeCopyRequiresWriterPermission bool `json:"canChangeCopyRequiresWriterPermission,omitempty"` 1510 1511 // CanChangeViewersCanCopyContent: Deprecated 1512 CanChangeViewersCanCopyContent bool `json:"canChangeViewersCanCopyContent,omitempty"` 1513 1514 // CanComment: Whether the current user can comment on this file. 1515 CanComment bool `json:"canComment,omitempty"` 1516 1517 // CanCopy: Whether the current user can copy this file. For an item in 1518 // a shared drive, whether the current user can copy non-folder 1519 // descendants of this item, or this item itself if it is not a folder. 1520 CanCopy bool `json:"canCopy,omitempty"` 1521 1522 // CanDelete: Whether the current user can delete this file. 1523 CanDelete bool `json:"canDelete,omitempty"` 1524 1525 // CanDeleteChildren: Whether the current user can delete children of 1526 // this folder. This is false when the item is not a folder. Only 1527 // populated for items in shared drives. 1528 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"` 1529 1530 // CanDownload: Whether the current user can download this file. 1531 CanDownload bool `json:"canDownload,omitempty"` 1532 1533 // CanEdit: Whether the current user can edit this file. Other factors 1534 // may limit the type of changes a user can make to a file. For example, 1535 // see canChangeCopyRequiresWriterPermission or canModifyContent. 1536 CanEdit bool `json:"canEdit,omitempty"` 1537 1538 // CanListChildren: Whether the current user can list the children of 1539 // this folder. This is always false when the item is not a folder. 1540 CanListChildren bool `json:"canListChildren,omitempty"` 1541 1542 // CanModifyContent: Whether the current user can modify the content of 1543 // this file. 1544 CanModifyContent bool `json:"canModifyContent,omitempty"` 1545 1546 // CanModifyContentRestriction: Whether the current user can modify 1547 // restrictions on content of this file. 1548 CanModifyContentRestriction bool `json:"canModifyContentRestriction,omitempty"` 1549 1550 // CanMoveChildrenOutOfDrive: Whether the current user can move children 1551 // of this folder outside of the shared drive. This is false when the 1552 // item is not a folder. Only populated for items in shared drives. 1553 CanMoveChildrenOutOfDrive bool `json:"canMoveChildrenOutOfDrive,omitempty"` 1554 1555 // CanMoveChildrenOutOfTeamDrive: Deprecated - use 1556 // canMoveChildrenOutOfDrive instead. 1557 CanMoveChildrenOutOfTeamDrive bool `json:"canMoveChildrenOutOfTeamDrive,omitempty"` 1558 1559 // CanMoveChildrenWithinDrive: Whether the current user can move 1560 // children of this folder within this drive. This is false when the 1561 // item is not a folder. Note that a request to move the child may still 1562 // fail depending on the current user's access to the child and to the 1563 // destination folder. 1564 CanMoveChildrenWithinDrive bool `json:"canMoveChildrenWithinDrive,omitempty"` 1565 1566 // CanMoveChildrenWithinTeamDrive: Deprecated - use 1567 // canMoveChildrenWithinDrive instead. 1568 CanMoveChildrenWithinTeamDrive bool `json:"canMoveChildrenWithinTeamDrive,omitempty"` 1569 1570 // CanMoveItemIntoTeamDrive: Deprecated - use canMoveItemOutOfDrive 1571 // instead. 1572 CanMoveItemIntoTeamDrive bool `json:"canMoveItemIntoTeamDrive,omitempty"` 1573 1574 // CanMoveItemOutOfDrive: Whether the current user can move this item 1575 // outside of this drive by changing its parent. Note that a request to 1576 // change the parent of the item may still fail depending on the new 1577 // parent that is being added. 1578 CanMoveItemOutOfDrive bool `json:"canMoveItemOutOfDrive,omitempty"` 1579 1580 // CanMoveItemOutOfTeamDrive: Deprecated - use canMoveItemOutOfDrive 1581 // instead. 1582 CanMoveItemOutOfTeamDrive bool `json:"canMoveItemOutOfTeamDrive,omitempty"` 1583 1584 // CanMoveItemWithinDrive: Whether the current user can move this item 1585 // within this drive. Note that a request to change the parent of the 1586 // item may still fail depending on the new parent that is being added 1587 // and the parent that is being removed. 1588 CanMoveItemWithinDrive bool `json:"canMoveItemWithinDrive,omitempty"` 1589 1590 // CanMoveItemWithinTeamDrive: Deprecated - use canMoveItemWithinDrive 1591 // instead. 1592 CanMoveItemWithinTeamDrive bool `json:"canMoveItemWithinTeamDrive,omitempty"` 1593 1594 // CanMoveTeamDriveItem: Deprecated - use canMoveItemWithinDrive or 1595 // canMoveItemOutOfDrive instead. 1596 CanMoveTeamDriveItem bool `json:"canMoveTeamDriveItem,omitempty"` 1597 1598 // CanReadDrive: Whether the current user can read the shared drive to 1599 // which this file belongs. Only populated for items in shared drives. 1600 CanReadDrive bool `json:"canReadDrive,omitempty"` 1601 1602 // CanReadRevisions: Whether the current user can read the revisions 1603 // resource of this file. For a shared drive item, whether revisions of 1604 // non-folder descendants of this item, or this item itself if it is not 1605 // a folder, can be read. 1606 CanReadRevisions bool `json:"canReadRevisions,omitempty"` 1607 1608 // CanReadTeamDrive: Deprecated - use canReadDrive instead. 1609 CanReadTeamDrive bool `json:"canReadTeamDrive,omitempty"` 1610 1611 // CanRemoveChildren: Whether the current user can remove children from 1612 // this folder. This is always false when the item is not a folder. For 1613 // a folder in a shared drive, use canDeleteChildren or canTrashChildren 1614 // instead. 1615 CanRemoveChildren bool `json:"canRemoveChildren,omitempty"` 1616 1617 // CanRemoveMyDriveParent: Whether the current user can remove a parent 1618 // from the item without adding another parent in the same request. Not 1619 // populated for shared drive files. 1620 CanRemoveMyDriveParent bool `json:"canRemoveMyDriveParent,omitempty"` 1621 1622 // CanRename: Whether the current user can rename this file. 1623 CanRename bool `json:"canRename,omitempty"` 1624 1625 // CanShare: Whether the current user can modify the sharing settings 1626 // for this file. 1627 CanShare bool `json:"canShare,omitempty"` 1628 1629 // CanTrash: Whether the current user can move this file to trash. 1630 CanTrash bool `json:"canTrash,omitempty"` 1631 1632 // CanTrashChildren: Whether the current user can trash children of this 1633 // folder. This is false when the item is not a folder. Only populated 1634 // for items in shared drives. 1635 CanTrashChildren bool `json:"canTrashChildren,omitempty"` 1636 1637 // CanUntrash: Whether the current user can restore this file from 1638 // trash. 1639 CanUntrash bool `json:"canUntrash,omitempty"` 1640 1641 // ForceSendFields is a list of field names (e.g. "CanAddChildren") to 1642 // unconditionally include in API requests. By default, fields with 1643 // empty values are omitted from API requests. However, any non-pointer, 1644 // non-interface field appearing in ForceSendFields will be sent to the 1645 // server regardless of whether the field is empty or not. This may be 1646 // used to include empty fields in Patch requests. 1647 ForceSendFields []string `json:"-"` 1648 1649 // NullFields is a list of field names (e.g. "CanAddChildren") to 1650 // include in API requests with the JSON null value. By default, fields 1651 // with empty values are omitted from API requests. However, any field 1652 // with an empty value appearing in NullFields will be sent to the 1653 // server as null. It is an error if a field in this list has a 1654 // non-empty value. This may be used to include null fields in Patch 1655 // requests. 1656 NullFields []string `json:"-"` 1657} 1658 1659func (s *FileCapabilities) MarshalJSON() ([]byte, error) { 1660 type NoMethod FileCapabilities 1661 raw := NoMethod(*s) 1662 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1663} 1664 1665// FileContentHints: Additional information about the content of the 1666// file. These fields are never populated in responses. 1667type FileContentHints struct { 1668 // IndexableText: Text to be indexed for the file to improve fullText 1669 // queries. This is limited to 128KB in length and may contain HTML 1670 // elements. 1671 IndexableText string `json:"indexableText,omitempty"` 1672 1673 // Thumbnail: A thumbnail for the file. This will only be used if Google 1674 // Drive cannot generate a standard thumbnail. 1675 Thumbnail *FileContentHintsThumbnail `json:"thumbnail,omitempty"` 1676 1677 // ForceSendFields is a list of field names (e.g. "IndexableText") to 1678 // unconditionally include in API requests. By default, fields with 1679 // empty values are omitted from API requests. However, any non-pointer, 1680 // non-interface field appearing in ForceSendFields will be sent to the 1681 // server regardless of whether the field is empty or not. This may be 1682 // used to include empty fields in Patch requests. 1683 ForceSendFields []string `json:"-"` 1684 1685 // NullFields is a list of field names (e.g. "IndexableText") to include 1686 // in API requests with the JSON null value. By default, fields with 1687 // empty values are omitted from API requests. However, any field with 1688 // an empty value appearing in NullFields will be sent to the server as 1689 // null. It is an error if a field in this list has a non-empty value. 1690 // This may be used to include null fields in Patch requests. 1691 NullFields []string `json:"-"` 1692} 1693 1694func (s *FileContentHints) MarshalJSON() ([]byte, error) { 1695 type NoMethod FileContentHints 1696 raw := NoMethod(*s) 1697 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1698} 1699 1700// FileContentHintsThumbnail: A thumbnail for the file. This will only 1701// be used if Google Drive cannot generate a standard thumbnail. 1702type FileContentHintsThumbnail struct { 1703 // Image: The thumbnail data encoded with URL-safe Base64 (RFC 4648 1704 // section 5). 1705 Image string `json:"image,omitempty"` 1706 1707 // MimeType: The MIME type of the thumbnail. 1708 MimeType string `json:"mimeType,omitempty"` 1709 1710 // ForceSendFields is a list of field names (e.g. "Image") to 1711 // unconditionally include in API requests. By default, fields with 1712 // empty values are omitted from API requests. However, any non-pointer, 1713 // non-interface field appearing in ForceSendFields will be sent to the 1714 // server regardless of whether the field is empty or not. This may be 1715 // used to include empty fields in Patch requests. 1716 ForceSendFields []string `json:"-"` 1717 1718 // NullFields is a list of field names (e.g. "Image") to include in API 1719 // requests with the JSON null value. By default, fields with empty 1720 // values are omitted from API requests. However, any field with an 1721 // empty value appearing in NullFields will be sent to the server as 1722 // null. It is an error if a field in this list has a non-empty value. 1723 // This may be used to include null fields in Patch requests. 1724 NullFields []string `json:"-"` 1725} 1726 1727func (s *FileContentHintsThumbnail) MarshalJSON() ([]byte, error) { 1728 type NoMethod FileContentHintsThumbnail 1729 raw := NoMethod(*s) 1730 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1731} 1732 1733// FileImageMediaMetadata: Additional metadata about image media, if 1734// available. 1735type FileImageMediaMetadata struct { 1736 // Aperture: The aperture used to create the photo (f-number). 1737 Aperture float64 `json:"aperture,omitempty"` 1738 1739 // CameraMake: The make of the camera used to create the photo. 1740 CameraMake string `json:"cameraMake,omitempty"` 1741 1742 // CameraModel: The model of the camera used to create the photo. 1743 CameraModel string `json:"cameraModel,omitempty"` 1744 1745 // ColorSpace: The color space of the photo. 1746 ColorSpace string `json:"colorSpace,omitempty"` 1747 1748 // ExposureBias: The exposure bias of the photo (APEX value). 1749 ExposureBias float64 `json:"exposureBias,omitempty"` 1750 1751 // ExposureMode: The exposure mode used to create the photo. 1752 ExposureMode string `json:"exposureMode,omitempty"` 1753 1754 // ExposureTime: The length of the exposure, in seconds. 1755 ExposureTime float64 `json:"exposureTime,omitempty"` 1756 1757 // FlashUsed: Whether a flash was used to create the photo. 1758 FlashUsed bool `json:"flashUsed,omitempty"` 1759 1760 // FocalLength: The focal length used to create the photo, in 1761 // millimeters. 1762 FocalLength float64 `json:"focalLength,omitempty"` 1763 1764 // Height: The height of the image in pixels. 1765 Height int64 `json:"height,omitempty"` 1766 1767 // IsoSpeed: The ISO speed used to create the photo. 1768 IsoSpeed int64 `json:"isoSpeed,omitempty"` 1769 1770 // Lens: The lens used to create the photo. 1771 Lens string `json:"lens,omitempty"` 1772 1773 // Location: Geographic location information stored in the image. 1774 Location *FileImageMediaMetadataLocation `json:"location,omitempty"` 1775 1776 // MaxApertureValue: The smallest f-number of the lens at the focal 1777 // length used to create the photo (APEX value). 1778 MaxApertureValue float64 `json:"maxApertureValue,omitempty"` 1779 1780 // MeteringMode: The metering mode used to create the photo. 1781 MeteringMode string `json:"meteringMode,omitempty"` 1782 1783 // Rotation: The number of clockwise 90 degree rotations applied from 1784 // the image's original orientation. 1785 Rotation int64 `json:"rotation,omitempty"` 1786 1787 // Sensor: The type of sensor used to create the photo. 1788 Sensor string `json:"sensor,omitempty"` 1789 1790 // SubjectDistance: The distance to the subject of the photo, in meters. 1791 SubjectDistance int64 `json:"subjectDistance,omitempty"` 1792 1793 // Time: The date and time the photo was taken (EXIF DateTime). 1794 Time string `json:"time,omitempty"` 1795 1796 // WhiteBalance: The white balance mode used to create the photo. 1797 WhiteBalance string `json:"whiteBalance,omitempty"` 1798 1799 // Width: The width of the image in pixels. 1800 Width int64 `json:"width,omitempty"` 1801 1802 // ForceSendFields is a list of field names (e.g. "Aperture") to 1803 // unconditionally include in API requests. By default, fields with 1804 // empty values are omitted from API requests. However, any non-pointer, 1805 // non-interface field appearing in ForceSendFields will be sent to the 1806 // server regardless of whether the field is empty or not. This may be 1807 // used to include empty fields in Patch requests. 1808 ForceSendFields []string `json:"-"` 1809 1810 // NullFields is a list of field names (e.g. "Aperture") to include in 1811 // API requests with the JSON null value. By default, fields with empty 1812 // values are omitted from API requests. However, any field with an 1813 // empty value appearing in NullFields will be sent to the server as 1814 // null. It is an error if a field in this list has a non-empty value. 1815 // This may be used to include null fields in Patch requests. 1816 NullFields []string `json:"-"` 1817} 1818 1819func (s *FileImageMediaMetadata) MarshalJSON() ([]byte, error) { 1820 type NoMethod FileImageMediaMetadata 1821 raw := NoMethod(*s) 1822 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1823} 1824 1825func (s *FileImageMediaMetadata) UnmarshalJSON(data []byte) error { 1826 type NoMethod FileImageMediaMetadata 1827 var s1 struct { 1828 Aperture gensupport.JSONFloat64 `json:"aperture"` 1829 ExposureBias gensupport.JSONFloat64 `json:"exposureBias"` 1830 ExposureTime gensupport.JSONFloat64 `json:"exposureTime"` 1831 FocalLength gensupport.JSONFloat64 `json:"focalLength"` 1832 MaxApertureValue gensupport.JSONFloat64 `json:"maxApertureValue"` 1833 *NoMethod 1834 } 1835 s1.NoMethod = (*NoMethod)(s) 1836 if err := json.Unmarshal(data, &s1); err != nil { 1837 return err 1838 } 1839 s.Aperture = float64(s1.Aperture) 1840 s.ExposureBias = float64(s1.ExposureBias) 1841 s.ExposureTime = float64(s1.ExposureTime) 1842 s.FocalLength = float64(s1.FocalLength) 1843 s.MaxApertureValue = float64(s1.MaxApertureValue) 1844 return nil 1845} 1846 1847// FileImageMediaMetadataLocation: Geographic location information 1848// stored in the image. 1849type FileImageMediaMetadataLocation struct { 1850 // Altitude: The altitude stored in the image. 1851 Altitude float64 `json:"altitude,omitempty"` 1852 1853 // Latitude: The latitude stored in the image. 1854 Latitude float64 `json:"latitude,omitempty"` 1855 1856 // Longitude: The longitude stored in the image. 1857 Longitude float64 `json:"longitude,omitempty"` 1858 1859 // ForceSendFields is a list of field names (e.g. "Altitude") to 1860 // unconditionally include in API requests. By default, fields with 1861 // empty values are omitted from API requests. However, any non-pointer, 1862 // non-interface field appearing in ForceSendFields will be sent to the 1863 // server regardless of whether the field is empty or not. This may be 1864 // used to include empty fields in Patch requests. 1865 ForceSendFields []string `json:"-"` 1866 1867 // NullFields is a list of field names (e.g. "Altitude") to include in 1868 // API requests with the JSON null value. By default, fields with empty 1869 // values are omitted from API requests. However, any field with an 1870 // empty value appearing in NullFields will be sent to the server as 1871 // null. It is an error if a field in this list has a non-empty value. 1872 // This may be used to include null fields in Patch requests. 1873 NullFields []string `json:"-"` 1874} 1875 1876func (s *FileImageMediaMetadataLocation) MarshalJSON() ([]byte, error) { 1877 type NoMethod FileImageMediaMetadataLocation 1878 raw := NoMethod(*s) 1879 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1880} 1881 1882func (s *FileImageMediaMetadataLocation) UnmarshalJSON(data []byte) error { 1883 type NoMethod FileImageMediaMetadataLocation 1884 var s1 struct { 1885 Altitude gensupport.JSONFloat64 `json:"altitude"` 1886 Latitude gensupport.JSONFloat64 `json:"latitude"` 1887 Longitude gensupport.JSONFloat64 `json:"longitude"` 1888 *NoMethod 1889 } 1890 s1.NoMethod = (*NoMethod)(s) 1891 if err := json.Unmarshal(data, &s1); err != nil { 1892 return err 1893 } 1894 s.Altitude = float64(s1.Altitude) 1895 s.Latitude = float64(s1.Latitude) 1896 s.Longitude = float64(s1.Longitude) 1897 return nil 1898} 1899 1900// FileShortcutDetails: Shortcut file details. Only populated for 1901// shortcut files, which have the mimeType field set to 1902// application/vnd.google-apps.shortcut. 1903type FileShortcutDetails struct { 1904 // TargetId: The ID of the file that this shortcut points to. 1905 TargetId string `json:"targetId,omitempty"` 1906 1907 // TargetMimeType: The MIME type of the file that this shortcut points 1908 // to. The value of this field is a snapshot of the target's MIME type, 1909 // captured when the shortcut is created. 1910 TargetMimeType string `json:"targetMimeType,omitempty"` 1911 1912 // ForceSendFields is a list of field names (e.g. "TargetId") to 1913 // unconditionally include in API requests. By default, fields with 1914 // empty values are omitted from API requests. However, any non-pointer, 1915 // non-interface field appearing in ForceSendFields will be sent to the 1916 // server regardless of whether the field is empty or not. This may be 1917 // used to include empty fields in Patch requests. 1918 ForceSendFields []string `json:"-"` 1919 1920 // NullFields is a list of field names (e.g. "TargetId") to include in 1921 // API requests with the JSON null value. By default, fields with empty 1922 // values are omitted from API requests. However, any field with an 1923 // empty value appearing in NullFields will be sent to the server as 1924 // null. It is an error if a field in this list has a non-empty value. 1925 // This may be used to include null fields in Patch requests. 1926 NullFields []string `json:"-"` 1927} 1928 1929func (s *FileShortcutDetails) MarshalJSON() ([]byte, error) { 1930 type NoMethod FileShortcutDetails 1931 raw := NoMethod(*s) 1932 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1933} 1934 1935// FileVideoMediaMetadata: Additional metadata about video media. This 1936// may not be available immediately upon upload. 1937type FileVideoMediaMetadata struct { 1938 // DurationMillis: The duration of the video in milliseconds. 1939 DurationMillis int64 `json:"durationMillis,omitempty,string"` 1940 1941 // Height: The height of the video in pixels. 1942 Height int64 `json:"height,omitempty"` 1943 1944 // Width: The width of the video in pixels. 1945 Width int64 `json:"width,omitempty"` 1946 1947 // ForceSendFields is a list of field names (e.g. "DurationMillis") to 1948 // unconditionally include in API requests. By default, fields with 1949 // empty values are omitted from API requests. However, any non-pointer, 1950 // non-interface field appearing in ForceSendFields will be sent to the 1951 // server regardless of whether the field is empty or not. This may be 1952 // used to include empty fields in Patch requests. 1953 ForceSendFields []string `json:"-"` 1954 1955 // NullFields is a list of field names (e.g. "DurationMillis") to 1956 // include in API requests with the JSON null value. By default, fields 1957 // with empty values are omitted from API requests. However, any field 1958 // with an empty value appearing in NullFields will be sent to the 1959 // server as null. It is an error if a field in this list has a 1960 // non-empty value. This may be used to include null fields in Patch 1961 // requests. 1962 NullFields []string `json:"-"` 1963} 1964 1965func (s *FileVideoMediaMetadata) MarshalJSON() ([]byte, error) { 1966 type NoMethod FileVideoMediaMetadata 1967 raw := NoMethod(*s) 1968 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1969} 1970 1971// FileList: A list of files. 1972type FileList struct { 1973 // Files: The list of files. If nextPageToken is populated, then this 1974 // list may be incomplete and an additional page of results should be 1975 // fetched. 1976 Files []*File `json:"files,omitempty"` 1977 1978 // IncompleteSearch: Whether the search process was incomplete. If true, 1979 // then some search results may be missing, since all documents were not 1980 // searched. This may occur when searching multiple drives with the 1981 // "allDrives" corpora, but all corpora could not be searched. When this 1982 // happens, it is suggested that clients narrow their query by choosing 1983 // a different corpus such as "user" or "drive". 1984 IncompleteSearch bool `json:"incompleteSearch,omitempty"` 1985 1986 // Kind: Identifies what kind of resource this is. Value: the fixed 1987 // string "drive#fileList". 1988 Kind string `json:"kind,omitempty"` 1989 1990 // NextPageToken: The page token for the next page of files. This will 1991 // be absent if the end of the files list has been reached. If the token 1992 // is rejected for any reason, it should be discarded, and pagination 1993 // should be restarted from the first page of results. 1994 NextPageToken string `json:"nextPageToken,omitempty"` 1995 1996 // ServerResponse contains the HTTP response code and headers from the 1997 // server. 1998 googleapi.ServerResponse `json:"-"` 1999 2000 // ForceSendFields is a list of field names (e.g. "Files") to 2001 // unconditionally include in API requests. By default, fields with 2002 // empty values are omitted from API requests. However, any non-pointer, 2003 // non-interface field appearing in ForceSendFields will be sent to the 2004 // server regardless of whether the field is empty or not. This may be 2005 // used to include empty fields in Patch requests. 2006 ForceSendFields []string `json:"-"` 2007 2008 // NullFields is a list of field names (e.g. "Files") to include in API 2009 // requests with the JSON null value. By default, fields with empty 2010 // values are omitted from API requests. However, any field with an 2011 // empty value appearing in NullFields will be sent to the server as 2012 // null. It is an error if a field in this list has a non-empty value. 2013 // This may be used to include null fields in Patch requests. 2014 NullFields []string `json:"-"` 2015} 2016 2017func (s *FileList) MarshalJSON() ([]byte, error) { 2018 type NoMethod FileList 2019 raw := NoMethod(*s) 2020 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2021} 2022 2023// GeneratedIds: A list of generated file IDs which can be provided in 2024// create requests. 2025type GeneratedIds struct { 2026 // Ids: The IDs generated for the requesting user in the specified 2027 // space. 2028 Ids []string `json:"ids,omitempty"` 2029 2030 // Kind: Identifies what kind of resource this is. Value: the fixed 2031 // string "drive#generatedIds". 2032 Kind string `json:"kind,omitempty"` 2033 2034 // Space: The type of file that can be created with these IDs. 2035 Space string `json:"space,omitempty"` 2036 2037 // ServerResponse contains the HTTP response code and headers from the 2038 // server. 2039 googleapi.ServerResponse `json:"-"` 2040 2041 // ForceSendFields is a list of field names (e.g. "Ids") to 2042 // unconditionally include in API requests. By default, fields with 2043 // empty values are omitted from API requests. However, any non-pointer, 2044 // non-interface field appearing in ForceSendFields will be sent to the 2045 // server regardless of whether the field is empty or not. This may be 2046 // used to include empty fields in Patch requests. 2047 ForceSendFields []string `json:"-"` 2048 2049 // NullFields is a list of field names (e.g. "Ids") to include in API 2050 // requests with the JSON null value. By default, fields with empty 2051 // values are omitted from API requests. However, any field with an 2052 // empty value appearing in NullFields will be sent to the server as 2053 // null. It is an error if a field in this list has a non-empty value. 2054 // This may be used to include null fields in Patch requests. 2055 NullFields []string `json:"-"` 2056} 2057 2058func (s *GeneratedIds) MarshalJSON() ([]byte, error) { 2059 type NoMethod GeneratedIds 2060 raw := NoMethod(*s) 2061 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2062} 2063 2064// Permission: A permission for a file. A permission grants a user, 2065// group, domain or the world access to a file or a folder hierarchy. 2066type Permission struct { 2067 // AllowFileDiscovery: Whether the permission allows the file to be 2068 // discovered through search. This is only applicable for permissions of 2069 // type domain or anyone. 2070 AllowFileDiscovery bool `json:"allowFileDiscovery,omitempty"` 2071 2072 // Deleted: Whether the account associated with this permission has been 2073 // deleted. This field only pertains to user and group permissions. 2074 Deleted bool `json:"deleted,omitempty"` 2075 2076 // DisplayName: The "pretty" name of the value of the permission. The 2077 // following is a list of examples for each type of permission: 2078 // - user - User's full name, as defined for their Google account, such 2079 // as "Joe Smith." 2080 // - group - Name of the Google Group, such as "The Company 2081 // Administrators." 2082 // - domain - String domain name, such as "thecompany.com." 2083 // - anyone - No displayName is present. 2084 DisplayName string `json:"displayName,omitempty"` 2085 2086 // Domain: The domain to which this permission refers. 2087 Domain string `json:"domain,omitempty"` 2088 2089 // EmailAddress: The email address of the user or group to which this 2090 // permission refers. 2091 EmailAddress string `json:"emailAddress,omitempty"` 2092 2093 // ExpirationTime: The time at which this permission will expire (RFC 2094 // 3339 date-time). Expiration times have the following restrictions: 2095 // 2096 // - They can only be set on user and group permissions 2097 // - The time must be in the future 2098 // - The time cannot be more than a year in the future 2099 ExpirationTime string `json:"expirationTime,omitempty"` 2100 2101 // Id: The ID of this permission. This is a unique identifier for the 2102 // grantee, and is published in User resources as permissionId. IDs 2103 // should be treated as opaque values. 2104 Id string `json:"id,omitempty"` 2105 2106 // Kind: Identifies what kind of resource this is. Value: the fixed 2107 // string "drive#permission". 2108 Kind string `json:"kind,omitempty"` 2109 2110 // PermissionDetails: Details of whether the permissions on this shared 2111 // drive item are inherited or directly on this item. This is an 2112 // output-only field which is present only for shared drive items. 2113 PermissionDetails []*PermissionPermissionDetails `json:"permissionDetails,omitempty"` 2114 2115 // PhotoLink: A link to the user's profile photo, if available. 2116 PhotoLink string `json:"photoLink,omitempty"` 2117 2118 // Role: The role granted by this permission. While new values may be 2119 // supported in the future, the following are currently allowed: 2120 // - owner 2121 // - organizer 2122 // - fileOrganizer 2123 // - writer 2124 // - commenter 2125 // - reader 2126 Role string `json:"role,omitempty"` 2127 2128 // TeamDrivePermissionDetails: Deprecated - use permissionDetails 2129 // instead. 2130 TeamDrivePermissionDetails []*PermissionTeamDrivePermissionDetails `json:"teamDrivePermissionDetails,omitempty"` 2131 2132 // Type: The type of the grantee. Valid values are: 2133 // - user 2134 // - group 2135 // - domain 2136 // - anyone When creating a permission, if type is user or group, you 2137 // must provide an emailAddress for the user or group. When type is 2138 // domain, you must provide a domain. There isn't extra information 2139 // required for a anyone type. 2140 Type string `json:"type,omitempty"` 2141 2142 // View: Indicates the view for this permission. Only populated for 2143 // permissions that belong to a view. published is the only supported 2144 // value. 2145 View string `json:"view,omitempty"` 2146 2147 // ServerResponse contains the HTTP response code and headers from the 2148 // server. 2149 googleapi.ServerResponse `json:"-"` 2150 2151 // ForceSendFields is a list of field names (e.g. "AllowFileDiscovery") 2152 // to unconditionally include in API requests. By default, fields with 2153 // empty values are omitted from API requests. However, any non-pointer, 2154 // non-interface field appearing in ForceSendFields will be sent to the 2155 // server regardless of whether the field is empty or not. This may be 2156 // used to include empty fields in Patch requests. 2157 ForceSendFields []string `json:"-"` 2158 2159 // NullFields is a list of field names (e.g. "AllowFileDiscovery") to 2160 // include in API requests with the JSON null value. By default, fields 2161 // with empty values are omitted from API requests. However, any field 2162 // with an empty value appearing in NullFields will be sent to the 2163 // server as null. It is an error if a field in this list has a 2164 // non-empty value. This may be used to include null fields in Patch 2165 // requests. 2166 NullFields []string `json:"-"` 2167} 2168 2169func (s *Permission) MarshalJSON() ([]byte, error) { 2170 type NoMethod Permission 2171 raw := NoMethod(*s) 2172 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2173} 2174 2175type PermissionPermissionDetails struct { 2176 // Inherited: Whether this permission is inherited. This field is always 2177 // populated. This is an output-only field. 2178 Inherited bool `json:"inherited,omitempty"` 2179 2180 // InheritedFrom: The ID of the item from which this permission is 2181 // inherited. This is an output-only field. 2182 InheritedFrom string `json:"inheritedFrom,omitempty"` 2183 2184 // PermissionType: The permission type for this user. While new values 2185 // may be added in future, the following are currently possible: 2186 // - file 2187 // - member 2188 PermissionType string `json:"permissionType,omitempty"` 2189 2190 // Role: The primary role for this user. While new values may be added 2191 // in the future, the following are currently possible: 2192 // - organizer 2193 // - fileOrganizer 2194 // - writer 2195 // - commenter 2196 // - reader 2197 Role string `json:"role,omitempty"` 2198 2199 // ForceSendFields is a list of field names (e.g. "Inherited") to 2200 // unconditionally include in API requests. By default, fields with 2201 // empty values are omitted from API requests. However, any non-pointer, 2202 // non-interface field appearing in ForceSendFields will be sent to the 2203 // server regardless of whether the field is empty or not. This may be 2204 // used to include empty fields in Patch requests. 2205 ForceSendFields []string `json:"-"` 2206 2207 // NullFields is a list of field names (e.g. "Inherited") to include in 2208 // API requests with the JSON null value. By default, fields with empty 2209 // values are omitted from API requests. However, any field with an 2210 // empty value appearing in NullFields will be sent to the server as 2211 // null. It is an error if a field in this list has a non-empty value. 2212 // This may be used to include null fields in Patch requests. 2213 NullFields []string `json:"-"` 2214} 2215 2216func (s *PermissionPermissionDetails) MarshalJSON() ([]byte, error) { 2217 type NoMethod PermissionPermissionDetails 2218 raw := NoMethod(*s) 2219 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2220} 2221 2222type PermissionTeamDrivePermissionDetails struct { 2223 // Inherited: Deprecated - use permissionDetails/inherited instead. 2224 Inherited bool `json:"inherited,omitempty"` 2225 2226 // InheritedFrom: Deprecated - use permissionDetails/inheritedFrom 2227 // instead. 2228 InheritedFrom string `json:"inheritedFrom,omitempty"` 2229 2230 // Role: Deprecated - use permissionDetails/role instead. 2231 Role string `json:"role,omitempty"` 2232 2233 // TeamDrivePermissionType: Deprecated - use 2234 // permissionDetails/permissionType instead. 2235 TeamDrivePermissionType string `json:"teamDrivePermissionType,omitempty"` 2236 2237 // ForceSendFields is a list of field names (e.g. "Inherited") to 2238 // unconditionally include in API requests. By default, fields with 2239 // empty values are omitted from API requests. However, any non-pointer, 2240 // non-interface field appearing in ForceSendFields will be sent to the 2241 // server regardless of whether the field is empty or not. This may be 2242 // used to include empty fields in Patch requests. 2243 ForceSendFields []string `json:"-"` 2244 2245 // NullFields is a list of field names (e.g. "Inherited") to include in 2246 // API requests with the JSON null value. By default, fields with empty 2247 // values are omitted from API requests. However, any field with an 2248 // empty value appearing in NullFields will be sent to the server as 2249 // null. It is an error if a field in this list has a non-empty value. 2250 // This may be used to include null fields in Patch requests. 2251 NullFields []string `json:"-"` 2252} 2253 2254func (s *PermissionTeamDrivePermissionDetails) MarshalJSON() ([]byte, error) { 2255 type NoMethod PermissionTeamDrivePermissionDetails 2256 raw := NoMethod(*s) 2257 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2258} 2259 2260// PermissionList: A list of permissions for a file. 2261type PermissionList struct { 2262 // Kind: Identifies what kind of resource this is. Value: the fixed 2263 // string "drive#permissionList". 2264 Kind string `json:"kind,omitempty"` 2265 2266 // NextPageToken: The page token for the next page of permissions. This 2267 // field will be absent if the end of the permissions list has been 2268 // reached. If the token is rejected for any reason, it should be 2269 // discarded, and pagination should be restarted from the first page of 2270 // results. 2271 NextPageToken string `json:"nextPageToken,omitempty"` 2272 2273 // Permissions: The list of permissions. If nextPageToken is populated, 2274 // then this list may be incomplete and an additional page of results 2275 // should be fetched. 2276 Permissions []*Permission `json:"permissions,omitempty"` 2277 2278 // ServerResponse contains the HTTP response code and headers from the 2279 // server. 2280 googleapi.ServerResponse `json:"-"` 2281 2282 // ForceSendFields is a list of field names (e.g. "Kind") to 2283 // unconditionally include in API requests. By default, fields with 2284 // empty values are omitted from API requests. However, any non-pointer, 2285 // non-interface field appearing in ForceSendFields will be sent to the 2286 // server regardless of whether the field is empty or not. This may be 2287 // used to include empty fields in Patch requests. 2288 ForceSendFields []string `json:"-"` 2289 2290 // NullFields is a list of field names (e.g. "Kind") to include in API 2291 // requests with the JSON null value. By default, fields with empty 2292 // values are omitted from API requests. However, any field with an 2293 // empty value appearing in NullFields will be sent to the server as 2294 // null. It is an error if a field in this list has a non-empty value. 2295 // This may be used to include null fields in Patch requests. 2296 NullFields []string `json:"-"` 2297} 2298 2299func (s *PermissionList) MarshalJSON() ([]byte, error) { 2300 type NoMethod PermissionList 2301 raw := NoMethod(*s) 2302 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2303} 2304 2305// Reply: A reply to a comment on a file. 2306type Reply struct { 2307 // Action: The action the reply performed to the parent comment. Valid 2308 // values are: 2309 // - resolve 2310 // - reopen 2311 Action string `json:"action,omitempty"` 2312 2313 // Author: The author of the reply. The author's email address and 2314 // permission ID will not be populated. 2315 Author *User `json:"author,omitempty"` 2316 2317 // Content: The plain text content of the reply. This field is used for 2318 // setting the content, while htmlContent should be displayed. This is 2319 // required on creates if no action is specified. 2320 Content string `json:"content,omitempty"` 2321 2322 // CreatedTime: The time at which the reply was created (RFC 3339 2323 // date-time). 2324 CreatedTime string `json:"createdTime,omitempty"` 2325 2326 // Deleted: Whether the reply has been deleted. A deleted reply has no 2327 // content. 2328 Deleted bool `json:"deleted,omitempty"` 2329 2330 // HtmlContent: The content of the reply with HTML formatting. 2331 HtmlContent string `json:"htmlContent,omitempty"` 2332 2333 // Id: The ID of the reply. 2334 Id string `json:"id,omitempty"` 2335 2336 // Kind: Identifies what kind of resource this is. Value: the fixed 2337 // string "drive#reply". 2338 Kind string `json:"kind,omitempty"` 2339 2340 // ModifiedTime: The last time the reply was modified (RFC 3339 2341 // date-time). 2342 ModifiedTime string `json:"modifiedTime,omitempty"` 2343 2344 // ServerResponse contains the HTTP response code and headers from the 2345 // server. 2346 googleapi.ServerResponse `json:"-"` 2347 2348 // ForceSendFields is a list of field names (e.g. "Action") to 2349 // unconditionally include in API requests. By default, fields with 2350 // empty values are omitted from API requests. However, any non-pointer, 2351 // non-interface field appearing in ForceSendFields will be sent to the 2352 // server regardless of whether the field is empty or not. This may be 2353 // used to include empty fields in Patch requests. 2354 ForceSendFields []string `json:"-"` 2355 2356 // NullFields is a list of field names (e.g. "Action") to include in API 2357 // requests with the JSON null value. By default, fields with empty 2358 // values are omitted from API requests. However, any field with an 2359 // empty value appearing in NullFields will be sent to the server as 2360 // null. It is an error if a field in this list has a non-empty value. 2361 // This may be used to include null fields in Patch requests. 2362 NullFields []string `json:"-"` 2363} 2364 2365func (s *Reply) MarshalJSON() ([]byte, error) { 2366 type NoMethod Reply 2367 raw := NoMethod(*s) 2368 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2369} 2370 2371// ReplyList: A list of replies to a comment on a file. 2372type ReplyList struct { 2373 // Kind: Identifies what kind of resource this is. Value: the fixed 2374 // string "drive#replyList". 2375 Kind string `json:"kind,omitempty"` 2376 2377 // NextPageToken: The page token for the next page of replies. This will 2378 // be absent if the end of the replies list has been reached. If the 2379 // token is rejected for any reason, it should be discarded, and 2380 // pagination should be restarted from the first page of results. 2381 NextPageToken string `json:"nextPageToken,omitempty"` 2382 2383 // Replies: The list of replies. If nextPageToken is populated, then 2384 // this list may be incomplete and an additional page of results should 2385 // be fetched. 2386 Replies []*Reply `json:"replies,omitempty"` 2387 2388 // ServerResponse contains the HTTP response code and headers from the 2389 // server. 2390 googleapi.ServerResponse `json:"-"` 2391 2392 // ForceSendFields is a list of field names (e.g. "Kind") to 2393 // unconditionally include in API requests. By default, fields with 2394 // empty values are omitted from API requests. However, any non-pointer, 2395 // non-interface field appearing in ForceSendFields will be sent to the 2396 // server regardless of whether the field is empty or not. This may be 2397 // used to include empty fields in Patch requests. 2398 ForceSendFields []string `json:"-"` 2399 2400 // NullFields is a list of field names (e.g. "Kind") to include in API 2401 // requests with the JSON null value. By default, fields with empty 2402 // values are omitted from API requests. However, any field with an 2403 // empty value appearing in NullFields will be sent to the server as 2404 // null. It is an error if a field in this list has a non-empty value. 2405 // This may be used to include null fields in Patch requests. 2406 NullFields []string `json:"-"` 2407} 2408 2409func (s *ReplyList) MarshalJSON() ([]byte, error) { 2410 type NoMethod ReplyList 2411 raw := NoMethod(*s) 2412 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2413} 2414 2415// Revision: The metadata for a revision to a file. 2416type Revision struct { 2417 // ExportLinks: Links for exporting Docs Editors files to specific 2418 // formats. 2419 ExportLinks map[string]string `json:"exportLinks,omitempty"` 2420 2421 // Id: The ID of the revision. 2422 Id string `json:"id,omitempty"` 2423 2424 // KeepForever: Whether to keep this revision forever, even if it is no 2425 // longer the head revision. If not set, the revision will be 2426 // automatically purged 30 days after newer content is uploaded. This 2427 // can be set on a maximum of 200 revisions for a file. 2428 // This field is only applicable to files with binary content in Drive. 2429 KeepForever bool `json:"keepForever,omitempty"` 2430 2431 // Kind: Identifies what kind of resource this is. Value: the fixed 2432 // string "drive#revision". 2433 Kind string `json:"kind,omitempty"` 2434 2435 // LastModifyingUser: The last user to modify this revision. 2436 LastModifyingUser *User `json:"lastModifyingUser,omitempty"` 2437 2438 // Md5Checksum: The MD5 checksum of the revision's content. This is only 2439 // applicable to files with binary content in Drive. 2440 Md5Checksum string `json:"md5Checksum,omitempty"` 2441 2442 // MimeType: The MIME type of the revision. 2443 MimeType string `json:"mimeType,omitempty"` 2444 2445 // ModifiedTime: The last time the revision was modified (RFC 3339 2446 // date-time). 2447 ModifiedTime string `json:"modifiedTime,omitempty"` 2448 2449 // OriginalFilename: The original filename used to create this revision. 2450 // This is only applicable to files with binary content in Drive. 2451 OriginalFilename string `json:"originalFilename,omitempty"` 2452 2453 // PublishAuto: Whether subsequent revisions will be automatically 2454 // republished. This is only applicable to Docs Editors files. 2455 PublishAuto bool `json:"publishAuto,omitempty"` 2456 2457 // Published: Whether this revision is published. This is only 2458 // applicable to Docs Editors files. 2459 Published bool `json:"published,omitempty"` 2460 2461 // PublishedLink: A link to the published revision. This is only 2462 // populated for Google Sites files. 2463 PublishedLink string `json:"publishedLink,omitempty"` 2464 2465 // PublishedOutsideDomain: Whether this revision is published outside 2466 // the domain. This is only applicable to Docs Editors files. 2467 PublishedOutsideDomain bool `json:"publishedOutsideDomain,omitempty"` 2468 2469 // Size: The size of the revision's content in bytes. This is only 2470 // applicable to files with binary content in Drive. 2471 Size int64 `json:"size,omitempty,string"` 2472 2473 // ServerResponse contains the HTTP response code and headers from the 2474 // server. 2475 googleapi.ServerResponse `json:"-"` 2476 2477 // ForceSendFields is a list of field names (e.g. "ExportLinks") to 2478 // unconditionally include in API requests. By default, fields with 2479 // empty values are omitted from API requests. However, any non-pointer, 2480 // non-interface field appearing in ForceSendFields will be sent to the 2481 // server regardless of whether the field is empty or not. This may be 2482 // used to include empty fields in Patch requests. 2483 ForceSendFields []string `json:"-"` 2484 2485 // NullFields is a list of field names (e.g. "ExportLinks") to include 2486 // in API requests with the JSON null value. By default, fields with 2487 // empty values are omitted from API requests. However, any field with 2488 // an empty value appearing in NullFields will be sent to the server as 2489 // null. It is an error if a field in this list has a non-empty value. 2490 // This may be used to include null fields in Patch requests. 2491 NullFields []string `json:"-"` 2492} 2493 2494func (s *Revision) MarshalJSON() ([]byte, error) { 2495 type NoMethod Revision 2496 raw := NoMethod(*s) 2497 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2498} 2499 2500// RevisionList: A list of revisions of a file. 2501type RevisionList struct { 2502 // Kind: Identifies what kind of resource this is. Value: the fixed 2503 // string "drive#revisionList". 2504 Kind string `json:"kind,omitempty"` 2505 2506 // NextPageToken: The page token for the next page of revisions. This 2507 // will be absent if the end of the revisions list has been reached. If 2508 // the token is rejected for any reason, it should be discarded, and 2509 // pagination should be restarted from the first page of results. 2510 NextPageToken string `json:"nextPageToken,omitempty"` 2511 2512 // Revisions: The list of revisions. If nextPageToken is populated, then 2513 // this list may be incomplete and an additional page of results should 2514 // be fetched. 2515 Revisions []*Revision `json:"revisions,omitempty"` 2516 2517 // ServerResponse contains the HTTP response code and headers from the 2518 // server. 2519 googleapi.ServerResponse `json:"-"` 2520 2521 // ForceSendFields is a list of field names (e.g. "Kind") to 2522 // unconditionally include in API requests. By default, fields with 2523 // empty values are omitted from API requests. However, any non-pointer, 2524 // non-interface field appearing in ForceSendFields will be sent to the 2525 // server regardless of whether the field is empty or not. This may be 2526 // used to include empty fields in Patch requests. 2527 ForceSendFields []string `json:"-"` 2528 2529 // NullFields is a list of field names (e.g. "Kind") to include in API 2530 // requests with the JSON null value. By default, fields with empty 2531 // values are omitted from API requests. However, any field with an 2532 // empty value appearing in NullFields will be sent to the server as 2533 // null. It is an error if a field in this list has a non-empty value. 2534 // This may be used to include null fields in Patch requests. 2535 NullFields []string `json:"-"` 2536} 2537 2538func (s *RevisionList) MarshalJSON() ([]byte, error) { 2539 type NoMethod RevisionList 2540 raw := NoMethod(*s) 2541 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2542} 2543 2544type StartPageToken struct { 2545 // Kind: Identifies what kind of resource this is. Value: the fixed 2546 // string "drive#startPageToken". 2547 Kind string `json:"kind,omitempty"` 2548 2549 // StartPageToken: The starting page token for listing changes. 2550 StartPageToken string `json:"startPageToken,omitempty"` 2551 2552 // ServerResponse contains the HTTP response code and headers from the 2553 // server. 2554 googleapi.ServerResponse `json:"-"` 2555 2556 // ForceSendFields is a list of field names (e.g. "Kind") to 2557 // unconditionally include in API requests. By default, fields with 2558 // empty values are omitted from API requests. However, any non-pointer, 2559 // non-interface field appearing in ForceSendFields will be sent to the 2560 // server regardless of whether the field is empty or not. This may be 2561 // used to include empty fields in Patch requests. 2562 ForceSendFields []string `json:"-"` 2563 2564 // NullFields is a list of field names (e.g. "Kind") to include in API 2565 // requests with the JSON null value. By default, fields with empty 2566 // values are omitted from API requests. However, any field with an 2567 // empty value appearing in NullFields will be sent to the server as 2568 // null. It is an error if a field in this list has a non-empty value. 2569 // This may be used to include null fields in Patch requests. 2570 NullFields []string `json:"-"` 2571} 2572 2573func (s *StartPageToken) MarshalJSON() ([]byte, error) { 2574 type NoMethod StartPageToken 2575 raw := NoMethod(*s) 2576 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2577} 2578 2579// TeamDrive: Deprecated: use the drive collection instead. 2580type TeamDrive struct { 2581 // BackgroundImageFile: An image file and cropping parameters from which 2582 // a background image for this Team Drive is set. This is a write only 2583 // field; it can only be set on drive.teamdrives.update requests that 2584 // don't set themeId. When specified, all fields of the 2585 // backgroundImageFile must be set. 2586 BackgroundImageFile *TeamDriveBackgroundImageFile `json:"backgroundImageFile,omitempty"` 2587 2588 // BackgroundImageLink: A short-lived link to this Team Drive's 2589 // background image. 2590 BackgroundImageLink string `json:"backgroundImageLink,omitempty"` 2591 2592 // Capabilities: Capabilities the current user has on this Team Drive. 2593 Capabilities *TeamDriveCapabilities `json:"capabilities,omitempty"` 2594 2595 // ColorRgb: The color of this Team Drive as an RGB hex string. It can 2596 // only be set on a drive.teamdrives.update request that does not set 2597 // themeId. 2598 ColorRgb string `json:"colorRgb,omitempty"` 2599 2600 // CreatedTime: The time at which the Team Drive was created (RFC 3339 2601 // date-time). 2602 CreatedTime string `json:"createdTime,omitempty"` 2603 2604 // Id: The ID of this Team Drive which is also the ID of the top level 2605 // folder of this Team Drive. 2606 Id string `json:"id,omitempty"` 2607 2608 // Kind: Identifies what kind of resource this is. Value: the fixed 2609 // string "drive#teamDrive". 2610 Kind string `json:"kind,omitempty"` 2611 2612 // Name: The name of this Team Drive. 2613 Name string `json:"name,omitempty"` 2614 2615 // Restrictions: A set of restrictions that apply to this Team Drive or 2616 // items inside this Team Drive. 2617 Restrictions *TeamDriveRestrictions `json:"restrictions,omitempty"` 2618 2619 // ThemeId: The ID of the theme from which the background image and 2620 // color will be set. The set of possible teamDriveThemes can be 2621 // retrieved from a drive.about.get response. When not specified on a 2622 // drive.teamdrives.create request, a random theme is chosen from which 2623 // the background image and color are set. This is a write-only field; 2624 // it can only be set on requests that don't set colorRgb or 2625 // backgroundImageFile. 2626 ThemeId string `json:"themeId,omitempty"` 2627 2628 // ServerResponse contains the HTTP response code and headers from the 2629 // server. 2630 googleapi.ServerResponse `json:"-"` 2631 2632 // ForceSendFields is a list of field names (e.g. "BackgroundImageFile") 2633 // to unconditionally include in API requests. By default, fields with 2634 // empty values are omitted from API requests. However, any non-pointer, 2635 // non-interface field appearing in ForceSendFields will be sent to the 2636 // server regardless of whether the field is empty or not. This may be 2637 // used to include empty fields in Patch requests. 2638 ForceSendFields []string `json:"-"` 2639 2640 // NullFields is a list of field names (e.g. "BackgroundImageFile") to 2641 // include in API requests with the JSON null value. By default, fields 2642 // with empty values are omitted from API requests. However, any field 2643 // with an empty value appearing in NullFields will be sent to the 2644 // server as null. It is an error if a field in this list has a 2645 // non-empty value. This may be used to include null fields in Patch 2646 // requests. 2647 NullFields []string `json:"-"` 2648} 2649 2650func (s *TeamDrive) MarshalJSON() ([]byte, error) { 2651 type NoMethod TeamDrive 2652 raw := NoMethod(*s) 2653 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2654} 2655 2656// TeamDriveBackgroundImageFile: An image file and cropping parameters 2657// from which a background image for this Team Drive is set. This is a 2658// write only field; it can only be set on drive.teamdrives.update 2659// requests that don't set themeId. When specified, all fields of the 2660// backgroundImageFile must be set. 2661type TeamDriveBackgroundImageFile struct { 2662 // Id: The ID of an image file in Drive to use for the background image. 2663 Id string `json:"id,omitempty"` 2664 2665 // Width: The width of the cropped image in the closed range of 0 to 1. 2666 // This value represents the width of the cropped image divided by the 2667 // width of the entire image. The height is computed by applying a width 2668 // to height aspect ratio of 80 to 9. The resulting image must be at 2669 // least 1280 pixels wide and 144 pixels high. 2670 Width float64 `json:"width,omitempty"` 2671 2672 // XCoordinate: The X coordinate of the upper left corner of the 2673 // cropping area in the background image. This is a value in the closed 2674 // range of 0 to 1. This value represents the horizontal distance from 2675 // the left side of the entire image to the left side of the cropping 2676 // area divided by the width of the entire image. 2677 XCoordinate float64 `json:"xCoordinate,omitempty"` 2678 2679 // YCoordinate: The Y coordinate of the upper left corner of the 2680 // cropping area in the background image. This is a value in the closed 2681 // range of 0 to 1. This value represents the vertical distance from the 2682 // top side of the entire image to the top side of the cropping area 2683 // divided by the height of the entire image. 2684 YCoordinate float64 `json:"yCoordinate,omitempty"` 2685 2686 // ForceSendFields is a list of field names (e.g. "Id") to 2687 // unconditionally include in API requests. By default, fields with 2688 // empty values are omitted from API requests. However, any non-pointer, 2689 // non-interface field appearing in ForceSendFields will be sent to the 2690 // server regardless of whether the field is empty or not. This may be 2691 // used to include empty fields in Patch requests. 2692 ForceSendFields []string `json:"-"` 2693 2694 // NullFields is a list of field names (e.g. "Id") to include in API 2695 // requests with the JSON null value. By default, fields with empty 2696 // values are omitted from API requests. However, any field with an 2697 // empty value appearing in NullFields will be sent to the server as 2698 // null. It is an error if a field in this list has a non-empty value. 2699 // This may be used to include null fields in Patch requests. 2700 NullFields []string `json:"-"` 2701} 2702 2703func (s *TeamDriveBackgroundImageFile) MarshalJSON() ([]byte, error) { 2704 type NoMethod TeamDriveBackgroundImageFile 2705 raw := NoMethod(*s) 2706 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2707} 2708 2709func (s *TeamDriveBackgroundImageFile) UnmarshalJSON(data []byte) error { 2710 type NoMethod TeamDriveBackgroundImageFile 2711 var s1 struct { 2712 Width gensupport.JSONFloat64 `json:"width"` 2713 XCoordinate gensupport.JSONFloat64 `json:"xCoordinate"` 2714 YCoordinate gensupport.JSONFloat64 `json:"yCoordinate"` 2715 *NoMethod 2716 } 2717 s1.NoMethod = (*NoMethod)(s) 2718 if err := json.Unmarshal(data, &s1); err != nil { 2719 return err 2720 } 2721 s.Width = float64(s1.Width) 2722 s.XCoordinate = float64(s1.XCoordinate) 2723 s.YCoordinate = float64(s1.YCoordinate) 2724 return nil 2725} 2726 2727// TeamDriveCapabilities: Capabilities the current user has on this Team 2728// Drive. 2729type TeamDriveCapabilities struct { 2730 // CanAddChildren: Whether the current user can add children to folders 2731 // in this Team Drive. 2732 CanAddChildren bool `json:"canAddChildren,omitempty"` 2733 2734 // CanChangeCopyRequiresWriterPermissionRestriction: Whether the current 2735 // user can change the copyRequiresWriterPermission restriction of this 2736 // Team Drive. 2737 CanChangeCopyRequiresWriterPermissionRestriction bool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"` 2738 2739 // CanChangeDomainUsersOnlyRestriction: Whether the current user can 2740 // change the domainUsersOnly restriction of this Team Drive. 2741 CanChangeDomainUsersOnlyRestriction bool `json:"canChangeDomainUsersOnlyRestriction,omitempty"` 2742 2743 // CanChangeTeamDriveBackground: Whether the current user can change the 2744 // background of this Team Drive. 2745 CanChangeTeamDriveBackground bool `json:"canChangeTeamDriveBackground,omitempty"` 2746 2747 // CanChangeTeamMembersOnlyRestriction: Whether the current user can 2748 // change the teamMembersOnly restriction of this Team Drive. 2749 CanChangeTeamMembersOnlyRestriction bool `json:"canChangeTeamMembersOnlyRestriction,omitempty"` 2750 2751 // CanComment: Whether the current user can comment on files in this 2752 // Team Drive. 2753 CanComment bool `json:"canComment,omitempty"` 2754 2755 // CanCopy: Whether the current user can copy files in this Team Drive. 2756 CanCopy bool `json:"canCopy,omitempty"` 2757 2758 // CanDeleteChildren: Whether the current user can delete children from 2759 // folders in this Team Drive. 2760 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"` 2761 2762 // CanDeleteTeamDrive: Whether the current user can delete this Team 2763 // Drive. Attempting to delete the Team Drive may still fail if there 2764 // are untrashed items inside the Team Drive. 2765 CanDeleteTeamDrive bool `json:"canDeleteTeamDrive,omitempty"` 2766 2767 // CanDownload: Whether the current user can download files in this Team 2768 // Drive. 2769 CanDownload bool `json:"canDownload,omitempty"` 2770 2771 // CanEdit: Whether the current user can edit files in this Team Drive 2772 CanEdit bool `json:"canEdit,omitempty"` 2773 2774 // CanListChildren: Whether the current user can list the children of 2775 // folders in this Team Drive. 2776 CanListChildren bool `json:"canListChildren,omitempty"` 2777 2778 // CanManageMembers: Whether the current user can add members to this 2779 // Team Drive or remove them or change their role. 2780 CanManageMembers bool `json:"canManageMembers,omitempty"` 2781 2782 // CanReadRevisions: Whether the current user can read the revisions 2783 // resource of files in this Team Drive. 2784 CanReadRevisions bool `json:"canReadRevisions,omitempty"` 2785 2786 // CanRemoveChildren: Deprecated - use canDeleteChildren or 2787 // canTrashChildren instead. 2788 CanRemoveChildren bool `json:"canRemoveChildren,omitempty"` 2789 2790 // CanRename: Whether the current user can rename files or folders in 2791 // this Team Drive. 2792 CanRename bool `json:"canRename,omitempty"` 2793 2794 // CanRenameTeamDrive: Whether the current user can rename this Team 2795 // Drive. 2796 CanRenameTeamDrive bool `json:"canRenameTeamDrive,omitempty"` 2797 2798 // CanShare: Whether the current user can share files or folders in this 2799 // Team Drive. 2800 CanShare bool `json:"canShare,omitempty"` 2801 2802 // CanTrashChildren: Whether the current user can trash children from 2803 // folders in this Team Drive. 2804 CanTrashChildren bool `json:"canTrashChildren,omitempty"` 2805 2806 // ForceSendFields is a list of field names (e.g. "CanAddChildren") to 2807 // unconditionally include in API requests. By default, fields with 2808 // empty values are omitted from API requests. However, any non-pointer, 2809 // non-interface field appearing in ForceSendFields will be sent to the 2810 // server regardless of whether the field is empty or not. This may be 2811 // used to include empty fields in Patch requests. 2812 ForceSendFields []string `json:"-"` 2813 2814 // NullFields is a list of field names (e.g. "CanAddChildren") to 2815 // include in API requests with the JSON null value. By default, fields 2816 // with empty values are omitted from API requests. However, any field 2817 // with an empty value appearing in NullFields will be sent to the 2818 // server as null. It is an error if a field in this list has a 2819 // non-empty value. This may be used to include null fields in Patch 2820 // requests. 2821 NullFields []string `json:"-"` 2822} 2823 2824func (s *TeamDriveCapabilities) MarshalJSON() ([]byte, error) { 2825 type NoMethod TeamDriveCapabilities 2826 raw := NoMethod(*s) 2827 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2828} 2829 2830// TeamDriveRestrictions: A set of restrictions that apply to this Team 2831// Drive or items inside this Team Drive. 2832type TeamDriveRestrictions struct { 2833 // AdminManagedRestrictions: Whether administrative privileges on this 2834 // Team Drive are required to modify restrictions. 2835 AdminManagedRestrictions bool `json:"adminManagedRestrictions,omitempty"` 2836 2837 // CopyRequiresWriterPermission: Whether the options to copy, print, or 2838 // download files inside this Team Drive, should be disabled for readers 2839 // and commenters. When this restriction is set to true, it will 2840 // override the similarly named field to true for any file inside this 2841 // Team Drive. 2842 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"` 2843 2844 // DomainUsersOnly: Whether access to this Team Drive and items inside 2845 // this Team Drive is restricted to users of the domain to which this 2846 // Team Drive belongs. This restriction may be overridden by other 2847 // sharing policies controlled outside of this Team Drive. 2848 DomainUsersOnly bool `json:"domainUsersOnly,omitempty"` 2849 2850 // TeamMembersOnly: Whether access to items inside this Team Drive is 2851 // restricted to members of this Team Drive. 2852 TeamMembersOnly bool `json:"teamMembersOnly,omitempty"` 2853 2854 // ForceSendFields is a list of field names (e.g. 2855 // "AdminManagedRestrictions") to unconditionally include in API 2856 // requests. By default, fields with empty values are omitted from API 2857 // requests. However, any non-pointer, non-interface field appearing in 2858 // ForceSendFields will be sent to the server regardless of whether the 2859 // field is empty or not. This may be used to include empty fields in 2860 // Patch requests. 2861 ForceSendFields []string `json:"-"` 2862 2863 // NullFields is a list of field names (e.g. "AdminManagedRestrictions") 2864 // to include in API requests with the JSON null value. By default, 2865 // fields with empty values are omitted from API requests. However, any 2866 // field with an empty value appearing in NullFields will be sent to the 2867 // server as null. It is an error if a field in this list has a 2868 // non-empty value. This may be used to include null fields in Patch 2869 // requests. 2870 NullFields []string `json:"-"` 2871} 2872 2873func (s *TeamDriveRestrictions) MarshalJSON() ([]byte, error) { 2874 type NoMethod TeamDriveRestrictions 2875 raw := NoMethod(*s) 2876 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2877} 2878 2879// TeamDriveList: A list of Team Drives. 2880type TeamDriveList struct { 2881 // Kind: Identifies what kind of resource this is. Value: the fixed 2882 // string "drive#teamDriveList". 2883 Kind string `json:"kind,omitempty"` 2884 2885 // NextPageToken: The page token for the next page of Team Drives. This 2886 // will be absent if the end of the Team Drives list has been reached. 2887 // If the token is rejected for any reason, it should be discarded, and 2888 // pagination should be restarted from the first page of results. 2889 NextPageToken string `json:"nextPageToken,omitempty"` 2890 2891 // TeamDrives: The list of Team Drives. If nextPageToken is populated, 2892 // then this list may be incomplete and an additional page of results 2893 // should be fetched. 2894 TeamDrives []*TeamDrive `json:"teamDrives,omitempty"` 2895 2896 // ServerResponse contains the HTTP response code and headers from the 2897 // server. 2898 googleapi.ServerResponse `json:"-"` 2899 2900 // ForceSendFields is a list of field names (e.g. "Kind") to 2901 // unconditionally include in API requests. By default, fields with 2902 // empty values are omitted from API requests. However, any non-pointer, 2903 // non-interface field appearing in ForceSendFields will be sent to the 2904 // server regardless of whether the field is empty or not. This may be 2905 // used to include empty fields in Patch requests. 2906 ForceSendFields []string `json:"-"` 2907 2908 // NullFields is a list of field names (e.g. "Kind") to include in API 2909 // requests with the JSON null value. By default, fields with empty 2910 // values are omitted from API requests. However, any field with an 2911 // empty value appearing in NullFields will be sent to the server as 2912 // null. It is an error if a field in this list has a non-empty value. 2913 // This may be used to include null fields in Patch requests. 2914 NullFields []string `json:"-"` 2915} 2916 2917func (s *TeamDriveList) MarshalJSON() ([]byte, error) { 2918 type NoMethod TeamDriveList 2919 raw := NoMethod(*s) 2920 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2921} 2922 2923// User: Information about a Drive user. 2924type User struct { 2925 // DisplayName: A plain text displayable name for this user. 2926 DisplayName string `json:"displayName,omitempty"` 2927 2928 // EmailAddress: The email address of the user. This may not be present 2929 // in certain contexts if the user has not made their email address 2930 // visible to the requester. 2931 EmailAddress string `json:"emailAddress,omitempty"` 2932 2933 // Kind: Identifies what kind of resource this is. Value: the fixed 2934 // string "drive#user". 2935 Kind string `json:"kind,omitempty"` 2936 2937 // Me: Whether this user is the requesting user. 2938 Me bool `json:"me,omitempty"` 2939 2940 // PermissionId: The user's ID as visible in Permission resources. 2941 PermissionId string `json:"permissionId,omitempty"` 2942 2943 // PhotoLink: A link to the user's profile photo, if available. 2944 PhotoLink string `json:"photoLink,omitempty"` 2945 2946 // ForceSendFields is a list of field names (e.g. "DisplayName") to 2947 // unconditionally include in API requests. By default, fields with 2948 // empty values are omitted from API requests. However, any non-pointer, 2949 // non-interface field appearing in ForceSendFields will be sent to the 2950 // server regardless of whether the field is empty or not. This may be 2951 // used to include empty fields in Patch requests. 2952 ForceSendFields []string `json:"-"` 2953 2954 // NullFields is a list of field names (e.g. "DisplayName") to include 2955 // in API requests with the JSON null value. By default, fields with 2956 // empty values are omitted from API requests. However, any field with 2957 // an empty value appearing in NullFields will be sent to the server as 2958 // null. It is an error if a field in this list has a non-empty value. 2959 // This may be used to include null fields in Patch requests. 2960 NullFields []string `json:"-"` 2961} 2962 2963func (s *User) MarshalJSON() ([]byte, error) { 2964 type NoMethod User 2965 raw := NoMethod(*s) 2966 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2967} 2968 2969// method id "drive.about.get": 2970 2971type AboutGetCall struct { 2972 s *Service 2973 urlParams_ gensupport.URLParams 2974 ifNoneMatch_ string 2975 ctx_ context.Context 2976 header_ http.Header 2977} 2978 2979// Get: Gets information about the user, the user's Drive, and system 2980// capabilities. 2981func (r *AboutService) Get() *AboutGetCall { 2982 c := &AboutGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2983 return c 2984} 2985 2986// Fields allows partial responses to be retrieved. See 2987// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2988// for more information. 2989func (c *AboutGetCall) Fields(s ...googleapi.Field) *AboutGetCall { 2990 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2991 return c 2992} 2993 2994// IfNoneMatch sets the optional parameter which makes the operation 2995// fail if the object's ETag matches the given value. This is useful for 2996// getting updates only after the object has changed since the last 2997// request. Use googleapi.IsNotModified to check whether the response 2998// error from Do is the result of In-None-Match. 2999func (c *AboutGetCall) IfNoneMatch(entityTag string) *AboutGetCall { 3000 c.ifNoneMatch_ = entityTag 3001 return c 3002} 3003 3004// Context sets the context to be used in this call's Do method. Any 3005// pending HTTP request will be aborted if the provided context is 3006// canceled. 3007func (c *AboutGetCall) Context(ctx context.Context) *AboutGetCall { 3008 c.ctx_ = ctx 3009 return c 3010} 3011 3012// Header returns an http.Header that can be modified by the caller to 3013// add HTTP headers to the request. 3014func (c *AboutGetCall) Header() http.Header { 3015 if c.header_ == nil { 3016 c.header_ = make(http.Header) 3017 } 3018 return c.header_ 3019} 3020 3021func (c *AboutGetCall) doRequest(alt string) (*http.Response, error) { 3022 reqHeaders := make(http.Header) 3023 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3024 for k, v := range c.header_ { 3025 reqHeaders[k] = v 3026 } 3027 reqHeaders.Set("User-Agent", c.s.userAgent()) 3028 if c.ifNoneMatch_ != "" { 3029 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3030 } 3031 var body io.Reader = nil 3032 c.urlParams_.Set("alt", alt) 3033 c.urlParams_.Set("prettyPrint", "false") 3034 urls := googleapi.ResolveRelative(c.s.BasePath, "about") 3035 urls += "?" + c.urlParams_.Encode() 3036 req, err := http.NewRequest("GET", urls, body) 3037 if err != nil { 3038 return nil, err 3039 } 3040 req.Header = reqHeaders 3041 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3042} 3043 3044// Do executes the "drive.about.get" call. 3045// Exactly one of *About or error will be non-nil. Any non-2xx status 3046// code is an error. Response headers are in either 3047// *About.ServerResponse.Header or (if a response was returned at all) 3048// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3049// check whether the returned error was because http.StatusNotModified 3050// was returned. 3051func (c *AboutGetCall) Do(opts ...googleapi.CallOption) (*About, error) { 3052 gensupport.SetOptions(c.urlParams_, opts...) 3053 res, err := c.doRequest("json") 3054 if res != nil && res.StatusCode == http.StatusNotModified { 3055 if res.Body != nil { 3056 res.Body.Close() 3057 } 3058 return nil, &googleapi.Error{ 3059 Code: res.StatusCode, 3060 Header: res.Header, 3061 } 3062 } 3063 if err != nil { 3064 return nil, err 3065 } 3066 defer googleapi.CloseBody(res) 3067 if err := googleapi.CheckResponse(res); err != nil { 3068 return nil, err 3069 } 3070 ret := &About{ 3071 ServerResponse: googleapi.ServerResponse{ 3072 Header: res.Header, 3073 HTTPStatusCode: res.StatusCode, 3074 }, 3075 } 3076 target := &ret 3077 if err := gensupport.DecodeResponse(target, res); err != nil { 3078 return nil, err 3079 } 3080 return ret, nil 3081 // { 3082 // "description": "Gets information about the user, the user's Drive, and system capabilities.", 3083 // "httpMethod": "GET", 3084 // "id": "drive.about.get", 3085 // "path": "about", 3086 // "response": { 3087 // "$ref": "About" 3088 // }, 3089 // "scopes": [ 3090 // "https://www.googleapis.com/auth/drive", 3091 // "https://www.googleapis.com/auth/drive.appdata", 3092 // "https://www.googleapis.com/auth/drive.file", 3093 // "https://www.googleapis.com/auth/drive.metadata", 3094 // "https://www.googleapis.com/auth/drive.metadata.readonly", 3095 // "https://www.googleapis.com/auth/drive.photos.readonly", 3096 // "https://www.googleapis.com/auth/drive.readonly" 3097 // ] 3098 // } 3099 3100} 3101 3102// method id "drive.changes.getStartPageToken": 3103 3104type ChangesGetStartPageTokenCall struct { 3105 s *Service 3106 urlParams_ gensupport.URLParams 3107 ifNoneMatch_ string 3108 ctx_ context.Context 3109 header_ http.Header 3110} 3111 3112// GetStartPageToken: Gets the starting pageToken for listing future 3113// changes. 3114func (r *ChangesService) GetStartPageToken() *ChangesGetStartPageTokenCall { 3115 c := &ChangesGetStartPageTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3116 return c 3117} 3118 3119// DriveId sets the optional parameter "driveId": The ID of the shared 3120// drive for which the starting pageToken for listing future changes 3121// from that shared drive is returned. 3122func (c *ChangesGetStartPageTokenCall) DriveId(driveId string) *ChangesGetStartPageTokenCall { 3123 c.urlParams_.Set("driveId", driveId) 3124 return c 3125} 3126 3127// SupportsAllDrives sets the optional parameter "supportsAllDrives": 3128// Whether the requesting application supports both My Drives and shared 3129// drives. 3130func (c *ChangesGetStartPageTokenCall) SupportsAllDrives(supportsAllDrives bool) *ChangesGetStartPageTokenCall { 3131 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 3132 return c 3133} 3134 3135// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 3136// Deprecated use supportsAllDrives instead. 3137func (c *ChangesGetStartPageTokenCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesGetStartPageTokenCall { 3138 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 3139 return c 3140} 3141 3142// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 3143// driveId instead. 3144func (c *ChangesGetStartPageTokenCall) TeamDriveId(teamDriveId string) *ChangesGetStartPageTokenCall { 3145 c.urlParams_.Set("teamDriveId", teamDriveId) 3146 return c 3147} 3148 3149// Fields allows partial responses to be retrieved. See 3150// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3151// for more information. 3152func (c *ChangesGetStartPageTokenCall) Fields(s ...googleapi.Field) *ChangesGetStartPageTokenCall { 3153 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3154 return c 3155} 3156 3157// IfNoneMatch sets the optional parameter which makes the operation 3158// fail if the object's ETag matches the given value. This is useful for 3159// getting updates only after the object has changed since the last 3160// request. Use googleapi.IsNotModified to check whether the response 3161// error from Do is the result of In-None-Match. 3162func (c *ChangesGetStartPageTokenCall) IfNoneMatch(entityTag string) *ChangesGetStartPageTokenCall { 3163 c.ifNoneMatch_ = entityTag 3164 return c 3165} 3166 3167// Context sets the context to be used in this call's Do method. Any 3168// pending HTTP request will be aborted if the provided context is 3169// canceled. 3170func (c *ChangesGetStartPageTokenCall) Context(ctx context.Context) *ChangesGetStartPageTokenCall { 3171 c.ctx_ = ctx 3172 return c 3173} 3174 3175// Header returns an http.Header that can be modified by the caller to 3176// add HTTP headers to the request. 3177func (c *ChangesGetStartPageTokenCall) Header() http.Header { 3178 if c.header_ == nil { 3179 c.header_ = make(http.Header) 3180 } 3181 return c.header_ 3182} 3183 3184func (c *ChangesGetStartPageTokenCall) doRequest(alt string) (*http.Response, error) { 3185 reqHeaders := make(http.Header) 3186 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3187 for k, v := range c.header_ { 3188 reqHeaders[k] = v 3189 } 3190 reqHeaders.Set("User-Agent", c.s.userAgent()) 3191 if c.ifNoneMatch_ != "" { 3192 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3193 } 3194 var body io.Reader = nil 3195 c.urlParams_.Set("alt", alt) 3196 c.urlParams_.Set("prettyPrint", "false") 3197 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/startPageToken") 3198 urls += "?" + c.urlParams_.Encode() 3199 req, err := http.NewRequest("GET", urls, body) 3200 if err != nil { 3201 return nil, err 3202 } 3203 req.Header = reqHeaders 3204 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3205} 3206 3207// Do executes the "drive.changes.getStartPageToken" call. 3208// Exactly one of *StartPageToken or error will be non-nil. Any non-2xx 3209// status code is an error. Response headers are in either 3210// *StartPageToken.ServerResponse.Header or (if a response was returned 3211// at all) in error.(*googleapi.Error).Header. Use 3212// googleapi.IsNotModified to check whether the returned error was 3213// because http.StatusNotModified was returned. 3214func (c *ChangesGetStartPageTokenCall) Do(opts ...googleapi.CallOption) (*StartPageToken, error) { 3215 gensupport.SetOptions(c.urlParams_, opts...) 3216 res, err := c.doRequest("json") 3217 if res != nil && res.StatusCode == http.StatusNotModified { 3218 if res.Body != nil { 3219 res.Body.Close() 3220 } 3221 return nil, &googleapi.Error{ 3222 Code: res.StatusCode, 3223 Header: res.Header, 3224 } 3225 } 3226 if err != nil { 3227 return nil, err 3228 } 3229 defer googleapi.CloseBody(res) 3230 if err := googleapi.CheckResponse(res); err != nil { 3231 return nil, err 3232 } 3233 ret := &StartPageToken{ 3234 ServerResponse: googleapi.ServerResponse{ 3235 Header: res.Header, 3236 HTTPStatusCode: res.StatusCode, 3237 }, 3238 } 3239 target := &ret 3240 if err := gensupport.DecodeResponse(target, res); err != nil { 3241 return nil, err 3242 } 3243 return ret, nil 3244 // { 3245 // "description": "Gets the starting pageToken for listing future changes.", 3246 // "httpMethod": "GET", 3247 // "id": "drive.changes.getStartPageToken", 3248 // "parameters": { 3249 // "driveId": { 3250 // "description": "The ID of the shared drive for which the starting pageToken for listing future changes from that shared drive is returned.", 3251 // "location": "query", 3252 // "type": "string" 3253 // }, 3254 // "supportsAllDrives": { 3255 // "default": "false", 3256 // "description": "Whether the requesting application supports both My Drives and shared drives.", 3257 // "location": "query", 3258 // "type": "boolean" 3259 // }, 3260 // "supportsTeamDrives": { 3261 // "default": "false", 3262 // "description": "Deprecated use supportsAllDrives instead.", 3263 // "location": "query", 3264 // "type": "boolean" 3265 // }, 3266 // "teamDriveId": { 3267 // "description": "Deprecated use driveId instead.", 3268 // "location": "query", 3269 // "type": "string" 3270 // } 3271 // }, 3272 // "path": "changes/startPageToken", 3273 // "response": { 3274 // "$ref": "StartPageToken" 3275 // }, 3276 // "scopes": [ 3277 // "https://www.googleapis.com/auth/drive", 3278 // "https://www.googleapis.com/auth/drive.appdata", 3279 // "https://www.googleapis.com/auth/drive.file", 3280 // "https://www.googleapis.com/auth/drive.metadata", 3281 // "https://www.googleapis.com/auth/drive.metadata.readonly", 3282 // "https://www.googleapis.com/auth/drive.photos.readonly", 3283 // "https://www.googleapis.com/auth/drive.readonly" 3284 // ] 3285 // } 3286 3287} 3288 3289// method id "drive.changes.list": 3290 3291type ChangesListCall struct { 3292 s *Service 3293 urlParams_ gensupport.URLParams 3294 ifNoneMatch_ string 3295 ctx_ context.Context 3296 header_ http.Header 3297} 3298 3299// List: Lists the changes for a user or shared drive. 3300// 3301// - pageToken: The token for continuing a previous list request on the 3302// next page. This should be set to the value of 'nextPageToken' from 3303// the previous response or to the response from the getStartPageToken 3304// method. 3305func (r *ChangesService) List(pageToken string) *ChangesListCall { 3306 c := &ChangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3307 c.urlParams_.Set("pageToken", pageToken) 3308 return c 3309} 3310 3311// DriveId sets the optional parameter "driveId": The shared drive from 3312// which changes are returned. If specified the change IDs will be 3313// reflective of the shared drive; use the combined drive ID and change 3314// ID as an identifier. 3315func (c *ChangesListCall) DriveId(driveId string) *ChangesListCall { 3316 c.urlParams_.Set("driveId", driveId) 3317 return c 3318} 3319 3320// IncludeCorpusRemovals sets the optional parameter 3321// "includeCorpusRemovals": Whether changes should include the file 3322// resource if the file is still accessible by the user at the time of 3323// the request, even when a file was removed from the list of changes 3324// and there will be no further change entries for this file. 3325func (c *ChangesListCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesListCall { 3326 c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals)) 3327 return c 3328} 3329 3330// IncludeItemsFromAllDrives sets the optional parameter 3331// "includeItemsFromAllDrives": Whether both My Drive and shared drive 3332// items should be included in results. 3333func (c *ChangesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesListCall { 3334 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives)) 3335 return c 3336} 3337 3338// IncludePermissionsForView sets the optional parameter 3339// "includePermissionsForView": Specifies which additional view's 3340// permissions to include in the response. Only 'published' is 3341// supported. 3342func (c *ChangesListCall) IncludePermissionsForView(includePermissionsForView string) *ChangesListCall { 3343 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 3344 return c 3345} 3346 3347// IncludeRemoved sets the optional parameter "includeRemoved": Whether 3348// to include changes indicating that items have been removed from the 3349// list of changes, for example by deletion or loss of access. 3350func (c *ChangesListCall) IncludeRemoved(includeRemoved bool) *ChangesListCall { 3351 c.urlParams_.Set("includeRemoved", fmt.Sprint(includeRemoved)) 3352 return c 3353} 3354 3355// IncludeTeamDriveItems sets the optional parameter 3356// "includeTeamDriveItems": Deprecated use includeItemsFromAllDrives 3357// instead. 3358func (c *ChangesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesListCall { 3359 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems)) 3360 return c 3361} 3362 3363// PageSize sets the optional parameter "pageSize": The maximum number 3364// of changes to return per page. 3365func (c *ChangesListCall) PageSize(pageSize int64) *ChangesListCall { 3366 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3367 return c 3368} 3369 3370// RestrictToMyDrive sets the optional parameter "restrictToMyDrive": 3371// Whether to restrict the results to changes inside the My Drive 3372// hierarchy. This omits changes to files such as those in the 3373// Application Data folder or shared files which have not been added to 3374// My Drive. 3375func (c *ChangesListCall) RestrictToMyDrive(restrictToMyDrive bool) *ChangesListCall { 3376 c.urlParams_.Set("restrictToMyDrive", fmt.Sprint(restrictToMyDrive)) 3377 return c 3378} 3379 3380// Spaces sets the optional parameter "spaces": A comma-separated list 3381// of spaces to query within the user corpus. Supported values are 3382// 'drive', 'appDataFolder' and 'photos'. 3383func (c *ChangesListCall) Spaces(spaces string) *ChangesListCall { 3384 c.urlParams_.Set("spaces", spaces) 3385 return c 3386} 3387 3388// SupportsAllDrives sets the optional parameter "supportsAllDrives": 3389// Whether the requesting application supports both My Drives and shared 3390// drives. 3391func (c *ChangesListCall) SupportsAllDrives(supportsAllDrives bool) *ChangesListCall { 3392 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 3393 return c 3394} 3395 3396// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 3397// Deprecated use supportsAllDrives instead. 3398func (c *ChangesListCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesListCall { 3399 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 3400 return c 3401} 3402 3403// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 3404// driveId instead. 3405func (c *ChangesListCall) TeamDriveId(teamDriveId string) *ChangesListCall { 3406 c.urlParams_.Set("teamDriveId", teamDriveId) 3407 return c 3408} 3409 3410// Fields allows partial responses to be retrieved. See 3411// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3412// for more information. 3413func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall { 3414 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3415 return c 3416} 3417 3418// IfNoneMatch sets the optional parameter which makes the operation 3419// fail if the object's ETag matches the given value. This is useful for 3420// getting updates only after the object has changed since the last 3421// request. Use googleapi.IsNotModified to check whether the response 3422// error from Do is the result of In-None-Match. 3423func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall { 3424 c.ifNoneMatch_ = entityTag 3425 return c 3426} 3427 3428// Context sets the context to be used in this call's Do method. Any 3429// pending HTTP request will be aborted if the provided context is 3430// canceled. 3431func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall { 3432 c.ctx_ = ctx 3433 return c 3434} 3435 3436// Header returns an http.Header that can be modified by the caller to 3437// add HTTP headers to the request. 3438func (c *ChangesListCall) Header() http.Header { 3439 if c.header_ == nil { 3440 c.header_ = make(http.Header) 3441 } 3442 return c.header_ 3443} 3444 3445func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) { 3446 reqHeaders := make(http.Header) 3447 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3448 for k, v := range c.header_ { 3449 reqHeaders[k] = v 3450 } 3451 reqHeaders.Set("User-Agent", c.s.userAgent()) 3452 if c.ifNoneMatch_ != "" { 3453 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3454 } 3455 var body io.Reader = nil 3456 c.urlParams_.Set("alt", alt) 3457 c.urlParams_.Set("prettyPrint", "false") 3458 urls := googleapi.ResolveRelative(c.s.BasePath, "changes") 3459 urls += "?" + c.urlParams_.Encode() 3460 req, err := http.NewRequest("GET", urls, body) 3461 if err != nil { 3462 return nil, err 3463 } 3464 req.Header = reqHeaders 3465 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3466} 3467 3468// Do executes the "drive.changes.list" call. 3469// Exactly one of *ChangeList or error will be non-nil. Any non-2xx 3470// status code is an error. Response headers are in either 3471// *ChangeList.ServerResponse.Header or (if a response was returned at 3472// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3473// to check whether the returned error was because 3474// http.StatusNotModified was returned. 3475func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangeList, error) { 3476 gensupport.SetOptions(c.urlParams_, opts...) 3477 res, err := c.doRequest("json") 3478 if res != nil && res.StatusCode == http.StatusNotModified { 3479 if res.Body != nil { 3480 res.Body.Close() 3481 } 3482 return nil, &googleapi.Error{ 3483 Code: res.StatusCode, 3484 Header: res.Header, 3485 } 3486 } 3487 if err != nil { 3488 return nil, err 3489 } 3490 defer googleapi.CloseBody(res) 3491 if err := googleapi.CheckResponse(res); err != nil { 3492 return nil, err 3493 } 3494 ret := &ChangeList{ 3495 ServerResponse: googleapi.ServerResponse{ 3496 Header: res.Header, 3497 HTTPStatusCode: res.StatusCode, 3498 }, 3499 } 3500 target := &ret 3501 if err := gensupport.DecodeResponse(target, res); err != nil { 3502 return nil, err 3503 } 3504 return ret, nil 3505 // { 3506 // "description": "Lists the changes for a user or shared drive.", 3507 // "httpMethod": "GET", 3508 // "id": "drive.changes.list", 3509 // "parameterOrder": [ 3510 // "pageToken" 3511 // ], 3512 // "parameters": { 3513 // "driveId": { 3514 // "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.", 3515 // "location": "query", 3516 // "type": "string" 3517 // }, 3518 // "includeCorpusRemovals": { 3519 // "default": "false", 3520 // "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.", 3521 // "location": "query", 3522 // "type": "boolean" 3523 // }, 3524 // "includeItemsFromAllDrives": { 3525 // "default": "false", 3526 // "description": "Whether both My Drive and shared drive items should be included in results.", 3527 // "location": "query", 3528 // "type": "boolean" 3529 // }, 3530 // "includePermissionsForView": { 3531 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 3532 // "location": "query", 3533 // "type": "string" 3534 // }, 3535 // "includeRemoved": { 3536 // "default": "true", 3537 // "description": "Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.", 3538 // "location": "query", 3539 // "type": "boolean" 3540 // }, 3541 // "includeTeamDriveItems": { 3542 // "default": "false", 3543 // "description": "Deprecated use includeItemsFromAllDrives instead.", 3544 // "location": "query", 3545 // "type": "boolean" 3546 // }, 3547 // "pageSize": { 3548 // "default": "100", 3549 // "description": "The maximum number of changes to return per page.", 3550 // "format": "int32", 3551 // "location": "query", 3552 // "maximum": "1000", 3553 // "minimum": "1", 3554 // "type": "integer" 3555 // }, 3556 // "pageToken": { 3557 // "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.", 3558 // "location": "query", 3559 // "required": true, 3560 // "type": "string" 3561 // }, 3562 // "restrictToMyDrive": { 3563 // "default": "false", 3564 // "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.", 3565 // "location": "query", 3566 // "type": "boolean" 3567 // }, 3568 // "spaces": { 3569 // "default": "drive", 3570 // "description": "A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.", 3571 // "location": "query", 3572 // "type": "string" 3573 // }, 3574 // "supportsAllDrives": { 3575 // "default": "false", 3576 // "description": "Whether the requesting application supports both My Drives and shared drives.", 3577 // "location": "query", 3578 // "type": "boolean" 3579 // }, 3580 // "supportsTeamDrives": { 3581 // "default": "false", 3582 // "description": "Deprecated use supportsAllDrives instead.", 3583 // "location": "query", 3584 // "type": "boolean" 3585 // }, 3586 // "teamDriveId": { 3587 // "description": "Deprecated use driveId instead.", 3588 // "location": "query", 3589 // "type": "string" 3590 // } 3591 // }, 3592 // "path": "changes", 3593 // "response": { 3594 // "$ref": "ChangeList" 3595 // }, 3596 // "scopes": [ 3597 // "https://www.googleapis.com/auth/drive", 3598 // "https://www.googleapis.com/auth/drive.appdata", 3599 // "https://www.googleapis.com/auth/drive.file", 3600 // "https://www.googleapis.com/auth/drive.metadata", 3601 // "https://www.googleapis.com/auth/drive.metadata.readonly", 3602 // "https://www.googleapis.com/auth/drive.photos.readonly", 3603 // "https://www.googleapis.com/auth/drive.readonly" 3604 // ], 3605 // "supportsSubscription": true 3606 // } 3607 3608} 3609 3610// method id "drive.changes.watch": 3611 3612type ChangesWatchCall struct { 3613 s *Service 3614 channel *Channel 3615 urlParams_ gensupport.URLParams 3616 ctx_ context.Context 3617 header_ http.Header 3618} 3619 3620// Watch: Subscribes to changes for a user. 3621// 3622// - pageToken: The token for continuing a previous list request on the 3623// next page. This should be set to the value of 'nextPageToken' from 3624// the previous response or to the response from the getStartPageToken 3625// method. 3626func (r *ChangesService) Watch(pageToken string, channel *Channel) *ChangesWatchCall { 3627 c := &ChangesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3628 c.urlParams_.Set("pageToken", pageToken) 3629 c.channel = channel 3630 return c 3631} 3632 3633// DriveId sets the optional parameter "driveId": The shared drive from 3634// which changes are returned. If specified the change IDs will be 3635// reflective of the shared drive; use the combined drive ID and change 3636// ID as an identifier. 3637func (c *ChangesWatchCall) DriveId(driveId string) *ChangesWatchCall { 3638 c.urlParams_.Set("driveId", driveId) 3639 return c 3640} 3641 3642// IncludeCorpusRemovals sets the optional parameter 3643// "includeCorpusRemovals": Whether changes should include the file 3644// resource if the file is still accessible by the user at the time of 3645// the request, even when a file was removed from the list of changes 3646// and there will be no further change entries for this file. 3647func (c *ChangesWatchCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesWatchCall { 3648 c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals)) 3649 return c 3650} 3651 3652// IncludeItemsFromAllDrives sets the optional parameter 3653// "includeItemsFromAllDrives": Whether both My Drive and shared drive 3654// items should be included in results. 3655func (c *ChangesWatchCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesWatchCall { 3656 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives)) 3657 return c 3658} 3659 3660// IncludePermissionsForView sets the optional parameter 3661// "includePermissionsForView": Specifies which additional view's 3662// permissions to include in the response. Only 'published' is 3663// supported. 3664func (c *ChangesWatchCall) IncludePermissionsForView(includePermissionsForView string) *ChangesWatchCall { 3665 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 3666 return c 3667} 3668 3669// IncludeRemoved sets the optional parameter "includeRemoved": Whether 3670// to include changes indicating that items have been removed from the 3671// list of changes, for example by deletion or loss of access. 3672func (c *ChangesWatchCall) IncludeRemoved(includeRemoved bool) *ChangesWatchCall { 3673 c.urlParams_.Set("includeRemoved", fmt.Sprint(includeRemoved)) 3674 return c 3675} 3676 3677// IncludeTeamDriveItems sets the optional parameter 3678// "includeTeamDriveItems": Deprecated use includeItemsFromAllDrives 3679// instead. 3680func (c *ChangesWatchCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesWatchCall { 3681 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems)) 3682 return c 3683} 3684 3685// PageSize sets the optional parameter "pageSize": The maximum number 3686// of changes to return per page. 3687func (c *ChangesWatchCall) PageSize(pageSize int64) *ChangesWatchCall { 3688 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 3689 return c 3690} 3691 3692// RestrictToMyDrive sets the optional parameter "restrictToMyDrive": 3693// Whether to restrict the results to changes inside the My Drive 3694// hierarchy. This omits changes to files such as those in the 3695// Application Data folder or shared files which have not been added to 3696// My Drive. 3697func (c *ChangesWatchCall) RestrictToMyDrive(restrictToMyDrive bool) *ChangesWatchCall { 3698 c.urlParams_.Set("restrictToMyDrive", fmt.Sprint(restrictToMyDrive)) 3699 return c 3700} 3701 3702// Spaces sets the optional parameter "spaces": A comma-separated list 3703// of spaces to query within the user corpus. Supported values are 3704// 'drive', 'appDataFolder' and 'photos'. 3705func (c *ChangesWatchCall) Spaces(spaces string) *ChangesWatchCall { 3706 c.urlParams_.Set("spaces", spaces) 3707 return c 3708} 3709 3710// SupportsAllDrives sets the optional parameter "supportsAllDrives": 3711// Whether the requesting application supports both My Drives and shared 3712// drives. 3713func (c *ChangesWatchCall) SupportsAllDrives(supportsAllDrives bool) *ChangesWatchCall { 3714 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 3715 return c 3716} 3717 3718// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 3719// Deprecated use supportsAllDrives instead. 3720func (c *ChangesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesWatchCall { 3721 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 3722 return c 3723} 3724 3725// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 3726// driveId instead. 3727func (c *ChangesWatchCall) TeamDriveId(teamDriveId string) *ChangesWatchCall { 3728 c.urlParams_.Set("teamDriveId", teamDriveId) 3729 return c 3730} 3731 3732// Fields allows partial responses to be retrieved. See 3733// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3734// for more information. 3735func (c *ChangesWatchCall) Fields(s ...googleapi.Field) *ChangesWatchCall { 3736 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3737 return c 3738} 3739 3740// Context sets the context to be used in this call's Do method. Any 3741// pending HTTP request will be aborted if the provided context is 3742// canceled. 3743func (c *ChangesWatchCall) Context(ctx context.Context) *ChangesWatchCall { 3744 c.ctx_ = ctx 3745 return c 3746} 3747 3748// Header returns an http.Header that can be modified by the caller to 3749// add HTTP headers to the request. 3750func (c *ChangesWatchCall) Header() http.Header { 3751 if c.header_ == nil { 3752 c.header_ = make(http.Header) 3753 } 3754 return c.header_ 3755} 3756 3757func (c *ChangesWatchCall) doRequest(alt string) (*http.Response, error) { 3758 reqHeaders := make(http.Header) 3759 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3760 for k, v := range c.header_ { 3761 reqHeaders[k] = v 3762 } 3763 reqHeaders.Set("User-Agent", c.s.userAgent()) 3764 var body io.Reader = nil 3765 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 3766 if err != nil { 3767 return nil, err 3768 } 3769 reqHeaders.Set("Content-Type", "application/json") 3770 c.urlParams_.Set("alt", alt) 3771 c.urlParams_.Set("prettyPrint", "false") 3772 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/watch") 3773 urls += "?" + c.urlParams_.Encode() 3774 req, err := http.NewRequest("POST", urls, body) 3775 if err != nil { 3776 return nil, err 3777 } 3778 req.Header = reqHeaders 3779 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3780} 3781 3782// Do executes the "drive.changes.watch" call. 3783// Exactly one of *Channel or error will be non-nil. Any non-2xx status 3784// code is an error. Response headers are in either 3785// *Channel.ServerResponse.Header or (if a response was returned at all) 3786// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3787// check whether the returned error was because http.StatusNotModified 3788// was returned. 3789func (c *ChangesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 3790 gensupport.SetOptions(c.urlParams_, opts...) 3791 res, err := c.doRequest("json") 3792 if res != nil && res.StatusCode == http.StatusNotModified { 3793 if res.Body != nil { 3794 res.Body.Close() 3795 } 3796 return nil, &googleapi.Error{ 3797 Code: res.StatusCode, 3798 Header: res.Header, 3799 } 3800 } 3801 if err != nil { 3802 return nil, err 3803 } 3804 defer googleapi.CloseBody(res) 3805 if err := googleapi.CheckResponse(res); err != nil { 3806 return nil, err 3807 } 3808 ret := &Channel{ 3809 ServerResponse: googleapi.ServerResponse{ 3810 Header: res.Header, 3811 HTTPStatusCode: res.StatusCode, 3812 }, 3813 } 3814 target := &ret 3815 if err := gensupport.DecodeResponse(target, res); err != nil { 3816 return nil, err 3817 } 3818 return ret, nil 3819 // { 3820 // "description": "Subscribes to changes for a user.", 3821 // "httpMethod": "POST", 3822 // "id": "drive.changes.watch", 3823 // "parameterOrder": [ 3824 // "pageToken" 3825 // ], 3826 // "parameters": { 3827 // "driveId": { 3828 // "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.", 3829 // "location": "query", 3830 // "type": "string" 3831 // }, 3832 // "includeCorpusRemovals": { 3833 // "default": "false", 3834 // "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.", 3835 // "location": "query", 3836 // "type": "boolean" 3837 // }, 3838 // "includeItemsFromAllDrives": { 3839 // "default": "false", 3840 // "description": "Whether both My Drive and shared drive items should be included in results.", 3841 // "location": "query", 3842 // "type": "boolean" 3843 // }, 3844 // "includePermissionsForView": { 3845 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 3846 // "location": "query", 3847 // "type": "string" 3848 // }, 3849 // "includeRemoved": { 3850 // "default": "true", 3851 // "description": "Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.", 3852 // "location": "query", 3853 // "type": "boolean" 3854 // }, 3855 // "includeTeamDriveItems": { 3856 // "default": "false", 3857 // "description": "Deprecated use includeItemsFromAllDrives instead.", 3858 // "location": "query", 3859 // "type": "boolean" 3860 // }, 3861 // "pageSize": { 3862 // "default": "100", 3863 // "description": "The maximum number of changes to return per page.", 3864 // "format": "int32", 3865 // "location": "query", 3866 // "maximum": "1000", 3867 // "minimum": "1", 3868 // "type": "integer" 3869 // }, 3870 // "pageToken": { 3871 // "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.", 3872 // "location": "query", 3873 // "required": true, 3874 // "type": "string" 3875 // }, 3876 // "restrictToMyDrive": { 3877 // "default": "false", 3878 // "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.", 3879 // "location": "query", 3880 // "type": "boolean" 3881 // }, 3882 // "spaces": { 3883 // "default": "drive", 3884 // "description": "A comma-separated list of spaces to query within the user corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.", 3885 // "location": "query", 3886 // "type": "string" 3887 // }, 3888 // "supportsAllDrives": { 3889 // "default": "false", 3890 // "description": "Whether the requesting application supports both My Drives and shared drives.", 3891 // "location": "query", 3892 // "type": "boolean" 3893 // }, 3894 // "supportsTeamDrives": { 3895 // "default": "false", 3896 // "description": "Deprecated use supportsAllDrives instead.", 3897 // "location": "query", 3898 // "type": "boolean" 3899 // }, 3900 // "teamDriveId": { 3901 // "description": "Deprecated use driveId instead.", 3902 // "location": "query", 3903 // "type": "string" 3904 // } 3905 // }, 3906 // "path": "changes/watch", 3907 // "request": { 3908 // "$ref": "Channel", 3909 // "parameterName": "resource" 3910 // }, 3911 // "response": { 3912 // "$ref": "Channel" 3913 // }, 3914 // "scopes": [ 3915 // "https://www.googleapis.com/auth/drive", 3916 // "https://www.googleapis.com/auth/drive.appdata", 3917 // "https://www.googleapis.com/auth/drive.file", 3918 // "https://www.googleapis.com/auth/drive.metadata", 3919 // "https://www.googleapis.com/auth/drive.metadata.readonly", 3920 // "https://www.googleapis.com/auth/drive.photos.readonly", 3921 // "https://www.googleapis.com/auth/drive.readonly" 3922 // ], 3923 // "supportsSubscription": true 3924 // } 3925 3926} 3927 3928// method id "drive.channels.stop": 3929 3930type ChannelsStopCall struct { 3931 s *Service 3932 channel *Channel 3933 urlParams_ gensupport.URLParams 3934 ctx_ context.Context 3935 header_ http.Header 3936} 3937 3938// Stop: Stop watching resources through this channel 3939func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { 3940 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3941 c.channel = channel 3942 return c 3943} 3944 3945// Fields allows partial responses to be retrieved. See 3946// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3947// for more information. 3948func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { 3949 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3950 return c 3951} 3952 3953// Context sets the context to be used in this call's Do method. Any 3954// pending HTTP request will be aborted if the provided context is 3955// canceled. 3956func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { 3957 c.ctx_ = ctx 3958 return c 3959} 3960 3961// Header returns an http.Header that can be modified by the caller to 3962// add HTTP headers to the request. 3963func (c *ChannelsStopCall) Header() http.Header { 3964 if c.header_ == nil { 3965 c.header_ = make(http.Header) 3966 } 3967 return c.header_ 3968} 3969 3970func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { 3971 reqHeaders := make(http.Header) 3972 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 3973 for k, v := range c.header_ { 3974 reqHeaders[k] = v 3975 } 3976 reqHeaders.Set("User-Agent", c.s.userAgent()) 3977 var body io.Reader = nil 3978 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 3979 if err != nil { 3980 return nil, err 3981 } 3982 reqHeaders.Set("Content-Type", "application/json") 3983 c.urlParams_.Set("alt", alt) 3984 c.urlParams_.Set("prettyPrint", "false") 3985 urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop") 3986 urls += "?" + c.urlParams_.Encode() 3987 req, err := http.NewRequest("POST", urls, body) 3988 if err != nil { 3989 return nil, err 3990 } 3991 req.Header = reqHeaders 3992 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3993} 3994 3995// Do executes the "drive.channels.stop" call. 3996func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error { 3997 gensupport.SetOptions(c.urlParams_, opts...) 3998 res, err := c.doRequest("json") 3999 if err != nil { 4000 return err 4001 } 4002 defer googleapi.CloseBody(res) 4003 if err := googleapi.CheckResponse(res); err != nil { 4004 return err 4005 } 4006 return nil 4007 // { 4008 // "description": "Stop watching resources through this channel", 4009 // "httpMethod": "POST", 4010 // "id": "drive.channels.stop", 4011 // "path": "channels/stop", 4012 // "request": { 4013 // "$ref": "Channel", 4014 // "parameterName": "resource" 4015 // }, 4016 // "scopes": [ 4017 // "https://www.googleapis.com/auth/drive", 4018 // "https://www.googleapis.com/auth/drive.appdata", 4019 // "https://www.googleapis.com/auth/drive.file", 4020 // "https://www.googleapis.com/auth/drive.metadata", 4021 // "https://www.googleapis.com/auth/drive.metadata.readonly", 4022 // "https://www.googleapis.com/auth/drive.photos.readonly", 4023 // "https://www.googleapis.com/auth/drive.readonly" 4024 // ] 4025 // } 4026 4027} 4028 4029// method id "drive.comments.create": 4030 4031type CommentsCreateCall struct { 4032 s *Service 4033 fileId string 4034 comment *Comment 4035 urlParams_ gensupport.URLParams 4036 ctx_ context.Context 4037 header_ http.Header 4038} 4039 4040// Create: Creates a new comment on a file. 4041// 4042// - fileId: The ID of the file. 4043func (r *CommentsService) Create(fileId string, comment *Comment) *CommentsCreateCall { 4044 c := &CommentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4045 c.fileId = fileId 4046 c.comment = comment 4047 return c 4048} 4049 4050// Fields allows partial responses to be retrieved. See 4051// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4052// for more information. 4053func (c *CommentsCreateCall) Fields(s ...googleapi.Field) *CommentsCreateCall { 4054 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4055 return c 4056} 4057 4058// Context sets the context to be used in this call's Do method. Any 4059// pending HTTP request will be aborted if the provided context is 4060// canceled. 4061func (c *CommentsCreateCall) Context(ctx context.Context) *CommentsCreateCall { 4062 c.ctx_ = ctx 4063 return c 4064} 4065 4066// Header returns an http.Header that can be modified by the caller to 4067// add HTTP headers to the request. 4068func (c *CommentsCreateCall) Header() http.Header { 4069 if c.header_ == nil { 4070 c.header_ = make(http.Header) 4071 } 4072 return c.header_ 4073} 4074 4075func (c *CommentsCreateCall) doRequest(alt string) (*http.Response, error) { 4076 reqHeaders := make(http.Header) 4077 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4078 for k, v := range c.header_ { 4079 reqHeaders[k] = v 4080 } 4081 reqHeaders.Set("User-Agent", c.s.userAgent()) 4082 var body io.Reader = nil 4083 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) 4084 if err != nil { 4085 return nil, err 4086 } 4087 reqHeaders.Set("Content-Type", "application/json") 4088 c.urlParams_.Set("alt", alt) 4089 c.urlParams_.Set("prettyPrint", "false") 4090 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") 4091 urls += "?" + c.urlParams_.Encode() 4092 req, err := http.NewRequest("POST", urls, body) 4093 if err != nil { 4094 return nil, err 4095 } 4096 req.Header = reqHeaders 4097 googleapi.Expand(req.URL, map[string]string{ 4098 "fileId": c.fileId, 4099 }) 4100 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4101} 4102 4103// Do executes the "drive.comments.create" call. 4104// Exactly one of *Comment or error will be non-nil. Any non-2xx status 4105// code is an error. Response headers are in either 4106// *Comment.ServerResponse.Header or (if a response was returned at all) 4107// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4108// check whether the returned error was because http.StatusNotModified 4109// was returned. 4110func (c *CommentsCreateCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 4111 gensupport.SetOptions(c.urlParams_, opts...) 4112 res, err := c.doRequest("json") 4113 if res != nil && res.StatusCode == http.StatusNotModified { 4114 if res.Body != nil { 4115 res.Body.Close() 4116 } 4117 return nil, &googleapi.Error{ 4118 Code: res.StatusCode, 4119 Header: res.Header, 4120 } 4121 } 4122 if err != nil { 4123 return nil, err 4124 } 4125 defer googleapi.CloseBody(res) 4126 if err := googleapi.CheckResponse(res); err != nil { 4127 return nil, err 4128 } 4129 ret := &Comment{ 4130 ServerResponse: googleapi.ServerResponse{ 4131 Header: res.Header, 4132 HTTPStatusCode: res.StatusCode, 4133 }, 4134 } 4135 target := &ret 4136 if err := gensupport.DecodeResponse(target, res); err != nil { 4137 return nil, err 4138 } 4139 return ret, nil 4140 // { 4141 // "description": "Creates a new comment on a file.", 4142 // "httpMethod": "POST", 4143 // "id": "drive.comments.create", 4144 // "parameterOrder": [ 4145 // "fileId" 4146 // ], 4147 // "parameters": { 4148 // "fileId": { 4149 // "description": "The ID of the file.", 4150 // "location": "path", 4151 // "required": true, 4152 // "type": "string" 4153 // } 4154 // }, 4155 // "path": "files/{fileId}/comments", 4156 // "request": { 4157 // "$ref": "Comment" 4158 // }, 4159 // "response": { 4160 // "$ref": "Comment" 4161 // }, 4162 // "scopes": [ 4163 // "https://www.googleapis.com/auth/drive", 4164 // "https://www.googleapis.com/auth/drive.file" 4165 // ] 4166 // } 4167 4168} 4169 4170// method id "drive.comments.delete": 4171 4172type CommentsDeleteCall struct { 4173 s *Service 4174 fileId string 4175 commentId string 4176 urlParams_ gensupport.URLParams 4177 ctx_ context.Context 4178 header_ http.Header 4179} 4180 4181// Delete: Deletes a comment. 4182// 4183// - commentId: The ID of the comment. 4184// - fileId: The ID of the file. 4185func (r *CommentsService) Delete(fileId string, commentId string) *CommentsDeleteCall { 4186 c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4187 c.fileId = fileId 4188 c.commentId = commentId 4189 return c 4190} 4191 4192// Fields allows partial responses to be retrieved. See 4193// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4194// for more information. 4195func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall { 4196 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4197 return c 4198} 4199 4200// Context sets the context to be used in this call's Do method. Any 4201// pending HTTP request will be aborted if the provided context is 4202// canceled. 4203func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall { 4204 c.ctx_ = ctx 4205 return c 4206} 4207 4208// Header returns an http.Header that can be modified by the caller to 4209// add HTTP headers to the request. 4210func (c *CommentsDeleteCall) Header() http.Header { 4211 if c.header_ == nil { 4212 c.header_ = make(http.Header) 4213 } 4214 return c.header_ 4215} 4216 4217func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { 4218 reqHeaders := make(http.Header) 4219 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4220 for k, v := range c.header_ { 4221 reqHeaders[k] = v 4222 } 4223 reqHeaders.Set("User-Agent", c.s.userAgent()) 4224 var body io.Reader = nil 4225 c.urlParams_.Set("alt", alt) 4226 c.urlParams_.Set("prettyPrint", "false") 4227 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") 4228 urls += "?" + c.urlParams_.Encode() 4229 req, err := http.NewRequest("DELETE", urls, body) 4230 if err != nil { 4231 return nil, err 4232 } 4233 req.Header = reqHeaders 4234 googleapi.Expand(req.URL, map[string]string{ 4235 "fileId": c.fileId, 4236 "commentId": c.commentId, 4237 }) 4238 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4239} 4240 4241// Do executes the "drive.comments.delete" call. 4242func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error { 4243 gensupport.SetOptions(c.urlParams_, opts...) 4244 res, err := c.doRequest("json") 4245 if err != nil { 4246 return err 4247 } 4248 defer googleapi.CloseBody(res) 4249 if err := googleapi.CheckResponse(res); err != nil { 4250 return err 4251 } 4252 return nil 4253 // { 4254 // "description": "Deletes a comment.", 4255 // "httpMethod": "DELETE", 4256 // "id": "drive.comments.delete", 4257 // "parameterOrder": [ 4258 // "fileId", 4259 // "commentId" 4260 // ], 4261 // "parameters": { 4262 // "commentId": { 4263 // "description": "The ID of the comment.", 4264 // "location": "path", 4265 // "required": true, 4266 // "type": "string" 4267 // }, 4268 // "fileId": { 4269 // "description": "The ID of the file.", 4270 // "location": "path", 4271 // "required": true, 4272 // "type": "string" 4273 // } 4274 // }, 4275 // "path": "files/{fileId}/comments/{commentId}", 4276 // "scopes": [ 4277 // "https://www.googleapis.com/auth/drive", 4278 // "https://www.googleapis.com/auth/drive.file" 4279 // ] 4280 // } 4281 4282} 4283 4284// method id "drive.comments.get": 4285 4286type CommentsGetCall struct { 4287 s *Service 4288 fileId string 4289 commentId string 4290 urlParams_ gensupport.URLParams 4291 ifNoneMatch_ string 4292 ctx_ context.Context 4293 header_ http.Header 4294} 4295 4296// Get: Gets a comment by ID. 4297// 4298// - commentId: The ID of the comment. 4299// - fileId: The ID of the file. 4300func (r *CommentsService) Get(fileId string, commentId string) *CommentsGetCall { 4301 c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4302 c.fileId = fileId 4303 c.commentId = commentId 4304 return c 4305} 4306 4307// IncludeDeleted sets the optional parameter "includeDeleted": Whether 4308// to return deleted comments. Deleted comments will not include their 4309// original content. 4310func (c *CommentsGetCall) IncludeDeleted(includeDeleted bool) *CommentsGetCall { 4311 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 4312 return c 4313} 4314 4315// Fields allows partial responses to be retrieved. See 4316// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4317// for more information. 4318func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { 4319 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4320 return c 4321} 4322 4323// IfNoneMatch sets the optional parameter which makes the operation 4324// fail if the object's ETag matches the given value. This is useful for 4325// getting updates only after the object has changed since the last 4326// request. Use googleapi.IsNotModified to check whether the response 4327// error from Do is the result of In-None-Match. 4328func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { 4329 c.ifNoneMatch_ = entityTag 4330 return c 4331} 4332 4333// Context sets the context to be used in this call's Do method. Any 4334// pending HTTP request will be aborted if the provided context is 4335// canceled. 4336func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { 4337 c.ctx_ = ctx 4338 return c 4339} 4340 4341// Header returns an http.Header that can be modified by the caller to 4342// add HTTP headers to the request. 4343func (c *CommentsGetCall) Header() http.Header { 4344 if c.header_ == nil { 4345 c.header_ = make(http.Header) 4346 } 4347 return c.header_ 4348} 4349 4350func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { 4351 reqHeaders := make(http.Header) 4352 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4353 for k, v := range c.header_ { 4354 reqHeaders[k] = v 4355 } 4356 reqHeaders.Set("User-Agent", c.s.userAgent()) 4357 if c.ifNoneMatch_ != "" { 4358 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4359 } 4360 var body io.Reader = nil 4361 c.urlParams_.Set("alt", alt) 4362 c.urlParams_.Set("prettyPrint", "false") 4363 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") 4364 urls += "?" + c.urlParams_.Encode() 4365 req, err := http.NewRequest("GET", urls, body) 4366 if err != nil { 4367 return nil, err 4368 } 4369 req.Header = reqHeaders 4370 googleapi.Expand(req.URL, map[string]string{ 4371 "fileId": c.fileId, 4372 "commentId": c.commentId, 4373 }) 4374 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4375} 4376 4377// Do executes the "drive.comments.get" call. 4378// Exactly one of *Comment or error will be non-nil. Any non-2xx status 4379// code is an error. Response headers are in either 4380// *Comment.ServerResponse.Header or (if a response was returned at all) 4381// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4382// check whether the returned error was because http.StatusNotModified 4383// was returned. 4384func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 4385 gensupport.SetOptions(c.urlParams_, opts...) 4386 res, err := c.doRequest("json") 4387 if res != nil && res.StatusCode == http.StatusNotModified { 4388 if res.Body != nil { 4389 res.Body.Close() 4390 } 4391 return nil, &googleapi.Error{ 4392 Code: res.StatusCode, 4393 Header: res.Header, 4394 } 4395 } 4396 if err != nil { 4397 return nil, err 4398 } 4399 defer googleapi.CloseBody(res) 4400 if err := googleapi.CheckResponse(res); err != nil { 4401 return nil, err 4402 } 4403 ret := &Comment{ 4404 ServerResponse: googleapi.ServerResponse{ 4405 Header: res.Header, 4406 HTTPStatusCode: res.StatusCode, 4407 }, 4408 } 4409 target := &ret 4410 if err := gensupport.DecodeResponse(target, res); err != nil { 4411 return nil, err 4412 } 4413 return ret, nil 4414 // { 4415 // "description": "Gets a comment by ID.", 4416 // "httpMethod": "GET", 4417 // "id": "drive.comments.get", 4418 // "parameterOrder": [ 4419 // "fileId", 4420 // "commentId" 4421 // ], 4422 // "parameters": { 4423 // "commentId": { 4424 // "description": "The ID of the comment.", 4425 // "location": "path", 4426 // "required": true, 4427 // "type": "string" 4428 // }, 4429 // "fileId": { 4430 // "description": "The ID of the file.", 4431 // "location": "path", 4432 // "required": true, 4433 // "type": "string" 4434 // }, 4435 // "includeDeleted": { 4436 // "default": "false", 4437 // "description": "Whether to return deleted comments. Deleted comments will not include their original content.", 4438 // "location": "query", 4439 // "type": "boolean" 4440 // } 4441 // }, 4442 // "path": "files/{fileId}/comments/{commentId}", 4443 // "response": { 4444 // "$ref": "Comment" 4445 // }, 4446 // "scopes": [ 4447 // "https://www.googleapis.com/auth/drive", 4448 // "https://www.googleapis.com/auth/drive.file", 4449 // "https://www.googleapis.com/auth/drive.readonly" 4450 // ] 4451 // } 4452 4453} 4454 4455// method id "drive.comments.list": 4456 4457type CommentsListCall struct { 4458 s *Service 4459 fileId string 4460 urlParams_ gensupport.URLParams 4461 ifNoneMatch_ string 4462 ctx_ context.Context 4463 header_ http.Header 4464} 4465 4466// List: Lists a file's comments. 4467// 4468// - fileId: The ID of the file. 4469func (r *CommentsService) List(fileId string) *CommentsListCall { 4470 c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4471 c.fileId = fileId 4472 return c 4473} 4474 4475// IncludeDeleted sets the optional parameter "includeDeleted": Whether 4476// to include deleted comments. Deleted comments will not include their 4477// original content. 4478func (c *CommentsListCall) IncludeDeleted(includeDeleted bool) *CommentsListCall { 4479 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 4480 return c 4481} 4482 4483// PageSize sets the optional parameter "pageSize": The maximum number 4484// of comments to return per page. 4485func (c *CommentsListCall) PageSize(pageSize int64) *CommentsListCall { 4486 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4487 return c 4488} 4489 4490// PageToken sets the optional parameter "pageToken": The token for 4491// continuing a previous list request on the next page. This should be 4492// set to the value of 'nextPageToken' from the previous response. 4493func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { 4494 c.urlParams_.Set("pageToken", pageToken) 4495 return c 4496} 4497 4498// StartModifiedTime sets the optional parameter "startModifiedTime": 4499// The minimum value of 'modifiedTime' for the result comments (RFC 3339 4500// date-time). 4501func (c *CommentsListCall) StartModifiedTime(startModifiedTime string) *CommentsListCall { 4502 c.urlParams_.Set("startModifiedTime", startModifiedTime) 4503 return c 4504} 4505 4506// Fields allows partial responses to be retrieved. See 4507// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4508// for more information. 4509func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { 4510 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4511 return c 4512} 4513 4514// IfNoneMatch sets the optional parameter which makes the operation 4515// fail if the object's ETag matches the given value. This is useful for 4516// getting updates only after the object has changed since the last 4517// request. Use googleapi.IsNotModified to check whether the response 4518// error from Do is the result of In-None-Match. 4519func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { 4520 c.ifNoneMatch_ = entityTag 4521 return c 4522} 4523 4524// Context sets the context to be used in this call's Do method. Any 4525// pending HTTP request will be aborted if the provided context is 4526// canceled. 4527func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { 4528 c.ctx_ = ctx 4529 return c 4530} 4531 4532// Header returns an http.Header that can be modified by the caller to 4533// add HTTP headers to the request. 4534func (c *CommentsListCall) Header() http.Header { 4535 if c.header_ == nil { 4536 c.header_ = make(http.Header) 4537 } 4538 return c.header_ 4539} 4540 4541func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { 4542 reqHeaders := make(http.Header) 4543 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4544 for k, v := range c.header_ { 4545 reqHeaders[k] = v 4546 } 4547 reqHeaders.Set("User-Agent", c.s.userAgent()) 4548 if c.ifNoneMatch_ != "" { 4549 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4550 } 4551 var body io.Reader = nil 4552 c.urlParams_.Set("alt", alt) 4553 c.urlParams_.Set("prettyPrint", "false") 4554 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") 4555 urls += "?" + c.urlParams_.Encode() 4556 req, err := http.NewRequest("GET", urls, body) 4557 if err != nil { 4558 return nil, err 4559 } 4560 req.Header = reqHeaders 4561 googleapi.Expand(req.URL, map[string]string{ 4562 "fileId": c.fileId, 4563 }) 4564 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4565} 4566 4567// Do executes the "drive.comments.list" call. 4568// Exactly one of *CommentList or error will be non-nil. Any non-2xx 4569// status code is an error. Response headers are in either 4570// *CommentList.ServerResponse.Header or (if a response was returned at 4571// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4572// to check whether the returned error was because 4573// http.StatusNotModified was returned. 4574func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) { 4575 gensupport.SetOptions(c.urlParams_, opts...) 4576 res, err := c.doRequest("json") 4577 if res != nil && res.StatusCode == http.StatusNotModified { 4578 if res.Body != nil { 4579 res.Body.Close() 4580 } 4581 return nil, &googleapi.Error{ 4582 Code: res.StatusCode, 4583 Header: res.Header, 4584 } 4585 } 4586 if err != nil { 4587 return nil, err 4588 } 4589 defer googleapi.CloseBody(res) 4590 if err := googleapi.CheckResponse(res); err != nil { 4591 return nil, err 4592 } 4593 ret := &CommentList{ 4594 ServerResponse: googleapi.ServerResponse{ 4595 Header: res.Header, 4596 HTTPStatusCode: res.StatusCode, 4597 }, 4598 } 4599 target := &ret 4600 if err := gensupport.DecodeResponse(target, res); err != nil { 4601 return nil, err 4602 } 4603 return ret, nil 4604 // { 4605 // "description": "Lists a file's comments.", 4606 // "httpMethod": "GET", 4607 // "id": "drive.comments.list", 4608 // "parameterOrder": [ 4609 // "fileId" 4610 // ], 4611 // "parameters": { 4612 // "fileId": { 4613 // "description": "The ID of the file.", 4614 // "location": "path", 4615 // "required": true, 4616 // "type": "string" 4617 // }, 4618 // "includeDeleted": { 4619 // "default": "false", 4620 // "description": "Whether to include deleted comments. Deleted comments will not include their original content.", 4621 // "location": "query", 4622 // "type": "boolean" 4623 // }, 4624 // "pageSize": { 4625 // "default": "20", 4626 // "description": "The maximum number of comments to return per page.", 4627 // "format": "int32", 4628 // "location": "query", 4629 // "maximum": "100", 4630 // "minimum": "1", 4631 // "type": "integer" 4632 // }, 4633 // "pageToken": { 4634 // "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.", 4635 // "location": "query", 4636 // "type": "string" 4637 // }, 4638 // "startModifiedTime": { 4639 // "description": "The minimum value of 'modifiedTime' for the result comments (RFC 3339 date-time).", 4640 // "location": "query", 4641 // "type": "string" 4642 // } 4643 // }, 4644 // "path": "files/{fileId}/comments", 4645 // "response": { 4646 // "$ref": "CommentList" 4647 // }, 4648 // "scopes": [ 4649 // "https://www.googleapis.com/auth/drive", 4650 // "https://www.googleapis.com/auth/drive.file", 4651 // "https://www.googleapis.com/auth/drive.readonly" 4652 // ] 4653 // } 4654 4655} 4656 4657// Pages invokes f for each page of results. 4658// A non-nil error returned from f will halt the iteration. 4659// The provided context supersedes any context provided to the Context method. 4660func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error { 4661 c.ctx_ = ctx 4662 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4663 for { 4664 x, err := c.Do() 4665 if err != nil { 4666 return err 4667 } 4668 if err := f(x); err != nil { 4669 return err 4670 } 4671 if x.NextPageToken == "" { 4672 return nil 4673 } 4674 c.PageToken(x.NextPageToken) 4675 } 4676} 4677 4678// method id "drive.comments.update": 4679 4680type CommentsUpdateCall struct { 4681 s *Service 4682 fileId string 4683 commentId string 4684 comment *Comment 4685 urlParams_ gensupport.URLParams 4686 ctx_ context.Context 4687 header_ http.Header 4688} 4689 4690// Update: Updates a comment with patch semantics. 4691// 4692// - commentId: The ID of the comment. 4693// - fileId: The ID of the file. 4694func (r *CommentsService) Update(fileId string, commentId string, comment *Comment) *CommentsUpdateCall { 4695 c := &CommentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4696 c.fileId = fileId 4697 c.commentId = commentId 4698 c.comment = comment 4699 return c 4700} 4701 4702// Fields allows partial responses to be retrieved. See 4703// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4704// for more information. 4705func (c *CommentsUpdateCall) Fields(s ...googleapi.Field) *CommentsUpdateCall { 4706 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4707 return c 4708} 4709 4710// Context sets the context to be used in this call's Do method. Any 4711// pending HTTP request will be aborted if the provided context is 4712// canceled. 4713func (c *CommentsUpdateCall) Context(ctx context.Context) *CommentsUpdateCall { 4714 c.ctx_ = ctx 4715 return c 4716} 4717 4718// Header returns an http.Header that can be modified by the caller to 4719// add HTTP headers to the request. 4720func (c *CommentsUpdateCall) Header() http.Header { 4721 if c.header_ == nil { 4722 c.header_ = make(http.Header) 4723 } 4724 return c.header_ 4725} 4726 4727func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) { 4728 reqHeaders := make(http.Header) 4729 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4730 for k, v := range c.header_ { 4731 reqHeaders[k] = v 4732 } 4733 reqHeaders.Set("User-Agent", c.s.userAgent()) 4734 var body io.Reader = nil 4735 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) 4736 if err != nil { 4737 return nil, err 4738 } 4739 reqHeaders.Set("Content-Type", "application/json") 4740 c.urlParams_.Set("alt", alt) 4741 c.urlParams_.Set("prettyPrint", "false") 4742 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") 4743 urls += "?" + c.urlParams_.Encode() 4744 req, err := http.NewRequest("PATCH", urls, body) 4745 if err != nil { 4746 return nil, err 4747 } 4748 req.Header = reqHeaders 4749 googleapi.Expand(req.URL, map[string]string{ 4750 "fileId": c.fileId, 4751 "commentId": c.commentId, 4752 }) 4753 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4754} 4755 4756// Do executes the "drive.comments.update" call. 4757// Exactly one of *Comment or error will be non-nil. Any non-2xx status 4758// code is an error. Response headers are in either 4759// *Comment.ServerResponse.Header or (if a response was returned at all) 4760// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4761// check whether the returned error was because http.StatusNotModified 4762// was returned. 4763func (c *CommentsUpdateCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 4764 gensupport.SetOptions(c.urlParams_, opts...) 4765 res, err := c.doRequest("json") 4766 if res != nil && res.StatusCode == http.StatusNotModified { 4767 if res.Body != nil { 4768 res.Body.Close() 4769 } 4770 return nil, &googleapi.Error{ 4771 Code: res.StatusCode, 4772 Header: res.Header, 4773 } 4774 } 4775 if err != nil { 4776 return nil, err 4777 } 4778 defer googleapi.CloseBody(res) 4779 if err := googleapi.CheckResponse(res); err != nil { 4780 return nil, err 4781 } 4782 ret := &Comment{ 4783 ServerResponse: googleapi.ServerResponse{ 4784 Header: res.Header, 4785 HTTPStatusCode: res.StatusCode, 4786 }, 4787 } 4788 target := &ret 4789 if err := gensupport.DecodeResponse(target, res); err != nil { 4790 return nil, err 4791 } 4792 return ret, nil 4793 // { 4794 // "description": "Updates a comment with patch semantics.", 4795 // "httpMethod": "PATCH", 4796 // "id": "drive.comments.update", 4797 // "parameterOrder": [ 4798 // "fileId", 4799 // "commentId" 4800 // ], 4801 // "parameters": { 4802 // "commentId": { 4803 // "description": "The ID of the comment.", 4804 // "location": "path", 4805 // "required": true, 4806 // "type": "string" 4807 // }, 4808 // "fileId": { 4809 // "description": "The ID of the file.", 4810 // "location": "path", 4811 // "required": true, 4812 // "type": "string" 4813 // } 4814 // }, 4815 // "path": "files/{fileId}/comments/{commentId}", 4816 // "request": { 4817 // "$ref": "Comment" 4818 // }, 4819 // "response": { 4820 // "$ref": "Comment" 4821 // }, 4822 // "scopes": [ 4823 // "https://www.googleapis.com/auth/drive", 4824 // "https://www.googleapis.com/auth/drive.file" 4825 // ] 4826 // } 4827 4828} 4829 4830// method id "drive.drives.create": 4831 4832type DrivesCreateCall struct { 4833 s *Service 4834 drive *Drive 4835 urlParams_ gensupport.URLParams 4836 ctx_ context.Context 4837 header_ http.Header 4838} 4839 4840// Create: Creates a new shared drive. 4841// 4842// - requestId: An ID, such as a random UUID, which uniquely identifies 4843// this user's request for idempotent creation of a shared drive. A 4844// repeated request by the same user and with the same request ID will 4845// avoid creating duplicates by attempting to create the same shared 4846// drive. If the shared drive already exists a 409 error will be 4847// returned. 4848func (r *DrivesService) Create(requestId string, drive *Drive) *DrivesCreateCall { 4849 c := &DrivesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4850 c.urlParams_.Set("requestId", requestId) 4851 c.drive = drive 4852 return c 4853} 4854 4855// Fields allows partial responses to be retrieved. See 4856// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4857// for more information. 4858func (c *DrivesCreateCall) Fields(s ...googleapi.Field) *DrivesCreateCall { 4859 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4860 return c 4861} 4862 4863// Context sets the context to be used in this call's Do method. Any 4864// pending HTTP request will be aborted if the provided context is 4865// canceled. 4866func (c *DrivesCreateCall) Context(ctx context.Context) *DrivesCreateCall { 4867 c.ctx_ = ctx 4868 return c 4869} 4870 4871// Header returns an http.Header that can be modified by the caller to 4872// add HTTP headers to the request. 4873func (c *DrivesCreateCall) Header() http.Header { 4874 if c.header_ == nil { 4875 c.header_ = make(http.Header) 4876 } 4877 return c.header_ 4878} 4879 4880func (c *DrivesCreateCall) doRequest(alt string) (*http.Response, error) { 4881 reqHeaders := make(http.Header) 4882 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4883 for k, v := range c.header_ { 4884 reqHeaders[k] = v 4885 } 4886 reqHeaders.Set("User-Agent", c.s.userAgent()) 4887 var body io.Reader = nil 4888 body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive) 4889 if err != nil { 4890 return nil, err 4891 } 4892 reqHeaders.Set("Content-Type", "application/json") 4893 c.urlParams_.Set("alt", alt) 4894 c.urlParams_.Set("prettyPrint", "false") 4895 urls := googleapi.ResolveRelative(c.s.BasePath, "drives") 4896 urls += "?" + c.urlParams_.Encode() 4897 req, err := http.NewRequest("POST", urls, body) 4898 if err != nil { 4899 return nil, err 4900 } 4901 req.Header = reqHeaders 4902 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4903} 4904 4905// Do executes the "drive.drives.create" call. 4906// Exactly one of *Drive or error will be non-nil. Any non-2xx status 4907// code is an error. Response headers are in either 4908// *Drive.ServerResponse.Header or (if a response was returned at all) 4909// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4910// check whether the returned error was because http.StatusNotModified 4911// was returned. 4912func (c *DrivesCreateCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 4913 gensupport.SetOptions(c.urlParams_, opts...) 4914 res, err := c.doRequest("json") 4915 if res != nil && res.StatusCode == http.StatusNotModified { 4916 if res.Body != nil { 4917 res.Body.Close() 4918 } 4919 return nil, &googleapi.Error{ 4920 Code: res.StatusCode, 4921 Header: res.Header, 4922 } 4923 } 4924 if err != nil { 4925 return nil, err 4926 } 4927 defer googleapi.CloseBody(res) 4928 if err := googleapi.CheckResponse(res); err != nil { 4929 return nil, err 4930 } 4931 ret := &Drive{ 4932 ServerResponse: googleapi.ServerResponse{ 4933 Header: res.Header, 4934 HTTPStatusCode: res.StatusCode, 4935 }, 4936 } 4937 target := &ret 4938 if err := gensupport.DecodeResponse(target, res); err != nil { 4939 return nil, err 4940 } 4941 return ret, nil 4942 // { 4943 // "description": "Creates a new shared drive.", 4944 // "httpMethod": "POST", 4945 // "id": "drive.drives.create", 4946 // "parameterOrder": [ 4947 // "requestId" 4948 // ], 4949 // "parameters": { 4950 // "requestId": { 4951 // "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.", 4952 // "location": "query", 4953 // "required": true, 4954 // "type": "string" 4955 // } 4956 // }, 4957 // "path": "drives", 4958 // "request": { 4959 // "$ref": "Drive" 4960 // }, 4961 // "response": { 4962 // "$ref": "Drive" 4963 // }, 4964 // "scopes": [ 4965 // "https://www.googleapis.com/auth/drive" 4966 // ] 4967 // } 4968 4969} 4970 4971// method id "drive.drives.delete": 4972 4973type DrivesDeleteCall struct { 4974 s *Service 4975 driveId string 4976 urlParams_ gensupport.URLParams 4977 ctx_ context.Context 4978 header_ http.Header 4979} 4980 4981// Delete: Permanently deletes a shared drive for which the user is an 4982// organizer. The shared drive cannot contain any untrashed items. 4983// 4984// - driveId: The ID of the shared drive. 4985func (r *DrivesService) Delete(driveId string) *DrivesDeleteCall { 4986 c := &DrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4987 c.driveId = driveId 4988 return c 4989} 4990 4991// Fields allows partial responses to be retrieved. See 4992// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4993// for more information. 4994func (c *DrivesDeleteCall) Fields(s ...googleapi.Field) *DrivesDeleteCall { 4995 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4996 return c 4997} 4998 4999// Context sets the context to be used in this call's Do method. Any 5000// pending HTTP request will be aborted if the provided context is 5001// canceled. 5002func (c *DrivesDeleteCall) Context(ctx context.Context) *DrivesDeleteCall { 5003 c.ctx_ = ctx 5004 return c 5005} 5006 5007// Header returns an http.Header that can be modified by the caller to 5008// add HTTP headers to the request. 5009func (c *DrivesDeleteCall) Header() http.Header { 5010 if c.header_ == nil { 5011 c.header_ = make(http.Header) 5012 } 5013 return c.header_ 5014} 5015 5016func (c *DrivesDeleteCall) doRequest(alt string) (*http.Response, error) { 5017 reqHeaders := make(http.Header) 5018 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5019 for k, v := range c.header_ { 5020 reqHeaders[k] = v 5021 } 5022 reqHeaders.Set("User-Agent", c.s.userAgent()) 5023 var body io.Reader = nil 5024 c.urlParams_.Set("alt", alt) 5025 c.urlParams_.Set("prettyPrint", "false") 5026 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") 5027 urls += "?" + c.urlParams_.Encode() 5028 req, err := http.NewRequest("DELETE", urls, body) 5029 if err != nil { 5030 return nil, err 5031 } 5032 req.Header = reqHeaders 5033 googleapi.Expand(req.URL, map[string]string{ 5034 "driveId": c.driveId, 5035 }) 5036 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5037} 5038 5039// Do executes the "drive.drives.delete" call. 5040func (c *DrivesDeleteCall) Do(opts ...googleapi.CallOption) error { 5041 gensupport.SetOptions(c.urlParams_, opts...) 5042 res, err := c.doRequest("json") 5043 if err != nil { 5044 return err 5045 } 5046 defer googleapi.CloseBody(res) 5047 if err := googleapi.CheckResponse(res); err != nil { 5048 return err 5049 } 5050 return nil 5051 // { 5052 // "description": "Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.", 5053 // "httpMethod": "DELETE", 5054 // "id": "drive.drives.delete", 5055 // "parameterOrder": [ 5056 // "driveId" 5057 // ], 5058 // "parameters": { 5059 // "driveId": { 5060 // "description": "The ID of the shared drive.", 5061 // "location": "path", 5062 // "required": true, 5063 // "type": "string" 5064 // } 5065 // }, 5066 // "path": "drives/{driveId}", 5067 // "scopes": [ 5068 // "https://www.googleapis.com/auth/drive" 5069 // ] 5070 // } 5071 5072} 5073 5074// method id "drive.drives.get": 5075 5076type DrivesGetCall struct { 5077 s *Service 5078 driveId string 5079 urlParams_ gensupport.URLParams 5080 ifNoneMatch_ string 5081 ctx_ context.Context 5082 header_ http.Header 5083} 5084 5085// Get: Gets a shared drive's metadata by ID. 5086// 5087// - driveId: The ID of the shared drive. 5088func (r *DrivesService) Get(driveId string) *DrivesGetCall { 5089 c := &DrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5090 c.driveId = driveId 5091 return c 5092} 5093 5094// UseDomainAdminAccess sets the optional parameter 5095// "useDomainAdminAccess": Issue the request as a domain administrator; 5096// if set to true, then the requester will be granted access if they are 5097// an administrator of the domain to which the shared drive belongs. 5098func (c *DrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesGetCall { 5099 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 5100 return c 5101} 5102 5103// Fields allows partial responses to be retrieved. See 5104// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5105// for more information. 5106func (c *DrivesGetCall) Fields(s ...googleapi.Field) *DrivesGetCall { 5107 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5108 return c 5109} 5110 5111// IfNoneMatch sets the optional parameter which makes the operation 5112// fail if the object's ETag matches the given value. This is useful for 5113// getting updates only after the object has changed since the last 5114// request. Use googleapi.IsNotModified to check whether the response 5115// error from Do is the result of In-None-Match. 5116func (c *DrivesGetCall) IfNoneMatch(entityTag string) *DrivesGetCall { 5117 c.ifNoneMatch_ = entityTag 5118 return c 5119} 5120 5121// Context sets the context to be used in this call's Do method. Any 5122// pending HTTP request will be aborted if the provided context is 5123// canceled. 5124func (c *DrivesGetCall) Context(ctx context.Context) *DrivesGetCall { 5125 c.ctx_ = ctx 5126 return c 5127} 5128 5129// Header returns an http.Header that can be modified by the caller to 5130// add HTTP headers to the request. 5131func (c *DrivesGetCall) Header() http.Header { 5132 if c.header_ == nil { 5133 c.header_ = make(http.Header) 5134 } 5135 return c.header_ 5136} 5137 5138func (c *DrivesGetCall) doRequest(alt string) (*http.Response, error) { 5139 reqHeaders := make(http.Header) 5140 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5141 for k, v := range c.header_ { 5142 reqHeaders[k] = v 5143 } 5144 reqHeaders.Set("User-Agent", c.s.userAgent()) 5145 if c.ifNoneMatch_ != "" { 5146 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5147 } 5148 var body io.Reader = nil 5149 c.urlParams_.Set("alt", alt) 5150 c.urlParams_.Set("prettyPrint", "false") 5151 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") 5152 urls += "?" + c.urlParams_.Encode() 5153 req, err := http.NewRequest("GET", urls, body) 5154 if err != nil { 5155 return nil, err 5156 } 5157 req.Header = reqHeaders 5158 googleapi.Expand(req.URL, map[string]string{ 5159 "driveId": c.driveId, 5160 }) 5161 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5162} 5163 5164// Do executes the "drive.drives.get" call. 5165// Exactly one of *Drive or error will be non-nil. Any non-2xx status 5166// code is an error. Response headers are in either 5167// *Drive.ServerResponse.Header or (if a response was returned at all) 5168// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5169// check whether the returned error was because http.StatusNotModified 5170// was returned. 5171func (c *DrivesGetCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 5172 gensupport.SetOptions(c.urlParams_, opts...) 5173 res, err := c.doRequest("json") 5174 if res != nil && res.StatusCode == http.StatusNotModified { 5175 if res.Body != nil { 5176 res.Body.Close() 5177 } 5178 return nil, &googleapi.Error{ 5179 Code: res.StatusCode, 5180 Header: res.Header, 5181 } 5182 } 5183 if err != nil { 5184 return nil, err 5185 } 5186 defer googleapi.CloseBody(res) 5187 if err := googleapi.CheckResponse(res); err != nil { 5188 return nil, err 5189 } 5190 ret := &Drive{ 5191 ServerResponse: googleapi.ServerResponse{ 5192 Header: res.Header, 5193 HTTPStatusCode: res.StatusCode, 5194 }, 5195 } 5196 target := &ret 5197 if err := gensupport.DecodeResponse(target, res); err != nil { 5198 return nil, err 5199 } 5200 return ret, nil 5201 // { 5202 // "description": "Gets a shared drive's metadata by ID.", 5203 // "httpMethod": "GET", 5204 // "id": "drive.drives.get", 5205 // "parameterOrder": [ 5206 // "driveId" 5207 // ], 5208 // "parameters": { 5209 // "driveId": { 5210 // "description": "The ID of the shared drive.", 5211 // "location": "path", 5212 // "required": true, 5213 // "type": "string" 5214 // }, 5215 // "useDomainAdminAccess": { 5216 // "default": "false", 5217 // "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.", 5218 // "location": "query", 5219 // "type": "boolean" 5220 // } 5221 // }, 5222 // "path": "drives/{driveId}", 5223 // "response": { 5224 // "$ref": "Drive" 5225 // }, 5226 // "scopes": [ 5227 // "https://www.googleapis.com/auth/drive", 5228 // "https://www.googleapis.com/auth/drive.readonly" 5229 // ] 5230 // } 5231 5232} 5233 5234// method id "drive.drives.hide": 5235 5236type DrivesHideCall struct { 5237 s *Service 5238 driveId string 5239 urlParams_ gensupport.URLParams 5240 ctx_ context.Context 5241 header_ http.Header 5242} 5243 5244// Hide: Hides a shared drive from the default view. 5245// 5246// - driveId: The ID of the shared drive. 5247func (r *DrivesService) Hide(driveId string) *DrivesHideCall { 5248 c := &DrivesHideCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5249 c.driveId = driveId 5250 return c 5251} 5252 5253// Fields allows partial responses to be retrieved. See 5254// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5255// for more information. 5256func (c *DrivesHideCall) Fields(s ...googleapi.Field) *DrivesHideCall { 5257 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5258 return c 5259} 5260 5261// Context sets the context to be used in this call's Do method. Any 5262// pending HTTP request will be aborted if the provided context is 5263// canceled. 5264func (c *DrivesHideCall) Context(ctx context.Context) *DrivesHideCall { 5265 c.ctx_ = ctx 5266 return c 5267} 5268 5269// Header returns an http.Header that can be modified by the caller to 5270// add HTTP headers to the request. 5271func (c *DrivesHideCall) Header() http.Header { 5272 if c.header_ == nil { 5273 c.header_ = make(http.Header) 5274 } 5275 return c.header_ 5276} 5277 5278func (c *DrivesHideCall) doRequest(alt string) (*http.Response, error) { 5279 reqHeaders := make(http.Header) 5280 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5281 for k, v := range c.header_ { 5282 reqHeaders[k] = v 5283 } 5284 reqHeaders.Set("User-Agent", c.s.userAgent()) 5285 var body io.Reader = nil 5286 c.urlParams_.Set("alt", alt) 5287 c.urlParams_.Set("prettyPrint", "false") 5288 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/hide") 5289 urls += "?" + c.urlParams_.Encode() 5290 req, err := http.NewRequest("POST", urls, body) 5291 if err != nil { 5292 return nil, err 5293 } 5294 req.Header = reqHeaders 5295 googleapi.Expand(req.URL, map[string]string{ 5296 "driveId": c.driveId, 5297 }) 5298 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5299} 5300 5301// Do executes the "drive.drives.hide" call. 5302// Exactly one of *Drive or error will be non-nil. Any non-2xx status 5303// code is an error. Response headers are in either 5304// *Drive.ServerResponse.Header or (if a response was returned at all) 5305// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5306// check whether the returned error was because http.StatusNotModified 5307// was returned. 5308func (c *DrivesHideCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 5309 gensupport.SetOptions(c.urlParams_, opts...) 5310 res, err := c.doRequest("json") 5311 if res != nil && res.StatusCode == http.StatusNotModified { 5312 if res.Body != nil { 5313 res.Body.Close() 5314 } 5315 return nil, &googleapi.Error{ 5316 Code: res.StatusCode, 5317 Header: res.Header, 5318 } 5319 } 5320 if err != nil { 5321 return nil, err 5322 } 5323 defer googleapi.CloseBody(res) 5324 if err := googleapi.CheckResponse(res); err != nil { 5325 return nil, err 5326 } 5327 ret := &Drive{ 5328 ServerResponse: googleapi.ServerResponse{ 5329 Header: res.Header, 5330 HTTPStatusCode: res.StatusCode, 5331 }, 5332 } 5333 target := &ret 5334 if err := gensupport.DecodeResponse(target, res); err != nil { 5335 return nil, err 5336 } 5337 return ret, nil 5338 // { 5339 // "description": "Hides a shared drive from the default view.", 5340 // "httpMethod": "POST", 5341 // "id": "drive.drives.hide", 5342 // "parameterOrder": [ 5343 // "driveId" 5344 // ], 5345 // "parameters": { 5346 // "driveId": { 5347 // "description": "The ID of the shared drive.", 5348 // "location": "path", 5349 // "required": true, 5350 // "type": "string" 5351 // } 5352 // }, 5353 // "path": "drives/{driveId}/hide", 5354 // "response": { 5355 // "$ref": "Drive" 5356 // }, 5357 // "scopes": [ 5358 // "https://www.googleapis.com/auth/drive" 5359 // ] 5360 // } 5361 5362} 5363 5364// method id "drive.drives.list": 5365 5366type DrivesListCall struct { 5367 s *Service 5368 urlParams_ gensupport.URLParams 5369 ifNoneMatch_ string 5370 ctx_ context.Context 5371 header_ http.Header 5372} 5373 5374// List: Lists the user's shared drives. 5375func (r *DrivesService) List() *DrivesListCall { 5376 c := &DrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5377 return c 5378} 5379 5380// PageSize sets the optional parameter "pageSize": Maximum number of 5381// shared drives to return. 5382func (c *DrivesListCall) PageSize(pageSize int64) *DrivesListCall { 5383 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5384 return c 5385} 5386 5387// PageToken sets the optional parameter "pageToken": Page token for 5388// shared drives. 5389func (c *DrivesListCall) PageToken(pageToken string) *DrivesListCall { 5390 c.urlParams_.Set("pageToken", pageToken) 5391 return c 5392} 5393 5394// Q sets the optional parameter "q": Query string for searching shared 5395// drives. 5396func (c *DrivesListCall) Q(q string) *DrivesListCall { 5397 c.urlParams_.Set("q", q) 5398 return c 5399} 5400 5401// UseDomainAdminAccess sets the optional parameter 5402// "useDomainAdminAccess": Issue the request as a domain administrator; 5403// if set to true, then all shared drives of the domain in which the 5404// requester is an administrator are returned. 5405func (c *DrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesListCall { 5406 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 5407 return c 5408} 5409 5410// Fields allows partial responses to be retrieved. See 5411// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5412// for more information. 5413func (c *DrivesListCall) Fields(s ...googleapi.Field) *DrivesListCall { 5414 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5415 return c 5416} 5417 5418// IfNoneMatch sets the optional parameter which makes the operation 5419// fail if the object's ETag matches the given value. This is useful for 5420// getting updates only after the object has changed since the last 5421// request. Use googleapi.IsNotModified to check whether the response 5422// error from Do is the result of In-None-Match. 5423func (c *DrivesListCall) IfNoneMatch(entityTag string) *DrivesListCall { 5424 c.ifNoneMatch_ = entityTag 5425 return c 5426} 5427 5428// Context sets the context to be used in this call's Do method. Any 5429// pending HTTP request will be aborted if the provided context is 5430// canceled. 5431func (c *DrivesListCall) Context(ctx context.Context) *DrivesListCall { 5432 c.ctx_ = ctx 5433 return c 5434} 5435 5436// Header returns an http.Header that can be modified by the caller to 5437// add HTTP headers to the request. 5438func (c *DrivesListCall) Header() http.Header { 5439 if c.header_ == nil { 5440 c.header_ = make(http.Header) 5441 } 5442 return c.header_ 5443} 5444 5445func (c *DrivesListCall) doRequest(alt string) (*http.Response, error) { 5446 reqHeaders := make(http.Header) 5447 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5448 for k, v := range c.header_ { 5449 reqHeaders[k] = v 5450 } 5451 reqHeaders.Set("User-Agent", c.s.userAgent()) 5452 if c.ifNoneMatch_ != "" { 5453 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5454 } 5455 var body io.Reader = nil 5456 c.urlParams_.Set("alt", alt) 5457 c.urlParams_.Set("prettyPrint", "false") 5458 urls := googleapi.ResolveRelative(c.s.BasePath, "drives") 5459 urls += "?" + c.urlParams_.Encode() 5460 req, err := http.NewRequest("GET", urls, body) 5461 if err != nil { 5462 return nil, err 5463 } 5464 req.Header = reqHeaders 5465 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5466} 5467 5468// Do executes the "drive.drives.list" call. 5469// Exactly one of *DriveList or error will be non-nil. Any non-2xx 5470// status code is an error. Response headers are in either 5471// *DriveList.ServerResponse.Header or (if a response was returned at 5472// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5473// to check whether the returned error was because 5474// http.StatusNotModified was returned. 5475func (c *DrivesListCall) Do(opts ...googleapi.CallOption) (*DriveList, error) { 5476 gensupport.SetOptions(c.urlParams_, opts...) 5477 res, err := c.doRequest("json") 5478 if res != nil && res.StatusCode == http.StatusNotModified { 5479 if res.Body != nil { 5480 res.Body.Close() 5481 } 5482 return nil, &googleapi.Error{ 5483 Code: res.StatusCode, 5484 Header: res.Header, 5485 } 5486 } 5487 if err != nil { 5488 return nil, err 5489 } 5490 defer googleapi.CloseBody(res) 5491 if err := googleapi.CheckResponse(res); err != nil { 5492 return nil, err 5493 } 5494 ret := &DriveList{ 5495 ServerResponse: googleapi.ServerResponse{ 5496 Header: res.Header, 5497 HTTPStatusCode: res.StatusCode, 5498 }, 5499 } 5500 target := &ret 5501 if err := gensupport.DecodeResponse(target, res); err != nil { 5502 return nil, err 5503 } 5504 return ret, nil 5505 // { 5506 // "description": "Lists the user's shared drives.", 5507 // "httpMethod": "GET", 5508 // "id": "drive.drives.list", 5509 // "parameters": { 5510 // "pageSize": { 5511 // "default": "10", 5512 // "description": "Maximum number of shared drives to return.", 5513 // "format": "int32", 5514 // "location": "query", 5515 // "maximum": "100", 5516 // "minimum": "1", 5517 // "type": "integer" 5518 // }, 5519 // "pageToken": { 5520 // "description": "Page token for shared drives.", 5521 // "location": "query", 5522 // "type": "string" 5523 // }, 5524 // "q": { 5525 // "description": "Query string for searching shared drives.", 5526 // "location": "query", 5527 // "type": "string" 5528 // }, 5529 // "useDomainAdminAccess": { 5530 // "default": "false", 5531 // "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.", 5532 // "location": "query", 5533 // "type": "boolean" 5534 // } 5535 // }, 5536 // "path": "drives", 5537 // "response": { 5538 // "$ref": "DriveList" 5539 // }, 5540 // "scopes": [ 5541 // "https://www.googleapis.com/auth/drive", 5542 // "https://www.googleapis.com/auth/drive.readonly" 5543 // ] 5544 // } 5545 5546} 5547 5548// Pages invokes f for each page of results. 5549// A non-nil error returned from f will halt the iteration. 5550// The provided context supersedes any context provided to the Context method. 5551func (c *DrivesListCall) Pages(ctx context.Context, f func(*DriveList) error) error { 5552 c.ctx_ = ctx 5553 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5554 for { 5555 x, err := c.Do() 5556 if err != nil { 5557 return err 5558 } 5559 if err := f(x); err != nil { 5560 return err 5561 } 5562 if x.NextPageToken == "" { 5563 return nil 5564 } 5565 c.PageToken(x.NextPageToken) 5566 } 5567} 5568 5569// method id "drive.drives.unhide": 5570 5571type DrivesUnhideCall struct { 5572 s *Service 5573 driveId string 5574 urlParams_ gensupport.URLParams 5575 ctx_ context.Context 5576 header_ http.Header 5577} 5578 5579// Unhide: Restores a shared drive to the default view. 5580// 5581// - driveId: The ID of the shared drive. 5582func (r *DrivesService) Unhide(driveId string) *DrivesUnhideCall { 5583 c := &DrivesUnhideCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5584 c.driveId = driveId 5585 return c 5586} 5587 5588// Fields allows partial responses to be retrieved. See 5589// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5590// for more information. 5591func (c *DrivesUnhideCall) Fields(s ...googleapi.Field) *DrivesUnhideCall { 5592 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5593 return c 5594} 5595 5596// Context sets the context to be used in this call's Do method. Any 5597// pending HTTP request will be aborted if the provided context is 5598// canceled. 5599func (c *DrivesUnhideCall) Context(ctx context.Context) *DrivesUnhideCall { 5600 c.ctx_ = ctx 5601 return c 5602} 5603 5604// Header returns an http.Header that can be modified by the caller to 5605// add HTTP headers to the request. 5606func (c *DrivesUnhideCall) Header() http.Header { 5607 if c.header_ == nil { 5608 c.header_ = make(http.Header) 5609 } 5610 return c.header_ 5611} 5612 5613func (c *DrivesUnhideCall) doRequest(alt string) (*http.Response, error) { 5614 reqHeaders := make(http.Header) 5615 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5616 for k, v := range c.header_ { 5617 reqHeaders[k] = v 5618 } 5619 reqHeaders.Set("User-Agent", c.s.userAgent()) 5620 var body io.Reader = nil 5621 c.urlParams_.Set("alt", alt) 5622 c.urlParams_.Set("prettyPrint", "false") 5623 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/unhide") 5624 urls += "?" + c.urlParams_.Encode() 5625 req, err := http.NewRequest("POST", urls, body) 5626 if err != nil { 5627 return nil, err 5628 } 5629 req.Header = reqHeaders 5630 googleapi.Expand(req.URL, map[string]string{ 5631 "driveId": c.driveId, 5632 }) 5633 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5634} 5635 5636// Do executes the "drive.drives.unhide" call. 5637// Exactly one of *Drive or error will be non-nil. Any non-2xx status 5638// code is an error. Response headers are in either 5639// *Drive.ServerResponse.Header or (if a response was returned at all) 5640// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5641// check whether the returned error was because http.StatusNotModified 5642// was returned. 5643func (c *DrivesUnhideCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 5644 gensupport.SetOptions(c.urlParams_, opts...) 5645 res, err := c.doRequest("json") 5646 if res != nil && res.StatusCode == http.StatusNotModified { 5647 if res.Body != nil { 5648 res.Body.Close() 5649 } 5650 return nil, &googleapi.Error{ 5651 Code: res.StatusCode, 5652 Header: res.Header, 5653 } 5654 } 5655 if err != nil { 5656 return nil, err 5657 } 5658 defer googleapi.CloseBody(res) 5659 if err := googleapi.CheckResponse(res); err != nil { 5660 return nil, err 5661 } 5662 ret := &Drive{ 5663 ServerResponse: googleapi.ServerResponse{ 5664 Header: res.Header, 5665 HTTPStatusCode: res.StatusCode, 5666 }, 5667 } 5668 target := &ret 5669 if err := gensupport.DecodeResponse(target, res); err != nil { 5670 return nil, err 5671 } 5672 return ret, nil 5673 // { 5674 // "description": "Restores a shared drive to the default view.", 5675 // "httpMethod": "POST", 5676 // "id": "drive.drives.unhide", 5677 // "parameterOrder": [ 5678 // "driveId" 5679 // ], 5680 // "parameters": { 5681 // "driveId": { 5682 // "description": "The ID of the shared drive.", 5683 // "location": "path", 5684 // "required": true, 5685 // "type": "string" 5686 // } 5687 // }, 5688 // "path": "drives/{driveId}/unhide", 5689 // "response": { 5690 // "$ref": "Drive" 5691 // }, 5692 // "scopes": [ 5693 // "https://www.googleapis.com/auth/drive" 5694 // ] 5695 // } 5696 5697} 5698 5699// method id "drive.drives.update": 5700 5701type DrivesUpdateCall struct { 5702 s *Service 5703 driveId string 5704 drive *Drive 5705 urlParams_ gensupport.URLParams 5706 ctx_ context.Context 5707 header_ http.Header 5708} 5709 5710// Update: Updates the metadate for a shared drive. 5711// 5712// - driveId: The ID of the shared drive. 5713func (r *DrivesService) Update(driveId string, drive *Drive) *DrivesUpdateCall { 5714 c := &DrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5715 c.driveId = driveId 5716 c.drive = drive 5717 return c 5718} 5719 5720// UseDomainAdminAccess sets the optional parameter 5721// "useDomainAdminAccess": Issue the request as a domain administrator; 5722// if set to true, then the requester will be granted access if they are 5723// an administrator of the domain to which the shared drive belongs. 5724func (c *DrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesUpdateCall { 5725 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 5726 return c 5727} 5728 5729// Fields allows partial responses to be retrieved. See 5730// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5731// for more information. 5732func (c *DrivesUpdateCall) Fields(s ...googleapi.Field) *DrivesUpdateCall { 5733 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5734 return c 5735} 5736 5737// Context sets the context to be used in this call's Do method. Any 5738// pending HTTP request will be aborted if the provided context is 5739// canceled. 5740func (c *DrivesUpdateCall) Context(ctx context.Context) *DrivesUpdateCall { 5741 c.ctx_ = ctx 5742 return c 5743} 5744 5745// Header returns an http.Header that can be modified by the caller to 5746// add HTTP headers to the request. 5747func (c *DrivesUpdateCall) Header() http.Header { 5748 if c.header_ == nil { 5749 c.header_ = make(http.Header) 5750 } 5751 return c.header_ 5752} 5753 5754func (c *DrivesUpdateCall) doRequest(alt string) (*http.Response, error) { 5755 reqHeaders := make(http.Header) 5756 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5757 for k, v := range c.header_ { 5758 reqHeaders[k] = v 5759 } 5760 reqHeaders.Set("User-Agent", c.s.userAgent()) 5761 var body io.Reader = nil 5762 body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive) 5763 if err != nil { 5764 return nil, err 5765 } 5766 reqHeaders.Set("Content-Type", "application/json") 5767 c.urlParams_.Set("alt", alt) 5768 c.urlParams_.Set("prettyPrint", "false") 5769 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") 5770 urls += "?" + c.urlParams_.Encode() 5771 req, err := http.NewRequest("PATCH", urls, body) 5772 if err != nil { 5773 return nil, err 5774 } 5775 req.Header = reqHeaders 5776 googleapi.Expand(req.URL, map[string]string{ 5777 "driveId": c.driveId, 5778 }) 5779 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5780} 5781 5782// Do executes the "drive.drives.update" call. 5783// Exactly one of *Drive or error will be non-nil. Any non-2xx status 5784// code is an error. Response headers are in either 5785// *Drive.ServerResponse.Header or (if a response was returned at all) 5786// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5787// check whether the returned error was because http.StatusNotModified 5788// was returned. 5789func (c *DrivesUpdateCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 5790 gensupport.SetOptions(c.urlParams_, opts...) 5791 res, err := c.doRequest("json") 5792 if res != nil && res.StatusCode == http.StatusNotModified { 5793 if res.Body != nil { 5794 res.Body.Close() 5795 } 5796 return nil, &googleapi.Error{ 5797 Code: res.StatusCode, 5798 Header: res.Header, 5799 } 5800 } 5801 if err != nil { 5802 return nil, err 5803 } 5804 defer googleapi.CloseBody(res) 5805 if err := googleapi.CheckResponse(res); err != nil { 5806 return nil, err 5807 } 5808 ret := &Drive{ 5809 ServerResponse: googleapi.ServerResponse{ 5810 Header: res.Header, 5811 HTTPStatusCode: res.StatusCode, 5812 }, 5813 } 5814 target := &ret 5815 if err := gensupport.DecodeResponse(target, res); err != nil { 5816 return nil, err 5817 } 5818 return ret, nil 5819 // { 5820 // "description": "Updates the metadate for a shared drive.", 5821 // "httpMethod": "PATCH", 5822 // "id": "drive.drives.update", 5823 // "parameterOrder": [ 5824 // "driveId" 5825 // ], 5826 // "parameters": { 5827 // "driveId": { 5828 // "description": "The ID of the shared drive.", 5829 // "location": "path", 5830 // "required": true, 5831 // "type": "string" 5832 // }, 5833 // "useDomainAdminAccess": { 5834 // "default": "false", 5835 // "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.", 5836 // "location": "query", 5837 // "type": "boolean" 5838 // } 5839 // }, 5840 // "path": "drives/{driveId}", 5841 // "request": { 5842 // "$ref": "Drive" 5843 // }, 5844 // "response": { 5845 // "$ref": "Drive" 5846 // }, 5847 // "scopes": [ 5848 // "https://www.googleapis.com/auth/drive" 5849 // ] 5850 // } 5851 5852} 5853 5854// method id "drive.files.copy": 5855 5856type FilesCopyCall struct { 5857 s *Service 5858 fileId string 5859 file *File 5860 urlParams_ gensupport.URLParams 5861 ctx_ context.Context 5862 header_ http.Header 5863} 5864 5865// Copy: Creates a copy of a file and applies any requested updates with 5866// patch semantics. Folders cannot be copied. 5867// 5868// - fileId: The ID of the file. 5869func (r *FilesService) Copy(fileId string, file *File) *FilesCopyCall { 5870 c := &FilesCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5871 c.fileId = fileId 5872 c.file = file 5873 return c 5874} 5875 5876// EnforceSingleParent sets the optional parameter 5877// "enforceSingleParent": Deprecated. Copying files into multiple 5878// folders is no longer supported. Use shortcuts instead. 5879func (c *FilesCopyCall) EnforceSingleParent(enforceSingleParent bool) *FilesCopyCall { 5880 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 5881 return c 5882} 5883 5884// IgnoreDefaultVisibility sets the optional parameter 5885// "ignoreDefaultVisibility": Whether to ignore the domain's default 5886// visibility settings for the created file. Domain administrators can 5887// choose to make all uploaded files visible to the domain by default; 5888// this parameter bypasses that behavior for the request. Permissions 5889// are still inherited from parent folders. 5890func (c *FilesCopyCall) IgnoreDefaultVisibility(ignoreDefaultVisibility bool) *FilesCopyCall { 5891 c.urlParams_.Set("ignoreDefaultVisibility", fmt.Sprint(ignoreDefaultVisibility)) 5892 return c 5893} 5894 5895// IncludePermissionsForView sets the optional parameter 5896// "includePermissionsForView": Specifies which additional view's 5897// permissions to include in the response. Only 'published' is 5898// supported. 5899func (c *FilesCopyCall) IncludePermissionsForView(includePermissionsForView string) *FilesCopyCall { 5900 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 5901 return c 5902} 5903 5904// KeepRevisionForever sets the optional parameter 5905// "keepRevisionForever": Whether to set the 'keepForever' field in the 5906// new head revision. This is only applicable to files with binary 5907// content in Google Drive. Only 200 revisions for the file can be kept 5908// forever. If the limit is reached, try deleting pinned revisions. 5909func (c *FilesCopyCall) KeepRevisionForever(keepRevisionForever bool) *FilesCopyCall { 5910 c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever)) 5911 return c 5912} 5913 5914// OcrLanguage sets the optional parameter "ocrLanguage": A language 5915// hint for OCR processing during image import (ISO 639-1 code). 5916func (c *FilesCopyCall) OcrLanguage(ocrLanguage string) *FilesCopyCall { 5917 c.urlParams_.Set("ocrLanguage", ocrLanguage) 5918 return c 5919} 5920 5921// SupportsAllDrives sets the optional parameter "supportsAllDrives": 5922// Whether the requesting application supports both My Drives and shared 5923// drives. 5924func (c *FilesCopyCall) SupportsAllDrives(supportsAllDrives bool) *FilesCopyCall { 5925 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 5926 return c 5927} 5928 5929// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 5930// Deprecated use supportsAllDrives instead. 5931func (c *FilesCopyCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesCopyCall { 5932 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 5933 return c 5934} 5935 5936// Fields allows partial responses to be retrieved. See 5937// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5938// for more information. 5939func (c *FilesCopyCall) Fields(s ...googleapi.Field) *FilesCopyCall { 5940 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5941 return c 5942} 5943 5944// Context sets the context to be used in this call's Do method. Any 5945// pending HTTP request will be aborted if the provided context is 5946// canceled. 5947func (c *FilesCopyCall) Context(ctx context.Context) *FilesCopyCall { 5948 c.ctx_ = ctx 5949 return c 5950} 5951 5952// Header returns an http.Header that can be modified by the caller to 5953// add HTTP headers to the request. 5954func (c *FilesCopyCall) Header() http.Header { 5955 if c.header_ == nil { 5956 c.header_ = make(http.Header) 5957 } 5958 return c.header_ 5959} 5960 5961func (c *FilesCopyCall) doRequest(alt string) (*http.Response, error) { 5962 reqHeaders := make(http.Header) 5963 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5964 for k, v := range c.header_ { 5965 reqHeaders[k] = v 5966 } 5967 reqHeaders.Set("User-Agent", c.s.userAgent()) 5968 var body io.Reader = nil 5969 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 5970 if err != nil { 5971 return nil, err 5972 } 5973 reqHeaders.Set("Content-Type", "application/json") 5974 c.urlParams_.Set("alt", alt) 5975 c.urlParams_.Set("prettyPrint", "false") 5976 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/copy") 5977 urls += "?" + c.urlParams_.Encode() 5978 req, err := http.NewRequest("POST", urls, body) 5979 if err != nil { 5980 return nil, err 5981 } 5982 req.Header = reqHeaders 5983 googleapi.Expand(req.URL, map[string]string{ 5984 "fileId": c.fileId, 5985 }) 5986 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5987} 5988 5989// Do executes the "drive.files.copy" call. 5990// Exactly one of *File or error will be non-nil. Any non-2xx status 5991// code is an error. Response headers are in either 5992// *File.ServerResponse.Header or (if a response was returned at all) in 5993// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5994// whether the returned error was because http.StatusNotModified was 5995// returned. 5996func (c *FilesCopyCall) Do(opts ...googleapi.CallOption) (*File, error) { 5997 gensupport.SetOptions(c.urlParams_, opts...) 5998 res, err := c.doRequest("json") 5999 if res != nil && res.StatusCode == http.StatusNotModified { 6000 if res.Body != nil { 6001 res.Body.Close() 6002 } 6003 return nil, &googleapi.Error{ 6004 Code: res.StatusCode, 6005 Header: res.Header, 6006 } 6007 } 6008 if err != nil { 6009 return nil, err 6010 } 6011 defer googleapi.CloseBody(res) 6012 if err := googleapi.CheckResponse(res); err != nil { 6013 return nil, err 6014 } 6015 ret := &File{ 6016 ServerResponse: googleapi.ServerResponse{ 6017 Header: res.Header, 6018 HTTPStatusCode: res.StatusCode, 6019 }, 6020 } 6021 target := &ret 6022 if err := gensupport.DecodeResponse(target, res); err != nil { 6023 return nil, err 6024 } 6025 return ret, nil 6026 // { 6027 // "description": "Creates a copy of a file and applies any requested updates with patch semantics. Folders cannot be copied.", 6028 // "httpMethod": "POST", 6029 // "id": "drive.files.copy", 6030 // "parameterOrder": [ 6031 // "fileId" 6032 // ], 6033 // "parameters": { 6034 // "enforceSingleParent": { 6035 // "default": "false", 6036 // "description": "Deprecated. Copying files into multiple folders is no longer supported. Use shortcuts instead.", 6037 // "location": "query", 6038 // "type": "boolean" 6039 // }, 6040 // "fileId": { 6041 // "description": "The ID of the file.", 6042 // "location": "path", 6043 // "required": true, 6044 // "type": "string" 6045 // }, 6046 // "ignoreDefaultVisibility": { 6047 // "default": "false", 6048 // "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.", 6049 // "location": "query", 6050 // "type": "boolean" 6051 // }, 6052 // "includePermissionsForView": { 6053 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 6054 // "location": "query", 6055 // "type": "string" 6056 // }, 6057 // "keepRevisionForever": { 6058 // "default": "false", 6059 // "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.", 6060 // "location": "query", 6061 // "type": "boolean" 6062 // }, 6063 // "ocrLanguage": { 6064 // "description": "A language hint for OCR processing during image import (ISO 639-1 code).", 6065 // "location": "query", 6066 // "type": "string" 6067 // }, 6068 // "supportsAllDrives": { 6069 // "default": "false", 6070 // "description": "Whether the requesting application supports both My Drives and shared drives.", 6071 // "location": "query", 6072 // "type": "boolean" 6073 // }, 6074 // "supportsTeamDrives": { 6075 // "default": "false", 6076 // "description": "Deprecated use supportsAllDrives instead.", 6077 // "location": "query", 6078 // "type": "boolean" 6079 // } 6080 // }, 6081 // "path": "files/{fileId}/copy", 6082 // "request": { 6083 // "$ref": "File" 6084 // }, 6085 // "response": { 6086 // "$ref": "File" 6087 // }, 6088 // "scopes": [ 6089 // "https://www.googleapis.com/auth/drive", 6090 // "https://www.googleapis.com/auth/drive.appdata", 6091 // "https://www.googleapis.com/auth/drive.file", 6092 // "https://www.googleapis.com/auth/drive.photos.readonly" 6093 // ] 6094 // } 6095 6096} 6097 6098// method id "drive.files.create": 6099 6100type FilesCreateCall struct { 6101 s *Service 6102 file *File 6103 urlParams_ gensupport.URLParams 6104 mediaInfo_ *gensupport.MediaInfo 6105 ctx_ context.Context 6106 header_ http.Header 6107} 6108 6109// Create: Creates a new file. 6110func (r *FilesService) Create(file *File) *FilesCreateCall { 6111 c := &FilesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6112 c.file = file 6113 return c 6114} 6115 6116// EnforceSingleParent sets the optional parameter 6117// "enforceSingleParent": Deprecated. Creating files in multiple folders 6118// is no longer supported. 6119func (c *FilesCreateCall) EnforceSingleParent(enforceSingleParent bool) *FilesCreateCall { 6120 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 6121 return c 6122} 6123 6124// IgnoreDefaultVisibility sets the optional parameter 6125// "ignoreDefaultVisibility": Whether to ignore the domain's default 6126// visibility settings for the created file. Domain administrators can 6127// choose to make all uploaded files visible to the domain by default; 6128// this parameter bypasses that behavior for the request. Permissions 6129// are still inherited from parent folders. 6130func (c *FilesCreateCall) IgnoreDefaultVisibility(ignoreDefaultVisibility bool) *FilesCreateCall { 6131 c.urlParams_.Set("ignoreDefaultVisibility", fmt.Sprint(ignoreDefaultVisibility)) 6132 return c 6133} 6134 6135// IncludePermissionsForView sets the optional parameter 6136// "includePermissionsForView": Specifies which additional view's 6137// permissions to include in the response. Only 'published' is 6138// supported. 6139func (c *FilesCreateCall) IncludePermissionsForView(includePermissionsForView string) *FilesCreateCall { 6140 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 6141 return c 6142} 6143 6144// KeepRevisionForever sets the optional parameter 6145// "keepRevisionForever": Whether to set the 'keepForever' field in the 6146// new head revision. This is only applicable to files with binary 6147// content in Google Drive. Only 200 revisions for the file can be kept 6148// forever. If the limit is reached, try deleting pinned revisions. 6149func (c *FilesCreateCall) KeepRevisionForever(keepRevisionForever bool) *FilesCreateCall { 6150 c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever)) 6151 return c 6152} 6153 6154// OcrLanguage sets the optional parameter "ocrLanguage": A language 6155// hint for OCR processing during image import (ISO 639-1 code). 6156func (c *FilesCreateCall) OcrLanguage(ocrLanguage string) *FilesCreateCall { 6157 c.urlParams_.Set("ocrLanguage", ocrLanguage) 6158 return c 6159} 6160 6161// SupportsAllDrives sets the optional parameter "supportsAllDrives": 6162// Whether the requesting application supports both My Drives and shared 6163// drives. 6164func (c *FilesCreateCall) SupportsAllDrives(supportsAllDrives bool) *FilesCreateCall { 6165 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 6166 return c 6167} 6168 6169// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 6170// Deprecated use supportsAllDrives instead. 6171func (c *FilesCreateCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesCreateCall { 6172 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 6173 return c 6174} 6175 6176// UseContentAsIndexableText sets the optional parameter 6177// "useContentAsIndexableText": Whether to use the uploaded content as 6178// indexable text. 6179func (c *FilesCreateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesCreateCall { 6180 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText)) 6181 return c 6182} 6183 6184// Media specifies the media to upload in one or more chunks. The chunk 6185// size may be controlled by supplying a MediaOption generated by 6186// googleapi.ChunkSize. The chunk size defaults to 6187// googleapi.DefaultUploadChunkSize.The Content-Type header used in the 6188// upload request will be determined by sniffing the contents of r, 6189// unless a MediaOption generated by googleapi.ContentType is 6190// supplied. 6191// At most one of Media and ResumableMedia may be set. 6192func (c *FilesCreateCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesCreateCall { 6193 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) 6194 return c 6195} 6196 6197// ResumableMedia specifies the media to upload in chunks and can be 6198// canceled with ctx. 6199// 6200// Deprecated: use Media instead. 6201// 6202// At most one of Media and ResumableMedia may be set. mediaType 6203// identifies the MIME media type of the upload, such as "image/png". If 6204// mediaType is "", it will be auto-detected. The provided ctx will 6205// supersede any context previously provided to the Context method. 6206func (c *FilesCreateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesCreateCall { 6207 c.ctx_ = ctx 6208 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) 6209 return c 6210} 6211 6212// ProgressUpdater provides a callback function that will be called 6213// after every chunk. It should be a low-latency function in order to 6214// not slow down the upload operation. This should only be called when 6215// using ResumableMedia (as opposed to Media). 6216func (c *FilesCreateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesCreateCall { 6217 c.mediaInfo_.SetProgressUpdater(pu) 6218 return c 6219} 6220 6221// Fields allows partial responses to be retrieved. See 6222// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6223// for more information. 6224func (c *FilesCreateCall) Fields(s ...googleapi.Field) *FilesCreateCall { 6225 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6226 return c 6227} 6228 6229// Context sets the context to be used in this call's Do method. Any 6230// pending HTTP request will be aborted if the provided context is 6231// canceled. 6232// This context will supersede any context previously provided to the 6233// ResumableMedia method. 6234func (c *FilesCreateCall) Context(ctx context.Context) *FilesCreateCall { 6235 c.ctx_ = ctx 6236 return c 6237} 6238 6239// Header returns an http.Header that can be modified by the caller to 6240// add HTTP headers to the request. 6241func (c *FilesCreateCall) Header() http.Header { 6242 if c.header_ == nil { 6243 c.header_ = make(http.Header) 6244 } 6245 return c.header_ 6246} 6247 6248func (c *FilesCreateCall) doRequest(alt string) (*http.Response, error) { 6249 reqHeaders := make(http.Header) 6250 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6251 for k, v := range c.header_ { 6252 reqHeaders[k] = v 6253 } 6254 reqHeaders.Set("User-Agent", c.s.userAgent()) 6255 var body io.Reader = nil 6256 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 6257 if err != nil { 6258 return nil, err 6259 } 6260 reqHeaders.Set("Content-Type", "application/json") 6261 c.urlParams_.Set("alt", alt) 6262 c.urlParams_.Set("prettyPrint", "false") 6263 urls := googleapi.ResolveRelative(c.s.BasePath, "files") 6264 if c.mediaInfo_ != nil { 6265 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v3/files") 6266 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) 6267 } 6268 if body == nil { 6269 body = new(bytes.Buffer) 6270 reqHeaders.Set("Content-Type", "application/json") 6271 } 6272 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) 6273 defer cleanup() 6274 urls += "?" + c.urlParams_.Encode() 6275 req, err := http.NewRequest("POST", urls, body) 6276 if err != nil { 6277 return nil, err 6278 } 6279 req.Header = reqHeaders 6280 req.GetBody = getBody 6281 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6282} 6283 6284// Do executes the "drive.files.create" call. 6285// Exactly one of *File or error will be non-nil. Any non-2xx status 6286// code is an error. Response headers are in either 6287// *File.ServerResponse.Header or (if a response was returned at all) in 6288// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 6289// whether the returned error was because http.StatusNotModified was 6290// returned. 6291func (c *FilesCreateCall) Do(opts ...googleapi.CallOption) (*File, error) { 6292 gensupport.SetOptions(c.urlParams_, opts...) 6293 res, err := c.doRequest("json") 6294 if res != nil && res.StatusCode == http.StatusNotModified { 6295 if res.Body != nil { 6296 res.Body.Close() 6297 } 6298 return nil, &googleapi.Error{ 6299 Code: res.StatusCode, 6300 Header: res.Header, 6301 } 6302 } 6303 if err != nil { 6304 return nil, err 6305 } 6306 defer googleapi.CloseBody(res) 6307 if err := googleapi.CheckResponse(res); err != nil { 6308 return nil, err 6309 } 6310 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) 6311 if rx != nil { 6312 rx.Client = c.s.client 6313 rx.UserAgent = c.s.userAgent() 6314 ctx := c.ctx_ 6315 if ctx == nil { 6316 ctx = context.TODO() 6317 } 6318 res, err = rx.Upload(ctx) 6319 if err != nil { 6320 return nil, err 6321 } 6322 defer res.Body.Close() 6323 if err := googleapi.CheckResponse(res); err != nil { 6324 return nil, err 6325 } 6326 } 6327 ret := &File{ 6328 ServerResponse: googleapi.ServerResponse{ 6329 Header: res.Header, 6330 HTTPStatusCode: res.StatusCode, 6331 }, 6332 } 6333 target := &ret 6334 if err := gensupport.DecodeResponse(target, res); err != nil { 6335 return nil, err 6336 } 6337 return ret, nil 6338 // { 6339 // "description": "Creates a new file.", 6340 // "httpMethod": "POST", 6341 // "id": "drive.files.create", 6342 // "mediaUpload": { 6343 // "accept": [ 6344 // "*/*" 6345 // ], 6346 // "maxSize": "5120GB", 6347 // "protocols": { 6348 // "resumable": { 6349 // "multipart": true, 6350 // "path": "/resumable/upload/drive/v3/files" 6351 // }, 6352 // "simple": { 6353 // "multipart": true, 6354 // "path": "/upload/drive/v3/files" 6355 // } 6356 // } 6357 // }, 6358 // "parameters": { 6359 // "enforceSingleParent": { 6360 // "default": "false", 6361 // "description": "Deprecated. Creating files in multiple folders is no longer supported.", 6362 // "location": "query", 6363 // "type": "boolean" 6364 // }, 6365 // "ignoreDefaultVisibility": { 6366 // "default": "false", 6367 // "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.", 6368 // "location": "query", 6369 // "type": "boolean" 6370 // }, 6371 // "includePermissionsForView": { 6372 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 6373 // "location": "query", 6374 // "type": "string" 6375 // }, 6376 // "keepRevisionForever": { 6377 // "default": "false", 6378 // "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.", 6379 // "location": "query", 6380 // "type": "boolean" 6381 // }, 6382 // "ocrLanguage": { 6383 // "description": "A language hint for OCR processing during image import (ISO 639-1 code).", 6384 // "location": "query", 6385 // "type": "string" 6386 // }, 6387 // "supportsAllDrives": { 6388 // "default": "false", 6389 // "description": "Whether the requesting application supports both My Drives and shared drives.", 6390 // "location": "query", 6391 // "type": "boolean" 6392 // }, 6393 // "supportsTeamDrives": { 6394 // "default": "false", 6395 // "description": "Deprecated use supportsAllDrives instead.", 6396 // "location": "query", 6397 // "type": "boolean" 6398 // }, 6399 // "useContentAsIndexableText": { 6400 // "default": "false", 6401 // "description": "Whether to use the uploaded content as indexable text.", 6402 // "location": "query", 6403 // "type": "boolean" 6404 // } 6405 // }, 6406 // "path": "files", 6407 // "request": { 6408 // "$ref": "File" 6409 // }, 6410 // "response": { 6411 // "$ref": "File" 6412 // }, 6413 // "scopes": [ 6414 // "https://www.googleapis.com/auth/drive", 6415 // "https://www.googleapis.com/auth/drive.appdata", 6416 // "https://www.googleapis.com/auth/drive.file" 6417 // ], 6418 // "supportsMediaUpload": true, 6419 // "supportsSubscription": true 6420 // } 6421 6422} 6423 6424// method id "drive.files.delete": 6425 6426type FilesDeleteCall struct { 6427 s *Service 6428 fileId string 6429 urlParams_ gensupport.URLParams 6430 ctx_ context.Context 6431 header_ http.Header 6432} 6433 6434// Delete: Permanently deletes a file owned by the user without moving 6435// it to the trash. If the file belongs to a shared drive the user must 6436// be an organizer on the parent. If the target is a folder, all 6437// descendants owned by the user are also deleted. 6438// 6439// - fileId: The ID of the file. 6440func (r *FilesService) Delete(fileId string) *FilesDeleteCall { 6441 c := &FilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6442 c.fileId = fileId 6443 return c 6444} 6445 6446// EnforceSingleParent sets the optional parameter 6447// "enforceSingleParent": Deprecated. If an item is not in a shared 6448// drive and its last parent is deleted but the item itself is not, the 6449// item will be placed under its owner's root. 6450func (c *FilesDeleteCall) EnforceSingleParent(enforceSingleParent bool) *FilesDeleteCall { 6451 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 6452 return c 6453} 6454 6455// SupportsAllDrives sets the optional parameter "supportsAllDrives": 6456// Whether the requesting application supports both My Drives and shared 6457// drives. 6458func (c *FilesDeleteCall) SupportsAllDrives(supportsAllDrives bool) *FilesDeleteCall { 6459 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 6460 return c 6461} 6462 6463// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 6464// Deprecated use supportsAllDrives instead. 6465func (c *FilesDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesDeleteCall { 6466 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 6467 return c 6468} 6469 6470// Fields allows partial responses to be retrieved. See 6471// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6472// for more information. 6473func (c *FilesDeleteCall) Fields(s ...googleapi.Field) *FilesDeleteCall { 6474 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6475 return c 6476} 6477 6478// Context sets the context to be used in this call's Do method. Any 6479// pending HTTP request will be aborted if the provided context is 6480// canceled. 6481func (c *FilesDeleteCall) Context(ctx context.Context) *FilesDeleteCall { 6482 c.ctx_ = ctx 6483 return c 6484} 6485 6486// Header returns an http.Header that can be modified by the caller to 6487// add HTTP headers to the request. 6488func (c *FilesDeleteCall) Header() http.Header { 6489 if c.header_ == nil { 6490 c.header_ = make(http.Header) 6491 } 6492 return c.header_ 6493} 6494 6495func (c *FilesDeleteCall) doRequest(alt string) (*http.Response, error) { 6496 reqHeaders := make(http.Header) 6497 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6498 for k, v := range c.header_ { 6499 reqHeaders[k] = v 6500 } 6501 reqHeaders.Set("User-Agent", c.s.userAgent()) 6502 var body io.Reader = nil 6503 c.urlParams_.Set("alt", alt) 6504 c.urlParams_.Set("prettyPrint", "false") 6505 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") 6506 urls += "?" + c.urlParams_.Encode() 6507 req, err := http.NewRequest("DELETE", urls, body) 6508 if err != nil { 6509 return nil, err 6510 } 6511 req.Header = reqHeaders 6512 googleapi.Expand(req.URL, map[string]string{ 6513 "fileId": c.fileId, 6514 }) 6515 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6516} 6517 6518// Do executes the "drive.files.delete" call. 6519func (c *FilesDeleteCall) Do(opts ...googleapi.CallOption) error { 6520 gensupport.SetOptions(c.urlParams_, opts...) 6521 res, err := c.doRequest("json") 6522 if err != nil { 6523 return err 6524 } 6525 defer googleapi.CloseBody(res) 6526 if err := googleapi.CheckResponse(res); err != nil { 6527 return err 6528 } 6529 return nil 6530 // { 6531 // "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.", 6532 // "httpMethod": "DELETE", 6533 // "id": "drive.files.delete", 6534 // "parameterOrder": [ 6535 // "fileId" 6536 // ], 6537 // "parameters": { 6538 // "enforceSingleParent": { 6539 // "default": "false", 6540 // "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.", 6541 // "location": "query", 6542 // "type": "boolean" 6543 // }, 6544 // "fileId": { 6545 // "description": "The ID of the file.", 6546 // "location": "path", 6547 // "required": true, 6548 // "type": "string" 6549 // }, 6550 // "supportsAllDrives": { 6551 // "default": "false", 6552 // "description": "Whether the requesting application supports both My Drives and shared drives.", 6553 // "location": "query", 6554 // "type": "boolean" 6555 // }, 6556 // "supportsTeamDrives": { 6557 // "default": "false", 6558 // "description": "Deprecated use supportsAllDrives instead.", 6559 // "location": "query", 6560 // "type": "boolean" 6561 // } 6562 // }, 6563 // "path": "files/{fileId}", 6564 // "scopes": [ 6565 // "https://www.googleapis.com/auth/drive", 6566 // "https://www.googleapis.com/auth/drive.appdata", 6567 // "https://www.googleapis.com/auth/drive.file" 6568 // ] 6569 // } 6570 6571} 6572 6573// method id "drive.files.emptyTrash": 6574 6575type FilesEmptyTrashCall struct { 6576 s *Service 6577 urlParams_ gensupport.URLParams 6578 ctx_ context.Context 6579 header_ http.Header 6580} 6581 6582// EmptyTrash: Permanently deletes all of the user's trashed files. 6583func (r *FilesService) EmptyTrash() *FilesEmptyTrashCall { 6584 c := &FilesEmptyTrashCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6585 return c 6586} 6587 6588// EnforceSingleParent sets the optional parameter 6589// "enforceSingleParent": Deprecated. If an item is not in a shared 6590// drive and its last parent is deleted but the item itself is not, the 6591// item will be placed under its owner's root. 6592func (c *FilesEmptyTrashCall) EnforceSingleParent(enforceSingleParent bool) *FilesEmptyTrashCall { 6593 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 6594 return c 6595} 6596 6597// Fields allows partial responses to be retrieved. See 6598// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6599// for more information. 6600func (c *FilesEmptyTrashCall) Fields(s ...googleapi.Field) *FilesEmptyTrashCall { 6601 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6602 return c 6603} 6604 6605// Context sets the context to be used in this call's Do method. Any 6606// pending HTTP request will be aborted if the provided context is 6607// canceled. 6608func (c *FilesEmptyTrashCall) Context(ctx context.Context) *FilesEmptyTrashCall { 6609 c.ctx_ = ctx 6610 return c 6611} 6612 6613// Header returns an http.Header that can be modified by the caller to 6614// add HTTP headers to the request. 6615func (c *FilesEmptyTrashCall) Header() http.Header { 6616 if c.header_ == nil { 6617 c.header_ = make(http.Header) 6618 } 6619 return c.header_ 6620} 6621 6622func (c *FilesEmptyTrashCall) doRequest(alt string) (*http.Response, error) { 6623 reqHeaders := make(http.Header) 6624 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6625 for k, v := range c.header_ { 6626 reqHeaders[k] = v 6627 } 6628 reqHeaders.Set("User-Agent", c.s.userAgent()) 6629 var body io.Reader = nil 6630 c.urlParams_.Set("alt", alt) 6631 c.urlParams_.Set("prettyPrint", "false") 6632 urls := googleapi.ResolveRelative(c.s.BasePath, "files/trash") 6633 urls += "?" + c.urlParams_.Encode() 6634 req, err := http.NewRequest("DELETE", urls, body) 6635 if err != nil { 6636 return nil, err 6637 } 6638 req.Header = reqHeaders 6639 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6640} 6641 6642// Do executes the "drive.files.emptyTrash" call. 6643func (c *FilesEmptyTrashCall) Do(opts ...googleapi.CallOption) error { 6644 gensupport.SetOptions(c.urlParams_, opts...) 6645 res, err := c.doRequest("json") 6646 if err != nil { 6647 return err 6648 } 6649 defer googleapi.CloseBody(res) 6650 if err := googleapi.CheckResponse(res); err != nil { 6651 return err 6652 } 6653 return nil 6654 // { 6655 // "description": "Permanently deletes all of the user's trashed files.", 6656 // "httpMethod": "DELETE", 6657 // "id": "drive.files.emptyTrash", 6658 // "parameters": { 6659 // "enforceSingleParent": { 6660 // "default": "false", 6661 // "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.", 6662 // "location": "query", 6663 // "type": "boolean" 6664 // } 6665 // }, 6666 // "path": "files/trash", 6667 // "scopes": [ 6668 // "https://www.googleapis.com/auth/drive" 6669 // ] 6670 // } 6671 6672} 6673 6674// method id "drive.files.export": 6675 6676type FilesExportCall struct { 6677 s *Service 6678 fileId string 6679 urlParams_ gensupport.URLParams 6680 ifNoneMatch_ string 6681 ctx_ context.Context 6682 header_ http.Header 6683} 6684 6685// Export: Exports a Google Doc to the requested MIME type and returns 6686// the exported content. Please note that the exported content is 6687// limited to 10MB. 6688// 6689// - fileId: The ID of the file. 6690// - mimeType: The MIME type of the format requested for this export. 6691func (r *FilesService) Export(fileId string, mimeType string) *FilesExportCall { 6692 c := &FilesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6693 c.fileId = fileId 6694 c.urlParams_.Set("mimeType", mimeType) 6695 return c 6696} 6697 6698// Fields allows partial responses to be retrieved. See 6699// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6700// for more information. 6701func (c *FilesExportCall) Fields(s ...googleapi.Field) *FilesExportCall { 6702 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6703 return c 6704} 6705 6706// IfNoneMatch sets the optional parameter which makes the operation 6707// fail if the object's ETag matches the given value. This is useful for 6708// getting updates only after the object has changed since the last 6709// request. Use googleapi.IsNotModified to check whether the response 6710// error from Do is the result of In-None-Match. 6711func (c *FilesExportCall) IfNoneMatch(entityTag string) *FilesExportCall { 6712 c.ifNoneMatch_ = entityTag 6713 return c 6714} 6715 6716// Context sets the context to be used in this call's Do and Download 6717// methods. Any pending HTTP request will be aborted if the provided 6718// context is canceled. 6719func (c *FilesExportCall) Context(ctx context.Context) *FilesExportCall { 6720 c.ctx_ = ctx 6721 return c 6722} 6723 6724// Header returns an http.Header that can be modified by the caller to 6725// add HTTP headers to the request. 6726func (c *FilesExportCall) Header() http.Header { 6727 if c.header_ == nil { 6728 c.header_ = make(http.Header) 6729 } 6730 return c.header_ 6731} 6732 6733func (c *FilesExportCall) doRequest(alt string) (*http.Response, error) { 6734 reqHeaders := make(http.Header) 6735 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6736 for k, v := range c.header_ { 6737 reqHeaders[k] = v 6738 } 6739 reqHeaders.Set("User-Agent", c.s.userAgent()) 6740 if c.ifNoneMatch_ != "" { 6741 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6742 } 6743 var body io.Reader = nil 6744 c.urlParams_.Set("alt", alt) 6745 c.urlParams_.Set("prettyPrint", "false") 6746 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/export") 6747 urls += "?" + c.urlParams_.Encode() 6748 req, err := http.NewRequest("GET", urls, body) 6749 if err != nil { 6750 return nil, err 6751 } 6752 req.Header = reqHeaders 6753 googleapi.Expand(req.URL, map[string]string{ 6754 "fileId": c.fileId, 6755 }) 6756 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6757} 6758 6759// Download fetches the API endpoint's "media" value, instead of the normal 6760// API response value. If the returned error is nil, the Response is guaranteed to 6761// have a 2xx status code. Callers must close the Response.Body as usual. 6762func (c *FilesExportCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 6763 gensupport.SetOptions(c.urlParams_, opts...) 6764 res, err := c.doRequest("media") 6765 if err != nil { 6766 return nil, err 6767 } 6768 if err := googleapi.CheckResponse(res); err != nil { 6769 res.Body.Close() 6770 return nil, err 6771 } 6772 return res, nil 6773} 6774 6775// Do executes the "drive.files.export" call. 6776func (c *FilesExportCall) Do(opts ...googleapi.CallOption) error { 6777 gensupport.SetOptions(c.urlParams_, opts...) 6778 res, err := c.doRequest("json") 6779 if err != nil { 6780 return err 6781 } 6782 defer googleapi.CloseBody(res) 6783 if err := googleapi.CheckResponse(res); err != nil { 6784 return err 6785 } 6786 return nil 6787 // { 6788 // "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.", 6789 // "httpMethod": "GET", 6790 // "id": "drive.files.export", 6791 // "parameterOrder": [ 6792 // "fileId", 6793 // "mimeType" 6794 // ], 6795 // "parameters": { 6796 // "fileId": { 6797 // "description": "The ID of the file.", 6798 // "location": "path", 6799 // "required": true, 6800 // "type": "string" 6801 // }, 6802 // "mimeType": { 6803 // "description": "The MIME type of the format requested for this export.", 6804 // "location": "query", 6805 // "required": true, 6806 // "type": "string" 6807 // } 6808 // }, 6809 // "path": "files/{fileId}/export", 6810 // "scopes": [ 6811 // "https://www.googleapis.com/auth/drive", 6812 // "https://www.googleapis.com/auth/drive.file", 6813 // "https://www.googleapis.com/auth/drive.readonly" 6814 // ], 6815 // "supportsMediaDownload": true 6816 // } 6817 6818} 6819 6820// method id "drive.files.generateIds": 6821 6822type FilesGenerateIdsCall struct { 6823 s *Service 6824 urlParams_ gensupport.URLParams 6825 ifNoneMatch_ string 6826 ctx_ context.Context 6827 header_ http.Header 6828} 6829 6830// GenerateIds: Generates a set of file IDs which can be provided in 6831// create or copy requests. 6832func (r *FilesService) GenerateIds() *FilesGenerateIdsCall { 6833 c := &FilesGenerateIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6834 return c 6835} 6836 6837// Count sets the optional parameter "count": The number of IDs to 6838// return. 6839func (c *FilesGenerateIdsCall) Count(count int64) *FilesGenerateIdsCall { 6840 c.urlParams_.Set("count", fmt.Sprint(count)) 6841 return c 6842} 6843 6844// Space sets the optional parameter "space": The space in which the IDs 6845// can be used to create new files. Supported values are 'drive' and 6846// 'appDataFolder'. 6847func (c *FilesGenerateIdsCall) Space(space string) *FilesGenerateIdsCall { 6848 c.urlParams_.Set("space", space) 6849 return c 6850} 6851 6852// Fields allows partial responses to be retrieved. See 6853// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6854// for more information. 6855func (c *FilesGenerateIdsCall) Fields(s ...googleapi.Field) *FilesGenerateIdsCall { 6856 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6857 return c 6858} 6859 6860// IfNoneMatch sets the optional parameter which makes the operation 6861// fail if the object's ETag matches the given value. This is useful for 6862// getting updates only after the object has changed since the last 6863// request. Use googleapi.IsNotModified to check whether the response 6864// error from Do is the result of In-None-Match. 6865func (c *FilesGenerateIdsCall) IfNoneMatch(entityTag string) *FilesGenerateIdsCall { 6866 c.ifNoneMatch_ = entityTag 6867 return c 6868} 6869 6870// Context sets the context to be used in this call's Do method. Any 6871// pending HTTP request will be aborted if the provided context is 6872// canceled. 6873func (c *FilesGenerateIdsCall) Context(ctx context.Context) *FilesGenerateIdsCall { 6874 c.ctx_ = ctx 6875 return c 6876} 6877 6878// Header returns an http.Header that can be modified by the caller to 6879// add HTTP headers to the request. 6880func (c *FilesGenerateIdsCall) Header() http.Header { 6881 if c.header_ == nil { 6882 c.header_ = make(http.Header) 6883 } 6884 return c.header_ 6885} 6886 6887func (c *FilesGenerateIdsCall) doRequest(alt string) (*http.Response, error) { 6888 reqHeaders := make(http.Header) 6889 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6890 for k, v := range c.header_ { 6891 reqHeaders[k] = v 6892 } 6893 reqHeaders.Set("User-Agent", c.s.userAgent()) 6894 if c.ifNoneMatch_ != "" { 6895 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6896 } 6897 var body io.Reader = nil 6898 c.urlParams_.Set("alt", alt) 6899 c.urlParams_.Set("prettyPrint", "false") 6900 urls := googleapi.ResolveRelative(c.s.BasePath, "files/generateIds") 6901 urls += "?" + c.urlParams_.Encode() 6902 req, err := http.NewRequest("GET", urls, body) 6903 if err != nil { 6904 return nil, err 6905 } 6906 req.Header = reqHeaders 6907 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6908} 6909 6910// Do executes the "drive.files.generateIds" call. 6911// Exactly one of *GeneratedIds or error will be non-nil. Any non-2xx 6912// status code is an error. Response headers are in either 6913// *GeneratedIds.ServerResponse.Header or (if a response was returned at 6914// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6915// to check whether the returned error was because 6916// http.StatusNotModified was returned. 6917func (c *FilesGenerateIdsCall) Do(opts ...googleapi.CallOption) (*GeneratedIds, error) { 6918 gensupport.SetOptions(c.urlParams_, opts...) 6919 res, err := c.doRequest("json") 6920 if res != nil && res.StatusCode == http.StatusNotModified { 6921 if res.Body != nil { 6922 res.Body.Close() 6923 } 6924 return nil, &googleapi.Error{ 6925 Code: res.StatusCode, 6926 Header: res.Header, 6927 } 6928 } 6929 if err != nil { 6930 return nil, err 6931 } 6932 defer googleapi.CloseBody(res) 6933 if err := googleapi.CheckResponse(res); err != nil { 6934 return nil, err 6935 } 6936 ret := &GeneratedIds{ 6937 ServerResponse: googleapi.ServerResponse{ 6938 Header: res.Header, 6939 HTTPStatusCode: res.StatusCode, 6940 }, 6941 } 6942 target := &ret 6943 if err := gensupport.DecodeResponse(target, res); err != nil { 6944 return nil, err 6945 } 6946 return ret, nil 6947 // { 6948 // "description": "Generates a set of file IDs which can be provided in create or copy requests.", 6949 // "httpMethod": "GET", 6950 // "id": "drive.files.generateIds", 6951 // "parameters": { 6952 // "count": { 6953 // "default": "10", 6954 // "description": "The number of IDs to return.", 6955 // "format": "int32", 6956 // "location": "query", 6957 // "maximum": "1000", 6958 // "minimum": "1", 6959 // "type": "integer" 6960 // }, 6961 // "space": { 6962 // "default": "drive", 6963 // "description": "The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.", 6964 // "location": "query", 6965 // "type": "string" 6966 // } 6967 // }, 6968 // "path": "files/generateIds", 6969 // "response": { 6970 // "$ref": "GeneratedIds" 6971 // }, 6972 // "scopes": [ 6973 // "https://www.googleapis.com/auth/drive", 6974 // "https://www.googleapis.com/auth/drive.appdata", 6975 // "https://www.googleapis.com/auth/drive.file" 6976 // ] 6977 // } 6978 6979} 6980 6981// method id "drive.files.get": 6982 6983type FilesGetCall struct { 6984 s *Service 6985 fileId string 6986 urlParams_ gensupport.URLParams 6987 ifNoneMatch_ string 6988 ctx_ context.Context 6989 header_ http.Header 6990} 6991 6992// Get: Gets a file's metadata or content by ID. 6993// 6994// - fileId: The ID of the file. 6995func (r *FilesService) Get(fileId string) *FilesGetCall { 6996 c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6997 c.fileId = fileId 6998 return c 6999} 7000 7001// AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": 7002// Whether the user is acknowledging the risk of downloading known 7003// malware or other abusive files. This is only applicable when 7004// alt=media. 7005func (c *FilesGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesGetCall { 7006 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse)) 7007 return c 7008} 7009 7010// IncludePermissionsForView sets the optional parameter 7011// "includePermissionsForView": Specifies which additional view's 7012// permissions to include in the response. Only 'published' is 7013// supported. 7014func (c *FilesGetCall) IncludePermissionsForView(includePermissionsForView string) *FilesGetCall { 7015 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 7016 return c 7017} 7018 7019// SupportsAllDrives sets the optional parameter "supportsAllDrives": 7020// Whether the requesting application supports both My Drives and shared 7021// drives. 7022func (c *FilesGetCall) SupportsAllDrives(supportsAllDrives bool) *FilesGetCall { 7023 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 7024 return c 7025} 7026 7027// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 7028// Deprecated use supportsAllDrives instead. 7029func (c *FilesGetCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesGetCall { 7030 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 7031 return c 7032} 7033 7034// Fields allows partial responses to be retrieved. See 7035// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7036// for more information. 7037func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall { 7038 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7039 return c 7040} 7041 7042// IfNoneMatch sets the optional parameter which makes the operation 7043// fail if the object's ETag matches the given value. This is useful for 7044// getting updates only after the object has changed since the last 7045// request. Use googleapi.IsNotModified to check whether the response 7046// error from Do is the result of In-None-Match. 7047func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall { 7048 c.ifNoneMatch_ = entityTag 7049 return c 7050} 7051 7052// Context sets the context to be used in this call's Do and Download 7053// methods. Any pending HTTP request will be aborted if the provided 7054// context is canceled. 7055func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall { 7056 c.ctx_ = ctx 7057 return c 7058} 7059 7060// Header returns an http.Header that can be modified by the caller to 7061// add HTTP headers to the request. 7062func (c *FilesGetCall) Header() http.Header { 7063 if c.header_ == nil { 7064 c.header_ = make(http.Header) 7065 } 7066 return c.header_ 7067} 7068 7069func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { 7070 reqHeaders := make(http.Header) 7071 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7072 for k, v := range c.header_ { 7073 reqHeaders[k] = v 7074 } 7075 reqHeaders.Set("User-Agent", c.s.userAgent()) 7076 if c.ifNoneMatch_ != "" { 7077 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7078 } 7079 var body io.Reader = nil 7080 c.urlParams_.Set("alt", alt) 7081 c.urlParams_.Set("prettyPrint", "false") 7082 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") 7083 urls += "?" + c.urlParams_.Encode() 7084 req, err := http.NewRequest("GET", urls, body) 7085 if err != nil { 7086 return nil, err 7087 } 7088 req.Header = reqHeaders 7089 googleapi.Expand(req.URL, map[string]string{ 7090 "fileId": c.fileId, 7091 }) 7092 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7093} 7094 7095// Download fetches the API endpoint's "media" value, instead of the normal 7096// API response value. If the returned error is nil, the Response is guaranteed to 7097// have a 2xx status code. Callers must close the Response.Body as usual. 7098func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 7099 gensupport.SetOptions(c.urlParams_, opts...) 7100 res, err := c.doRequest("media") 7101 if err != nil { 7102 return nil, err 7103 } 7104 if err := googleapi.CheckResponse(res); err != nil { 7105 res.Body.Close() 7106 return nil, err 7107 } 7108 return res, nil 7109} 7110 7111// Do executes the "drive.files.get" call. 7112// Exactly one of *File or error will be non-nil. Any non-2xx status 7113// code is an error. Response headers are in either 7114// *File.ServerResponse.Header or (if a response was returned at all) in 7115// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7116// whether the returned error was because http.StatusNotModified was 7117// returned. 7118func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) { 7119 gensupport.SetOptions(c.urlParams_, opts...) 7120 res, err := c.doRequest("json") 7121 if res != nil && res.StatusCode == http.StatusNotModified { 7122 if res.Body != nil { 7123 res.Body.Close() 7124 } 7125 return nil, &googleapi.Error{ 7126 Code: res.StatusCode, 7127 Header: res.Header, 7128 } 7129 } 7130 if err != nil { 7131 return nil, err 7132 } 7133 defer googleapi.CloseBody(res) 7134 if err := googleapi.CheckResponse(res); err != nil { 7135 return nil, err 7136 } 7137 ret := &File{ 7138 ServerResponse: googleapi.ServerResponse{ 7139 Header: res.Header, 7140 HTTPStatusCode: res.StatusCode, 7141 }, 7142 } 7143 target := &ret 7144 if err := gensupport.DecodeResponse(target, res); err != nil { 7145 return nil, err 7146 } 7147 return ret, nil 7148 // { 7149 // "description": "Gets a file's metadata or content by ID.", 7150 // "httpMethod": "GET", 7151 // "id": "drive.files.get", 7152 // "parameterOrder": [ 7153 // "fileId" 7154 // ], 7155 // "parameters": { 7156 // "acknowledgeAbuse": { 7157 // "default": "false", 7158 // "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.", 7159 // "location": "query", 7160 // "type": "boolean" 7161 // }, 7162 // "fileId": { 7163 // "description": "The ID of the file.", 7164 // "location": "path", 7165 // "required": true, 7166 // "type": "string" 7167 // }, 7168 // "includePermissionsForView": { 7169 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 7170 // "location": "query", 7171 // "type": "string" 7172 // }, 7173 // "supportsAllDrives": { 7174 // "default": "false", 7175 // "description": "Whether the requesting application supports both My Drives and shared drives.", 7176 // "location": "query", 7177 // "type": "boolean" 7178 // }, 7179 // "supportsTeamDrives": { 7180 // "default": "false", 7181 // "description": "Deprecated use supportsAllDrives instead.", 7182 // "location": "query", 7183 // "type": "boolean" 7184 // } 7185 // }, 7186 // "path": "files/{fileId}", 7187 // "response": { 7188 // "$ref": "File" 7189 // }, 7190 // "scopes": [ 7191 // "https://www.googleapis.com/auth/drive", 7192 // "https://www.googleapis.com/auth/drive.appdata", 7193 // "https://www.googleapis.com/auth/drive.file", 7194 // "https://www.googleapis.com/auth/drive.metadata", 7195 // "https://www.googleapis.com/auth/drive.metadata.readonly", 7196 // "https://www.googleapis.com/auth/drive.photos.readonly", 7197 // "https://www.googleapis.com/auth/drive.readonly" 7198 // ], 7199 // "supportsMediaDownload": true, 7200 // "supportsSubscription": true, 7201 // "useMediaDownloadService": true 7202 // } 7203 7204} 7205 7206// method id "drive.files.list": 7207 7208type FilesListCall struct { 7209 s *Service 7210 urlParams_ gensupport.URLParams 7211 ifNoneMatch_ string 7212 ctx_ context.Context 7213 header_ http.Header 7214} 7215 7216// List: Lists or searches files. 7217func (r *FilesService) List() *FilesListCall { 7218 c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7219 return c 7220} 7221 7222// Corpora sets the optional parameter "corpora": Groupings of files to 7223// which the query applies. Supported groupings are: 'user' (files 7224// created by, opened by, or shared directly with the user), 'drive' 7225// (files in the specified shared drive as indicated by the 'driveId'), 7226// 'domain' (files shared to the user's domain), and 'allDrives' (A 7227// combination of 'user' and 'drive' for all drives where the user is a 7228// member). When able, use 'user' or 'drive', instead of 'allDrives', 7229// for efficiency. 7230func (c *FilesListCall) Corpora(corpora string) *FilesListCall { 7231 c.urlParams_.Set("corpora", corpora) 7232 return c 7233} 7234 7235// Corpus sets the optional parameter "corpus": The source of files to 7236// list. Deprecated: use 'corpora' instead. 7237// 7238// Possible values: 7239// "domain" - Files shared to the user's domain. 7240// "user" - Files owned by or shared to the user. If a user has 7241// permissions on a Shared Drive, the files inside it won't be retrieved 7242// unless the user has created, opened, or shared the file. 7243func (c *FilesListCall) Corpus(corpus string) *FilesListCall { 7244 c.urlParams_.Set("corpus", corpus) 7245 return c 7246} 7247 7248// DriveId sets the optional parameter "driveId": ID of the shared drive 7249// to search. 7250func (c *FilesListCall) DriveId(driveId string) *FilesListCall { 7251 c.urlParams_.Set("driveId", driveId) 7252 return c 7253} 7254 7255// IncludeItemsFromAllDrives sets the optional parameter 7256// "includeItemsFromAllDrives": Whether both My Drive and shared drive 7257// items should be included in results. 7258func (c *FilesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *FilesListCall { 7259 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives)) 7260 return c 7261} 7262 7263// IncludePermissionsForView sets the optional parameter 7264// "includePermissionsForView": Specifies which additional view's 7265// permissions to include in the response. Only 'published' is 7266// supported. 7267func (c *FilesListCall) IncludePermissionsForView(includePermissionsForView string) *FilesListCall { 7268 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 7269 return c 7270} 7271 7272// IncludeTeamDriveItems sets the optional parameter 7273// "includeTeamDriveItems": Deprecated use includeItemsFromAllDrives 7274// instead. 7275func (c *FilesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *FilesListCall { 7276 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems)) 7277 return c 7278} 7279 7280// OrderBy sets the optional parameter "orderBy": A comma-separated list 7281// of sort keys. Valid keys are 'createdTime', 'folder', 7282// 'modifiedByMeTime', 'modifiedTime', 'name', 'name_natural', 7283// 'quotaBytesUsed', 'recency', 'sharedWithMeTime', 'starred', and 7284// 'viewedByMeTime'. Each key sorts ascending by default, but may be 7285// reversed with the 'desc' modifier. Example usage: 7286// ?orderBy=folder,modifiedTime desc,name. Please note that there is a 7287// current limitation for users with approximately one million files in 7288// which the requested sort order is ignored. 7289func (c *FilesListCall) OrderBy(orderBy string) *FilesListCall { 7290 c.urlParams_.Set("orderBy", orderBy) 7291 return c 7292} 7293 7294// PageSize sets the optional parameter "pageSize": The maximum number 7295// of files to return per page. Partial or empty result pages are 7296// possible even before the end of the files list has been reached. 7297func (c *FilesListCall) PageSize(pageSize int64) *FilesListCall { 7298 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7299 return c 7300} 7301 7302// PageToken sets the optional parameter "pageToken": The token for 7303// continuing a previous list request on the next page. This should be 7304// set to the value of 'nextPageToken' from the previous response. 7305func (c *FilesListCall) PageToken(pageToken string) *FilesListCall { 7306 c.urlParams_.Set("pageToken", pageToken) 7307 return c 7308} 7309 7310// Q sets the optional parameter "q": A query for filtering the file 7311// results. See the "Search for Files" guide for supported syntax. 7312func (c *FilesListCall) Q(q string) *FilesListCall { 7313 c.urlParams_.Set("q", q) 7314 return c 7315} 7316 7317// Spaces sets the optional parameter "spaces": A comma-separated list 7318// of spaces to query within the corpus. Supported values are 'drive', 7319// 'appDataFolder' and 'photos'. 7320func (c *FilesListCall) Spaces(spaces string) *FilesListCall { 7321 c.urlParams_.Set("spaces", spaces) 7322 return c 7323} 7324 7325// SupportsAllDrives sets the optional parameter "supportsAllDrives": 7326// Whether the requesting application supports both My Drives and shared 7327// drives. 7328func (c *FilesListCall) SupportsAllDrives(supportsAllDrives bool) *FilesListCall { 7329 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 7330 return c 7331} 7332 7333// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 7334// Deprecated use supportsAllDrives instead. 7335func (c *FilesListCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesListCall { 7336 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 7337 return c 7338} 7339 7340// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 7341// driveId instead. 7342func (c *FilesListCall) TeamDriveId(teamDriveId string) *FilesListCall { 7343 c.urlParams_.Set("teamDriveId", teamDriveId) 7344 return c 7345} 7346 7347// Fields allows partial responses to be retrieved. See 7348// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7349// for more information. 7350func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall { 7351 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7352 return c 7353} 7354 7355// IfNoneMatch sets the optional parameter which makes the operation 7356// fail if the object's ETag matches the given value. This is useful for 7357// getting updates only after the object has changed since the last 7358// request. Use googleapi.IsNotModified to check whether the response 7359// error from Do is the result of In-None-Match. 7360func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall { 7361 c.ifNoneMatch_ = entityTag 7362 return c 7363} 7364 7365// Context sets the context to be used in this call's Do method. Any 7366// pending HTTP request will be aborted if the provided context is 7367// canceled. 7368func (c *FilesListCall) Context(ctx context.Context) *FilesListCall { 7369 c.ctx_ = ctx 7370 return c 7371} 7372 7373// Header returns an http.Header that can be modified by the caller to 7374// add HTTP headers to the request. 7375func (c *FilesListCall) Header() http.Header { 7376 if c.header_ == nil { 7377 c.header_ = make(http.Header) 7378 } 7379 return c.header_ 7380} 7381 7382func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { 7383 reqHeaders := make(http.Header) 7384 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7385 for k, v := range c.header_ { 7386 reqHeaders[k] = v 7387 } 7388 reqHeaders.Set("User-Agent", c.s.userAgent()) 7389 if c.ifNoneMatch_ != "" { 7390 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7391 } 7392 var body io.Reader = nil 7393 c.urlParams_.Set("alt", alt) 7394 c.urlParams_.Set("prettyPrint", "false") 7395 urls := googleapi.ResolveRelative(c.s.BasePath, "files") 7396 urls += "?" + c.urlParams_.Encode() 7397 req, err := http.NewRequest("GET", urls, body) 7398 if err != nil { 7399 return nil, err 7400 } 7401 req.Header = reqHeaders 7402 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7403} 7404 7405// Do executes the "drive.files.list" call. 7406// Exactly one of *FileList or error will be non-nil. Any non-2xx status 7407// code is an error. Response headers are in either 7408// *FileList.ServerResponse.Header or (if a response was returned at 7409// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7410// to check whether the returned error was because 7411// http.StatusNotModified was returned. 7412func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) { 7413 gensupport.SetOptions(c.urlParams_, opts...) 7414 res, err := c.doRequest("json") 7415 if res != nil && res.StatusCode == http.StatusNotModified { 7416 if res.Body != nil { 7417 res.Body.Close() 7418 } 7419 return nil, &googleapi.Error{ 7420 Code: res.StatusCode, 7421 Header: res.Header, 7422 } 7423 } 7424 if err != nil { 7425 return nil, err 7426 } 7427 defer googleapi.CloseBody(res) 7428 if err := googleapi.CheckResponse(res); err != nil { 7429 return nil, err 7430 } 7431 ret := &FileList{ 7432 ServerResponse: googleapi.ServerResponse{ 7433 Header: res.Header, 7434 HTTPStatusCode: res.StatusCode, 7435 }, 7436 } 7437 target := &ret 7438 if err := gensupport.DecodeResponse(target, res); err != nil { 7439 return nil, err 7440 } 7441 return ret, nil 7442 // { 7443 // "description": "Lists or searches files.", 7444 // "httpMethod": "GET", 7445 // "id": "drive.files.list", 7446 // "parameters": { 7447 // "corpora": { 7448 // "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.", 7449 // "location": "query", 7450 // "type": "string" 7451 // }, 7452 // "corpus": { 7453 // "description": "The source of files to list. Deprecated: use 'corpora' instead.", 7454 // "enum": [ 7455 // "domain", 7456 // "user" 7457 // ], 7458 // "enumDescriptions": [ 7459 // "Files shared to the user's domain.", 7460 // "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." 7461 // ], 7462 // "location": "query", 7463 // "type": "string" 7464 // }, 7465 // "driveId": { 7466 // "description": "ID of the shared drive to search.", 7467 // "location": "query", 7468 // "type": "string" 7469 // }, 7470 // "includeItemsFromAllDrives": { 7471 // "default": "false", 7472 // "description": "Whether both My Drive and shared drive items should be included in results.", 7473 // "location": "query", 7474 // "type": "boolean" 7475 // }, 7476 // "includePermissionsForView": { 7477 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 7478 // "location": "query", 7479 // "type": "string" 7480 // }, 7481 // "includeTeamDriveItems": { 7482 // "default": "false", 7483 // "description": "Deprecated use includeItemsFromAllDrives instead.", 7484 // "location": "query", 7485 // "type": "boolean" 7486 // }, 7487 // "orderBy": { 7488 // "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.", 7489 // "location": "query", 7490 // "type": "string" 7491 // }, 7492 // "pageSize": { 7493 // "default": "100", 7494 // "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.", 7495 // "format": "int32", 7496 // "location": "query", 7497 // "maximum": "1000", 7498 // "minimum": "1", 7499 // "type": "integer" 7500 // }, 7501 // "pageToken": { 7502 // "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.", 7503 // "location": "query", 7504 // "type": "string" 7505 // }, 7506 // "q": { 7507 // "description": "A query for filtering the file results. See the \"Search for Files\" guide for supported syntax.", 7508 // "location": "query", 7509 // "type": "string" 7510 // }, 7511 // "spaces": { 7512 // "default": "drive", 7513 // "description": "A comma-separated list of spaces to query within the corpus. Supported values are 'drive', 'appDataFolder' and 'photos'.", 7514 // "location": "query", 7515 // "type": "string" 7516 // }, 7517 // "supportsAllDrives": { 7518 // "default": "false", 7519 // "description": "Whether the requesting application supports both My Drives and shared drives.", 7520 // "location": "query", 7521 // "type": "boolean" 7522 // }, 7523 // "supportsTeamDrives": { 7524 // "default": "false", 7525 // "description": "Deprecated use supportsAllDrives instead.", 7526 // "location": "query", 7527 // "type": "boolean" 7528 // }, 7529 // "teamDriveId": { 7530 // "description": "Deprecated use driveId instead.", 7531 // "location": "query", 7532 // "type": "string" 7533 // } 7534 // }, 7535 // "path": "files", 7536 // "response": { 7537 // "$ref": "FileList" 7538 // }, 7539 // "scopes": [ 7540 // "https://www.googleapis.com/auth/drive", 7541 // "https://www.googleapis.com/auth/drive.appdata", 7542 // "https://www.googleapis.com/auth/drive.file", 7543 // "https://www.googleapis.com/auth/drive.metadata", 7544 // "https://www.googleapis.com/auth/drive.metadata.readonly", 7545 // "https://www.googleapis.com/auth/drive.photos.readonly", 7546 // "https://www.googleapis.com/auth/drive.readonly" 7547 // ] 7548 // } 7549 7550} 7551 7552// Pages invokes f for each page of results. 7553// A non-nil error returned from f will halt the iteration. 7554// The provided context supersedes any context provided to the Context method. 7555func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error { 7556 c.ctx_ = ctx 7557 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 7558 for { 7559 x, err := c.Do() 7560 if err != nil { 7561 return err 7562 } 7563 if err := f(x); err != nil { 7564 return err 7565 } 7566 if x.NextPageToken == "" { 7567 return nil 7568 } 7569 c.PageToken(x.NextPageToken) 7570 } 7571} 7572 7573// method id "drive.files.update": 7574 7575type FilesUpdateCall struct { 7576 s *Service 7577 fileId string 7578 file *File 7579 urlParams_ gensupport.URLParams 7580 mediaInfo_ *gensupport.MediaInfo 7581 ctx_ context.Context 7582 header_ http.Header 7583} 7584 7585// Update: Updates a file's metadata and/or content. This method 7586// supports patch semantics. 7587// 7588// - fileId: The ID of the file. 7589func (r *FilesService) Update(fileId string, file *File) *FilesUpdateCall { 7590 c := &FilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7591 c.fileId = fileId 7592 c.file = file 7593 return c 7594} 7595 7596// AddParents sets the optional parameter "addParents": A 7597// comma-separated list of parent IDs to add. 7598func (c *FilesUpdateCall) AddParents(addParents string) *FilesUpdateCall { 7599 c.urlParams_.Set("addParents", addParents) 7600 return c 7601} 7602 7603// EnforceSingleParent sets the optional parameter 7604// "enforceSingleParent": Deprecated. Adding files to multiple folders 7605// is no longer supported. Use shortcuts instead. 7606func (c *FilesUpdateCall) EnforceSingleParent(enforceSingleParent bool) *FilesUpdateCall { 7607 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 7608 return c 7609} 7610 7611// IncludePermissionsForView sets the optional parameter 7612// "includePermissionsForView": Specifies which additional view's 7613// permissions to include in the response. Only 'published' is 7614// supported. 7615func (c *FilesUpdateCall) IncludePermissionsForView(includePermissionsForView string) *FilesUpdateCall { 7616 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 7617 return c 7618} 7619 7620// KeepRevisionForever sets the optional parameter 7621// "keepRevisionForever": Whether to set the 'keepForever' field in the 7622// new head revision. This is only applicable to files with binary 7623// content in Google Drive. Only 200 revisions for the file can be kept 7624// forever. If the limit is reached, try deleting pinned revisions. 7625func (c *FilesUpdateCall) KeepRevisionForever(keepRevisionForever bool) *FilesUpdateCall { 7626 c.urlParams_.Set("keepRevisionForever", fmt.Sprint(keepRevisionForever)) 7627 return c 7628} 7629 7630// OcrLanguage sets the optional parameter "ocrLanguage": A language 7631// hint for OCR processing during image import (ISO 639-1 code). 7632func (c *FilesUpdateCall) OcrLanguage(ocrLanguage string) *FilesUpdateCall { 7633 c.urlParams_.Set("ocrLanguage", ocrLanguage) 7634 return c 7635} 7636 7637// RemoveParents sets the optional parameter "removeParents": A 7638// comma-separated list of parent IDs to remove. 7639func (c *FilesUpdateCall) RemoveParents(removeParents string) *FilesUpdateCall { 7640 c.urlParams_.Set("removeParents", removeParents) 7641 return c 7642} 7643 7644// SupportsAllDrives sets the optional parameter "supportsAllDrives": 7645// Whether the requesting application supports both My Drives and shared 7646// drives. 7647func (c *FilesUpdateCall) SupportsAllDrives(supportsAllDrives bool) *FilesUpdateCall { 7648 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 7649 return c 7650} 7651 7652// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 7653// Deprecated use supportsAllDrives instead. 7654func (c *FilesUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesUpdateCall { 7655 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 7656 return c 7657} 7658 7659// UseContentAsIndexableText sets the optional parameter 7660// "useContentAsIndexableText": Whether to use the uploaded content as 7661// indexable text. 7662func (c *FilesUpdateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesUpdateCall { 7663 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText)) 7664 return c 7665} 7666 7667// Media specifies the media to upload in one or more chunks. The chunk 7668// size may be controlled by supplying a MediaOption generated by 7669// googleapi.ChunkSize. The chunk size defaults to 7670// googleapi.DefaultUploadChunkSize.The Content-Type header used in the 7671// upload request will be determined by sniffing the contents of r, 7672// unless a MediaOption generated by googleapi.ContentType is 7673// supplied. 7674// At most one of Media and ResumableMedia may be set. 7675func (c *FilesUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesUpdateCall { 7676 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) 7677 return c 7678} 7679 7680// ResumableMedia specifies the media to upload in chunks and can be 7681// canceled with ctx. 7682// 7683// Deprecated: use Media instead. 7684// 7685// At most one of Media and ResumableMedia may be set. mediaType 7686// identifies the MIME media type of the upload, such as "image/png". If 7687// mediaType is "", it will be auto-detected. The provided ctx will 7688// supersede any context previously provided to the Context method. 7689func (c *FilesUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesUpdateCall { 7690 c.ctx_ = ctx 7691 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) 7692 return c 7693} 7694 7695// ProgressUpdater provides a callback function that will be called 7696// after every chunk. It should be a low-latency function in order to 7697// not slow down the upload operation. This should only be called when 7698// using ResumableMedia (as opposed to Media). 7699func (c *FilesUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesUpdateCall { 7700 c.mediaInfo_.SetProgressUpdater(pu) 7701 return c 7702} 7703 7704// Fields allows partial responses to be retrieved. See 7705// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7706// for more information. 7707func (c *FilesUpdateCall) Fields(s ...googleapi.Field) *FilesUpdateCall { 7708 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7709 return c 7710} 7711 7712// Context sets the context to be used in this call's Do method. Any 7713// pending HTTP request will be aborted if the provided context is 7714// canceled. 7715// This context will supersede any context previously provided to the 7716// ResumableMedia method. 7717func (c *FilesUpdateCall) Context(ctx context.Context) *FilesUpdateCall { 7718 c.ctx_ = ctx 7719 return c 7720} 7721 7722// Header returns an http.Header that can be modified by the caller to 7723// add HTTP headers to the request. 7724func (c *FilesUpdateCall) Header() http.Header { 7725 if c.header_ == nil { 7726 c.header_ = make(http.Header) 7727 } 7728 return c.header_ 7729} 7730 7731func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) { 7732 reqHeaders := make(http.Header) 7733 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7734 for k, v := range c.header_ { 7735 reqHeaders[k] = v 7736 } 7737 reqHeaders.Set("User-Agent", c.s.userAgent()) 7738 var body io.Reader = nil 7739 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 7740 if err != nil { 7741 return nil, err 7742 } 7743 reqHeaders.Set("Content-Type", "application/json") 7744 c.urlParams_.Set("alt", alt) 7745 c.urlParams_.Set("prettyPrint", "false") 7746 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") 7747 if c.mediaInfo_ != nil { 7748 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v3/files/{fileId}") 7749 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) 7750 } 7751 if body == nil { 7752 body = new(bytes.Buffer) 7753 reqHeaders.Set("Content-Type", "application/json") 7754 } 7755 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) 7756 defer cleanup() 7757 urls += "?" + c.urlParams_.Encode() 7758 req, err := http.NewRequest("PATCH", urls, body) 7759 if err != nil { 7760 return nil, err 7761 } 7762 req.Header = reqHeaders 7763 req.GetBody = getBody 7764 googleapi.Expand(req.URL, map[string]string{ 7765 "fileId": c.fileId, 7766 }) 7767 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7768} 7769 7770// Do executes the "drive.files.update" call. 7771// Exactly one of *File or error will be non-nil. Any non-2xx status 7772// code is an error. Response headers are in either 7773// *File.ServerResponse.Header or (if a response was returned at all) in 7774// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7775// whether the returned error was because http.StatusNotModified was 7776// returned. 7777func (c *FilesUpdateCall) Do(opts ...googleapi.CallOption) (*File, error) { 7778 gensupport.SetOptions(c.urlParams_, opts...) 7779 res, err := c.doRequest("json") 7780 if res != nil && res.StatusCode == http.StatusNotModified { 7781 if res.Body != nil { 7782 res.Body.Close() 7783 } 7784 return nil, &googleapi.Error{ 7785 Code: res.StatusCode, 7786 Header: res.Header, 7787 } 7788 } 7789 if err != nil { 7790 return nil, err 7791 } 7792 defer googleapi.CloseBody(res) 7793 if err := googleapi.CheckResponse(res); err != nil { 7794 return nil, err 7795 } 7796 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) 7797 if rx != nil { 7798 rx.Client = c.s.client 7799 rx.UserAgent = c.s.userAgent() 7800 ctx := c.ctx_ 7801 if ctx == nil { 7802 ctx = context.TODO() 7803 } 7804 res, err = rx.Upload(ctx) 7805 if err != nil { 7806 return nil, err 7807 } 7808 defer res.Body.Close() 7809 if err := googleapi.CheckResponse(res); err != nil { 7810 return nil, err 7811 } 7812 } 7813 ret := &File{ 7814 ServerResponse: googleapi.ServerResponse{ 7815 Header: res.Header, 7816 HTTPStatusCode: res.StatusCode, 7817 }, 7818 } 7819 target := &ret 7820 if err := gensupport.DecodeResponse(target, res); err != nil { 7821 return nil, err 7822 } 7823 return ret, nil 7824 // { 7825 // "description": "Updates a file's metadata and/or content. This method supports patch semantics.", 7826 // "httpMethod": "PATCH", 7827 // "id": "drive.files.update", 7828 // "mediaUpload": { 7829 // "accept": [ 7830 // "*/*" 7831 // ], 7832 // "maxSize": "5120GB", 7833 // "protocols": { 7834 // "resumable": { 7835 // "multipart": true, 7836 // "path": "/resumable/upload/drive/v3/files/{fileId}" 7837 // }, 7838 // "simple": { 7839 // "multipart": true, 7840 // "path": "/upload/drive/v3/files/{fileId}" 7841 // } 7842 // } 7843 // }, 7844 // "parameterOrder": [ 7845 // "fileId" 7846 // ], 7847 // "parameters": { 7848 // "addParents": { 7849 // "description": "A comma-separated list of parent IDs to add.", 7850 // "location": "query", 7851 // "type": "string" 7852 // }, 7853 // "enforceSingleParent": { 7854 // "default": "false", 7855 // "description": "Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead.", 7856 // "location": "query", 7857 // "type": "boolean" 7858 // }, 7859 // "fileId": { 7860 // "description": "The ID of the file.", 7861 // "location": "path", 7862 // "required": true, 7863 // "type": "string" 7864 // }, 7865 // "includePermissionsForView": { 7866 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 7867 // "location": "query", 7868 // "type": "string" 7869 // }, 7870 // "keepRevisionForever": { 7871 // "default": "false", 7872 // "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.", 7873 // "location": "query", 7874 // "type": "boolean" 7875 // }, 7876 // "ocrLanguage": { 7877 // "description": "A language hint for OCR processing during image import (ISO 639-1 code).", 7878 // "location": "query", 7879 // "type": "string" 7880 // }, 7881 // "removeParents": { 7882 // "description": "A comma-separated list of parent IDs to remove.", 7883 // "location": "query", 7884 // "type": "string" 7885 // }, 7886 // "supportsAllDrives": { 7887 // "default": "false", 7888 // "description": "Whether the requesting application supports both My Drives and shared drives.", 7889 // "location": "query", 7890 // "type": "boolean" 7891 // }, 7892 // "supportsTeamDrives": { 7893 // "default": "false", 7894 // "description": "Deprecated use supportsAllDrives instead.", 7895 // "location": "query", 7896 // "type": "boolean" 7897 // }, 7898 // "useContentAsIndexableText": { 7899 // "default": "false", 7900 // "description": "Whether to use the uploaded content as indexable text.", 7901 // "location": "query", 7902 // "type": "boolean" 7903 // } 7904 // }, 7905 // "path": "files/{fileId}", 7906 // "request": { 7907 // "$ref": "File" 7908 // }, 7909 // "response": { 7910 // "$ref": "File" 7911 // }, 7912 // "scopes": [ 7913 // "https://www.googleapis.com/auth/drive", 7914 // "https://www.googleapis.com/auth/drive.appdata", 7915 // "https://www.googleapis.com/auth/drive.file", 7916 // "https://www.googleapis.com/auth/drive.metadata", 7917 // "https://www.googleapis.com/auth/drive.scripts" 7918 // ], 7919 // "supportsMediaUpload": true 7920 // } 7921 7922} 7923 7924// method id "drive.files.watch": 7925 7926type FilesWatchCall struct { 7927 s *Service 7928 fileId string 7929 channel *Channel 7930 urlParams_ gensupport.URLParams 7931 ctx_ context.Context 7932 header_ http.Header 7933} 7934 7935// Watch: Subscribes to changes to a file 7936// 7937// - fileId: The ID of the file. 7938func (r *FilesService) Watch(fileId string, channel *Channel) *FilesWatchCall { 7939 c := &FilesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7940 c.fileId = fileId 7941 c.channel = channel 7942 return c 7943} 7944 7945// AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": 7946// Whether the user is acknowledging the risk of downloading known 7947// malware or other abusive files. This is only applicable when 7948// alt=media. 7949func (c *FilesWatchCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesWatchCall { 7950 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse)) 7951 return c 7952} 7953 7954// IncludePermissionsForView sets the optional parameter 7955// "includePermissionsForView": Specifies which additional view's 7956// permissions to include in the response. Only 'published' is 7957// supported. 7958func (c *FilesWatchCall) IncludePermissionsForView(includePermissionsForView string) *FilesWatchCall { 7959 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 7960 return c 7961} 7962 7963// SupportsAllDrives sets the optional parameter "supportsAllDrives": 7964// Whether the requesting application supports both My Drives and shared 7965// drives. 7966func (c *FilesWatchCall) SupportsAllDrives(supportsAllDrives bool) *FilesWatchCall { 7967 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 7968 return c 7969} 7970 7971// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 7972// Deprecated use supportsAllDrives instead. 7973func (c *FilesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesWatchCall { 7974 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 7975 return c 7976} 7977 7978// Fields allows partial responses to be retrieved. See 7979// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7980// for more information. 7981func (c *FilesWatchCall) Fields(s ...googleapi.Field) *FilesWatchCall { 7982 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7983 return c 7984} 7985 7986// Context sets the context to be used in this call's Do and Download 7987// methods. Any pending HTTP request will be aborted if the provided 7988// context is canceled. 7989func (c *FilesWatchCall) Context(ctx context.Context) *FilesWatchCall { 7990 c.ctx_ = ctx 7991 return c 7992} 7993 7994// Header returns an http.Header that can be modified by the caller to 7995// add HTTP headers to the request. 7996func (c *FilesWatchCall) Header() http.Header { 7997 if c.header_ == nil { 7998 c.header_ = make(http.Header) 7999 } 8000 return c.header_ 8001} 8002 8003func (c *FilesWatchCall) doRequest(alt string) (*http.Response, error) { 8004 reqHeaders := make(http.Header) 8005 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8006 for k, v := range c.header_ { 8007 reqHeaders[k] = v 8008 } 8009 reqHeaders.Set("User-Agent", c.s.userAgent()) 8010 var body io.Reader = nil 8011 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 8012 if err != nil { 8013 return nil, err 8014 } 8015 reqHeaders.Set("Content-Type", "application/json") 8016 c.urlParams_.Set("alt", alt) 8017 c.urlParams_.Set("prettyPrint", "false") 8018 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/watch") 8019 urls += "?" + c.urlParams_.Encode() 8020 req, err := http.NewRequest("POST", urls, body) 8021 if err != nil { 8022 return nil, err 8023 } 8024 req.Header = reqHeaders 8025 googleapi.Expand(req.URL, map[string]string{ 8026 "fileId": c.fileId, 8027 }) 8028 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8029} 8030 8031// Download fetches the API endpoint's "media" value, instead of the normal 8032// API response value. If the returned error is nil, the Response is guaranteed to 8033// have a 2xx status code. Callers must close the Response.Body as usual. 8034func (c *FilesWatchCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 8035 gensupport.SetOptions(c.urlParams_, opts...) 8036 res, err := c.doRequest("media") 8037 if err != nil { 8038 return nil, err 8039 } 8040 if err := googleapi.CheckResponse(res); err != nil { 8041 res.Body.Close() 8042 return nil, err 8043 } 8044 return res, nil 8045} 8046 8047// Do executes the "drive.files.watch" call. 8048// Exactly one of *Channel or error will be non-nil. Any non-2xx status 8049// code is an error. Response headers are in either 8050// *Channel.ServerResponse.Header or (if a response was returned at all) 8051// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8052// check whether the returned error was because http.StatusNotModified 8053// was returned. 8054func (c *FilesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 8055 gensupport.SetOptions(c.urlParams_, opts...) 8056 res, err := c.doRequest("json") 8057 if res != nil && res.StatusCode == http.StatusNotModified { 8058 if res.Body != nil { 8059 res.Body.Close() 8060 } 8061 return nil, &googleapi.Error{ 8062 Code: res.StatusCode, 8063 Header: res.Header, 8064 } 8065 } 8066 if err != nil { 8067 return nil, err 8068 } 8069 defer googleapi.CloseBody(res) 8070 if err := googleapi.CheckResponse(res); err != nil { 8071 return nil, err 8072 } 8073 ret := &Channel{ 8074 ServerResponse: googleapi.ServerResponse{ 8075 Header: res.Header, 8076 HTTPStatusCode: res.StatusCode, 8077 }, 8078 } 8079 target := &ret 8080 if err := gensupport.DecodeResponse(target, res); err != nil { 8081 return nil, err 8082 } 8083 return ret, nil 8084 // { 8085 // "description": "Subscribes to changes to a file", 8086 // "httpMethod": "POST", 8087 // "id": "drive.files.watch", 8088 // "parameterOrder": [ 8089 // "fileId" 8090 // ], 8091 // "parameters": { 8092 // "acknowledgeAbuse": { 8093 // "default": "false", 8094 // "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.", 8095 // "location": "query", 8096 // "type": "boolean" 8097 // }, 8098 // "fileId": { 8099 // "description": "The ID of the file.", 8100 // "location": "path", 8101 // "required": true, 8102 // "type": "string" 8103 // }, 8104 // "includePermissionsForView": { 8105 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 8106 // "location": "query", 8107 // "type": "string" 8108 // }, 8109 // "supportsAllDrives": { 8110 // "default": "false", 8111 // "description": "Whether the requesting application supports both My Drives and shared drives.", 8112 // "location": "query", 8113 // "type": "boolean" 8114 // }, 8115 // "supportsTeamDrives": { 8116 // "default": "false", 8117 // "description": "Deprecated use supportsAllDrives instead.", 8118 // "location": "query", 8119 // "type": "boolean" 8120 // } 8121 // }, 8122 // "path": "files/{fileId}/watch", 8123 // "request": { 8124 // "$ref": "Channel", 8125 // "parameterName": "resource" 8126 // }, 8127 // "response": { 8128 // "$ref": "Channel" 8129 // }, 8130 // "scopes": [ 8131 // "https://www.googleapis.com/auth/drive", 8132 // "https://www.googleapis.com/auth/drive.appdata", 8133 // "https://www.googleapis.com/auth/drive.file", 8134 // "https://www.googleapis.com/auth/drive.metadata", 8135 // "https://www.googleapis.com/auth/drive.metadata.readonly", 8136 // "https://www.googleapis.com/auth/drive.photos.readonly", 8137 // "https://www.googleapis.com/auth/drive.readonly" 8138 // ], 8139 // "supportsMediaDownload": true, 8140 // "supportsSubscription": true, 8141 // "useMediaDownloadService": true 8142 // } 8143 8144} 8145 8146// method id "drive.permissions.create": 8147 8148type PermissionsCreateCall struct { 8149 s *Service 8150 fileId string 8151 permission *Permission 8152 urlParams_ gensupport.URLParams 8153 ctx_ context.Context 8154 header_ http.Header 8155} 8156 8157// Create: Creates a permission for a file or shared drive. 8158// 8159// - fileId: The ID of the file or shared drive. 8160func (r *PermissionsService) Create(fileId string, permission *Permission) *PermissionsCreateCall { 8161 c := &PermissionsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8162 c.fileId = fileId 8163 c.permission = permission 8164 return c 8165} 8166 8167// EmailMessage sets the optional parameter "emailMessage": A plain text 8168// custom message to include in the notification email. 8169func (c *PermissionsCreateCall) EmailMessage(emailMessage string) *PermissionsCreateCall { 8170 c.urlParams_.Set("emailMessage", emailMessage) 8171 return c 8172} 8173 8174// EnforceSingleParent sets the optional parameter 8175// "enforceSingleParent": Deprecated. See moveToNewOwnersRoot for 8176// details. 8177func (c *PermissionsCreateCall) EnforceSingleParent(enforceSingleParent bool) *PermissionsCreateCall { 8178 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 8179 return c 8180} 8181 8182// MoveToNewOwnersRoot sets the optional parameter 8183// "moveToNewOwnersRoot": This parameter will only take effect if the 8184// item is not in a shared drive and the request is attempting to 8185// transfer the ownership of the item. If set to true, the item will be 8186// moved to the new owner's My Drive root folder and all prior parents 8187// removed. If set to false, parents are not changed. 8188func (c *PermissionsCreateCall) MoveToNewOwnersRoot(moveToNewOwnersRoot bool) *PermissionsCreateCall { 8189 c.urlParams_.Set("moveToNewOwnersRoot", fmt.Sprint(moveToNewOwnersRoot)) 8190 return c 8191} 8192 8193// SendNotificationEmail sets the optional parameter 8194// "sendNotificationEmail": Whether to send a notification email when 8195// sharing to users or groups. This defaults to true for users and 8196// groups, and is not allowed for other requests. It must not be 8197// disabled for ownership transfers. 8198func (c *PermissionsCreateCall) SendNotificationEmail(sendNotificationEmail bool) *PermissionsCreateCall { 8199 c.urlParams_.Set("sendNotificationEmail", fmt.Sprint(sendNotificationEmail)) 8200 return c 8201} 8202 8203// SupportsAllDrives sets the optional parameter "supportsAllDrives": 8204// Whether the requesting application supports both My Drives and shared 8205// drives. 8206func (c *PermissionsCreateCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsCreateCall { 8207 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 8208 return c 8209} 8210 8211// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 8212// Deprecated use supportsAllDrives instead. 8213func (c *PermissionsCreateCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsCreateCall { 8214 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 8215 return c 8216} 8217 8218// TransferOwnership sets the optional parameter "transferOwnership": 8219// Whether to transfer ownership to the specified user and downgrade the 8220// current owner to a writer. This parameter is required as an 8221// acknowledgement of the side effect. 8222func (c *PermissionsCreateCall) TransferOwnership(transferOwnership bool) *PermissionsCreateCall { 8223 c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership)) 8224 return c 8225} 8226 8227// UseDomainAdminAccess sets the optional parameter 8228// "useDomainAdminAccess": Issue the request as a domain administrator; 8229// if set to true, then the requester will be granted access if the file 8230// ID parameter refers to a shared drive and the requester is an 8231// administrator of the domain to which the shared drive belongs. 8232func (c *PermissionsCreateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsCreateCall { 8233 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 8234 return c 8235} 8236 8237// Fields allows partial responses to be retrieved. See 8238// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8239// for more information. 8240func (c *PermissionsCreateCall) Fields(s ...googleapi.Field) *PermissionsCreateCall { 8241 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8242 return c 8243} 8244 8245// Context sets the context to be used in this call's Do method. Any 8246// pending HTTP request will be aborted if the provided context is 8247// canceled. 8248func (c *PermissionsCreateCall) Context(ctx context.Context) *PermissionsCreateCall { 8249 c.ctx_ = ctx 8250 return c 8251} 8252 8253// Header returns an http.Header that can be modified by the caller to 8254// add HTTP headers to the request. 8255func (c *PermissionsCreateCall) Header() http.Header { 8256 if c.header_ == nil { 8257 c.header_ = make(http.Header) 8258 } 8259 return c.header_ 8260} 8261 8262func (c *PermissionsCreateCall) doRequest(alt string) (*http.Response, error) { 8263 reqHeaders := make(http.Header) 8264 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8265 for k, v := range c.header_ { 8266 reqHeaders[k] = v 8267 } 8268 reqHeaders.Set("User-Agent", c.s.userAgent()) 8269 var body io.Reader = nil 8270 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) 8271 if err != nil { 8272 return nil, err 8273 } 8274 reqHeaders.Set("Content-Type", "application/json") 8275 c.urlParams_.Set("alt", alt) 8276 c.urlParams_.Set("prettyPrint", "false") 8277 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") 8278 urls += "?" + c.urlParams_.Encode() 8279 req, err := http.NewRequest("POST", urls, body) 8280 if err != nil { 8281 return nil, err 8282 } 8283 req.Header = reqHeaders 8284 googleapi.Expand(req.URL, map[string]string{ 8285 "fileId": c.fileId, 8286 }) 8287 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8288} 8289 8290// Do executes the "drive.permissions.create" call. 8291// Exactly one of *Permission or error will be non-nil. Any non-2xx 8292// status code is an error. Response headers are in either 8293// *Permission.ServerResponse.Header or (if a response was returned at 8294// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8295// to check whether the returned error was because 8296// http.StatusNotModified was returned. 8297func (c *PermissionsCreateCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 8298 gensupport.SetOptions(c.urlParams_, opts...) 8299 res, err := c.doRequest("json") 8300 if res != nil && res.StatusCode == http.StatusNotModified { 8301 if res.Body != nil { 8302 res.Body.Close() 8303 } 8304 return nil, &googleapi.Error{ 8305 Code: res.StatusCode, 8306 Header: res.Header, 8307 } 8308 } 8309 if err != nil { 8310 return nil, err 8311 } 8312 defer googleapi.CloseBody(res) 8313 if err := googleapi.CheckResponse(res); err != nil { 8314 return nil, err 8315 } 8316 ret := &Permission{ 8317 ServerResponse: googleapi.ServerResponse{ 8318 Header: res.Header, 8319 HTTPStatusCode: res.StatusCode, 8320 }, 8321 } 8322 target := &ret 8323 if err := gensupport.DecodeResponse(target, res); err != nil { 8324 return nil, err 8325 } 8326 return ret, nil 8327 // { 8328 // "description": "Creates a permission for a file or shared drive.", 8329 // "httpMethod": "POST", 8330 // "id": "drive.permissions.create", 8331 // "parameterOrder": [ 8332 // "fileId" 8333 // ], 8334 // "parameters": { 8335 // "emailMessage": { 8336 // "description": "A plain text custom message to include in the notification email.", 8337 // "location": "query", 8338 // "type": "string" 8339 // }, 8340 // "enforceSingleParent": { 8341 // "default": "false", 8342 // "description": "Deprecated. See moveToNewOwnersRoot for details.", 8343 // "location": "query", 8344 // "type": "boolean" 8345 // }, 8346 // "fileId": { 8347 // "description": "The ID of the file or shared drive.", 8348 // "location": "path", 8349 // "required": true, 8350 // "type": "string" 8351 // }, 8352 // "moveToNewOwnersRoot": { 8353 // "default": "false", 8354 // "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.", 8355 // "location": "query", 8356 // "type": "boolean" 8357 // }, 8358 // "sendNotificationEmail": { 8359 // "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.", 8360 // "location": "query", 8361 // "type": "boolean" 8362 // }, 8363 // "supportsAllDrives": { 8364 // "default": "false", 8365 // "description": "Whether the requesting application supports both My Drives and shared drives.", 8366 // "location": "query", 8367 // "type": "boolean" 8368 // }, 8369 // "supportsTeamDrives": { 8370 // "default": "false", 8371 // "description": "Deprecated use supportsAllDrives instead.", 8372 // "location": "query", 8373 // "type": "boolean" 8374 // }, 8375 // "transferOwnership": { 8376 // "default": "false", 8377 // "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.", 8378 // "location": "query", 8379 // "type": "boolean" 8380 // }, 8381 // "useDomainAdminAccess": { 8382 // "default": "false", 8383 // "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.", 8384 // "location": "query", 8385 // "type": "boolean" 8386 // } 8387 // }, 8388 // "path": "files/{fileId}/permissions", 8389 // "request": { 8390 // "$ref": "Permission" 8391 // }, 8392 // "response": { 8393 // "$ref": "Permission" 8394 // }, 8395 // "scopes": [ 8396 // "https://www.googleapis.com/auth/drive", 8397 // "https://www.googleapis.com/auth/drive.file" 8398 // ] 8399 // } 8400 8401} 8402 8403// method id "drive.permissions.delete": 8404 8405type PermissionsDeleteCall struct { 8406 s *Service 8407 fileId string 8408 permissionId string 8409 urlParams_ gensupport.URLParams 8410 ctx_ context.Context 8411 header_ http.Header 8412} 8413 8414// Delete: Deletes a permission. 8415// 8416// - fileId: The ID of the file or shared drive. 8417// - permissionId: The ID of the permission. 8418func (r *PermissionsService) Delete(fileId string, permissionId string) *PermissionsDeleteCall { 8419 c := &PermissionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8420 c.fileId = fileId 8421 c.permissionId = permissionId 8422 return c 8423} 8424 8425// SupportsAllDrives sets the optional parameter "supportsAllDrives": 8426// Whether the requesting application supports both My Drives and shared 8427// drives. 8428func (c *PermissionsDeleteCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsDeleteCall { 8429 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 8430 return c 8431} 8432 8433// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 8434// Deprecated use supportsAllDrives instead. 8435func (c *PermissionsDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsDeleteCall { 8436 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 8437 return c 8438} 8439 8440// UseDomainAdminAccess sets the optional parameter 8441// "useDomainAdminAccess": Issue the request as a domain administrator; 8442// if set to true, then the requester will be granted access if the file 8443// ID parameter refers to a shared drive and the requester is an 8444// administrator of the domain to which the shared drive belongs. 8445func (c *PermissionsDeleteCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsDeleteCall { 8446 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 8447 return c 8448} 8449 8450// Fields allows partial responses to be retrieved. See 8451// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8452// for more information. 8453func (c *PermissionsDeleteCall) Fields(s ...googleapi.Field) *PermissionsDeleteCall { 8454 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8455 return c 8456} 8457 8458// Context sets the context to be used in this call's Do method. Any 8459// pending HTTP request will be aborted if the provided context is 8460// canceled. 8461func (c *PermissionsDeleteCall) Context(ctx context.Context) *PermissionsDeleteCall { 8462 c.ctx_ = ctx 8463 return c 8464} 8465 8466// Header returns an http.Header that can be modified by the caller to 8467// add HTTP headers to the request. 8468func (c *PermissionsDeleteCall) Header() http.Header { 8469 if c.header_ == nil { 8470 c.header_ = make(http.Header) 8471 } 8472 return c.header_ 8473} 8474 8475func (c *PermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { 8476 reqHeaders := make(http.Header) 8477 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8478 for k, v := range c.header_ { 8479 reqHeaders[k] = v 8480 } 8481 reqHeaders.Set("User-Agent", c.s.userAgent()) 8482 var body io.Reader = nil 8483 c.urlParams_.Set("alt", alt) 8484 c.urlParams_.Set("prettyPrint", "false") 8485 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") 8486 urls += "?" + c.urlParams_.Encode() 8487 req, err := http.NewRequest("DELETE", urls, body) 8488 if err != nil { 8489 return nil, err 8490 } 8491 req.Header = reqHeaders 8492 googleapi.Expand(req.URL, map[string]string{ 8493 "fileId": c.fileId, 8494 "permissionId": c.permissionId, 8495 }) 8496 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8497} 8498 8499// Do executes the "drive.permissions.delete" call. 8500func (c *PermissionsDeleteCall) Do(opts ...googleapi.CallOption) error { 8501 gensupport.SetOptions(c.urlParams_, opts...) 8502 res, err := c.doRequest("json") 8503 if err != nil { 8504 return err 8505 } 8506 defer googleapi.CloseBody(res) 8507 if err := googleapi.CheckResponse(res); err != nil { 8508 return err 8509 } 8510 return nil 8511 // { 8512 // "description": "Deletes a permission.", 8513 // "httpMethod": "DELETE", 8514 // "id": "drive.permissions.delete", 8515 // "parameterOrder": [ 8516 // "fileId", 8517 // "permissionId" 8518 // ], 8519 // "parameters": { 8520 // "fileId": { 8521 // "description": "The ID of the file or shared drive.", 8522 // "location": "path", 8523 // "required": true, 8524 // "type": "string" 8525 // }, 8526 // "permissionId": { 8527 // "description": "The ID of the permission.", 8528 // "location": "path", 8529 // "required": true, 8530 // "type": "string" 8531 // }, 8532 // "supportsAllDrives": { 8533 // "default": "false", 8534 // "description": "Whether the requesting application supports both My Drives and shared drives.", 8535 // "location": "query", 8536 // "type": "boolean" 8537 // }, 8538 // "supportsTeamDrives": { 8539 // "default": "false", 8540 // "description": "Deprecated use supportsAllDrives instead.", 8541 // "location": "query", 8542 // "type": "boolean" 8543 // }, 8544 // "useDomainAdminAccess": { 8545 // "default": "false", 8546 // "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.", 8547 // "location": "query", 8548 // "type": "boolean" 8549 // } 8550 // }, 8551 // "path": "files/{fileId}/permissions/{permissionId}", 8552 // "scopes": [ 8553 // "https://www.googleapis.com/auth/drive", 8554 // "https://www.googleapis.com/auth/drive.file" 8555 // ] 8556 // } 8557 8558} 8559 8560// method id "drive.permissions.get": 8561 8562type PermissionsGetCall struct { 8563 s *Service 8564 fileId string 8565 permissionId string 8566 urlParams_ gensupport.URLParams 8567 ifNoneMatch_ string 8568 ctx_ context.Context 8569 header_ http.Header 8570} 8571 8572// Get: Gets a permission by ID. 8573// 8574// - fileId: The ID of the file. 8575// - permissionId: The ID of the permission. 8576func (r *PermissionsService) Get(fileId string, permissionId string) *PermissionsGetCall { 8577 c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8578 c.fileId = fileId 8579 c.permissionId = permissionId 8580 return c 8581} 8582 8583// SupportsAllDrives sets the optional parameter "supportsAllDrives": 8584// Whether the requesting application supports both My Drives and shared 8585// drives. 8586func (c *PermissionsGetCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsGetCall { 8587 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 8588 return c 8589} 8590 8591// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 8592// Deprecated use supportsAllDrives instead. 8593func (c *PermissionsGetCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsGetCall { 8594 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 8595 return c 8596} 8597 8598// UseDomainAdminAccess sets the optional parameter 8599// "useDomainAdminAccess": Issue the request as a domain administrator; 8600// if set to true, then the requester will be granted access if the file 8601// ID parameter refers to a shared drive and the requester is an 8602// administrator of the domain to which the shared drive belongs. 8603func (c *PermissionsGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsGetCall { 8604 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 8605 return c 8606} 8607 8608// Fields allows partial responses to be retrieved. See 8609// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8610// for more information. 8611func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall { 8612 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8613 return c 8614} 8615 8616// IfNoneMatch sets the optional parameter which makes the operation 8617// fail if the object's ETag matches the given value. This is useful for 8618// getting updates only after the object has changed since the last 8619// request. Use googleapi.IsNotModified to check whether the response 8620// error from Do is the result of In-None-Match. 8621func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall { 8622 c.ifNoneMatch_ = entityTag 8623 return c 8624} 8625 8626// Context sets the context to be used in this call's Do method. Any 8627// pending HTTP request will be aborted if the provided context is 8628// canceled. 8629func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall { 8630 c.ctx_ = ctx 8631 return c 8632} 8633 8634// Header returns an http.Header that can be modified by the caller to 8635// add HTTP headers to the request. 8636func (c *PermissionsGetCall) Header() http.Header { 8637 if c.header_ == nil { 8638 c.header_ = make(http.Header) 8639 } 8640 return c.header_ 8641} 8642 8643func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { 8644 reqHeaders := make(http.Header) 8645 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8646 for k, v := range c.header_ { 8647 reqHeaders[k] = v 8648 } 8649 reqHeaders.Set("User-Agent", c.s.userAgent()) 8650 if c.ifNoneMatch_ != "" { 8651 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8652 } 8653 var body io.Reader = nil 8654 c.urlParams_.Set("alt", alt) 8655 c.urlParams_.Set("prettyPrint", "false") 8656 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") 8657 urls += "?" + c.urlParams_.Encode() 8658 req, err := http.NewRequest("GET", urls, body) 8659 if err != nil { 8660 return nil, err 8661 } 8662 req.Header = reqHeaders 8663 googleapi.Expand(req.URL, map[string]string{ 8664 "fileId": c.fileId, 8665 "permissionId": c.permissionId, 8666 }) 8667 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8668} 8669 8670// Do executes the "drive.permissions.get" call. 8671// Exactly one of *Permission or error will be non-nil. Any non-2xx 8672// status code is an error. Response headers are in either 8673// *Permission.ServerResponse.Header or (if a response was returned at 8674// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8675// to check whether the returned error was because 8676// http.StatusNotModified was returned. 8677func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 8678 gensupport.SetOptions(c.urlParams_, opts...) 8679 res, err := c.doRequest("json") 8680 if res != nil && res.StatusCode == http.StatusNotModified { 8681 if res.Body != nil { 8682 res.Body.Close() 8683 } 8684 return nil, &googleapi.Error{ 8685 Code: res.StatusCode, 8686 Header: res.Header, 8687 } 8688 } 8689 if err != nil { 8690 return nil, err 8691 } 8692 defer googleapi.CloseBody(res) 8693 if err := googleapi.CheckResponse(res); err != nil { 8694 return nil, err 8695 } 8696 ret := &Permission{ 8697 ServerResponse: googleapi.ServerResponse{ 8698 Header: res.Header, 8699 HTTPStatusCode: res.StatusCode, 8700 }, 8701 } 8702 target := &ret 8703 if err := gensupport.DecodeResponse(target, res); err != nil { 8704 return nil, err 8705 } 8706 return ret, nil 8707 // { 8708 // "description": "Gets a permission by ID.", 8709 // "httpMethod": "GET", 8710 // "id": "drive.permissions.get", 8711 // "parameterOrder": [ 8712 // "fileId", 8713 // "permissionId" 8714 // ], 8715 // "parameters": { 8716 // "fileId": { 8717 // "description": "The ID of the file.", 8718 // "location": "path", 8719 // "required": true, 8720 // "type": "string" 8721 // }, 8722 // "permissionId": { 8723 // "description": "The ID of the permission.", 8724 // "location": "path", 8725 // "required": true, 8726 // "type": "string" 8727 // }, 8728 // "supportsAllDrives": { 8729 // "default": "false", 8730 // "description": "Whether the requesting application supports both My Drives and shared drives.", 8731 // "location": "query", 8732 // "type": "boolean" 8733 // }, 8734 // "supportsTeamDrives": { 8735 // "default": "false", 8736 // "description": "Deprecated use supportsAllDrives instead.", 8737 // "location": "query", 8738 // "type": "boolean" 8739 // }, 8740 // "useDomainAdminAccess": { 8741 // "default": "false", 8742 // "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.", 8743 // "location": "query", 8744 // "type": "boolean" 8745 // } 8746 // }, 8747 // "path": "files/{fileId}/permissions/{permissionId}", 8748 // "response": { 8749 // "$ref": "Permission" 8750 // }, 8751 // "scopes": [ 8752 // "https://www.googleapis.com/auth/drive", 8753 // "https://www.googleapis.com/auth/drive.file", 8754 // "https://www.googleapis.com/auth/drive.metadata", 8755 // "https://www.googleapis.com/auth/drive.metadata.readonly", 8756 // "https://www.googleapis.com/auth/drive.photos.readonly", 8757 // "https://www.googleapis.com/auth/drive.readonly" 8758 // ] 8759 // } 8760 8761} 8762 8763// method id "drive.permissions.list": 8764 8765type PermissionsListCall struct { 8766 s *Service 8767 fileId string 8768 urlParams_ gensupport.URLParams 8769 ifNoneMatch_ string 8770 ctx_ context.Context 8771 header_ http.Header 8772} 8773 8774// List: Lists a file's or shared drive's permissions. 8775// 8776// - fileId: The ID of the file or shared drive. 8777func (r *PermissionsService) List(fileId string) *PermissionsListCall { 8778 c := &PermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8779 c.fileId = fileId 8780 return c 8781} 8782 8783// IncludePermissionsForView sets the optional parameter 8784// "includePermissionsForView": Specifies which additional view's 8785// permissions to include in the response. Only 'published' is 8786// supported. 8787func (c *PermissionsListCall) IncludePermissionsForView(includePermissionsForView string) *PermissionsListCall { 8788 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 8789 return c 8790} 8791 8792// PageSize sets the optional parameter "pageSize": The maximum number 8793// of permissions to return per page. When not set for files in a shared 8794// drive, at most 100 results will be returned. When not set for files 8795// that are not in a shared drive, the entire list will be returned. 8796func (c *PermissionsListCall) PageSize(pageSize int64) *PermissionsListCall { 8797 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8798 return c 8799} 8800 8801// PageToken sets the optional parameter "pageToken": The token for 8802// continuing a previous list request on the next page. This should be 8803// set to the value of 'nextPageToken' from the previous response. 8804func (c *PermissionsListCall) PageToken(pageToken string) *PermissionsListCall { 8805 c.urlParams_.Set("pageToken", pageToken) 8806 return c 8807} 8808 8809// SupportsAllDrives sets the optional parameter "supportsAllDrives": 8810// Whether the requesting application supports both My Drives and shared 8811// drives. 8812func (c *PermissionsListCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsListCall { 8813 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 8814 return c 8815} 8816 8817// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 8818// Deprecated use supportsAllDrives instead. 8819func (c *PermissionsListCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsListCall { 8820 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 8821 return c 8822} 8823 8824// UseDomainAdminAccess sets the optional parameter 8825// "useDomainAdminAccess": Issue the request as a domain administrator; 8826// if set to true, then the requester will be granted access if the file 8827// ID parameter refers to a shared drive and the requester is an 8828// administrator of the domain to which the shared drive belongs. 8829func (c *PermissionsListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsListCall { 8830 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 8831 return c 8832} 8833 8834// Fields allows partial responses to be retrieved. See 8835// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8836// for more information. 8837func (c *PermissionsListCall) Fields(s ...googleapi.Field) *PermissionsListCall { 8838 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8839 return c 8840} 8841 8842// IfNoneMatch sets the optional parameter which makes the operation 8843// fail if the object's ETag matches the given value. This is useful for 8844// getting updates only after the object has changed since the last 8845// request. Use googleapi.IsNotModified to check whether the response 8846// error from Do is the result of In-None-Match. 8847func (c *PermissionsListCall) IfNoneMatch(entityTag string) *PermissionsListCall { 8848 c.ifNoneMatch_ = entityTag 8849 return c 8850} 8851 8852// Context sets the context to be used in this call's Do method. Any 8853// pending HTTP request will be aborted if the provided context is 8854// canceled. 8855func (c *PermissionsListCall) Context(ctx context.Context) *PermissionsListCall { 8856 c.ctx_ = ctx 8857 return c 8858} 8859 8860// Header returns an http.Header that can be modified by the caller to 8861// add HTTP headers to the request. 8862func (c *PermissionsListCall) Header() http.Header { 8863 if c.header_ == nil { 8864 c.header_ = make(http.Header) 8865 } 8866 return c.header_ 8867} 8868 8869func (c *PermissionsListCall) doRequest(alt string) (*http.Response, error) { 8870 reqHeaders := make(http.Header) 8871 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8872 for k, v := range c.header_ { 8873 reqHeaders[k] = v 8874 } 8875 reqHeaders.Set("User-Agent", c.s.userAgent()) 8876 if c.ifNoneMatch_ != "" { 8877 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8878 } 8879 var body io.Reader = nil 8880 c.urlParams_.Set("alt", alt) 8881 c.urlParams_.Set("prettyPrint", "false") 8882 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") 8883 urls += "?" + c.urlParams_.Encode() 8884 req, err := http.NewRequest("GET", urls, body) 8885 if err != nil { 8886 return nil, err 8887 } 8888 req.Header = reqHeaders 8889 googleapi.Expand(req.URL, map[string]string{ 8890 "fileId": c.fileId, 8891 }) 8892 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8893} 8894 8895// Do executes the "drive.permissions.list" call. 8896// Exactly one of *PermissionList or error will be non-nil. Any non-2xx 8897// status code is an error. Response headers are in either 8898// *PermissionList.ServerResponse.Header or (if a response was returned 8899// at all) in error.(*googleapi.Error).Header. Use 8900// googleapi.IsNotModified to check whether the returned error was 8901// because http.StatusNotModified was returned. 8902func (c *PermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionList, error) { 8903 gensupport.SetOptions(c.urlParams_, opts...) 8904 res, err := c.doRequest("json") 8905 if res != nil && res.StatusCode == http.StatusNotModified { 8906 if res.Body != nil { 8907 res.Body.Close() 8908 } 8909 return nil, &googleapi.Error{ 8910 Code: res.StatusCode, 8911 Header: res.Header, 8912 } 8913 } 8914 if err != nil { 8915 return nil, err 8916 } 8917 defer googleapi.CloseBody(res) 8918 if err := googleapi.CheckResponse(res); err != nil { 8919 return nil, err 8920 } 8921 ret := &PermissionList{ 8922 ServerResponse: googleapi.ServerResponse{ 8923 Header: res.Header, 8924 HTTPStatusCode: res.StatusCode, 8925 }, 8926 } 8927 target := &ret 8928 if err := gensupport.DecodeResponse(target, res); err != nil { 8929 return nil, err 8930 } 8931 return ret, nil 8932 // { 8933 // "description": "Lists a file's or shared drive's permissions.", 8934 // "httpMethod": "GET", 8935 // "id": "drive.permissions.list", 8936 // "parameterOrder": [ 8937 // "fileId" 8938 // ], 8939 // "parameters": { 8940 // "fileId": { 8941 // "description": "The ID of the file or shared drive.", 8942 // "location": "path", 8943 // "required": true, 8944 // "type": "string" 8945 // }, 8946 // "includePermissionsForView": { 8947 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 8948 // "location": "query", 8949 // "type": "string" 8950 // }, 8951 // "pageSize": { 8952 // "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.", 8953 // "format": "int32", 8954 // "location": "query", 8955 // "maximum": "100", 8956 // "minimum": "1", 8957 // "type": "integer" 8958 // }, 8959 // "pageToken": { 8960 // "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.", 8961 // "location": "query", 8962 // "type": "string" 8963 // }, 8964 // "supportsAllDrives": { 8965 // "default": "false", 8966 // "description": "Whether the requesting application supports both My Drives and shared drives.", 8967 // "location": "query", 8968 // "type": "boolean" 8969 // }, 8970 // "supportsTeamDrives": { 8971 // "default": "false", 8972 // "description": "Deprecated use supportsAllDrives instead.", 8973 // "location": "query", 8974 // "type": "boolean" 8975 // }, 8976 // "useDomainAdminAccess": { 8977 // "default": "false", 8978 // "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.", 8979 // "location": "query", 8980 // "type": "boolean" 8981 // } 8982 // }, 8983 // "path": "files/{fileId}/permissions", 8984 // "response": { 8985 // "$ref": "PermissionList" 8986 // }, 8987 // "scopes": [ 8988 // "https://www.googleapis.com/auth/drive", 8989 // "https://www.googleapis.com/auth/drive.file", 8990 // "https://www.googleapis.com/auth/drive.metadata", 8991 // "https://www.googleapis.com/auth/drive.metadata.readonly", 8992 // "https://www.googleapis.com/auth/drive.photos.readonly", 8993 // "https://www.googleapis.com/auth/drive.readonly" 8994 // ] 8995 // } 8996 8997} 8998 8999// Pages invokes f for each page of results. 9000// A non-nil error returned from f will halt the iteration. 9001// The provided context supersedes any context provided to the Context method. 9002func (c *PermissionsListCall) Pages(ctx context.Context, f func(*PermissionList) error) error { 9003 c.ctx_ = ctx 9004 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9005 for { 9006 x, err := c.Do() 9007 if err != nil { 9008 return err 9009 } 9010 if err := f(x); err != nil { 9011 return err 9012 } 9013 if x.NextPageToken == "" { 9014 return nil 9015 } 9016 c.PageToken(x.NextPageToken) 9017 } 9018} 9019 9020// method id "drive.permissions.update": 9021 9022type PermissionsUpdateCall struct { 9023 s *Service 9024 fileId string 9025 permissionId string 9026 permission *Permission 9027 urlParams_ gensupport.URLParams 9028 ctx_ context.Context 9029 header_ http.Header 9030} 9031 9032// Update: Updates a permission with patch semantics. 9033// 9034// - fileId: The ID of the file or shared drive. 9035// - permissionId: The ID of the permission. 9036func (r *PermissionsService) Update(fileId string, permissionId string, permission *Permission) *PermissionsUpdateCall { 9037 c := &PermissionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9038 c.fileId = fileId 9039 c.permissionId = permissionId 9040 c.permission = permission 9041 return c 9042} 9043 9044// RemoveExpiration sets the optional parameter "removeExpiration": 9045// Whether to remove the expiration date. 9046func (c *PermissionsUpdateCall) RemoveExpiration(removeExpiration bool) *PermissionsUpdateCall { 9047 c.urlParams_.Set("removeExpiration", fmt.Sprint(removeExpiration)) 9048 return c 9049} 9050 9051// SupportsAllDrives sets the optional parameter "supportsAllDrives": 9052// Whether the requesting application supports both My Drives and shared 9053// drives. 9054func (c *PermissionsUpdateCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsUpdateCall { 9055 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 9056 return c 9057} 9058 9059// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 9060// Deprecated use supportsAllDrives instead. 9061func (c *PermissionsUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsUpdateCall { 9062 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 9063 return c 9064} 9065 9066// TransferOwnership sets the optional parameter "transferOwnership": 9067// Whether to transfer ownership to the specified user and downgrade the 9068// current owner to a writer. This parameter is required as an 9069// acknowledgement of the side effect. 9070func (c *PermissionsUpdateCall) TransferOwnership(transferOwnership bool) *PermissionsUpdateCall { 9071 c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership)) 9072 return c 9073} 9074 9075// UseDomainAdminAccess sets the optional parameter 9076// "useDomainAdminAccess": Issue the request as a domain administrator; 9077// if set to true, then the requester will be granted access if the file 9078// ID parameter refers to a shared drive and the requester is an 9079// administrator of the domain to which the shared drive belongs. 9080func (c *PermissionsUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsUpdateCall { 9081 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 9082 return c 9083} 9084 9085// Fields allows partial responses to be retrieved. See 9086// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9087// for more information. 9088func (c *PermissionsUpdateCall) Fields(s ...googleapi.Field) *PermissionsUpdateCall { 9089 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9090 return c 9091} 9092 9093// Context sets the context to be used in this call's Do method. Any 9094// pending HTTP request will be aborted if the provided context is 9095// canceled. 9096func (c *PermissionsUpdateCall) Context(ctx context.Context) *PermissionsUpdateCall { 9097 c.ctx_ = ctx 9098 return c 9099} 9100 9101// Header returns an http.Header that can be modified by the caller to 9102// add HTTP headers to the request. 9103func (c *PermissionsUpdateCall) Header() http.Header { 9104 if c.header_ == nil { 9105 c.header_ = make(http.Header) 9106 } 9107 return c.header_ 9108} 9109 9110func (c *PermissionsUpdateCall) doRequest(alt string) (*http.Response, error) { 9111 reqHeaders := make(http.Header) 9112 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9113 for k, v := range c.header_ { 9114 reqHeaders[k] = v 9115 } 9116 reqHeaders.Set("User-Agent", c.s.userAgent()) 9117 var body io.Reader = nil 9118 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) 9119 if err != nil { 9120 return nil, err 9121 } 9122 reqHeaders.Set("Content-Type", "application/json") 9123 c.urlParams_.Set("alt", alt) 9124 c.urlParams_.Set("prettyPrint", "false") 9125 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") 9126 urls += "?" + c.urlParams_.Encode() 9127 req, err := http.NewRequest("PATCH", urls, body) 9128 if err != nil { 9129 return nil, err 9130 } 9131 req.Header = reqHeaders 9132 googleapi.Expand(req.URL, map[string]string{ 9133 "fileId": c.fileId, 9134 "permissionId": c.permissionId, 9135 }) 9136 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9137} 9138 9139// Do executes the "drive.permissions.update" call. 9140// Exactly one of *Permission or error will be non-nil. Any non-2xx 9141// status code is an error. Response headers are in either 9142// *Permission.ServerResponse.Header or (if a response was returned at 9143// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9144// to check whether the returned error was because 9145// http.StatusNotModified was returned. 9146func (c *PermissionsUpdateCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 9147 gensupport.SetOptions(c.urlParams_, opts...) 9148 res, err := c.doRequest("json") 9149 if res != nil && res.StatusCode == http.StatusNotModified { 9150 if res.Body != nil { 9151 res.Body.Close() 9152 } 9153 return nil, &googleapi.Error{ 9154 Code: res.StatusCode, 9155 Header: res.Header, 9156 } 9157 } 9158 if err != nil { 9159 return nil, err 9160 } 9161 defer googleapi.CloseBody(res) 9162 if err := googleapi.CheckResponse(res); err != nil { 9163 return nil, err 9164 } 9165 ret := &Permission{ 9166 ServerResponse: googleapi.ServerResponse{ 9167 Header: res.Header, 9168 HTTPStatusCode: res.StatusCode, 9169 }, 9170 } 9171 target := &ret 9172 if err := gensupport.DecodeResponse(target, res); err != nil { 9173 return nil, err 9174 } 9175 return ret, nil 9176 // { 9177 // "description": "Updates a permission with patch semantics.", 9178 // "httpMethod": "PATCH", 9179 // "id": "drive.permissions.update", 9180 // "parameterOrder": [ 9181 // "fileId", 9182 // "permissionId" 9183 // ], 9184 // "parameters": { 9185 // "fileId": { 9186 // "description": "The ID of the file or shared drive.", 9187 // "location": "path", 9188 // "required": true, 9189 // "type": "string" 9190 // }, 9191 // "permissionId": { 9192 // "description": "The ID of the permission.", 9193 // "location": "path", 9194 // "required": true, 9195 // "type": "string" 9196 // }, 9197 // "removeExpiration": { 9198 // "default": "false", 9199 // "description": "Whether to remove the expiration date.", 9200 // "location": "query", 9201 // "type": "boolean" 9202 // }, 9203 // "supportsAllDrives": { 9204 // "default": "false", 9205 // "description": "Whether the requesting application supports both My Drives and shared drives.", 9206 // "location": "query", 9207 // "type": "boolean" 9208 // }, 9209 // "supportsTeamDrives": { 9210 // "default": "false", 9211 // "description": "Deprecated use supportsAllDrives instead.", 9212 // "location": "query", 9213 // "type": "boolean" 9214 // }, 9215 // "transferOwnership": { 9216 // "default": "false", 9217 // "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.", 9218 // "location": "query", 9219 // "type": "boolean" 9220 // }, 9221 // "useDomainAdminAccess": { 9222 // "default": "false", 9223 // "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.", 9224 // "location": "query", 9225 // "type": "boolean" 9226 // } 9227 // }, 9228 // "path": "files/{fileId}/permissions/{permissionId}", 9229 // "request": { 9230 // "$ref": "Permission" 9231 // }, 9232 // "response": { 9233 // "$ref": "Permission" 9234 // }, 9235 // "scopes": [ 9236 // "https://www.googleapis.com/auth/drive", 9237 // "https://www.googleapis.com/auth/drive.file" 9238 // ] 9239 // } 9240 9241} 9242 9243// method id "drive.replies.create": 9244 9245type RepliesCreateCall struct { 9246 s *Service 9247 fileId string 9248 commentId string 9249 reply *Reply 9250 urlParams_ gensupport.URLParams 9251 ctx_ context.Context 9252 header_ http.Header 9253} 9254 9255// Create: Creates a new reply to a comment. 9256// 9257// - commentId: The ID of the comment. 9258// - fileId: The ID of the file. 9259func (r *RepliesService) Create(fileId string, commentId string, reply *Reply) *RepliesCreateCall { 9260 c := &RepliesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9261 c.fileId = fileId 9262 c.commentId = commentId 9263 c.reply = reply 9264 return c 9265} 9266 9267// Fields allows partial responses to be retrieved. See 9268// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9269// for more information. 9270func (c *RepliesCreateCall) Fields(s ...googleapi.Field) *RepliesCreateCall { 9271 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9272 return c 9273} 9274 9275// Context sets the context to be used in this call's Do method. Any 9276// pending HTTP request will be aborted if the provided context is 9277// canceled. 9278func (c *RepliesCreateCall) Context(ctx context.Context) *RepliesCreateCall { 9279 c.ctx_ = ctx 9280 return c 9281} 9282 9283// Header returns an http.Header that can be modified by the caller to 9284// add HTTP headers to the request. 9285func (c *RepliesCreateCall) Header() http.Header { 9286 if c.header_ == nil { 9287 c.header_ = make(http.Header) 9288 } 9289 return c.header_ 9290} 9291 9292func (c *RepliesCreateCall) doRequest(alt string) (*http.Response, error) { 9293 reqHeaders := make(http.Header) 9294 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9295 for k, v := range c.header_ { 9296 reqHeaders[k] = v 9297 } 9298 reqHeaders.Set("User-Agent", c.s.userAgent()) 9299 var body io.Reader = nil 9300 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reply) 9301 if err != nil { 9302 return nil, err 9303 } 9304 reqHeaders.Set("Content-Type", "application/json") 9305 c.urlParams_.Set("alt", alt) 9306 c.urlParams_.Set("prettyPrint", "false") 9307 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") 9308 urls += "?" + c.urlParams_.Encode() 9309 req, err := http.NewRequest("POST", urls, body) 9310 if err != nil { 9311 return nil, err 9312 } 9313 req.Header = reqHeaders 9314 googleapi.Expand(req.URL, map[string]string{ 9315 "fileId": c.fileId, 9316 "commentId": c.commentId, 9317 }) 9318 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9319} 9320 9321// Do executes the "drive.replies.create" call. 9322// Exactly one of *Reply or error will be non-nil. Any non-2xx status 9323// code is an error. Response headers are in either 9324// *Reply.ServerResponse.Header or (if a response was returned at all) 9325// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9326// check whether the returned error was because http.StatusNotModified 9327// was returned. 9328func (c *RepliesCreateCall) Do(opts ...googleapi.CallOption) (*Reply, error) { 9329 gensupport.SetOptions(c.urlParams_, opts...) 9330 res, err := c.doRequest("json") 9331 if res != nil && res.StatusCode == http.StatusNotModified { 9332 if res.Body != nil { 9333 res.Body.Close() 9334 } 9335 return nil, &googleapi.Error{ 9336 Code: res.StatusCode, 9337 Header: res.Header, 9338 } 9339 } 9340 if err != nil { 9341 return nil, err 9342 } 9343 defer googleapi.CloseBody(res) 9344 if err := googleapi.CheckResponse(res); err != nil { 9345 return nil, err 9346 } 9347 ret := &Reply{ 9348 ServerResponse: googleapi.ServerResponse{ 9349 Header: res.Header, 9350 HTTPStatusCode: res.StatusCode, 9351 }, 9352 } 9353 target := &ret 9354 if err := gensupport.DecodeResponse(target, res); err != nil { 9355 return nil, err 9356 } 9357 return ret, nil 9358 // { 9359 // "description": "Creates a new reply to a comment.", 9360 // "httpMethod": "POST", 9361 // "id": "drive.replies.create", 9362 // "parameterOrder": [ 9363 // "fileId", 9364 // "commentId" 9365 // ], 9366 // "parameters": { 9367 // "commentId": { 9368 // "description": "The ID of the comment.", 9369 // "location": "path", 9370 // "required": true, 9371 // "type": "string" 9372 // }, 9373 // "fileId": { 9374 // "description": "The ID of the file.", 9375 // "location": "path", 9376 // "required": true, 9377 // "type": "string" 9378 // } 9379 // }, 9380 // "path": "files/{fileId}/comments/{commentId}/replies", 9381 // "request": { 9382 // "$ref": "Reply" 9383 // }, 9384 // "response": { 9385 // "$ref": "Reply" 9386 // }, 9387 // "scopes": [ 9388 // "https://www.googleapis.com/auth/drive", 9389 // "https://www.googleapis.com/auth/drive.file" 9390 // ] 9391 // } 9392 9393} 9394 9395// method id "drive.replies.delete": 9396 9397type RepliesDeleteCall struct { 9398 s *Service 9399 fileId string 9400 commentId string 9401 replyId string 9402 urlParams_ gensupport.URLParams 9403 ctx_ context.Context 9404 header_ http.Header 9405} 9406 9407// Delete: Deletes a reply. 9408// 9409// - commentId: The ID of the comment. 9410// - fileId: The ID of the file. 9411// - replyId: The ID of the reply. 9412func (r *RepliesService) Delete(fileId string, commentId string, replyId string) *RepliesDeleteCall { 9413 c := &RepliesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9414 c.fileId = fileId 9415 c.commentId = commentId 9416 c.replyId = replyId 9417 return c 9418} 9419 9420// Fields allows partial responses to be retrieved. See 9421// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9422// for more information. 9423func (c *RepliesDeleteCall) Fields(s ...googleapi.Field) *RepliesDeleteCall { 9424 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9425 return c 9426} 9427 9428// Context sets the context to be used in this call's Do method. Any 9429// pending HTTP request will be aborted if the provided context is 9430// canceled. 9431func (c *RepliesDeleteCall) Context(ctx context.Context) *RepliesDeleteCall { 9432 c.ctx_ = ctx 9433 return c 9434} 9435 9436// Header returns an http.Header that can be modified by the caller to 9437// add HTTP headers to the request. 9438func (c *RepliesDeleteCall) Header() http.Header { 9439 if c.header_ == nil { 9440 c.header_ = make(http.Header) 9441 } 9442 return c.header_ 9443} 9444 9445func (c *RepliesDeleteCall) doRequest(alt string) (*http.Response, error) { 9446 reqHeaders := make(http.Header) 9447 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9448 for k, v := range c.header_ { 9449 reqHeaders[k] = v 9450 } 9451 reqHeaders.Set("User-Agent", c.s.userAgent()) 9452 var body io.Reader = nil 9453 c.urlParams_.Set("alt", alt) 9454 c.urlParams_.Set("prettyPrint", "false") 9455 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") 9456 urls += "?" + c.urlParams_.Encode() 9457 req, err := http.NewRequest("DELETE", urls, body) 9458 if err != nil { 9459 return nil, err 9460 } 9461 req.Header = reqHeaders 9462 googleapi.Expand(req.URL, map[string]string{ 9463 "fileId": c.fileId, 9464 "commentId": c.commentId, 9465 "replyId": c.replyId, 9466 }) 9467 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9468} 9469 9470// Do executes the "drive.replies.delete" call. 9471func (c *RepliesDeleteCall) Do(opts ...googleapi.CallOption) error { 9472 gensupport.SetOptions(c.urlParams_, opts...) 9473 res, err := c.doRequest("json") 9474 if err != nil { 9475 return err 9476 } 9477 defer googleapi.CloseBody(res) 9478 if err := googleapi.CheckResponse(res); err != nil { 9479 return err 9480 } 9481 return nil 9482 // { 9483 // "description": "Deletes a reply.", 9484 // "httpMethod": "DELETE", 9485 // "id": "drive.replies.delete", 9486 // "parameterOrder": [ 9487 // "fileId", 9488 // "commentId", 9489 // "replyId" 9490 // ], 9491 // "parameters": { 9492 // "commentId": { 9493 // "description": "The ID of the comment.", 9494 // "location": "path", 9495 // "required": true, 9496 // "type": "string" 9497 // }, 9498 // "fileId": { 9499 // "description": "The ID of the file.", 9500 // "location": "path", 9501 // "required": true, 9502 // "type": "string" 9503 // }, 9504 // "replyId": { 9505 // "description": "The ID of the reply.", 9506 // "location": "path", 9507 // "required": true, 9508 // "type": "string" 9509 // } 9510 // }, 9511 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 9512 // "scopes": [ 9513 // "https://www.googleapis.com/auth/drive", 9514 // "https://www.googleapis.com/auth/drive.file" 9515 // ] 9516 // } 9517 9518} 9519 9520// method id "drive.replies.get": 9521 9522type RepliesGetCall struct { 9523 s *Service 9524 fileId string 9525 commentId string 9526 replyId string 9527 urlParams_ gensupport.URLParams 9528 ifNoneMatch_ string 9529 ctx_ context.Context 9530 header_ http.Header 9531} 9532 9533// Get: Gets a reply by ID. 9534// 9535// - commentId: The ID of the comment. 9536// - fileId: The ID of the file. 9537// - replyId: The ID of the reply. 9538func (r *RepliesService) Get(fileId string, commentId string, replyId string) *RepliesGetCall { 9539 c := &RepliesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9540 c.fileId = fileId 9541 c.commentId = commentId 9542 c.replyId = replyId 9543 return c 9544} 9545 9546// IncludeDeleted sets the optional parameter "includeDeleted": Whether 9547// to return deleted replies. Deleted replies will not include their 9548// original content. 9549func (c *RepliesGetCall) IncludeDeleted(includeDeleted bool) *RepliesGetCall { 9550 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 9551 return c 9552} 9553 9554// Fields allows partial responses to be retrieved. See 9555// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9556// for more information. 9557func (c *RepliesGetCall) Fields(s ...googleapi.Field) *RepliesGetCall { 9558 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9559 return c 9560} 9561 9562// IfNoneMatch sets the optional parameter which makes the operation 9563// fail if the object's ETag matches the given value. This is useful for 9564// getting updates only after the object has changed since the last 9565// request. Use googleapi.IsNotModified to check whether the response 9566// error from Do is the result of In-None-Match. 9567func (c *RepliesGetCall) IfNoneMatch(entityTag string) *RepliesGetCall { 9568 c.ifNoneMatch_ = entityTag 9569 return c 9570} 9571 9572// Context sets the context to be used in this call's Do method. Any 9573// pending HTTP request will be aborted if the provided context is 9574// canceled. 9575func (c *RepliesGetCall) Context(ctx context.Context) *RepliesGetCall { 9576 c.ctx_ = ctx 9577 return c 9578} 9579 9580// Header returns an http.Header that can be modified by the caller to 9581// add HTTP headers to the request. 9582func (c *RepliesGetCall) Header() http.Header { 9583 if c.header_ == nil { 9584 c.header_ = make(http.Header) 9585 } 9586 return c.header_ 9587} 9588 9589func (c *RepliesGetCall) doRequest(alt string) (*http.Response, error) { 9590 reqHeaders := make(http.Header) 9591 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9592 for k, v := range c.header_ { 9593 reqHeaders[k] = v 9594 } 9595 reqHeaders.Set("User-Agent", c.s.userAgent()) 9596 if c.ifNoneMatch_ != "" { 9597 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9598 } 9599 var body io.Reader = nil 9600 c.urlParams_.Set("alt", alt) 9601 c.urlParams_.Set("prettyPrint", "false") 9602 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") 9603 urls += "?" + c.urlParams_.Encode() 9604 req, err := http.NewRequest("GET", urls, body) 9605 if err != nil { 9606 return nil, err 9607 } 9608 req.Header = reqHeaders 9609 googleapi.Expand(req.URL, map[string]string{ 9610 "fileId": c.fileId, 9611 "commentId": c.commentId, 9612 "replyId": c.replyId, 9613 }) 9614 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9615} 9616 9617// Do executes the "drive.replies.get" call. 9618// Exactly one of *Reply or error will be non-nil. Any non-2xx status 9619// code is an error. Response headers are in either 9620// *Reply.ServerResponse.Header or (if a response was returned at all) 9621// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9622// check whether the returned error was because http.StatusNotModified 9623// was returned. 9624func (c *RepliesGetCall) Do(opts ...googleapi.CallOption) (*Reply, error) { 9625 gensupport.SetOptions(c.urlParams_, opts...) 9626 res, err := c.doRequest("json") 9627 if res != nil && res.StatusCode == http.StatusNotModified { 9628 if res.Body != nil { 9629 res.Body.Close() 9630 } 9631 return nil, &googleapi.Error{ 9632 Code: res.StatusCode, 9633 Header: res.Header, 9634 } 9635 } 9636 if err != nil { 9637 return nil, err 9638 } 9639 defer googleapi.CloseBody(res) 9640 if err := googleapi.CheckResponse(res); err != nil { 9641 return nil, err 9642 } 9643 ret := &Reply{ 9644 ServerResponse: googleapi.ServerResponse{ 9645 Header: res.Header, 9646 HTTPStatusCode: res.StatusCode, 9647 }, 9648 } 9649 target := &ret 9650 if err := gensupport.DecodeResponse(target, res); err != nil { 9651 return nil, err 9652 } 9653 return ret, nil 9654 // { 9655 // "description": "Gets a reply by ID.", 9656 // "httpMethod": "GET", 9657 // "id": "drive.replies.get", 9658 // "parameterOrder": [ 9659 // "fileId", 9660 // "commentId", 9661 // "replyId" 9662 // ], 9663 // "parameters": { 9664 // "commentId": { 9665 // "description": "The ID of the comment.", 9666 // "location": "path", 9667 // "required": true, 9668 // "type": "string" 9669 // }, 9670 // "fileId": { 9671 // "description": "The ID of the file.", 9672 // "location": "path", 9673 // "required": true, 9674 // "type": "string" 9675 // }, 9676 // "includeDeleted": { 9677 // "default": "false", 9678 // "description": "Whether to return deleted replies. Deleted replies will not include their original content.", 9679 // "location": "query", 9680 // "type": "boolean" 9681 // }, 9682 // "replyId": { 9683 // "description": "The ID of the reply.", 9684 // "location": "path", 9685 // "required": true, 9686 // "type": "string" 9687 // } 9688 // }, 9689 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 9690 // "response": { 9691 // "$ref": "Reply" 9692 // }, 9693 // "scopes": [ 9694 // "https://www.googleapis.com/auth/drive", 9695 // "https://www.googleapis.com/auth/drive.file", 9696 // "https://www.googleapis.com/auth/drive.readonly" 9697 // ] 9698 // } 9699 9700} 9701 9702// method id "drive.replies.list": 9703 9704type RepliesListCall struct { 9705 s *Service 9706 fileId string 9707 commentId string 9708 urlParams_ gensupport.URLParams 9709 ifNoneMatch_ string 9710 ctx_ context.Context 9711 header_ http.Header 9712} 9713 9714// List: Lists a comment's replies. 9715// 9716// - commentId: The ID of the comment. 9717// - fileId: The ID of the file. 9718func (r *RepliesService) List(fileId string, commentId string) *RepliesListCall { 9719 c := &RepliesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9720 c.fileId = fileId 9721 c.commentId = commentId 9722 return c 9723} 9724 9725// IncludeDeleted sets the optional parameter "includeDeleted": Whether 9726// to include deleted replies. Deleted replies will not include their 9727// original content. 9728func (c *RepliesListCall) IncludeDeleted(includeDeleted bool) *RepliesListCall { 9729 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 9730 return c 9731} 9732 9733// PageSize sets the optional parameter "pageSize": The maximum number 9734// of replies to return per page. 9735func (c *RepliesListCall) PageSize(pageSize int64) *RepliesListCall { 9736 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9737 return c 9738} 9739 9740// PageToken sets the optional parameter "pageToken": The token for 9741// continuing a previous list request on the next page. This should be 9742// set to the value of 'nextPageToken' from the previous response. 9743func (c *RepliesListCall) PageToken(pageToken string) *RepliesListCall { 9744 c.urlParams_.Set("pageToken", pageToken) 9745 return c 9746} 9747 9748// Fields allows partial responses to be retrieved. See 9749// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9750// for more information. 9751func (c *RepliesListCall) Fields(s ...googleapi.Field) *RepliesListCall { 9752 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9753 return c 9754} 9755 9756// IfNoneMatch sets the optional parameter which makes the operation 9757// fail if the object's ETag matches the given value. This is useful for 9758// getting updates only after the object has changed since the last 9759// request. Use googleapi.IsNotModified to check whether the response 9760// error from Do is the result of In-None-Match. 9761func (c *RepliesListCall) IfNoneMatch(entityTag string) *RepliesListCall { 9762 c.ifNoneMatch_ = entityTag 9763 return c 9764} 9765 9766// Context sets the context to be used in this call's Do method. Any 9767// pending HTTP request will be aborted if the provided context is 9768// canceled. 9769func (c *RepliesListCall) Context(ctx context.Context) *RepliesListCall { 9770 c.ctx_ = ctx 9771 return c 9772} 9773 9774// Header returns an http.Header that can be modified by the caller to 9775// add HTTP headers to the request. 9776func (c *RepliesListCall) Header() http.Header { 9777 if c.header_ == nil { 9778 c.header_ = make(http.Header) 9779 } 9780 return c.header_ 9781} 9782 9783func (c *RepliesListCall) doRequest(alt string) (*http.Response, error) { 9784 reqHeaders := make(http.Header) 9785 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9786 for k, v := range c.header_ { 9787 reqHeaders[k] = v 9788 } 9789 reqHeaders.Set("User-Agent", c.s.userAgent()) 9790 if c.ifNoneMatch_ != "" { 9791 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9792 } 9793 var body io.Reader = nil 9794 c.urlParams_.Set("alt", alt) 9795 c.urlParams_.Set("prettyPrint", "false") 9796 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") 9797 urls += "?" + c.urlParams_.Encode() 9798 req, err := http.NewRequest("GET", urls, body) 9799 if err != nil { 9800 return nil, err 9801 } 9802 req.Header = reqHeaders 9803 googleapi.Expand(req.URL, map[string]string{ 9804 "fileId": c.fileId, 9805 "commentId": c.commentId, 9806 }) 9807 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9808} 9809 9810// Do executes the "drive.replies.list" call. 9811// Exactly one of *ReplyList or error will be non-nil. Any non-2xx 9812// status code is an error. Response headers are in either 9813// *ReplyList.ServerResponse.Header or (if a response was returned at 9814// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9815// to check whether the returned error was because 9816// http.StatusNotModified was returned. 9817func (c *RepliesListCall) Do(opts ...googleapi.CallOption) (*ReplyList, error) { 9818 gensupport.SetOptions(c.urlParams_, opts...) 9819 res, err := c.doRequest("json") 9820 if res != nil && res.StatusCode == http.StatusNotModified { 9821 if res.Body != nil { 9822 res.Body.Close() 9823 } 9824 return nil, &googleapi.Error{ 9825 Code: res.StatusCode, 9826 Header: res.Header, 9827 } 9828 } 9829 if err != nil { 9830 return nil, err 9831 } 9832 defer googleapi.CloseBody(res) 9833 if err := googleapi.CheckResponse(res); err != nil { 9834 return nil, err 9835 } 9836 ret := &ReplyList{ 9837 ServerResponse: googleapi.ServerResponse{ 9838 Header: res.Header, 9839 HTTPStatusCode: res.StatusCode, 9840 }, 9841 } 9842 target := &ret 9843 if err := gensupport.DecodeResponse(target, res); err != nil { 9844 return nil, err 9845 } 9846 return ret, nil 9847 // { 9848 // "description": "Lists a comment's replies.", 9849 // "httpMethod": "GET", 9850 // "id": "drive.replies.list", 9851 // "parameterOrder": [ 9852 // "fileId", 9853 // "commentId" 9854 // ], 9855 // "parameters": { 9856 // "commentId": { 9857 // "description": "The ID of the comment.", 9858 // "location": "path", 9859 // "required": true, 9860 // "type": "string" 9861 // }, 9862 // "fileId": { 9863 // "description": "The ID of the file.", 9864 // "location": "path", 9865 // "required": true, 9866 // "type": "string" 9867 // }, 9868 // "includeDeleted": { 9869 // "default": "false", 9870 // "description": "Whether to include deleted replies. Deleted replies will not include their original content.", 9871 // "location": "query", 9872 // "type": "boolean" 9873 // }, 9874 // "pageSize": { 9875 // "default": "20", 9876 // "description": "The maximum number of replies to return per page.", 9877 // "format": "int32", 9878 // "location": "query", 9879 // "maximum": "100", 9880 // "minimum": "1", 9881 // "type": "integer" 9882 // }, 9883 // "pageToken": { 9884 // "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.", 9885 // "location": "query", 9886 // "type": "string" 9887 // } 9888 // }, 9889 // "path": "files/{fileId}/comments/{commentId}/replies", 9890 // "response": { 9891 // "$ref": "ReplyList" 9892 // }, 9893 // "scopes": [ 9894 // "https://www.googleapis.com/auth/drive", 9895 // "https://www.googleapis.com/auth/drive.file", 9896 // "https://www.googleapis.com/auth/drive.readonly" 9897 // ] 9898 // } 9899 9900} 9901 9902// Pages invokes f for each page of results. 9903// A non-nil error returned from f will halt the iteration. 9904// The provided context supersedes any context provided to the Context method. 9905func (c *RepliesListCall) Pages(ctx context.Context, f func(*ReplyList) error) error { 9906 c.ctx_ = ctx 9907 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9908 for { 9909 x, err := c.Do() 9910 if err != nil { 9911 return err 9912 } 9913 if err := f(x); err != nil { 9914 return err 9915 } 9916 if x.NextPageToken == "" { 9917 return nil 9918 } 9919 c.PageToken(x.NextPageToken) 9920 } 9921} 9922 9923// method id "drive.replies.update": 9924 9925type RepliesUpdateCall struct { 9926 s *Service 9927 fileId string 9928 commentId string 9929 replyId string 9930 reply *Reply 9931 urlParams_ gensupport.URLParams 9932 ctx_ context.Context 9933 header_ http.Header 9934} 9935 9936// Update: Updates a reply with patch semantics. 9937// 9938// - commentId: The ID of the comment. 9939// - fileId: The ID of the file. 9940// - replyId: The ID of the reply. 9941func (r *RepliesService) Update(fileId string, commentId string, replyId string, reply *Reply) *RepliesUpdateCall { 9942 c := &RepliesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9943 c.fileId = fileId 9944 c.commentId = commentId 9945 c.replyId = replyId 9946 c.reply = reply 9947 return c 9948} 9949 9950// Fields allows partial responses to be retrieved. See 9951// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9952// for more information. 9953func (c *RepliesUpdateCall) Fields(s ...googleapi.Field) *RepliesUpdateCall { 9954 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9955 return c 9956} 9957 9958// Context sets the context to be used in this call's Do method. Any 9959// pending HTTP request will be aborted if the provided context is 9960// canceled. 9961func (c *RepliesUpdateCall) Context(ctx context.Context) *RepliesUpdateCall { 9962 c.ctx_ = ctx 9963 return c 9964} 9965 9966// Header returns an http.Header that can be modified by the caller to 9967// add HTTP headers to the request. 9968func (c *RepliesUpdateCall) Header() http.Header { 9969 if c.header_ == nil { 9970 c.header_ = make(http.Header) 9971 } 9972 return c.header_ 9973} 9974 9975func (c *RepliesUpdateCall) doRequest(alt string) (*http.Response, error) { 9976 reqHeaders := make(http.Header) 9977 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9978 for k, v := range c.header_ { 9979 reqHeaders[k] = v 9980 } 9981 reqHeaders.Set("User-Agent", c.s.userAgent()) 9982 var body io.Reader = nil 9983 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reply) 9984 if err != nil { 9985 return nil, err 9986 } 9987 reqHeaders.Set("Content-Type", "application/json") 9988 c.urlParams_.Set("alt", alt) 9989 c.urlParams_.Set("prettyPrint", "false") 9990 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") 9991 urls += "?" + c.urlParams_.Encode() 9992 req, err := http.NewRequest("PATCH", urls, body) 9993 if err != nil { 9994 return nil, err 9995 } 9996 req.Header = reqHeaders 9997 googleapi.Expand(req.URL, map[string]string{ 9998 "fileId": c.fileId, 9999 "commentId": c.commentId, 10000 "replyId": c.replyId, 10001 }) 10002 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10003} 10004 10005// Do executes the "drive.replies.update" call. 10006// Exactly one of *Reply or error will be non-nil. Any non-2xx status 10007// code is an error. Response headers are in either 10008// *Reply.ServerResponse.Header or (if a response was returned at all) 10009// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10010// check whether the returned error was because http.StatusNotModified 10011// was returned. 10012func (c *RepliesUpdateCall) Do(opts ...googleapi.CallOption) (*Reply, error) { 10013 gensupport.SetOptions(c.urlParams_, opts...) 10014 res, err := c.doRequest("json") 10015 if res != nil && res.StatusCode == http.StatusNotModified { 10016 if res.Body != nil { 10017 res.Body.Close() 10018 } 10019 return nil, &googleapi.Error{ 10020 Code: res.StatusCode, 10021 Header: res.Header, 10022 } 10023 } 10024 if err != nil { 10025 return nil, err 10026 } 10027 defer googleapi.CloseBody(res) 10028 if err := googleapi.CheckResponse(res); err != nil { 10029 return nil, err 10030 } 10031 ret := &Reply{ 10032 ServerResponse: googleapi.ServerResponse{ 10033 Header: res.Header, 10034 HTTPStatusCode: res.StatusCode, 10035 }, 10036 } 10037 target := &ret 10038 if err := gensupport.DecodeResponse(target, res); err != nil { 10039 return nil, err 10040 } 10041 return ret, nil 10042 // { 10043 // "description": "Updates a reply with patch semantics.", 10044 // "httpMethod": "PATCH", 10045 // "id": "drive.replies.update", 10046 // "parameterOrder": [ 10047 // "fileId", 10048 // "commentId", 10049 // "replyId" 10050 // ], 10051 // "parameters": { 10052 // "commentId": { 10053 // "description": "The ID of the comment.", 10054 // "location": "path", 10055 // "required": true, 10056 // "type": "string" 10057 // }, 10058 // "fileId": { 10059 // "description": "The ID of the file.", 10060 // "location": "path", 10061 // "required": true, 10062 // "type": "string" 10063 // }, 10064 // "replyId": { 10065 // "description": "The ID of the reply.", 10066 // "location": "path", 10067 // "required": true, 10068 // "type": "string" 10069 // } 10070 // }, 10071 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 10072 // "request": { 10073 // "$ref": "Reply" 10074 // }, 10075 // "response": { 10076 // "$ref": "Reply" 10077 // }, 10078 // "scopes": [ 10079 // "https://www.googleapis.com/auth/drive", 10080 // "https://www.googleapis.com/auth/drive.file" 10081 // ] 10082 // } 10083 10084} 10085 10086// method id "drive.revisions.delete": 10087 10088type RevisionsDeleteCall struct { 10089 s *Service 10090 fileId string 10091 revisionId string 10092 urlParams_ gensupport.URLParams 10093 ctx_ context.Context 10094 header_ http.Header 10095} 10096 10097// Delete: Permanently deletes a file version. You can only delete 10098// revisions for files with binary content in Google Drive, like images 10099// or videos. Revisions for other files, like Google Docs or Sheets, and 10100// the last remaining file version can't be deleted. 10101// 10102// - fileId: The ID of the file. 10103// - revisionId: The ID of the revision. 10104func (r *RevisionsService) Delete(fileId string, revisionId string) *RevisionsDeleteCall { 10105 c := &RevisionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10106 c.fileId = fileId 10107 c.revisionId = revisionId 10108 return c 10109} 10110 10111// Fields allows partial responses to be retrieved. See 10112// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10113// for more information. 10114func (c *RevisionsDeleteCall) Fields(s ...googleapi.Field) *RevisionsDeleteCall { 10115 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10116 return c 10117} 10118 10119// Context sets the context to be used in this call's Do method. Any 10120// pending HTTP request will be aborted if the provided context is 10121// canceled. 10122func (c *RevisionsDeleteCall) Context(ctx context.Context) *RevisionsDeleteCall { 10123 c.ctx_ = ctx 10124 return c 10125} 10126 10127// Header returns an http.Header that can be modified by the caller to 10128// add HTTP headers to the request. 10129func (c *RevisionsDeleteCall) Header() http.Header { 10130 if c.header_ == nil { 10131 c.header_ = make(http.Header) 10132 } 10133 return c.header_ 10134} 10135 10136func (c *RevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { 10137 reqHeaders := make(http.Header) 10138 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10139 for k, v := range c.header_ { 10140 reqHeaders[k] = v 10141 } 10142 reqHeaders.Set("User-Agent", c.s.userAgent()) 10143 var body io.Reader = nil 10144 c.urlParams_.Set("alt", alt) 10145 c.urlParams_.Set("prettyPrint", "false") 10146 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") 10147 urls += "?" + c.urlParams_.Encode() 10148 req, err := http.NewRequest("DELETE", urls, body) 10149 if err != nil { 10150 return nil, err 10151 } 10152 req.Header = reqHeaders 10153 googleapi.Expand(req.URL, map[string]string{ 10154 "fileId": c.fileId, 10155 "revisionId": c.revisionId, 10156 }) 10157 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10158} 10159 10160// Do executes the "drive.revisions.delete" call. 10161func (c *RevisionsDeleteCall) Do(opts ...googleapi.CallOption) error { 10162 gensupport.SetOptions(c.urlParams_, opts...) 10163 res, err := c.doRequest("json") 10164 if err != nil { 10165 return err 10166 } 10167 defer googleapi.CloseBody(res) 10168 if err := googleapi.CheckResponse(res); err != nil { 10169 return err 10170 } 10171 return nil 10172 // { 10173 // "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.", 10174 // "httpMethod": "DELETE", 10175 // "id": "drive.revisions.delete", 10176 // "parameterOrder": [ 10177 // "fileId", 10178 // "revisionId" 10179 // ], 10180 // "parameters": { 10181 // "fileId": { 10182 // "description": "The ID of the file.", 10183 // "location": "path", 10184 // "required": true, 10185 // "type": "string" 10186 // }, 10187 // "revisionId": { 10188 // "description": "The ID of the revision.", 10189 // "location": "path", 10190 // "required": true, 10191 // "type": "string" 10192 // } 10193 // }, 10194 // "path": "files/{fileId}/revisions/{revisionId}", 10195 // "scopes": [ 10196 // "https://www.googleapis.com/auth/drive", 10197 // "https://www.googleapis.com/auth/drive.appdata", 10198 // "https://www.googleapis.com/auth/drive.file" 10199 // ] 10200 // } 10201 10202} 10203 10204// method id "drive.revisions.get": 10205 10206type RevisionsGetCall struct { 10207 s *Service 10208 fileId string 10209 revisionId string 10210 urlParams_ gensupport.URLParams 10211 ifNoneMatch_ string 10212 ctx_ context.Context 10213 header_ http.Header 10214} 10215 10216// Get: Gets a revision's metadata or content by ID. 10217// 10218// - fileId: The ID of the file. 10219// - revisionId: The ID of the revision. 10220func (r *RevisionsService) Get(fileId string, revisionId string) *RevisionsGetCall { 10221 c := &RevisionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10222 c.fileId = fileId 10223 c.revisionId = revisionId 10224 return c 10225} 10226 10227// AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": 10228// Whether the user is acknowledging the risk of downloading known 10229// malware or other abusive files. This is only applicable when 10230// alt=media. 10231func (c *RevisionsGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *RevisionsGetCall { 10232 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse)) 10233 return c 10234} 10235 10236// Fields allows partial responses to be retrieved. See 10237// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10238// for more information. 10239func (c *RevisionsGetCall) Fields(s ...googleapi.Field) *RevisionsGetCall { 10240 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10241 return c 10242} 10243 10244// IfNoneMatch sets the optional parameter which makes the operation 10245// fail if the object's ETag matches the given value. This is useful for 10246// getting updates only after the object has changed since the last 10247// request. Use googleapi.IsNotModified to check whether the response 10248// error from Do is the result of In-None-Match. 10249func (c *RevisionsGetCall) IfNoneMatch(entityTag string) *RevisionsGetCall { 10250 c.ifNoneMatch_ = entityTag 10251 return c 10252} 10253 10254// Context sets the context to be used in this call's Do and Download 10255// methods. Any pending HTTP request will be aborted if the provided 10256// context is canceled. 10257func (c *RevisionsGetCall) Context(ctx context.Context) *RevisionsGetCall { 10258 c.ctx_ = ctx 10259 return c 10260} 10261 10262// Header returns an http.Header that can be modified by the caller to 10263// add HTTP headers to the request. 10264func (c *RevisionsGetCall) Header() http.Header { 10265 if c.header_ == nil { 10266 c.header_ = make(http.Header) 10267 } 10268 return c.header_ 10269} 10270 10271func (c *RevisionsGetCall) doRequest(alt string) (*http.Response, error) { 10272 reqHeaders := make(http.Header) 10273 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10274 for k, v := range c.header_ { 10275 reqHeaders[k] = v 10276 } 10277 reqHeaders.Set("User-Agent", c.s.userAgent()) 10278 if c.ifNoneMatch_ != "" { 10279 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10280 } 10281 var body io.Reader = nil 10282 c.urlParams_.Set("alt", alt) 10283 c.urlParams_.Set("prettyPrint", "false") 10284 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") 10285 urls += "?" + c.urlParams_.Encode() 10286 req, err := http.NewRequest("GET", urls, body) 10287 if err != nil { 10288 return nil, err 10289 } 10290 req.Header = reqHeaders 10291 googleapi.Expand(req.URL, map[string]string{ 10292 "fileId": c.fileId, 10293 "revisionId": c.revisionId, 10294 }) 10295 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10296} 10297 10298// Download fetches the API endpoint's "media" value, instead of the normal 10299// API response value. If the returned error is nil, the Response is guaranteed to 10300// have a 2xx status code. Callers must close the Response.Body as usual. 10301func (c *RevisionsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 10302 gensupport.SetOptions(c.urlParams_, opts...) 10303 res, err := c.doRequest("media") 10304 if err != nil { 10305 return nil, err 10306 } 10307 if err := googleapi.CheckResponse(res); err != nil { 10308 res.Body.Close() 10309 return nil, err 10310 } 10311 return res, nil 10312} 10313 10314// Do executes the "drive.revisions.get" call. 10315// Exactly one of *Revision or error will be non-nil. Any non-2xx status 10316// code is an error. Response headers are in either 10317// *Revision.ServerResponse.Header or (if a response was returned at 10318// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10319// to check whether the returned error was because 10320// http.StatusNotModified was returned. 10321func (c *RevisionsGetCall) Do(opts ...googleapi.CallOption) (*Revision, error) { 10322 gensupport.SetOptions(c.urlParams_, opts...) 10323 res, err := c.doRequest("json") 10324 if res != nil && res.StatusCode == http.StatusNotModified { 10325 if res.Body != nil { 10326 res.Body.Close() 10327 } 10328 return nil, &googleapi.Error{ 10329 Code: res.StatusCode, 10330 Header: res.Header, 10331 } 10332 } 10333 if err != nil { 10334 return nil, err 10335 } 10336 defer googleapi.CloseBody(res) 10337 if err := googleapi.CheckResponse(res); err != nil { 10338 return nil, err 10339 } 10340 ret := &Revision{ 10341 ServerResponse: googleapi.ServerResponse{ 10342 Header: res.Header, 10343 HTTPStatusCode: res.StatusCode, 10344 }, 10345 } 10346 target := &ret 10347 if err := gensupport.DecodeResponse(target, res); err != nil { 10348 return nil, err 10349 } 10350 return ret, nil 10351 // { 10352 // "description": "Gets a revision's metadata or content by ID.", 10353 // "httpMethod": "GET", 10354 // "id": "drive.revisions.get", 10355 // "parameterOrder": [ 10356 // "fileId", 10357 // "revisionId" 10358 // ], 10359 // "parameters": { 10360 // "acknowledgeAbuse": { 10361 // "default": "false", 10362 // "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files. This is only applicable when alt=media.", 10363 // "location": "query", 10364 // "type": "boolean" 10365 // }, 10366 // "fileId": { 10367 // "description": "The ID of the file.", 10368 // "location": "path", 10369 // "required": true, 10370 // "type": "string" 10371 // }, 10372 // "revisionId": { 10373 // "description": "The ID of the revision.", 10374 // "location": "path", 10375 // "required": true, 10376 // "type": "string" 10377 // } 10378 // }, 10379 // "path": "files/{fileId}/revisions/{revisionId}", 10380 // "response": { 10381 // "$ref": "Revision" 10382 // }, 10383 // "scopes": [ 10384 // "https://www.googleapis.com/auth/drive", 10385 // "https://www.googleapis.com/auth/drive.appdata", 10386 // "https://www.googleapis.com/auth/drive.file", 10387 // "https://www.googleapis.com/auth/drive.metadata", 10388 // "https://www.googleapis.com/auth/drive.metadata.readonly", 10389 // "https://www.googleapis.com/auth/drive.photos.readonly", 10390 // "https://www.googleapis.com/auth/drive.readonly" 10391 // ], 10392 // "supportsMediaDownload": true, 10393 // "useMediaDownloadService": true 10394 // } 10395 10396} 10397 10398// method id "drive.revisions.list": 10399 10400type RevisionsListCall struct { 10401 s *Service 10402 fileId string 10403 urlParams_ gensupport.URLParams 10404 ifNoneMatch_ string 10405 ctx_ context.Context 10406 header_ http.Header 10407} 10408 10409// List: Lists a file's revisions. 10410// 10411// - fileId: The ID of the file. 10412func (r *RevisionsService) List(fileId string) *RevisionsListCall { 10413 c := &RevisionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10414 c.fileId = fileId 10415 return c 10416} 10417 10418// PageSize sets the optional parameter "pageSize": The maximum number 10419// of revisions to return per page. 10420func (c *RevisionsListCall) PageSize(pageSize int64) *RevisionsListCall { 10421 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 10422 return c 10423} 10424 10425// PageToken sets the optional parameter "pageToken": The token for 10426// continuing a previous list request on the next page. This should be 10427// set to the value of 'nextPageToken' from the previous response. 10428func (c *RevisionsListCall) PageToken(pageToken string) *RevisionsListCall { 10429 c.urlParams_.Set("pageToken", pageToken) 10430 return c 10431} 10432 10433// Fields allows partial responses to be retrieved. See 10434// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10435// for more information. 10436func (c *RevisionsListCall) Fields(s ...googleapi.Field) *RevisionsListCall { 10437 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10438 return c 10439} 10440 10441// IfNoneMatch sets the optional parameter which makes the operation 10442// fail if the object's ETag matches the given value. This is useful for 10443// getting updates only after the object has changed since the last 10444// request. Use googleapi.IsNotModified to check whether the response 10445// error from Do is the result of In-None-Match. 10446func (c *RevisionsListCall) IfNoneMatch(entityTag string) *RevisionsListCall { 10447 c.ifNoneMatch_ = entityTag 10448 return c 10449} 10450 10451// Context sets the context to be used in this call's Do method. Any 10452// pending HTTP request will be aborted if the provided context is 10453// canceled. 10454func (c *RevisionsListCall) Context(ctx context.Context) *RevisionsListCall { 10455 c.ctx_ = ctx 10456 return c 10457} 10458 10459// Header returns an http.Header that can be modified by the caller to 10460// add HTTP headers to the request. 10461func (c *RevisionsListCall) Header() http.Header { 10462 if c.header_ == nil { 10463 c.header_ = make(http.Header) 10464 } 10465 return c.header_ 10466} 10467 10468func (c *RevisionsListCall) doRequest(alt string) (*http.Response, error) { 10469 reqHeaders := make(http.Header) 10470 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10471 for k, v := range c.header_ { 10472 reqHeaders[k] = v 10473 } 10474 reqHeaders.Set("User-Agent", c.s.userAgent()) 10475 if c.ifNoneMatch_ != "" { 10476 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10477 } 10478 var body io.Reader = nil 10479 c.urlParams_.Set("alt", alt) 10480 c.urlParams_.Set("prettyPrint", "false") 10481 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions") 10482 urls += "?" + c.urlParams_.Encode() 10483 req, err := http.NewRequest("GET", urls, body) 10484 if err != nil { 10485 return nil, err 10486 } 10487 req.Header = reqHeaders 10488 googleapi.Expand(req.URL, map[string]string{ 10489 "fileId": c.fileId, 10490 }) 10491 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10492} 10493 10494// Do executes the "drive.revisions.list" call. 10495// Exactly one of *RevisionList or error will be non-nil. Any non-2xx 10496// status code is an error. Response headers are in either 10497// *RevisionList.ServerResponse.Header or (if a response was returned at 10498// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10499// to check whether the returned error was because 10500// http.StatusNotModified was returned. 10501func (c *RevisionsListCall) Do(opts ...googleapi.CallOption) (*RevisionList, error) { 10502 gensupport.SetOptions(c.urlParams_, opts...) 10503 res, err := c.doRequest("json") 10504 if res != nil && res.StatusCode == http.StatusNotModified { 10505 if res.Body != nil { 10506 res.Body.Close() 10507 } 10508 return nil, &googleapi.Error{ 10509 Code: res.StatusCode, 10510 Header: res.Header, 10511 } 10512 } 10513 if err != nil { 10514 return nil, err 10515 } 10516 defer googleapi.CloseBody(res) 10517 if err := googleapi.CheckResponse(res); err != nil { 10518 return nil, err 10519 } 10520 ret := &RevisionList{ 10521 ServerResponse: googleapi.ServerResponse{ 10522 Header: res.Header, 10523 HTTPStatusCode: res.StatusCode, 10524 }, 10525 } 10526 target := &ret 10527 if err := gensupport.DecodeResponse(target, res); err != nil { 10528 return nil, err 10529 } 10530 return ret, nil 10531 // { 10532 // "description": "Lists a file's revisions.", 10533 // "httpMethod": "GET", 10534 // "id": "drive.revisions.list", 10535 // "parameterOrder": [ 10536 // "fileId" 10537 // ], 10538 // "parameters": { 10539 // "fileId": { 10540 // "description": "The ID of the file.", 10541 // "location": "path", 10542 // "required": true, 10543 // "type": "string" 10544 // }, 10545 // "pageSize": { 10546 // "default": "200", 10547 // "description": "The maximum number of revisions to return per page.", 10548 // "format": "int32", 10549 // "location": "query", 10550 // "maximum": "1000", 10551 // "minimum": "1", 10552 // "type": "integer" 10553 // }, 10554 // "pageToken": { 10555 // "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.", 10556 // "location": "query", 10557 // "type": "string" 10558 // } 10559 // }, 10560 // "path": "files/{fileId}/revisions", 10561 // "response": { 10562 // "$ref": "RevisionList" 10563 // }, 10564 // "scopes": [ 10565 // "https://www.googleapis.com/auth/drive", 10566 // "https://www.googleapis.com/auth/drive.appdata", 10567 // "https://www.googleapis.com/auth/drive.file", 10568 // "https://www.googleapis.com/auth/drive.metadata", 10569 // "https://www.googleapis.com/auth/drive.metadata.readonly", 10570 // "https://www.googleapis.com/auth/drive.photos.readonly", 10571 // "https://www.googleapis.com/auth/drive.readonly" 10572 // ] 10573 // } 10574 10575} 10576 10577// Pages invokes f for each page of results. 10578// A non-nil error returned from f will halt the iteration. 10579// The provided context supersedes any context provided to the Context method. 10580func (c *RevisionsListCall) Pages(ctx context.Context, f func(*RevisionList) error) error { 10581 c.ctx_ = ctx 10582 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10583 for { 10584 x, err := c.Do() 10585 if err != nil { 10586 return err 10587 } 10588 if err := f(x); err != nil { 10589 return err 10590 } 10591 if x.NextPageToken == "" { 10592 return nil 10593 } 10594 c.PageToken(x.NextPageToken) 10595 } 10596} 10597 10598// method id "drive.revisions.update": 10599 10600type RevisionsUpdateCall struct { 10601 s *Service 10602 fileId string 10603 revisionId string 10604 revision *Revision 10605 urlParams_ gensupport.URLParams 10606 ctx_ context.Context 10607 header_ http.Header 10608} 10609 10610// Update: Updates a revision with patch semantics. 10611// 10612// - fileId: The ID of the file. 10613// - revisionId: The ID of the revision. 10614func (r *RevisionsService) Update(fileId string, revisionId string, revision *Revision) *RevisionsUpdateCall { 10615 c := &RevisionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10616 c.fileId = fileId 10617 c.revisionId = revisionId 10618 c.revision = revision 10619 return c 10620} 10621 10622// Fields allows partial responses to be retrieved. See 10623// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10624// for more information. 10625func (c *RevisionsUpdateCall) Fields(s ...googleapi.Field) *RevisionsUpdateCall { 10626 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10627 return c 10628} 10629 10630// Context sets the context to be used in this call's Do method. Any 10631// pending HTTP request will be aborted if the provided context is 10632// canceled. 10633func (c *RevisionsUpdateCall) Context(ctx context.Context) *RevisionsUpdateCall { 10634 c.ctx_ = ctx 10635 return c 10636} 10637 10638// Header returns an http.Header that can be modified by the caller to 10639// add HTTP headers to the request. 10640func (c *RevisionsUpdateCall) Header() http.Header { 10641 if c.header_ == nil { 10642 c.header_ = make(http.Header) 10643 } 10644 return c.header_ 10645} 10646 10647func (c *RevisionsUpdateCall) doRequest(alt string) (*http.Response, error) { 10648 reqHeaders := make(http.Header) 10649 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10650 for k, v := range c.header_ { 10651 reqHeaders[k] = v 10652 } 10653 reqHeaders.Set("User-Agent", c.s.userAgent()) 10654 var body io.Reader = nil 10655 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision) 10656 if err != nil { 10657 return nil, err 10658 } 10659 reqHeaders.Set("Content-Type", "application/json") 10660 c.urlParams_.Set("alt", alt) 10661 c.urlParams_.Set("prettyPrint", "false") 10662 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") 10663 urls += "?" + c.urlParams_.Encode() 10664 req, err := http.NewRequest("PATCH", urls, body) 10665 if err != nil { 10666 return nil, err 10667 } 10668 req.Header = reqHeaders 10669 googleapi.Expand(req.URL, map[string]string{ 10670 "fileId": c.fileId, 10671 "revisionId": c.revisionId, 10672 }) 10673 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10674} 10675 10676// Do executes the "drive.revisions.update" call. 10677// Exactly one of *Revision or error will be non-nil. Any non-2xx status 10678// code is an error. Response headers are in either 10679// *Revision.ServerResponse.Header or (if a response was returned at 10680// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10681// to check whether the returned error was because 10682// http.StatusNotModified was returned. 10683func (c *RevisionsUpdateCall) Do(opts ...googleapi.CallOption) (*Revision, error) { 10684 gensupport.SetOptions(c.urlParams_, opts...) 10685 res, err := c.doRequest("json") 10686 if res != nil && res.StatusCode == http.StatusNotModified { 10687 if res.Body != nil { 10688 res.Body.Close() 10689 } 10690 return nil, &googleapi.Error{ 10691 Code: res.StatusCode, 10692 Header: res.Header, 10693 } 10694 } 10695 if err != nil { 10696 return nil, err 10697 } 10698 defer googleapi.CloseBody(res) 10699 if err := googleapi.CheckResponse(res); err != nil { 10700 return nil, err 10701 } 10702 ret := &Revision{ 10703 ServerResponse: googleapi.ServerResponse{ 10704 Header: res.Header, 10705 HTTPStatusCode: res.StatusCode, 10706 }, 10707 } 10708 target := &ret 10709 if err := gensupport.DecodeResponse(target, res); err != nil { 10710 return nil, err 10711 } 10712 return ret, nil 10713 // { 10714 // "description": "Updates a revision with patch semantics.", 10715 // "httpMethod": "PATCH", 10716 // "id": "drive.revisions.update", 10717 // "parameterOrder": [ 10718 // "fileId", 10719 // "revisionId" 10720 // ], 10721 // "parameters": { 10722 // "fileId": { 10723 // "description": "The ID of the file.", 10724 // "location": "path", 10725 // "required": true, 10726 // "type": "string" 10727 // }, 10728 // "revisionId": { 10729 // "description": "The ID of the revision.", 10730 // "location": "path", 10731 // "required": true, 10732 // "type": "string" 10733 // } 10734 // }, 10735 // "path": "files/{fileId}/revisions/{revisionId}", 10736 // "request": { 10737 // "$ref": "Revision" 10738 // }, 10739 // "response": { 10740 // "$ref": "Revision" 10741 // }, 10742 // "scopes": [ 10743 // "https://www.googleapis.com/auth/drive", 10744 // "https://www.googleapis.com/auth/drive.appdata", 10745 // "https://www.googleapis.com/auth/drive.file" 10746 // ] 10747 // } 10748 10749} 10750 10751// method id "drive.teamdrives.create": 10752 10753type TeamdrivesCreateCall struct { 10754 s *Service 10755 teamdrive *TeamDrive 10756 urlParams_ gensupport.URLParams 10757 ctx_ context.Context 10758 header_ http.Header 10759} 10760 10761// Create: Deprecated use drives.create instead. 10762// 10763// - requestId: An ID, such as a random UUID, which uniquely identifies 10764// this user's request for idempotent creation of a Team Drive. A 10765// repeated request by the same user and with the same request ID will 10766// avoid creating duplicates by attempting to create the same Team 10767// Drive. If the Team Drive already exists a 409 error will be 10768// returned. 10769func (r *TeamdrivesService) Create(requestId string, teamdrive *TeamDrive) *TeamdrivesCreateCall { 10770 c := &TeamdrivesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10771 c.urlParams_.Set("requestId", requestId) 10772 c.teamdrive = teamdrive 10773 return c 10774} 10775 10776// Fields allows partial responses to be retrieved. See 10777// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10778// for more information. 10779func (c *TeamdrivesCreateCall) Fields(s ...googleapi.Field) *TeamdrivesCreateCall { 10780 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10781 return c 10782} 10783 10784// Context sets the context to be used in this call's Do method. Any 10785// pending HTTP request will be aborted if the provided context is 10786// canceled. 10787func (c *TeamdrivesCreateCall) Context(ctx context.Context) *TeamdrivesCreateCall { 10788 c.ctx_ = ctx 10789 return c 10790} 10791 10792// Header returns an http.Header that can be modified by the caller to 10793// add HTTP headers to the request. 10794func (c *TeamdrivesCreateCall) Header() http.Header { 10795 if c.header_ == nil { 10796 c.header_ = make(http.Header) 10797 } 10798 return c.header_ 10799} 10800 10801func (c *TeamdrivesCreateCall) doRequest(alt string) (*http.Response, error) { 10802 reqHeaders := make(http.Header) 10803 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10804 for k, v := range c.header_ { 10805 reqHeaders[k] = v 10806 } 10807 reqHeaders.Set("User-Agent", c.s.userAgent()) 10808 var body io.Reader = nil 10809 body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive) 10810 if err != nil { 10811 return nil, err 10812 } 10813 reqHeaders.Set("Content-Type", "application/json") 10814 c.urlParams_.Set("alt", alt) 10815 c.urlParams_.Set("prettyPrint", "false") 10816 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives") 10817 urls += "?" + c.urlParams_.Encode() 10818 req, err := http.NewRequest("POST", urls, body) 10819 if err != nil { 10820 return nil, err 10821 } 10822 req.Header = reqHeaders 10823 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10824} 10825 10826// Do executes the "drive.teamdrives.create" call. 10827// Exactly one of *TeamDrive or error will be non-nil. Any non-2xx 10828// status code is an error. Response headers are in either 10829// *TeamDrive.ServerResponse.Header or (if a response was returned at 10830// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10831// to check whether the returned error was because 10832// http.StatusNotModified was returned. 10833func (c *TeamdrivesCreateCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) { 10834 gensupport.SetOptions(c.urlParams_, opts...) 10835 res, err := c.doRequest("json") 10836 if res != nil && res.StatusCode == http.StatusNotModified { 10837 if res.Body != nil { 10838 res.Body.Close() 10839 } 10840 return nil, &googleapi.Error{ 10841 Code: res.StatusCode, 10842 Header: res.Header, 10843 } 10844 } 10845 if err != nil { 10846 return nil, err 10847 } 10848 defer googleapi.CloseBody(res) 10849 if err := googleapi.CheckResponse(res); err != nil { 10850 return nil, err 10851 } 10852 ret := &TeamDrive{ 10853 ServerResponse: googleapi.ServerResponse{ 10854 Header: res.Header, 10855 HTTPStatusCode: res.StatusCode, 10856 }, 10857 } 10858 target := &ret 10859 if err := gensupport.DecodeResponse(target, res); err != nil { 10860 return nil, err 10861 } 10862 return ret, nil 10863 // { 10864 // "description": "Deprecated use drives.create instead.", 10865 // "httpMethod": "POST", 10866 // "id": "drive.teamdrives.create", 10867 // "parameterOrder": [ 10868 // "requestId" 10869 // ], 10870 // "parameters": { 10871 // "requestId": { 10872 // "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.", 10873 // "location": "query", 10874 // "required": true, 10875 // "type": "string" 10876 // } 10877 // }, 10878 // "path": "teamdrives", 10879 // "request": { 10880 // "$ref": "TeamDrive" 10881 // }, 10882 // "response": { 10883 // "$ref": "TeamDrive" 10884 // }, 10885 // "scopes": [ 10886 // "https://www.googleapis.com/auth/drive" 10887 // ] 10888 // } 10889 10890} 10891 10892// method id "drive.teamdrives.delete": 10893 10894type TeamdrivesDeleteCall struct { 10895 s *Service 10896 teamDriveId string 10897 urlParams_ gensupport.URLParams 10898 ctx_ context.Context 10899 header_ http.Header 10900} 10901 10902// Delete: Deprecated use drives.delete instead. 10903// 10904// - teamDriveId: The ID of the Team Drive. 10905func (r *TeamdrivesService) Delete(teamDriveId string) *TeamdrivesDeleteCall { 10906 c := &TeamdrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10907 c.teamDriveId = teamDriveId 10908 return c 10909} 10910 10911// Fields allows partial responses to be retrieved. See 10912// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10913// for more information. 10914func (c *TeamdrivesDeleteCall) Fields(s ...googleapi.Field) *TeamdrivesDeleteCall { 10915 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10916 return c 10917} 10918 10919// Context sets the context to be used in this call's Do method. Any 10920// pending HTTP request will be aborted if the provided context is 10921// canceled. 10922func (c *TeamdrivesDeleteCall) Context(ctx context.Context) *TeamdrivesDeleteCall { 10923 c.ctx_ = ctx 10924 return c 10925} 10926 10927// Header returns an http.Header that can be modified by the caller to 10928// add HTTP headers to the request. 10929func (c *TeamdrivesDeleteCall) Header() http.Header { 10930 if c.header_ == nil { 10931 c.header_ = make(http.Header) 10932 } 10933 return c.header_ 10934} 10935 10936func (c *TeamdrivesDeleteCall) doRequest(alt string) (*http.Response, error) { 10937 reqHeaders := make(http.Header) 10938 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10939 for k, v := range c.header_ { 10940 reqHeaders[k] = v 10941 } 10942 reqHeaders.Set("User-Agent", c.s.userAgent()) 10943 var body io.Reader = nil 10944 c.urlParams_.Set("alt", alt) 10945 c.urlParams_.Set("prettyPrint", "false") 10946 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") 10947 urls += "?" + c.urlParams_.Encode() 10948 req, err := http.NewRequest("DELETE", urls, body) 10949 if err != nil { 10950 return nil, err 10951 } 10952 req.Header = reqHeaders 10953 googleapi.Expand(req.URL, map[string]string{ 10954 "teamDriveId": c.teamDriveId, 10955 }) 10956 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10957} 10958 10959// Do executes the "drive.teamdrives.delete" call. 10960func (c *TeamdrivesDeleteCall) Do(opts ...googleapi.CallOption) error { 10961 gensupport.SetOptions(c.urlParams_, opts...) 10962 res, err := c.doRequest("json") 10963 if err != nil { 10964 return err 10965 } 10966 defer googleapi.CloseBody(res) 10967 if err := googleapi.CheckResponse(res); err != nil { 10968 return err 10969 } 10970 return nil 10971 // { 10972 // "description": "Deprecated use drives.delete instead.", 10973 // "httpMethod": "DELETE", 10974 // "id": "drive.teamdrives.delete", 10975 // "parameterOrder": [ 10976 // "teamDriveId" 10977 // ], 10978 // "parameters": { 10979 // "teamDriveId": { 10980 // "description": "The ID of the Team Drive", 10981 // "location": "path", 10982 // "required": true, 10983 // "type": "string" 10984 // } 10985 // }, 10986 // "path": "teamdrives/{teamDriveId}", 10987 // "scopes": [ 10988 // "https://www.googleapis.com/auth/drive" 10989 // ] 10990 // } 10991 10992} 10993 10994// method id "drive.teamdrives.get": 10995 10996type TeamdrivesGetCall struct { 10997 s *Service 10998 teamDriveId string 10999 urlParams_ gensupport.URLParams 11000 ifNoneMatch_ string 11001 ctx_ context.Context 11002 header_ http.Header 11003} 11004 11005// Get: Deprecated use drives.get instead. 11006// 11007// - teamDriveId: The ID of the Team Drive. 11008func (r *TeamdrivesService) Get(teamDriveId string) *TeamdrivesGetCall { 11009 c := &TeamdrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11010 c.teamDriveId = teamDriveId 11011 return c 11012} 11013 11014// UseDomainAdminAccess sets the optional parameter 11015// "useDomainAdminAccess": Issue the request as a domain administrator; 11016// if set to true, then the requester will be granted access if they are 11017// an administrator of the domain to which the Team Drive belongs. 11018func (c *TeamdrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesGetCall { 11019 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 11020 return c 11021} 11022 11023// Fields allows partial responses to be retrieved. See 11024// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11025// for more information. 11026func (c *TeamdrivesGetCall) Fields(s ...googleapi.Field) *TeamdrivesGetCall { 11027 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11028 return c 11029} 11030 11031// IfNoneMatch sets the optional parameter which makes the operation 11032// fail if the object's ETag matches the given value. This is useful for 11033// getting updates only after the object has changed since the last 11034// request. Use googleapi.IsNotModified to check whether the response 11035// error from Do is the result of In-None-Match. 11036func (c *TeamdrivesGetCall) IfNoneMatch(entityTag string) *TeamdrivesGetCall { 11037 c.ifNoneMatch_ = entityTag 11038 return c 11039} 11040 11041// Context sets the context to be used in this call's Do method. Any 11042// pending HTTP request will be aborted if the provided context is 11043// canceled. 11044func (c *TeamdrivesGetCall) Context(ctx context.Context) *TeamdrivesGetCall { 11045 c.ctx_ = ctx 11046 return c 11047} 11048 11049// Header returns an http.Header that can be modified by the caller to 11050// add HTTP headers to the request. 11051func (c *TeamdrivesGetCall) Header() http.Header { 11052 if c.header_ == nil { 11053 c.header_ = make(http.Header) 11054 } 11055 return c.header_ 11056} 11057 11058func (c *TeamdrivesGetCall) doRequest(alt string) (*http.Response, error) { 11059 reqHeaders := make(http.Header) 11060 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 11061 for k, v := range c.header_ { 11062 reqHeaders[k] = v 11063 } 11064 reqHeaders.Set("User-Agent", c.s.userAgent()) 11065 if c.ifNoneMatch_ != "" { 11066 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11067 } 11068 var body io.Reader = nil 11069 c.urlParams_.Set("alt", alt) 11070 c.urlParams_.Set("prettyPrint", "false") 11071 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") 11072 urls += "?" + c.urlParams_.Encode() 11073 req, err := http.NewRequest("GET", urls, body) 11074 if err != nil { 11075 return nil, err 11076 } 11077 req.Header = reqHeaders 11078 googleapi.Expand(req.URL, map[string]string{ 11079 "teamDriveId": c.teamDriveId, 11080 }) 11081 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11082} 11083 11084// Do executes the "drive.teamdrives.get" call. 11085// Exactly one of *TeamDrive or error will be non-nil. Any non-2xx 11086// status code is an error. Response headers are in either 11087// *TeamDrive.ServerResponse.Header or (if a response was returned at 11088// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11089// to check whether the returned error was because 11090// http.StatusNotModified was returned. 11091func (c *TeamdrivesGetCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) { 11092 gensupport.SetOptions(c.urlParams_, opts...) 11093 res, err := c.doRequest("json") 11094 if res != nil && res.StatusCode == http.StatusNotModified { 11095 if res.Body != nil { 11096 res.Body.Close() 11097 } 11098 return nil, &googleapi.Error{ 11099 Code: res.StatusCode, 11100 Header: res.Header, 11101 } 11102 } 11103 if err != nil { 11104 return nil, err 11105 } 11106 defer googleapi.CloseBody(res) 11107 if err := googleapi.CheckResponse(res); err != nil { 11108 return nil, err 11109 } 11110 ret := &TeamDrive{ 11111 ServerResponse: googleapi.ServerResponse{ 11112 Header: res.Header, 11113 HTTPStatusCode: res.StatusCode, 11114 }, 11115 } 11116 target := &ret 11117 if err := gensupport.DecodeResponse(target, res); err != nil { 11118 return nil, err 11119 } 11120 return ret, nil 11121 // { 11122 // "description": "Deprecated use drives.get instead.", 11123 // "httpMethod": "GET", 11124 // "id": "drive.teamdrives.get", 11125 // "parameterOrder": [ 11126 // "teamDriveId" 11127 // ], 11128 // "parameters": { 11129 // "teamDriveId": { 11130 // "description": "The ID of the Team Drive", 11131 // "location": "path", 11132 // "required": true, 11133 // "type": "string" 11134 // }, 11135 // "useDomainAdminAccess": { 11136 // "default": "false", 11137 // "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.", 11138 // "location": "query", 11139 // "type": "boolean" 11140 // } 11141 // }, 11142 // "path": "teamdrives/{teamDriveId}", 11143 // "response": { 11144 // "$ref": "TeamDrive" 11145 // }, 11146 // "scopes": [ 11147 // "https://www.googleapis.com/auth/drive", 11148 // "https://www.googleapis.com/auth/drive.readonly" 11149 // ] 11150 // } 11151 11152} 11153 11154// method id "drive.teamdrives.list": 11155 11156type TeamdrivesListCall struct { 11157 s *Service 11158 urlParams_ gensupport.URLParams 11159 ifNoneMatch_ string 11160 ctx_ context.Context 11161 header_ http.Header 11162} 11163 11164// List: Deprecated use drives.list instead. 11165func (r *TeamdrivesService) List() *TeamdrivesListCall { 11166 c := &TeamdrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11167 return c 11168} 11169 11170// PageSize sets the optional parameter "pageSize": Maximum number of 11171// Team Drives to return. 11172func (c *TeamdrivesListCall) PageSize(pageSize int64) *TeamdrivesListCall { 11173 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 11174 return c 11175} 11176 11177// PageToken sets the optional parameter "pageToken": Page token for 11178// Team Drives. 11179func (c *TeamdrivesListCall) PageToken(pageToken string) *TeamdrivesListCall { 11180 c.urlParams_.Set("pageToken", pageToken) 11181 return c 11182} 11183 11184// Q sets the optional parameter "q": Query string for searching Team 11185// Drives. 11186func (c *TeamdrivesListCall) Q(q string) *TeamdrivesListCall { 11187 c.urlParams_.Set("q", q) 11188 return c 11189} 11190 11191// UseDomainAdminAccess sets the optional parameter 11192// "useDomainAdminAccess": Issue the request as a domain administrator; 11193// if set to true, then all Team Drives of the domain in which the 11194// requester is an administrator are returned. 11195func (c *TeamdrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesListCall { 11196 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 11197 return c 11198} 11199 11200// Fields allows partial responses to be retrieved. See 11201// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11202// for more information. 11203func (c *TeamdrivesListCall) Fields(s ...googleapi.Field) *TeamdrivesListCall { 11204 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11205 return c 11206} 11207 11208// IfNoneMatch sets the optional parameter which makes the operation 11209// fail if the object's ETag matches the given value. This is useful for 11210// getting updates only after the object has changed since the last 11211// request. Use googleapi.IsNotModified to check whether the response 11212// error from Do is the result of In-None-Match. 11213func (c *TeamdrivesListCall) IfNoneMatch(entityTag string) *TeamdrivesListCall { 11214 c.ifNoneMatch_ = entityTag 11215 return c 11216} 11217 11218// Context sets the context to be used in this call's Do method. Any 11219// pending HTTP request will be aborted if the provided context is 11220// canceled. 11221func (c *TeamdrivesListCall) Context(ctx context.Context) *TeamdrivesListCall { 11222 c.ctx_ = ctx 11223 return c 11224} 11225 11226// Header returns an http.Header that can be modified by the caller to 11227// add HTTP headers to the request. 11228func (c *TeamdrivesListCall) Header() http.Header { 11229 if c.header_ == nil { 11230 c.header_ = make(http.Header) 11231 } 11232 return c.header_ 11233} 11234 11235func (c *TeamdrivesListCall) doRequest(alt string) (*http.Response, error) { 11236 reqHeaders := make(http.Header) 11237 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 11238 for k, v := range c.header_ { 11239 reqHeaders[k] = v 11240 } 11241 reqHeaders.Set("User-Agent", c.s.userAgent()) 11242 if c.ifNoneMatch_ != "" { 11243 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11244 } 11245 var body io.Reader = nil 11246 c.urlParams_.Set("alt", alt) 11247 c.urlParams_.Set("prettyPrint", "false") 11248 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives") 11249 urls += "?" + c.urlParams_.Encode() 11250 req, err := http.NewRequest("GET", urls, body) 11251 if err != nil { 11252 return nil, err 11253 } 11254 req.Header = reqHeaders 11255 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11256} 11257 11258// Do executes the "drive.teamdrives.list" call. 11259// Exactly one of *TeamDriveList or error will be non-nil. Any non-2xx 11260// status code is an error. Response headers are in either 11261// *TeamDriveList.ServerResponse.Header or (if a response was returned 11262// at all) in error.(*googleapi.Error).Header. Use 11263// googleapi.IsNotModified to check whether the returned error was 11264// because http.StatusNotModified was returned. 11265func (c *TeamdrivesListCall) Do(opts ...googleapi.CallOption) (*TeamDriveList, error) { 11266 gensupport.SetOptions(c.urlParams_, opts...) 11267 res, err := c.doRequest("json") 11268 if res != nil && res.StatusCode == http.StatusNotModified { 11269 if res.Body != nil { 11270 res.Body.Close() 11271 } 11272 return nil, &googleapi.Error{ 11273 Code: res.StatusCode, 11274 Header: res.Header, 11275 } 11276 } 11277 if err != nil { 11278 return nil, err 11279 } 11280 defer googleapi.CloseBody(res) 11281 if err := googleapi.CheckResponse(res); err != nil { 11282 return nil, err 11283 } 11284 ret := &TeamDriveList{ 11285 ServerResponse: googleapi.ServerResponse{ 11286 Header: res.Header, 11287 HTTPStatusCode: res.StatusCode, 11288 }, 11289 } 11290 target := &ret 11291 if err := gensupport.DecodeResponse(target, res); err != nil { 11292 return nil, err 11293 } 11294 return ret, nil 11295 // { 11296 // "description": "Deprecated use drives.list instead.", 11297 // "httpMethod": "GET", 11298 // "id": "drive.teamdrives.list", 11299 // "parameters": { 11300 // "pageSize": { 11301 // "default": "10", 11302 // "description": "Maximum number of Team Drives to return.", 11303 // "format": "int32", 11304 // "location": "query", 11305 // "maximum": "100", 11306 // "minimum": "1", 11307 // "type": "integer" 11308 // }, 11309 // "pageToken": { 11310 // "description": "Page token for Team Drives.", 11311 // "location": "query", 11312 // "type": "string" 11313 // }, 11314 // "q": { 11315 // "description": "Query string for searching Team Drives.", 11316 // "location": "query", 11317 // "type": "string" 11318 // }, 11319 // "useDomainAdminAccess": { 11320 // "default": "false", 11321 // "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.", 11322 // "location": "query", 11323 // "type": "boolean" 11324 // } 11325 // }, 11326 // "path": "teamdrives", 11327 // "response": { 11328 // "$ref": "TeamDriveList" 11329 // }, 11330 // "scopes": [ 11331 // "https://www.googleapis.com/auth/drive", 11332 // "https://www.googleapis.com/auth/drive.readonly" 11333 // ] 11334 // } 11335 11336} 11337 11338// Pages invokes f for each page of results. 11339// A non-nil error returned from f will halt the iteration. 11340// The provided context supersedes any context provided to the Context method. 11341func (c *TeamdrivesListCall) Pages(ctx context.Context, f func(*TeamDriveList) error) error { 11342 c.ctx_ = ctx 11343 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 11344 for { 11345 x, err := c.Do() 11346 if err != nil { 11347 return err 11348 } 11349 if err := f(x); err != nil { 11350 return err 11351 } 11352 if x.NextPageToken == "" { 11353 return nil 11354 } 11355 c.PageToken(x.NextPageToken) 11356 } 11357} 11358 11359// method id "drive.teamdrives.update": 11360 11361type TeamdrivesUpdateCall struct { 11362 s *Service 11363 teamDriveId string 11364 teamdrive *TeamDrive 11365 urlParams_ gensupport.URLParams 11366 ctx_ context.Context 11367 header_ http.Header 11368} 11369 11370// Update: Deprecated use drives.update instead 11371// 11372// - teamDriveId: The ID of the Team Drive. 11373func (r *TeamdrivesService) Update(teamDriveId string, teamdrive *TeamDrive) *TeamdrivesUpdateCall { 11374 c := &TeamdrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11375 c.teamDriveId = teamDriveId 11376 c.teamdrive = teamdrive 11377 return c 11378} 11379 11380// UseDomainAdminAccess sets the optional parameter 11381// "useDomainAdminAccess": Issue the request as a domain administrator; 11382// if set to true, then the requester will be granted access if they are 11383// an administrator of the domain to which the Team Drive belongs. 11384func (c *TeamdrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesUpdateCall { 11385 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 11386 return c 11387} 11388 11389// Fields allows partial responses to be retrieved. See 11390// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11391// for more information. 11392func (c *TeamdrivesUpdateCall) Fields(s ...googleapi.Field) *TeamdrivesUpdateCall { 11393 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11394 return c 11395} 11396 11397// Context sets the context to be used in this call's Do method. Any 11398// pending HTTP request will be aborted if the provided context is 11399// canceled. 11400func (c *TeamdrivesUpdateCall) Context(ctx context.Context) *TeamdrivesUpdateCall { 11401 c.ctx_ = ctx 11402 return c 11403} 11404 11405// Header returns an http.Header that can be modified by the caller to 11406// add HTTP headers to the request. 11407func (c *TeamdrivesUpdateCall) Header() http.Header { 11408 if c.header_ == nil { 11409 c.header_ = make(http.Header) 11410 } 11411 return c.header_ 11412} 11413 11414func (c *TeamdrivesUpdateCall) doRequest(alt string) (*http.Response, error) { 11415 reqHeaders := make(http.Header) 11416 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 11417 for k, v := range c.header_ { 11418 reqHeaders[k] = v 11419 } 11420 reqHeaders.Set("User-Agent", c.s.userAgent()) 11421 var body io.Reader = nil 11422 body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive) 11423 if err != nil { 11424 return nil, err 11425 } 11426 reqHeaders.Set("Content-Type", "application/json") 11427 c.urlParams_.Set("alt", alt) 11428 c.urlParams_.Set("prettyPrint", "false") 11429 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") 11430 urls += "?" + c.urlParams_.Encode() 11431 req, err := http.NewRequest("PATCH", urls, body) 11432 if err != nil { 11433 return nil, err 11434 } 11435 req.Header = reqHeaders 11436 googleapi.Expand(req.URL, map[string]string{ 11437 "teamDriveId": c.teamDriveId, 11438 }) 11439 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11440} 11441 11442// Do executes the "drive.teamdrives.update" call. 11443// Exactly one of *TeamDrive or error will be non-nil. Any non-2xx 11444// status code is an error. Response headers are in either 11445// *TeamDrive.ServerResponse.Header or (if a response was returned at 11446// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 11447// to check whether the returned error was because 11448// http.StatusNotModified was returned. 11449func (c *TeamdrivesUpdateCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) { 11450 gensupport.SetOptions(c.urlParams_, opts...) 11451 res, err := c.doRequest("json") 11452 if res != nil && res.StatusCode == http.StatusNotModified { 11453 if res.Body != nil { 11454 res.Body.Close() 11455 } 11456 return nil, &googleapi.Error{ 11457 Code: res.StatusCode, 11458 Header: res.Header, 11459 } 11460 } 11461 if err != nil { 11462 return nil, err 11463 } 11464 defer googleapi.CloseBody(res) 11465 if err := googleapi.CheckResponse(res); err != nil { 11466 return nil, err 11467 } 11468 ret := &TeamDrive{ 11469 ServerResponse: googleapi.ServerResponse{ 11470 Header: res.Header, 11471 HTTPStatusCode: res.StatusCode, 11472 }, 11473 } 11474 target := &ret 11475 if err := gensupport.DecodeResponse(target, res); err != nil { 11476 return nil, err 11477 } 11478 return ret, nil 11479 // { 11480 // "description": "Deprecated use drives.update instead", 11481 // "httpMethod": "PATCH", 11482 // "id": "drive.teamdrives.update", 11483 // "parameterOrder": [ 11484 // "teamDriveId" 11485 // ], 11486 // "parameters": { 11487 // "teamDriveId": { 11488 // "description": "The ID of the Team Drive", 11489 // "location": "path", 11490 // "required": true, 11491 // "type": "string" 11492 // }, 11493 // "useDomainAdminAccess": { 11494 // "default": "false", 11495 // "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.", 11496 // "location": "query", 11497 // "type": "boolean" 11498 // } 11499 // }, 11500 // "path": "teamdrives/{teamDriveId}", 11501 // "request": { 11502 // "$ref": "TeamDrive" 11503 // }, 11504 // "response": { 11505 // "$ref": "TeamDrive" 11506 // }, 11507 // "scopes": [ 11508 // "https://www.googleapis.com/auth/drive" 11509 // ] 11510 // } 11511 11512} 11513