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/v2" 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/v2" 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:v2" 79const apiName = "drive" 80const apiVersion = "v2" 81const basePath = "https://www.googleapis.com/drive/v2/" 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 // View your Google Drive apps 93 DriveAppsReadonlyScope = "https://www.googleapis.com/auth/drive.apps.readonly" 94 95 // See, edit, create, and delete only the specific Google Drive files 96 // you use with this app 97 DriveFileScope = "https://www.googleapis.com/auth/drive.file" 98 99 // View and manage metadata of files in your Google Drive 100 DriveMetadataScope = "https://www.googleapis.com/auth/drive.metadata" 101 102 // See information about your Google Drive files 103 DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/drive.metadata.readonly" 104 105 // View the photos, videos and albums in your Google Photos 106 DrivePhotosReadonlyScope = "https://www.googleapis.com/auth/drive.photos.readonly" 107 108 // See and download all your Google Drive files 109 DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly" 110 111 // Modify your Google Apps Script scripts' behavior 112 DriveScriptsScope = "https://www.googleapis.com/auth/drive.scripts" 113) 114 115// NewService creates a new Service. 116func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 117 scopesOption := option.WithScopes( 118 "https://www.googleapis.com/auth/drive", 119 "https://www.googleapis.com/auth/drive.appdata", 120 "https://www.googleapis.com/auth/drive.apps.readonly", 121 "https://www.googleapis.com/auth/drive.file", 122 "https://www.googleapis.com/auth/drive.metadata", 123 "https://www.googleapis.com/auth/drive.metadata.readonly", 124 "https://www.googleapis.com/auth/drive.photos.readonly", 125 "https://www.googleapis.com/auth/drive.readonly", 126 "https://www.googleapis.com/auth/drive.scripts", 127 ) 128 // NOTE: prepend, so we don't override user-specified scopes. 129 opts = append([]option.ClientOption{scopesOption}, opts...) 130 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 131 client, endpoint, err := htransport.NewClient(ctx, opts...) 132 if err != nil { 133 return nil, err 134 } 135 s, err := New(client) 136 if err != nil { 137 return nil, err 138 } 139 if endpoint != "" { 140 s.BasePath = endpoint 141 } 142 return s, nil 143} 144 145// New creates a new Service. It uses the provided http.Client for requests. 146// 147// Deprecated: please use NewService instead. 148// To provide a custom HTTP client, use option.WithHTTPClient. 149// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 150func New(client *http.Client) (*Service, error) { 151 if client == nil { 152 return nil, errors.New("client is nil") 153 } 154 s := &Service{client: client, BasePath: basePath} 155 s.About = NewAboutService(s) 156 s.Apps = NewAppsService(s) 157 s.Changes = NewChangesService(s) 158 s.Channels = NewChannelsService(s) 159 s.Children = NewChildrenService(s) 160 s.Comments = NewCommentsService(s) 161 s.Drives = NewDrivesService(s) 162 s.Files = NewFilesService(s) 163 s.Parents = NewParentsService(s) 164 s.Permissions = NewPermissionsService(s) 165 s.Properties = NewPropertiesService(s) 166 s.Replies = NewRepliesService(s) 167 s.Revisions = NewRevisionsService(s) 168 s.Teamdrives = NewTeamdrivesService(s) 169 return s, nil 170} 171 172type Service struct { 173 client *http.Client 174 BasePath string // API endpoint base URL 175 UserAgent string // optional additional User-Agent fragment 176 177 About *AboutService 178 179 Apps *AppsService 180 181 Changes *ChangesService 182 183 Channels *ChannelsService 184 185 Children *ChildrenService 186 187 Comments *CommentsService 188 189 Drives *DrivesService 190 191 Files *FilesService 192 193 Parents *ParentsService 194 195 Permissions *PermissionsService 196 197 Properties *PropertiesService 198 199 Replies *RepliesService 200 201 Revisions *RevisionsService 202 203 Teamdrives *TeamdrivesService 204} 205 206func (s *Service) userAgent() string { 207 if s.UserAgent == "" { 208 return googleapi.UserAgent 209 } 210 return googleapi.UserAgent + " " + s.UserAgent 211} 212 213func NewAboutService(s *Service) *AboutService { 214 rs := &AboutService{s: s} 215 return rs 216} 217 218type AboutService struct { 219 s *Service 220} 221 222func NewAppsService(s *Service) *AppsService { 223 rs := &AppsService{s: s} 224 return rs 225} 226 227type AppsService struct { 228 s *Service 229} 230 231func NewChangesService(s *Service) *ChangesService { 232 rs := &ChangesService{s: s} 233 return rs 234} 235 236type ChangesService struct { 237 s *Service 238} 239 240func NewChannelsService(s *Service) *ChannelsService { 241 rs := &ChannelsService{s: s} 242 return rs 243} 244 245type ChannelsService struct { 246 s *Service 247} 248 249func NewChildrenService(s *Service) *ChildrenService { 250 rs := &ChildrenService{s: s} 251 return rs 252} 253 254type ChildrenService struct { 255 s *Service 256} 257 258func NewCommentsService(s *Service) *CommentsService { 259 rs := &CommentsService{s: s} 260 return rs 261} 262 263type CommentsService struct { 264 s *Service 265} 266 267func NewDrivesService(s *Service) *DrivesService { 268 rs := &DrivesService{s: s} 269 return rs 270} 271 272type DrivesService struct { 273 s *Service 274} 275 276func NewFilesService(s *Service) *FilesService { 277 rs := &FilesService{s: s} 278 return rs 279} 280 281type FilesService struct { 282 s *Service 283} 284 285func NewParentsService(s *Service) *ParentsService { 286 rs := &ParentsService{s: s} 287 return rs 288} 289 290type ParentsService struct { 291 s *Service 292} 293 294func NewPermissionsService(s *Service) *PermissionsService { 295 rs := &PermissionsService{s: s} 296 return rs 297} 298 299type PermissionsService struct { 300 s *Service 301} 302 303func NewPropertiesService(s *Service) *PropertiesService { 304 rs := &PropertiesService{s: s} 305 return rs 306} 307 308type PropertiesService struct { 309 s *Service 310} 311 312func NewRepliesService(s *Service) *RepliesService { 313 rs := &RepliesService{s: s} 314 return rs 315} 316 317type RepliesService struct { 318 s *Service 319} 320 321func NewRevisionsService(s *Service) *RevisionsService { 322 rs := &RevisionsService{s: s} 323 return rs 324} 325 326type RevisionsService struct { 327 s *Service 328} 329 330func NewTeamdrivesService(s *Service) *TeamdrivesService { 331 rs := &TeamdrivesService{s: s} 332 return rs 333} 334 335type TeamdrivesService struct { 336 s *Service 337} 338 339// About: An item with user information and settings. 340type About struct { 341 // AdditionalRoleInfo: Information about supported additional roles per 342 // file type. The most specific type takes precedence. 343 AdditionalRoleInfo []*AboutAdditionalRoleInfo `json:"additionalRoleInfo,omitempty"` 344 345 // CanCreateDrives: Whether the user can create shared drives. 346 CanCreateDrives bool `json:"canCreateDrives,omitempty"` 347 348 // CanCreateTeamDrives: Deprecated - use canCreateDrives instead. 349 CanCreateTeamDrives bool `json:"canCreateTeamDrives,omitempty"` 350 351 // DomainSharingPolicy: The domain sharing policy for the current user. 352 // Possible values are: 353 // - allowed 354 // - allowedWithWarning 355 // - incomingOnly 356 // - disallowed 357 DomainSharingPolicy string `json:"domainSharingPolicy,omitempty"` 358 359 // DriveThemes: A list of themes that are supported for shared drives. 360 DriveThemes []*AboutDriveThemes `json:"driveThemes,omitempty"` 361 362 // Etag: The ETag of the item. 363 Etag string `json:"etag,omitempty"` 364 365 // ExportFormats: The allowable export formats. 366 ExportFormats []*AboutExportFormats `json:"exportFormats,omitempty"` 367 368 // Features: List of additional features enabled on this account. 369 Features []*AboutFeatures `json:"features,omitempty"` 370 371 // FolderColorPalette: The palette of allowable folder colors as RGB hex 372 // strings. 373 FolderColorPalette []string `json:"folderColorPalette,omitempty"` 374 375 // ImportFormats: The allowable import formats. 376 ImportFormats []*AboutImportFormats `json:"importFormats,omitempty"` 377 378 // IsCurrentAppInstalled: A boolean indicating whether the authenticated 379 // app is installed by the authenticated user. 380 IsCurrentAppInstalled bool `json:"isCurrentAppInstalled,omitempty"` 381 382 // Kind: This is always drive#about. 383 Kind string `json:"kind,omitempty"` 384 385 // LanguageCode: The user's language or locale code, as defined by BCP 386 // 47, with some extensions from Unicode's LDML format 387 // (http://www.unicode.org/reports/tr35/). 388 LanguageCode string `json:"languageCode,omitempty"` 389 390 // LargestChangeId: The largest change id. 391 LargestChangeId int64 `json:"largestChangeId,omitempty,string"` 392 393 // MaxUploadSizes: List of max upload sizes for each file type. The most 394 // specific type takes precedence. 395 MaxUploadSizes []*AboutMaxUploadSizes `json:"maxUploadSizes,omitempty"` 396 397 // Name: The name of the current user. 398 Name string `json:"name,omitempty"` 399 400 // PermissionId: The current user's ID as visible in the permissions 401 // collection. 402 PermissionId string `json:"permissionId,omitempty"` 403 404 // QuotaBytesByService: The amount of storage quota used by different 405 // Google services. 406 QuotaBytesByService []*AboutQuotaBytesByService `json:"quotaBytesByService,omitempty"` 407 408 // QuotaBytesTotal: The total number of quota bytes. This is only 409 // relevant when quotaType is LIMITED. 410 QuotaBytesTotal int64 `json:"quotaBytesTotal,omitempty,string"` 411 412 // QuotaBytesUsed: The number of quota bytes used by Google Drive. 413 QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"` 414 415 // QuotaBytesUsedAggregate: The number of quota bytes used by all Google 416 // apps (Drive, Picasa, etc.). 417 QuotaBytesUsedAggregate int64 `json:"quotaBytesUsedAggregate,omitempty,string"` 418 419 // QuotaBytesUsedInTrash: The number of quota bytes used by trashed 420 // items. 421 QuotaBytesUsedInTrash int64 `json:"quotaBytesUsedInTrash,omitempty,string"` 422 423 // QuotaType: The type of the user's storage quota. Possible values are: 424 // 425 // - LIMITED 426 // - UNLIMITED 427 QuotaType string `json:"quotaType,omitempty"` 428 429 // RemainingChangeIds: The number of remaining change ids, limited to no 430 // more than 2500. 431 RemainingChangeIds int64 `json:"remainingChangeIds,omitempty,string"` 432 433 // RootFolderId: The id of the root folder. 434 RootFolderId string `json:"rootFolderId,omitempty"` 435 436 // SelfLink: A link back to this item. 437 SelfLink string `json:"selfLink,omitempty"` 438 439 // TeamDriveThemes: Deprecated - use driveThemes instead. 440 TeamDriveThemes []*AboutTeamDriveThemes `json:"teamDriveThemes,omitempty"` 441 442 // User: The authenticated user. 443 User *User `json:"user,omitempty"` 444 445 // ServerResponse contains the HTTP response code and headers from the 446 // server. 447 googleapi.ServerResponse `json:"-"` 448 449 // ForceSendFields is a list of field names (e.g. "AdditionalRoleInfo") 450 // to unconditionally include in API requests. By default, fields with 451 // empty values are omitted from API requests. However, any non-pointer, 452 // non-interface field appearing in ForceSendFields will be sent to the 453 // server regardless of whether the field is empty or not. This may be 454 // used to include empty fields in Patch requests. 455 ForceSendFields []string `json:"-"` 456 457 // NullFields is a list of field names (e.g. "AdditionalRoleInfo") to 458 // include in API requests with the JSON null value. By default, fields 459 // with empty values are omitted from API requests. However, any field 460 // with an empty value appearing in NullFields will be sent to the 461 // server as null. It is an error if a field in this list has a 462 // non-empty value. This may be used to include null fields in Patch 463 // requests. 464 NullFields []string `json:"-"` 465} 466 467func (s *About) MarshalJSON() ([]byte, error) { 468 type NoMethod About 469 raw := NoMethod(*s) 470 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 471} 472 473type AboutAdditionalRoleInfo struct { 474 // RoleSets: The supported additional roles per primary role. 475 RoleSets []*AboutAdditionalRoleInfoRoleSets `json:"roleSets,omitempty"` 476 477 // Type: The content type that this additional role info applies to. 478 Type string `json:"type,omitempty"` 479 480 // ForceSendFields is a list of field names (e.g. "RoleSets") to 481 // unconditionally include in API requests. By default, fields with 482 // empty values are omitted from API requests. However, any non-pointer, 483 // non-interface field appearing in ForceSendFields will be sent to the 484 // server regardless of whether the field is empty or not. This may be 485 // used to include empty fields in Patch requests. 486 ForceSendFields []string `json:"-"` 487 488 // NullFields is a list of field names (e.g. "RoleSets") to include in 489 // API requests with the JSON null value. By default, fields with empty 490 // values are omitted from API requests. However, any field with an 491 // empty value appearing in NullFields will be sent to the server as 492 // null. It is an error if a field in this list has a non-empty value. 493 // This may be used to include null fields in Patch requests. 494 NullFields []string `json:"-"` 495} 496 497func (s *AboutAdditionalRoleInfo) MarshalJSON() ([]byte, error) { 498 type NoMethod AboutAdditionalRoleInfo 499 raw := NoMethod(*s) 500 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 501} 502 503type AboutAdditionalRoleInfoRoleSets struct { 504 // AdditionalRoles: The supported additional roles with the primary 505 // role. 506 AdditionalRoles []string `json:"additionalRoles,omitempty"` 507 508 // PrimaryRole: A primary permission role. 509 PrimaryRole string `json:"primaryRole,omitempty"` 510 511 // ForceSendFields is a list of field names (e.g. "AdditionalRoles") to 512 // unconditionally include in API requests. By default, fields with 513 // empty values are omitted from API requests. However, any non-pointer, 514 // non-interface field appearing in ForceSendFields will be sent to the 515 // server regardless of whether the field is empty or not. This may be 516 // used to include empty fields in Patch requests. 517 ForceSendFields []string `json:"-"` 518 519 // NullFields is a list of field names (e.g. "AdditionalRoles") to 520 // include in API requests with the JSON null value. By default, fields 521 // with empty values are omitted from API requests. However, any field 522 // with an empty value appearing in NullFields will be sent to the 523 // server as null. It is an error if a field in this list has a 524 // non-empty value. This may be used to include null fields in Patch 525 // requests. 526 NullFields []string `json:"-"` 527} 528 529func (s *AboutAdditionalRoleInfoRoleSets) MarshalJSON() ([]byte, error) { 530 type NoMethod AboutAdditionalRoleInfoRoleSets 531 raw := NoMethod(*s) 532 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 533} 534 535type AboutDriveThemes struct { 536 // BackgroundImageLink: A link to this theme's background image. 537 BackgroundImageLink string `json:"backgroundImageLink,omitempty"` 538 539 // ColorRgb: The color of this theme as an RGB hex string. 540 ColorRgb string `json:"colorRgb,omitempty"` 541 542 // Id: The ID of the theme. 543 Id string `json:"id,omitempty"` 544 545 // ForceSendFields is a list of field names (e.g. "BackgroundImageLink") 546 // to unconditionally include in API requests. By default, fields with 547 // empty values are omitted from API requests. However, any non-pointer, 548 // non-interface field appearing in ForceSendFields will be sent to the 549 // server regardless of whether the field is empty or not. This may be 550 // used to include empty fields in Patch requests. 551 ForceSendFields []string `json:"-"` 552 553 // NullFields is a list of field names (e.g. "BackgroundImageLink") to 554 // include in API requests with the JSON null value. By default, fields 555 // with empty values are omitted from API requests. However, any field 556 // with an empty value appearing in NullFields will be sent to the 557 // server as null. It is an error if a field in this list has a 558 // non-empty value. This may be used to include null fields in Patch 559 // requests. 560 NullFields []string `json:"-"` 561} 562 563func (s *AboutDriveThemes) MarshalJSON() ([]byte, error) { 564 type NoMethod AboutDriveThemes 565 raw := NoMethod(*s) 566 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 567} 568 569type AboutExportFormats struct { 570 // Source: The content type to convert from. 571 Source string `json:"source,omitempty"` 572 573 // Targets: The possible content types to convert to. 574 Targets []string `json:"targets,omitempty"` 575 576 // ForceSendFields is a list of field names (e.g. "Source") to 577 // unconditionally include in API requests. By default, fields with 578 // empty values are omitted from API requests. However, any non-pointer, 579 // non-interface field appearing in ForceSendFields will be sent to the 580 // server regardless of whether the field is empty or not. This may be 581 // used to include empty fields in Patch requests. 582 ForceSendFields []string `json:"-"` 583 584 // NullFields is a list of field names (e.g. "Source") to include in API 585 // requests with the JSON null value. By default, fields with empty 586 // values are omitted from API requests. However, any field with an 587 // empty value appearing in NullFields will be sent to the server as 588 // null. It is an error if a field in this list has a non-empty value. 589 // This may be used to include null fields in Patch requests. 590 NullFields []string `json:"-"` 591} 592 593func (s *AboutExportFormats) MarshalJSON() ([]byte, error) { 594 type NoMethod AboutExportFormats 595 raw := NoMethod(*s) 596 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 597} 598 599type AboutFeatures struct { 600 // FeatureName: The name of the feature. 601 FeatureName string `json:"featureName,omitempty"` 602 603 // FeatureRate: The request limit rate for this feature, in queries per 604 // second. 605 FeatureRate float64 `json:"featureRate,omitempty"` 606 607 // ForceSendFields is a list of field names (e.g. "FeatureName") to 608 // unconditionally include in API requests. By default, fields with 609 // empty values are omitted from API requests. However, any non-pointer, 610 // non-interface field appearing in ForceSendFields will be sent to the 611 // server regardless of whether the field is empty or not. This may be 612 // used to include empty fields in Patch requests. 613 ForceSendFields []string `json:"-"` 614 615 // NullFields is a list of field names (e.g. "FeatureName") to include 616 // in API requests with the JSON null value. By default, fields with 617 // empty values are omitted from API requests. However, any field with 618 // an empty value appearing in NullFields will be sent to the server as 619 // null. It is an error if a field in this list has a non-empty value. 620 // This may be used to include null fields in Patch requests. 621 NullFields []string `json:"-"` 622} 623 624func (s *AboutFeatures) MarshalJSON() ([]byte, error) { 625 type NoMethod AboutFeatures 626 raw := NoMethod(*s) 627 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 628} 629 630func (s *AboutFeatures) UnmarshalJSON(data []byte) error { 631 type NoMethod AboutFeatures 632 var s1 struct { 633 FeatureRate gensupport.JSONFloat64 `json:"featureRate"` 634 *NoMethod 635 } 636 s1.NoMethod = (*NoMethod)(s) 637 if err := json.Unmarshal(data, &s1); err != nil { 638 return err 639 } 640 s.FeatureRate = float64(s1.FeatureRate) 641 return nil 642} 643 644type AboutImportFormats struct { 645 // Source: The imported file's content type to convert from. 646 Source string `json:"source,omitempty"` 647 648 // Targets: The possible content types to convert to. 649 Targets []string `json:"targets,omitempty"` 650 651 // ForceSendFields is a list of field names (e.g. "Source") to 652 // unconditionally include in API requests. By default, fields with 653 // empty values are omitted from API requests. However, any non-pointer, 654 // non-interface field appearing in ForceSendFields will be sent to the 655 // server regardless of whether the field is empty or not. This may be 656 // used to include empty fields in Patch requests. 657 ForceSendFields []string `json:"-"` 658 659 // NullFields is a list of field names (e.g. "Source") to include in API 660 // requests with the JSON null value. By default, fields with empty 661 // values are omitted from API requests. However, any field with an 662 // empty value appearing in NullFields will be sent to the server as 663 // null. It is an error if a field in this list has a non-empty value. 664 // This may be used to include null fields in Patch requests. 665 NullFields []string `json:"-"` 666} 667 668func (s *AboutImportFormats) MarshalJSON() ([]byte, error) { 669 type NoMethod AboutImportFormats 670 raw := NoMethod(*s) 671 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 672} 673 674type AboutMaxUploadSizes struct { 675 // Size: The max upload size for this type. 676 Size int64 `json:"size,omitempty,string"` 677 678 // Type: The file type. 679 Type string `json:"type,omitempty"` 680 681 // ForceSendFields is a list of field names (e.g. "Size") to 682 // unconditionally include in API requests. By default, fields with 683 // empty values are omitted from API requests. However, any non-pointer, 684 // non-interface field appearing in ForceSendFields will be sent to the 685 // server regardless of whether the field is empty or not. This may be 686 // used to include empty fields in Patch requests. 687 ForceSendFields []string `json:"-"` 688 689 // NullFields is a list of field names (e.g. "Size") to include in API 690 // requests with the JSON null value. By default, fields with empty 691 // values are omitted from API requests. However, any field with an 692 // empty value appearing in NullFields will be sent to the server as 693 // null. It is an error if a field in this list has a non-empty value. 694 // This may be used to include null fields in Patch requests. 695 NullFields []string `json:"-"` 696} 697 698func (s *AboutMaxUploadSizes) MarshalJSON() ([]byte, error) { 699 type NoMethod AboutMaxUploadSizes 700 raw := NoMethod(*s) 701 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 702} 703 704type AboutQuotaBytesByService struct { 705 // BytesUsed: The storage quota bytes used by the service. 706 BytesUsed int64 `json:"bytesUsed,omitempty,string"` 707 708 // ServiceName: The service's name, e.g. DRIVE, GMAIL, or PHOTOS. 709 ServiceName string `json:"serviceName,omitempty"` 710 711 // ForceSendFields is a list of field names (e.g. "BytesUsed") to 712 // unconditionally include in API requests. By default, fields with 713 // empty values are omitted from API requests. However, any non-pointer, 714 // non-interface field appearing in ForceSendFields will be sent to the 715 // server regardless of whether the field is empty or not. This may be 716 // used to include empty fields in Patch requests. 717 ForceSendFields []string `json:"-"` 718 719 // NullFields is a list of field names (e.g. "BytesUsed") to include in 720 // API requests with the JSON null value. By default, fields with empty 721 // values are omitted from API requests. However, any field with an 722 // empty value appearing in NullFields will be sent to the server as 723 // null. It is an error if a field in this list has a non-empty value. 724 // This may be used to include null fields in Patch requests. 725 NullFields []string `json:"-"` 726} 727 728func (s *AboutQuotaBytesByService) MarshalJSON() ([]byte, error) { 729 type NoMethod AboutQuotaBytesByService 730 raw := NoMethod(*s) 731 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 732} 733 734type AboutTeamDriveThemes struct { 735 // BackgroundImageLink: Deprecated - use driveThemes/backgroundImageLink 736 // instead. 737 BackgroundImageLink string `json:"backgroundImageLink,omitempty"` 738 739 // ColorRgb: Deprecated - use driveThemes/colorRgb instead. 740 ColorRgb string `json:"colorRgb,omitempty"` 741 742 // Id: Deprecated - use driveThemes/id instead. 743 Id string `json:"id,omitempty"` 744 745 // ForceSendFields is a list of field names (e.g. "BackgroundImageLink") 746 // to unconditionally include in API requests. By default, fields with 747 // empty values are omitted from API requests. However, any non-pointer, 748 // non-interface field appearing in ForceSendFields will be sent to the 749 // server regardless of whether the field is empty or not. This may be 750 // used to include empty fields in Patch requests. 751 ForceSendFields []string `json:"-"` 752 753 // NullFields is a list of field names (e.g. "BackgroundImageLink") to 754 // include in API requests with the JSON null value. By default, fields 755 // with empty values are omitted from API requests. However, any field 756 // with an empty value appearing in NullFields will be sent to the 757 // server as null. It is an error if a field in this list has a 758 // non-empty value. This may be used to include null fields in Patch 759 // requests. 760 NullFields []string `json:"-"` 761} 762 763func (s *AboutTeamDriveThemes) MarshalJSON() ([]byte, error) { 764 type NoMethod AboutTeamDriveThemes 765 raw := NoMethod(*s) 766 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 767} 768 769// App: The apps resource provides a list of the apps that a user has 770// installed, with information about each app's supported MIME types, 771// file extensions, and other details. 772type App struct { 773 // Authorized: Whether the app is authorized to access data on the 774 // user's Drive. 775 Authorized bool `json:"authorized,omitempty"` 776 777 // CreateInFolderTemplate: The template url to create a new file with 778 // this app in a given folder. The template will contain {folderId} to 779 // be replaced by the folder to create the new file in. 780 CreateInFolderTemplate string `json:"createInFolderTemplate,omitempty"` 781 782 // CreateUrl: The url to create a new file with this app. 783 CreateUrl string `json:"createUrl,omitempty"` 784 785 // HasDriveWideScope: Whether the app has drive-wide scope. An app with 786 // drive-wide scope can access all files in the user's drive. 787 HasDriveWideScope bool `json:"hasDriveWideScope,omitempty"` 788 789 // Icons: The various icons for the app. 790 Icons []*AppIcons `json:"icons,omitempty"` 791 792 // Id: The ID of the app. 793 Id string `json:"id,omitempty"` 794 795 // Installed: Whether the app is installed. 796 Installed bool `json:"installed,omitempty"` 797 798 // Kind: This is always drive#app. 799 Kind string `json:"kind,omitempty"` 800 801 // LongDescription: A long description of the app. 802 LongDescription string `json:"longDescription,omitempty"` 803 804 // Name: The name of the app. 805 Name string `json:"name,omitempty"` 806 807 // ObjectType: The type of object this app creates (e.g. Chart). If 808 // empty, the app name should be used instead. 809 ObjectType string `json:"objectType,omitempty"` 810 811 // OpenUrlTemplate: The template url for opening files with this app. 812 // The template will contain {ids} and/or {exportIds} to be replaced by 813 // the actual file ids. See Open Files for the full documentation. 814 OpenUrlTemplate string `json:"openUrlTemplate,omitempty"` 815 816 // PrimaryFileExtensions: The list of primary file extensions. 817 PrimaryFileExtensions []string `json:"primaryFileExtensions,omitempty"` 818 819 // PrimaryMimeTypes: The list of primary mime types. 820 PrimaryMimeTypes []string `json:"primaryMimeTypes,omitempty"` 821 822 // ProductId: The ID of the product listing for this app. 823 ProductId string `json:"productId,omitempty"` 824 825 // ProductUrl: A link to the product listing for this app. 826 ProductUrl string `json:"productUrl,omitempty"` 827 828 // SecondaryFileExtensions: The list of secondary file extensions. 829 SecondaryFileExtensions []string `json:"secondaryFileExtensions,omitempty"` 830 831 // SecondaryMimeTypes: The list of secondary mime types. 832 SecondaryMimeTypes []string `json:"secondaryMimeTypes,omitempty"` 833 834 // ShortDescription: A short description of the app. 835 ShortDescription string `json:"shortDescription,omitempty"` 836 837 // SupportsCreate: Whether this app supports creating new objects. 838 SupportsCreate bool `json:"supportsCreate,omitempty"` 839 840 // SupportsImport: Whether this app supports importing from Docs 841 // Editors. 842 SupportsImport bool `json:"supportsImport,omitempty"` 843 844 // SupportsMultiOpen: Whether this app supports opening more than one 845 // file. 846 SupportsMultiOpen bool `json:"supportsMultiOpen,omitempty"` 847 848 // SupportsOfflineCreate: Whether this app supports creating new files 849 // when offline. 850 SupportsOfflineCreate bool `json:"supportsOfflineCreate,omitempty"` 851 852 // UseByDefault: Whether the app is selected as the default handler for 853 // the types it supports. 854 UseByDefault bool `json:"useByDefault,omitempty"` 855 856 // ServerResponse contains the HTTP response code and headers from the 857 // server. 858 googleapi.ServerResponse `json:"-"` 859 860 // ForceSendFields is a list of field names (e.g. "Authorized") to 861 // unconditionally include in API requests. By default, fields with 862 // empty values are omitted from API requests. However, any non-pointer, 863 // non-interface field appearing in ForceSendFields will be sent to the 864 // server regardless of whether the field is empty or not. This may be 865 // used to include empty fields in Patch requests. 866 ForceSendFields []string `json:"-"` 867 868 // NullFields is a list of field names (e.g. "Authorized") to include in 869 // API requests with the JSON null value. By default, fields with empty 870 // values are omitted from API requests. However, any field with an 871 // empty value appearing in NullFields will be sent to the server as 872 // null. It is an error if a field in this list has a non-empty value. 873 // This may be used to include null fields in Patch requests. 874 NullFields []string `json:"-"` 875} 876 877func (s *App) MarshalJSON() ([]byte, error) { 878 type NoMethod App 879 raw := NoMethod(*s) 880 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 881} 882 883type AppIcons struct { 884 // Category: Category of the icon. Allowed values are: 885 // - application - icon for the application 886 // - document - icon for a file associated with the app 887 // - documentShared - icon for a shared file associated with the app 888 Category string `json:"category,omitempty"` 889 890 // IconUrl: URL for the icon. 891 IconUrl string `json:"iconUrl,omitempty"` 892 893 // Size: Size of the icon. Represented as the maximum of the width and 894 // height. 895 Size int64 `json:"size,omitempty"` 896 897 // ForceSendFields is a list of field names (e.g. "Category") to 898 // unconditionally include in API requests. By default, fields with 899 // empty values are omitted from API requests. However, any non-pointer, 900 // non-interface field appearing in ForceSendFields will be sent to the 901 // server regardless of whether the field is empty or not. This may be 902 // used to include empty fields in Patch requests. 903 ForceSendFields []string `json:"-"` 904 905 // NullFields is a list of field names (e.g. "Category") to include in 906 // API requests with the JSON null value. By default, fields with empty 907 // values are omitted from API requests. However, any field with an 908 // empty value appearing in NullFields will be sent to the server as 909 // null. It is an error if a field in this list has a non-empty value. 910 // This may be used to include null fields in Patch requests. 911 NullFields []string `json:"-"` 912} 913 914func (s *AppIcons) MarshalJSON() ([]byte, error) { 915 type NoMethod AppIcons 916 raw := NoMethod(*s) 917 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 918} 919 920// AppList: A list of third-party applications which the user has 921// installed or given access to Google Drive. 922type AppList struct { 923 // DefaultAppIds: List of app IDs that the user has specified to use by 924 // default. The list is in reverse-priority order (lowest to highest). 925 DefaultAppIds []string `json:"defaultAppIds,omitempty"` 926 927 // Etag: The ETag of the list. 928 Etag string `json:"etag,omitempty"` 929 930 // Items: The list of apps. 931 Items []*App `json:"items,omitempty"` 932 933 // Kind: This is always drive#appList. 934 Kind string `json:"kind,omitempty"` 935 936 // SelfLink: A link back to this list. 937 SelfLink string `json:"selfLink,omitempty"` 938 939 // ServerResponse contains the HTTP response code and headers from the 940 // server. 941 googleapi.ServerResponse `json:"-"` 942 943 // ForceSendFields is a list of field names (e.g. "DefaultAppIds") to 944 // unconditionally include in API requests. By default, fields with 945 // empty values are omitted from API requests. However, any non-pointer, 946 // non-interface field appearing in ForceSendFields will be sent to the 947 // server regardless of whether the field is empty or not. This may be 948 // used to include empty fields in Patch requests. 949 ForceSendFields []string `json:"-"` 950 951 // NullFields is a list of field names (e.g. "DefaultAppIds") to include 952 // in API requests with the JSON null value. By default, fields with 953 // empty values are omitted from API requests. However, any field with 954 // an empty value appearing in NullFields will be sent to the server as 955 // null. It is an error if a field in this list has a non-empty value. 956 // This may be used to include null fields in Patch requests. 957 NullFields []string `json:"-"` 958} 959 960func (s *AppList) MarshalJSON() ([]byte, error) { 961 type NoMethod AppList 962 raw := NoMethod(*s) 963 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 964} 965 966// Change: Representation of a change to a file or shared drive. 967type Change struct { 968 // ChangeType: The type of the change. Possible values are file and 969 // drive. 970 ChangeType string `json:"changeType,omitempty"` 971 972 // Deleted: Whether the file or shared drive has been removed from this 973 // list of changes, for example by deletion or loss of access. 974 Deleted bool `json:"deleted,omitempty"` 975 976 // Drive: The updated state of the shared drive. Present if the 977 // changeType is drive, the user is still a member of the shared drive, 978 // and the shared drive has not been deleted. 979 Drive *Drive `json:"drive,omitempty"` 980 981 // DriveId: The ID of the shared drive associated with this change. 982 DriveId string `json:"driveId,omitempty"` 983 984 // File: The updated state of the file. Present if the type is file and 985 // the file has not been removed from this list of changes. 986 File *File `json:"file,omitempty"` 987 988 // FileId: The ID of the file associated with this change. 989 FileId string `json:"fileId,omitempty"` 990 991 // Id: The ID of the change. 992 Id int64 `json:"id,omitempty,string"` 993 994 // Kind: This is always drive#change. 995 Kind string `json:"kind,omitempty"` 996 997 // ModificationDate: The time of this modification. 998 ModificationDate string `json:"modificationDate,omitempty"` 999 1000 // SelfLink: A link back to this change. 1001 SelfLink string `json:"selfLink,omitempty"` 1002 1003 // TeamDrive: Deprecated - use drive instead. 1004 TeamDrive *TeamDrive `json:"teamDrive,omitempty"` 1005 1006 // TeamDriveId: Deprecated - use driveId instead. 1007 TeamDriveId string `json:"teamDriveId,omitempty"` 1008 1009 // Type: Deprecated - use changeType instead. 1010 Type string `json:"type,omitempty"` 1011 1012 // ServerResponse contains the HTTP response code and headers from the 1013 // server. 1014 googleapi.ServerResponse `json:"-"` 1015 1016 // ForceSendFields is a list of field names (e.g. "ChangeType") to 1017 // unconditionally include in API requests. By default, fields with 1018 // empty values are omitted from API requests. However, any non-pointer, 1019 // non-interface field appearing in ForceSendFields will be sent to the 1020 // server regardless of whether the field is empty or not. This may be 1021 // used to include empty fields in Patch requests. 1022 ForceSendFields []string `json:"-"` 1023 1024 // NullFields is a list of field names (e.g. "ChangeType") to include in 1025 // API requests with the JSON null value. By default, fields with empty 1026 // values are omitted from API requests. However, any field with an 1027 // empty value appearing in NullFields will be sent to the server as 1028 // null. It is an error if a field in this list has a non-empty value. 1029 // This may be used to include null fields in Patch requests. 1030 NullFields []string `json:"-"` 1031} 1032 1033func (s *Change) MarshalJSON() ([]byte, error) { 1034 type NoMethod Change 1035 raw := NoMethod(*s) 1036 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1037} 1038 1039// ChangeList: A list of changes for a user. 1040type ChangeList struct { 1041 // Etag: The ETag of the list. 1042 Etag string `json:"etag,omitempty"` 1043 1044 // Items: The list of changes. If nextPageToken is populated, then this 1045 // list may be incomplete and an additional page of results should be 1046 // fetched. 1047 Items []*Change `json:"items,omitempty"` 1048 1049 // Kind: This is always drive#changeList. 1050 Kind string `json:"kind,omitempty"` 1051 1052 // LargestChangeId: The current largest change ID. 1053 LargestChangeId int64 `json:"largestChangeId,omitempty,string"` 1054 1055 // NewStartPageToken: The starting page token for future changes. This 1056 // will be present only if the end of the current changes list has been 1057 // reached. 1058 NewStartPageToken string `json:"newStartPageToken,omitempty"` 1059 1060 // NextLink: A link to the next page of changes. 1061 NextLink string `json:"nextLink,omitempty"` 1062 1063 // NextPageToken: The page token for the next page of changes. This will 1064 // be absent if the end of the changes list has been reached. If the 1065 // token is rejected for any reason, it should be discarded, and 1066 // pagination should be restarted from the first page of results. 1067 NextPageToken string `json:"nextPageToken,omitempty"` 1068 1069 // SelfLink: A link back to this list. 1070 SelfLink string `json:"selfLink,omitempty"` 1071 1072 // ServerResponse contains the HTTP response code and headers from the 1073 // server. 1074 googleapi.ServerResponse `json:"-"` 1075 1076 // ForceSendFields is a list of field names (e.g. "Etag") to 1077 // unconditionally include in API requests. By default, fields with 1078 // empty values are omitted from API requests. However, any non-pointer, 1079 // non-interface field appearing in ForceSendFields will be sent to the 1080 // server regardless of whether the field is empty or not. This may be 1081 // used to include empty fields in Patch requests. 1082 ForceSendFields []string `json:"-"` 1083 1084 // NullFields is a list of field names (e.g. "Etag") to include in API 1085 // requests with the JSON null value. By default, fields with empty 1086 // values are omitted from API requests. However, any field with an 1087 // empty value appearing in NullFields will be sent to the server as 1088 // null. It is an error if a field in this list has a non-empty value. 1089 // This may be used to include null fields in Patch requests. 1090 NullFields []string `json:"-"` 1091} 1092 1093func (s *ChangeList) MarshalJSON() ([]byte, error) { 1094 type NoMethod ChangeList 1095 raw := NoMethod(*s) 1096 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1097} 1098 1099// Channel: An notification channel used to watch for resource changes. 1100type Channel struct { 1101 // Address: The address where notifications are delivered for this 1102 // channel. 1103 Address string `json:"address,omitempty"` 1104 1105 // Expiration: Date and time of notification channel expiration, 1106 // expressed as a Unix timestamp, in milliseconds. Optional. 1107 Expiration int64 `json:"expiration,omitempty,string"` 1108 1109 // Id: A UUID or similar unique string that identifies this channel. 1110 Id string `json:"id,omitempty"` 1111 1112 // Kind: Identifies this as a notification channel used to watch for 1113 // changes to a resource, which is "api#channel". 1114 Kind string `json:"kind,omitempty"` 1115 1116 // Params: Additional parameters controlling delivery channel behavior. 1117 // Optional. 1118 Params map[string]string `json:"params,omitempty"` 1119 1120 // Payload: A Boolean value to indicate whether payload is wanted. 1121 // Optional. 1122 Payload bool `json:"payload,omitempty"` 1123 1124 // ResourceId: An opaque ID that identifies the resource being watched 1125 // on this channel. Stable across different API versions. 1126 ResourceId string `json:"resourceId,omitempty"` 1127 1128 // ResourceUri: A version-specific identifier for the watched resource. 1129 ResourceUri string `json:"resourceUri,omitempty"` 1130 1131 // Token: An arbitrary string delivered to the target address with each 1132 // notification delivered over this channel. Optional. 1133 Token string `json:"token,omitempty"` 1134 1135 // Type: The type of delivery mechanism used for this channel. Valid 1136 // values are "web_hook" (or "webhook"). Both values refer to a channel 1137 // where Http requests are used to deliver messages. 1138 Type string `json:"type,omitempty"` 1139 1140 // ServerResponse contains the HTTP response code and headers from the 1141 // server. 1142 googleapi.ServerResponse `json:"-"` 1143 1144 // ForceSendFields is a list of field names (e.g. "Address") to 1145 // unconditionally include in API requests. By default, fields with 1146 // empty values are omitted from API requests. However, any non-pointer, 1147 // non-interface field appearing in ForceSendFields will be sent to the 1148 // server regardless of whether the field is empty or not. This may be 1149 // used to include empty fields in Patch requests. 1150 ForceSendFields []string `json:"-"` 1151 1152 // NullFields is a list of field names (e.g. "Address") to include in 1153 // API requests with the JSON null value. By default, fields with empty 1154 // values are omitted from API requests. However, any field with an 1155 // empty value appearing in NullFields will be sent to the server as 1156 // null. It is an error if a field in this list has a non-empty value. 1157 // This may be used to include null fields in Patch requests. 1158 NullFields []string `json:"-"` 1159} 1160 1161func (s *Channel) MarshalJSON() ([]byte, error) { 1162 type NoMethod Channel 1163 raw := NoMethod(*s) 1164 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1165} 1166 1167// ChildList: A list of children of a file. 1168type ChildList struct { 1169 // Etag: The ETag of the list. 1170 Etag string `json:"etag,omitempty"` 1171 1172 // Items: The list of children. If nextPageToken is populated, then this 1173 // list may be incomplete and an additional page of results should be 1174 // fetched. 1175 Items []*ChildReference `json:"items,omitempty"` 1176 1177 // Kind: This is always drive#childList. 1178 Kind string `json:"kind,omitempty"` 1179 1180 // NextLink: A link to the next page of children. 1181 NextLink string `json:"nextLink,omitempty"` 1182 1183 // NextPageToken: The page token for the next page of children. This 1184 // will be absent if the end of the children list has been reached. If 1185 // the token is rejected for any reason, it should be discarded, and 1186 // pagination should be restarted from the first page of results. 1187 NextPageToken string `json:"nextPageToken,omitempty"` 1188 1189 // SelfLink: A link back to this list. 1190 SelfLink string `json:"selfLink,omitempty"` 1191 1192 // ServerResponse contains the HTTP response code and headers from the 1193 // server. 1194 googleapi.ServerResponse `json:"-"` 1195 1196 // ForceSendFields is a list of field names (e.g. "Etag") to 1197 // unconditionally include in API requests. By default, fields with 1198 // empty values are omitted from API requests. However, any non-pointer, 1199 // non-interface field appearing in ForceSendFields will be sent to the 1200 // server regardless of whether the field is empty or not. This may be 1201 // used to include empty fields in Patch requests. 1202 ForceSendFields []string `json:"-"` 1203 1204 // NullFields is a list of field names (e.g. "Etag") to include in API 1205 // requests with the JSON null value. By default, fields with empty 1206 // values are omitted from API requests. However, any field with an 1207 // empty value appearing in NullFields will be sent to the server as 1208 // null. It is an error if a field in this list has a non-empty value. 1209 // This may be used to include null fields in Patch requests. 1210 NullFields []string `json:"-"` 1211} 1212 1213func (s *ChildList) MarshalJSON() ([]byte, error) { 1214 type NoMethod ChildList 1215 raw := NoMethod(*s) 1216 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1217} 1218 1219// ChildReference: A reference to a folder's child. 1220type ChildReference struct { 1221 // ChildLink: A link to the child. 1222 ChildLink string `json:"childLink,omitempty"` 1223 1224 // Id: The ID of the child. 1225 Id string `json:"id,omitempty"` 1226 1227 // Kind: This is always drive#childReference. 1228 Kind string `json:"kind,omitempty"` 1229 1230 // SelfLink: A link back to this reference. 1231 SelfLink string `json:"selfLink,omitempty"` 1232 1233 // ServerResponse contains the HTTP response code and headers from the 1234 // server. 1235 googleapi.ServerResponse `json:"-"` 1236 1237 // ForceSendFields is a list of field names (e.g. "ChildLink") to 1238 // unconditionally include in API requests. By default, fields with 1239 // empty values are omitted from API requests. However, any non-pointer, 1240 // non-interface field appearing in ForceSendFields will be sent to the 1241 // server regardless of whether the field is empty or not. This may be 1242 // used to include empty fields in Patch requests. 1243 ForceSendFields []string `json:"-"` 1244 1245 // NullFields is a list of field names (e.g. "ChildLink") to include in 1246 // API requests with the JSON null value. By default, fields with empty 1247 // values are omitted from API requests. However, any field with an 1248 // empty value appearing in NullFields will be sent to the server as 1249 // null. It is an error if a field in this list has a non-empty value. 1250 // This may be used to include null fields in Patch requests. 1251 NullFields []string `json:"-"` 1252} 1253 1254func (s *ChildReference) MarshalJSON() ([]byte, error) { 1255 type NoMethod ChildReference 1256 raw := NoMethod(*s) 1257 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1258} 1259 1260// Comment: A comment on a file in Google Drive. 1261type Comment struct { 1262 // Anchor: A region of the document represented as a JSON string. See 1263 // anchor documentation for details on how to define and interpret 1264 // anchor properties. 1265 Anchor string `json:"anchor,omitempty"` 1266 1267 // Author: The author of the comment. The author's email address and 1268 // permission ID will not be populated. 1269 Author *User `json:"author,omitempty"` 1270 1271 // CommentId: The ID of the comment. 1272 CommentId string `json:"commentId,omitempty"` 1273 1274 // Content: The plain text content used to create this comment. This is 1275 // not HTML safe and should only be used as a starting point to make 1276 // edits to a comment's content. 1277 Content string `json:"content,omitempty"` 1278 1279 // Context: The context of the file which is being commented on. 1280 Context *CommentContext `json:"context,omitempty"` 1281 1282 // CreatedDate: The date when this comment was first created. 1283 CreatedDate string `json:"createdDate,omitempty"` 1284 1285 // Deleted: Whether this comment has been deleted. If a comment has been 1286 // deleted the content will be cleared and this will only represent a 1287 // comment that once existed. 1288 Deleted bool `json:"deleted,omitempty"` 1289 1290 // FileId: The file which this comment is addressing. 1291 FileId string `json:"fileId,omitempty"` 1292 1293 // FileTitle: The title of the file which this comment is addressing. 1294 FileTitle string `json:"fileTitle,omitempty"` 1295 1296 // HtmlContent: HTML formatted content for this comment. 1297 HtmlContent string `json:"htmlContent,omitempty"` 1298 1299 // Kind: This is always drive#comment. 1300 Kind string `json:"kind,omitempty"` 1301 1302 // ModifiedDate: The date when this comment or any of its replies were 1303 // last modified. 1304 ModifiedDate string `json:"modifiedDate,omitempty"` 1305 1306 // Replies: Replies to this post. 1307 Replies []*CommentReply `json:"replies,omitempty"` 1308 1309 // SelfLink: A link back to this comment. 1310 SelfLink string `json:"selfLink,omitempty"` 1311 1312 // Status: The status of this comment. Status can be changed by posting 1313 // a reply to a comment with the desired status. 1314 // - "open" - The comment is still open. 1315 // - "resolved" - The comment has been resolved by one of its replies. 1316 Status string `json:"status,omitempty"` 1317 1318 // ServerResponse contains the HTTP response code and headers from the 1319 // server. 1320 googleapi.ServerResponse `json:"-"` 1321 1322 // ForceSendFields is a list of field names (e.g. "Anchor") to 1323 // unconditionally include in API requests. By default, fields with 1324 // empty values are omitted from API requests. However, any non-pointer, 1325 // non-interface field appearing in ForceSendFields will be sent to the 1326 // server regardless of whether the field is empty or not. This may be 1327 // used to include empty fields in Patch requests. 1328 ForceSendFields []string `json:"-"` 1329 1330 // NullFields is a list of field names (e.g. "Anchor") to include in API 1331 // requests with the JSON null value. By default, fields with empty 1332 // values are omitted from API requests. However, any field with an 1333 // empty value appearing in NullFields will be sent to the server as 1334 // null. It is an error if a field in this list has a non-empty value. 1335 // This may be used to include null fields in Patch requests. 1336 NullFields []string `json:"-"` 1337} 1338 1339func (s *Comment) MarshalJSON() ([]byte, error) { 1340 type NoMethod Comment 1341 raw := NoMethod(*s) 1342 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1343} 1344 1345// CommentContext: The context of the file which is being commented on. 1346type CommentContext struct { 1347 // Type: The MIME type of the context snippet. 1348 Type string `json:"type,omitempty"` 1349 1350 // Value: Data representation of the segment of the file being commented 1351 // on. In the case of a text file for example, this would be the actual 1352 // text that the comment is about. 1353 Value string `json:"value,omitempty"` 1354 1355 // ForceSendFields is a list of field names (e.g. "Type") to 1356 // unconditionally include in API requests. By default, fields with 1357 // empty values are omitted from API requests. However, any non-pointer, 1358 // non-interface field appearing in ForceSendFields will be sent to the 1359 // server regardless of whether the field is empty or not. This may be 1360 // used to include empty fields in Patch requests. 1361 ForceSendFields []string `json:"-"` 1362 1363 // NullFields is a list of field names (e.g. "Type") to include in API 1364 // requests with the JSON null value. By default, fields with empty 1365 // values are omitted from API requests. However, any field with an 1366 // empty value appearing in NullFields will be sent to the server as 1367 // null. It is an error if a field in this list has a non-empty value. 1368 // This may be used to include null fields in Patch requests. 1369 NullFields []string `json:"-"` 1370} 1371 1372func (s *CommentContext) MarshalJSON() ([]byte, error) { 1373 type NoMethod CommentContext 1374 raw := NoMethod(*s) 1375 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1376} 1377 1378// CommentList: A list of comments on a file in Google Drive. 1379type CommentList struct { 1380 // Items: The list of comments. If nextPageToken is populated, then this 1381 // list may be incomplete and an additional page of results should be 1382 // fetched. 1383 Items []*Comment `json:"items,omitempty"` 1384 1385 // Kind: This is always drive#commentList. 1386 Kind string `json:"kind,omitempty"` 1387 1388 // NextLink: A link to the next page of comments. 1389 NextLink string `json:"nextLink,omitempty"` 1390 1391 // NextPageToken: The page token for the next page of comments. This 1392 // will be absent if the end of the comments list has been reached. If 1393 // the token is rejected for any reason, it should be discarded, and 1394 // pagination should be restarted from the first page of results. 1395 NextPageToken string `json:"nextPageToken,omitempty"` 1396 1397 // SelfLink: A link back to this list. 1398 SelfLink string `json:"selfLink,omitempty"` 1399 1400 // ServerResponse contains the HTTP response code and headers from the 1401 // server. 1402 googleapi.ServerResponse `json:"-"` 1403 1404 // ForceSendFields is a list of field names (e.g. "Items") to 1405 // unconditionally include in API requests. By default, fields with 1406 // empty values are omitted from API requests. However, any non-pointer, 1407 // non-interface field appearing in ForceSendFields will be sent to the 1408 // server regardless of whether the field is empty or not. This may be 1409 // used to include empty fields in Patch requests. 1410 ForceSendFields []string `json:"-"` 1411 1412 // NullFields is a list of field names (e.g. "Items") to include in API 1413 // requests with the JSON null value. By default, fields with empty 1414 // values are omitted from API requests. However, any field with an 1415 // empty value appearing in NullFields will be sent to the server as 1416 // null. It is an error if a field in this list has a non-empty value. 1417 // This may be used to include null fields in Patch requests. 1418 NullFields []string `json:"-"` 1419} 1420 1421func (s *CommentList) MarshalJSON() ([]byte, error) { 1422 type NoMethod CommentList 1423 raw := NoMethod(*s) 1424 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1425} 1426 1427// CommentReply: A comment on a file in Google Drive. 1428type CommentReply struct { 1429 // Author: The author of the reply. The author's email address and 1430 // permission ID will not be populated. 1431 Author *User `json:"author,omitempty"` 1432 1433 // Content: The plain text content used to create this reply. This is 1434 // not HTML safe and should only be used as a starting point to make 1435 // edits to a reply's content. This field is required on inserts if no 1436 // verb is specified (resolve/reopen). 1437 Content string `json:"content,omitempty"` 1438 1439 // CreatedDate: The date when this reply was first created. 1440 CreatedDate string `json:"createdDate,omitempty"` 1441 1442 // Deleted: Whether this reply has been deleted. If a reply has been 1443 // deleted the content will be cleared and this will only represent a 1444 // reply that once existed. 1445 Deleted bool `json:"deleted,omitempty"` 1446 1447 // HtmlContent: HTML formatted content for this reply. 1448 HtmlContent string `json:"htmlContent,omitempty"` 1449 1450 // Kind: This is always drive#commentReply. 1451 Kind string `json:"kind,omitempty"` 1452 1453 // ModifiedDate: The date when this reply was last modified. 1454 ModifiedDate string `json:"modifiedDate,omitempty"` 1455 1456 // ReplyId: The ID of the reply. 1457 ReplyId string `json:"replyId,omitempty"` 1458 1459 // Verb: The action this reply performed to the parent comment. When 1460 // creating a new reply this is the action to be perform to the parent 1461 // comment. Possible values are: 1462 // - "resolve" - To resolve a comment. 1463 // - "reopen" - To reopen (un-resolve) a comment. 1464 Verb string `json:"verb,omitempty"` 1465 1466 // ServerResponse contains the HTTP response code and headers from the 1467 // server. 1468 googleapi.ServerResponse `json:"-"` 1469 1470 // ForceSendFields is a list of field names (e.g. "Author") to 1471 // unconditionally include in API requests. By default, fields with 1472 // empty values are omitted from API requests. However, any non-pointer, 1473 // non-interface field appearing in ForceSendFields will be sent to the 1474 // server regardless of whether the field is empty or not. This may be 1475 // used to include empty fields in Patch requests. 1476 ForceSendFields []string `json:"-"` 1477 1478 // NullFields is a list of field names (e.g. "Author") to include in API 1479 // requests with the JSON null value. By default, fields with empty 1480 // values are omitted from API requests. However, any field with an 1481 // empty value appearing in NullFields will be sent to the server as 1482 // null. It is an error if a field in this list has a non-empty value. 1483 // This may be used to include null fields in Patch requests. 1484 NullFields []string `json:"-"` 1485} 1486 1487func (s *CommentReply) MarshalJSON() ([]byte, error) { 1488 type NoMethod CommentReply 1489 raw := NoMethod(*s) 1490 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1491} 1492 1493// CommentReplyList: A list of replies to a comment on a file in Google 1494// Drive. 1495type CommentReplyList struct { 1496 // Items: The list of replies. If nextPageToken is populated, then this 1497 // list may be incomplete and an additional page of results should be 1498 // fetched. 1499 Items []*CommentReply `json:"items,omitempty"` 1500 1501 // Kind: This is always drive#commentReplyList. 1502 Kind string `json:"kind,omitempty"` 1503 1504 // NextLink: A link to the next page of replies. 1505 NextLink string `json:"nextLink,omitempty"` 1506 1507 // NextPageToken: The page token for the next page of replies. This will 1508 // be absent if the end of the replies list has been reached. If the 1509 // token is rejected for any reason, it should be discarded, and 1510 // pagination should be restarted from the first page of results. 1511 NextPageToken string `json:"nextPageToken,omitempty"` 1512 1513 // SelfLink: A link back to this list. 1514 SelfLink string `json:"selfLink,omitempty"` 1515 1516 // ServerResponse contains the HTTP response code and headers from the 1517 // server. 1518 googleapi.ServerResponse `json:"-"` 1519 1520 // ForceSendFields is a list of field names (e.g. "Items") to 1521 // unconditionally include in API requests. By default, fields with 1522 // empty values are omitted from API requests. However, any non-pointer, 1523 // non-interface field appearing in ForceSendFields will be sent to the 1524 // server regardless of whether the field is empty or not. This may be 1525 // used to include empty fields in Patch requests. 1526 ForceSendFields []string `json:"-"` 1527 1528 // NullFields is a list of field names (e.g. "Items") to include in API 1529 // requests with the JSON null value. By default, fields with empty 1530 // values are omitted from API requests. However, any field with an 1531 // empty value appearing in NullFields will be sent to the server as 1532 // null. It is an error if a field in this list has a non-empty value. 1533 // This may be used to include null fields in Patch requests. 1534 NullFields []string `json:"-"` 1535} 1536 1537func (s *CommentReplyList) MarshalJSON() ([]byte, error) { 1538 type NoMethod CommentReplyList 1539 raw := NoMethod(*s) 1540 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1541} 1542 1543// ContentRestriction: A restriction for accessing the content of the 1544// file. 1545type ContentRestriction struct { 1546 // ReadOnly: Whether the content of the file is read-only. If a file is 1547 // read-only, a new revision of the file may not be added, comments may 1548 // not be added or modified, and the title of the file may not be 1549 // modified. 1550 ReadOnly bool `json:"readOnly,omitempty"` 1551 1552 // Reason: Reason for why the content of the file is restricted. This is 1553 // only mutable on requests that also set readOnly=true. 1554 Reason string `json:"reason,omitempty"` 1555 1556 // RestrictingUser: The user who set the content restriction. Only 1557 // populated if readOnly is true. 1558 RestrictingUser *User `json:"restrictingUser,omitempty"` 1559 1560 // RestrictionDate: The time at which the content restriction was set 1561 // (formatted RFC 3339 timestamp). Only populated if readOnly is true. 1562 RestrictionDate string `json:"restrictionDate,omitempty"` 1563 1564 // Type: The type of the content restriction. Currently the only 1565 // possible value is globalContentRestriction. 1566 Type string `json:"type,omitempty"` 1567 1568 // ForceSendFields is a list of field names (e.g. "ReadOnly") to 1569 // unconditionally include in API requests. By default, fields with 1570 // empty values are omitted from API requests. However, any non-pointer, 1571 // non-interface field appearing in ForceSendFields will be sent to the 1572 // server regardless of whether the field is empty or not. This may be 1573 // used to include empty fields in Patch requests. 1574 ForceSendFields []string `json:"-"` 1575 1576 // NullFields is a list of field names (e.g. "ReadOnly") to include in 1577 // API requests with the JSON null value. By default, fields with empty 1578 // values are omitted from API requests. However, any field with an 1579 // empty value appearing in NullFields will be sent to the server as 1580 // null. It is an error if a field in this list has a non-empty value. 1581 // This may be used to include null fields in Patch requests. 1582 NullFields []string `json:"-"` 1583} 1584 1585func (s *ContentRestriction) MarshalJSON() ([]byte, error) { 1586 type NoMethod ContentRestriction 1587 raw := NoMethod(*s) 1588 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1589} 1590 1591// Drive: Representation of a shared drive. 1592type Drive struct { 1593 // BackgroundImageFile: An image file and cropping parameters from which 1594 // a background image for this shared drive is set. This is a write only 1595 // field; it can only be set on drive.drives.update requests that don't 1596 // set themeId. When specified, all fields of the backgroundImageFile 1597 // must be set. 1598 BackgroundImageFile *DriveBackgroundImageFile `json:"backgroundImageFile,omitempty"` 1599 1600 // BackgroundImageLink: A short-lived link to this shared drive's 1601 // background image. 1602 BackgroundImageLink string `json:"backgroundImageLink,omitempty"` 1603 1604 // Capabilities: Capabilities the current user has on this shared drive. 1605 Capabilities *DriveCapabilities `json:"capabilities,omitempty"` 1606 1607 // ColorRgb: The color of this shared drive as an RGB hex string. It can 1608 // only be set on a drive.drives.update request that does not set 1609 // themeId. 1610 ColorRgb string `json:"colorRgb,omitempty"` 1611 1612 // CreatedDate: The time at which the shared drive was created (RFC 3339 1613 // date-time). 1614 CreatedDate string `json:"createdDate,omitempty"` 1615 1616 // Hidden: Whether the shared drive is hidden from default view. 1617 Hidden bool `json:"hidden,omitempty"` 1618 1619 // Id: The ID of this shared drive which is also the ID of the top level 1620 // folder of this shared drive. 1621 Id string `json:"id,omitempty"` 1622 1623 // Kind: This is always drive#drive 1624 Kind string `json:"kind,omitempty"` 1625 1626 // Name: The name of this shared drive. 1627 Name string `json:"name,omitempty"` 1628 1629 // Restrictions: A set of restrictions that apply to this shared drive 1630 // or items inside this shared drive. 1631 Restrictions *DriveRestrictions `json:"restrictions,omitempty"` 1632 1633 // ThemeId: The ID of the theme from which the background image and 1634 // color will be set. The set of possible driveThemes can be retrieved 1635 // from a drive.about.get response. When not specified on a 1636 // drive.drives.insert request, a random theme is chosen from which the 1637 // background image and color are set. This is a write-only field; it 1638 // can only be set on requests that don't set colorRgb or 1639 // backgroundImageFile. 1640 ThemeId string `json:"themeId,omitempty"` 1641 1642 // ServerResponse contains the HTTP response code and headers from the 1643 // server. 1644 googleapi.ServerResponse `json:"-"` 1645 1646 // ForceSendFields is a list of field names (e.g. "BackgroundImageFile") 1647 // to unconditionally include in API requests. By default, fields with 1648 // empty values are omitted from API requests. However, any non-pointer, 1649 // non-interface field appearing in ForceSendFields will be sent to the 1650 // server regardless of whether the field is empty or not. This may be 1651 // used to include empty fields in Patch requests. 1652 ForceSendFields []string `json:"-"` 1653 1654 // NullFields is a list of field names (e.g. "BackgroundImageFile") to 1655 // include in API requests with the JSON null value. By default, fields 1656 // with empty values are omitted from API requests. However, any field 1657 // with an empty value appearing in NullFields will be sent to the 1658 // server as null. It is an error if a field in this list has a 1659 // non-empty value. This may be used to include null fields in Patch 1660 // requests. 1661 NullFields []string `json:"-"` 1662} 1663 1664func (s *Drive) MarshalJSON() ([]byte, error) { 1665 type NoMethod Drive 1666 raw := NoMethod(*s) 1667 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1668} 1669 1670// DriveBackgroundImageFile: An image file and cropping parameters from 1671// which a background image for this shared drive is set. This is a 1672// write only field; it can only be set on drive.drives.update requests 1673// that don't set themeId. When specified, all fields of the 1674// backgroundImageFile must be set. 1675type DriveBackgroundImageFile struct { 1676 // Id: The ID of an image file in Google Drive to use for the background 1677 // image. 1678 Id string `json:"id,omitempty"` 1679 1680 // Width: The width of the cropped image in the closed range of 0 to 1. 1681 // This value represents the width of the cropped image divided by the 1682 // width of the entire image. The height is computed by applying a width 1683 // to height aspect ratio of 80 to 9. The resulting image must be at 1684 // least 1280 pixels wide and 144 pixels high. 1685 Width float64 `json:"width,omitempty"` 1686 1687 // XCoordinate: The X coordinate of the upper left corner of the 1688 // cropping area in the background image. This is a value in the closed 1689 // range of 0 to 1. This value represents the horizontal distance from 1690 // the left side of the entire image to the left side of the cropping 1691 // area divided by the width of the entire image. 1692 XCoordinate float64 `json:"xCoordinate,omitempty"` 1693 1694 // YCoordinate: The Y coordinate of the upper left corner of the 1695 // cropping area in the background image. This is a value in the closed 1696 // range of 0 to 1. This value represents the vertical distance from the 1697 // top side of the entire image to the top side of the cropping area 1698 // divided by the height of the entire image. 1699 YCoordinate float64 `json:"yCoordinate,omitempty"` 1700 1701 // ForceSendFields is a list of field names (e.g. "Id") to 1702 // unconditionally include in API requests. By default, fields with 1703 // empty values are omitted from API requests. However, any non-pointer, 1704 // non-interface field appearing in ForceSendFields will be sent to the 1705 // server regardless of whether the field is empty or not. This may be 1706 // used to include empty fields in Patch requests. 1707 ForceSendFields []string `json:"-"` 1708 1709 // NullFields is a list of field names (e.g. "Id") to include in API 1710 // requests with the JSON null value. By default, fields with empty 1711 // values are omitted from API requests. However, any field with an 1712 // empty value appearing in NullFields will be sent to the server as 1713 // null. It is an error if a field in this list has a non-empty value. 1714 // This may be used to include null fields in Patch requests. 1715 NullFields []string `json:"-"` 1716} 1717 1718func (s *DriveBackgroundImageFile) MarshalJSON() ([]byte, error) { 1719 type NoMethod DriveBackgroundImageFile 1720 raw := NoMethod(*s) 1721 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1722} 1723 1724func (s *DriveBackgroundImageFile) UnmarshalJSON(data []byte) error { 1725 type NoMethod DriveBackgroundImageFile 1726 var s1 struct { 1727 Width gensupport.JSONFloat64 `json:"width"` 1728 XCoordinate gensupport.JSONFloat64 `json:"xCoordinate"` 1729 YCoordinate gensupport.JSONFloat64 `json:"yCoordinate"` 1730 *NoMethod 1731 } 1732 s1.NoMethod = (*NoMethod)(s) 1733 if err := json.Unmarshal(data, &s1); err != nil { 1734 return err 1735 } 1736 s.Width = float64(s1.Width) 1737 s.XCoordinate = float64(s1.XCoordinate) 1738 s.YCoordinate = float64(s1.YCoordinate) 1739 return nil 1740} 1741 1742// DriveCapabilities: Capabilities the current user has on this shared 1743// drive. 1744type DriveCapabilities struct { 1745 // CanAddChildren: Whether the current user can add children to folders 1746 // in this shared drive. 1747 CanAddChildren bool `json:"canAddChildren,omitempty"` 1748 1749 // CanChangeCopyRequiresWriterPermissionRestriction: Whether the current 1750 // user can change the copyRequiresWriterPermission restriction of this 1751 // shared drive. 1752 CanChangeCopyRequiresWriterPermissionRestriction bool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"` 1753 1754 // CanChangeDomainUsersOnlyRestriction: Whether the current user can 1755 // change the domainUsersOnly restriction of this shared drive. 1756 CanChangeDomainUsersOnlyRestriction bool `json:"canChangeDomainUsersOnlyRestriction,omitempty"` 1757 1758 // CanChangeDriveBackground: Whether the current user can change the 1759 // background of this shared drive. 1760 CanChangeDriveBackground bool `json:"canChangeDriveBackground,omitempty"` 1761 1762 // CanChangeDriveMembersOnlyRestriction: Whether the current user can 1763 // change the driveMembersOnly restriction of this shared drive. 1764 CanChangeDriveMembersOnlyRestriction bool `json:"canChangeDriveMembersOnlyRestriction,omitempty"` 1765 1766 // CanComment: Whether the current user can comment on files in this 1767 // shared drive. 1768 CanComment bool `json:"canComment,omitempty"` 1769 1770 // CanCopy: Whether the current user can copy files in this shared 1771 // drive. 1772 CanCopy bool `json:"canCopy,omitempty"` 1773 1774 // CanDeleteChildren: Whether the current user can delete children from 1775 // folders in this shared drive. 1776 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"` 1777 1778 // CanDeleteDrive: Whether the current user can delete this shared 1779 // drive. Attempting to delete the shared drive may still fail if there 1780 // are untrashed items inside the shared drive. 1781 CanDeleteDrive bool `json:"canDeleteDrive,omitempty"` 1782 1783 // CanDownload: Whether the current user can download files in this 1784 // shared drive. 1785 CanDownload bool `json:"canDownload,omitempty"` 1786 1787 // CanEdit: Whether the current user can edit files in this shared drive 1788 CanEdit bool `json:"canEdit,omitempty"` 1789 1790 // CanListChildren: Whether the current user can list the children of 1791 // folders in this shared drive. 1792 CanListChildren bool `json:"canListChildren,omitempty"` 1793 1794 // CanManageMembers: Whether the current user can add members to this 1795 // shared drive or remove them or change their role. 1796 CanManageMembers bool `json:"canManageMembers,omitempty"` 1797 1798 // CanReadRevisions: Whether the current user can read the revisions 1799 // resource of files in this shared drive. 1800 CanReadRevisions bool `json:"canReadRevisions,omitempty"` 1801 1802 // CanRename: Whether the current user can rename files or folders in 1803 // this shared drive. 1804 CanRename bool `json:"canRename,omitempty"` 1805 1806 // CanRenameDrive: Whether the current user can rename this shared 1807 // drive. 1808 CanRenameDrive bool `json:"canRenameDrive,omitempty"` 1809 1810 // CanShare: Whether the current user can share files or folders in this 1811 // shared drive. 1812 CanShare bool `json:"canShare,omitempty"` 1813 1814 // CanTrashChildren: Whether the current user can trash children from 1815 // folders in this shared drive. 1816 CanTrashChildren bool `json:"canTrashChildren,omitempty"` 1817 1818 // ForceSendFields is a list of field names (e.g. "CanAddChildren") to 1819 // unconditionally include in API requests. By default, fields with 1820 // empty values are omitted from API requests. However, any non-pointer, 1821 // non-interface field appearing in ForceSendFields will be sent to the 1822 // server regardless of whether the field is empty or not. This may be 1823 // used to include empty fields in Patch requests. 1824 ForceSendFields []string `json:"-"` 1825 1826 // NullFields is a list of field names (e.g. "CanAddChildren") to 1827 // include in API requests with the JSON null value. By default, fields 1828 // with empty values are omitted from API requests. However, any field 1829 // with an empty value appearing in NullFields will be sent to the 1830 // server as null. It is an error if a field in this list has a 1831 // non-empty value. This may be used to include null fields in Patch 1832 // requests. 1833 NullFields []string `json:"-"` 1834} 1835 1836func (s *DriveCapabilities) MarshalJSON() ([]byte, error) { 1837 type NoMethod DriveCapabilities 1838 raw := NoMethod(*s) 1839 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1840} 1841 1842// DriveRestrictions: A set of restrictions that apply to this shared 1843// drive or items inside this shared drive. 1844type DriveRestrictions struct { 1845 // AdminManagedRestrictions: Whether administrative privileges on this 1846 // shared drive are required to modify restrictions. 1847 AdminManagedRestrictions bool `json:"adminManagedRestrictions,omitempty"` 1848 1849 // CopyRequiresWriterPermission: Whether the options to copy, print, or 1850 // download files inside this shared drive, should be disabled for 1851 // readers and commenters. When this restriction is set to true, it will 1852 // override the similarly named field to true for any file inside this 1853 // shared drive. 1854 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"` 1855 1856 // DomainUsersOnly: Whether access to this shared drive and items inside 1857 // this shared drive is restricted to users of the domain to which this 1858 // shared drive belongs. This restriction may be overridden by other 1859 // sharing policies controlled outside of this shared drive. 1860 DomainUsersOnly bool `json:"domainUsersOnly,omitempty"` 1861 1862 // DriveMembersOnly: Whether access to items inside this shared drive is 1863 // restricted to its members. 1864 DriveMembersOnly bool `json:"driveMembersOnly,omitempty"` 1865 1866 // ForceSendFields is a list of field names (e.g. 1867 // "AdminManagedRestrictions") to unconditionally include in API 1868 // requests. By default, fields with empty values are omitted from API 1869 // requests. However, any non-pointer, non-interface field appearing in 1870 // ForceSendFields will be sent to the server regardless of whether the 1871 // field is empty or not. This may be used to include empty fields in 1872 // Patch requests. 1873 ForceSendFields []string `json:"-"` 1874 1875 // NullFields is a list of field names (e.g. "AdminManagedRestrictions") 1876 // to include in API requests with the JSON null value. By default, 1877 // fields with empty values are omitted from API requests. However, any 1878 // field with an empty value appearing in NullFields will be sent to the 1879 // server as null. It is an error if a field in this list has a 1880 // non-empty value. This may be used to include null fields in Patch 1881 // requests. 1882 NullFields []string `json:"-"` 1883} 1884 1885func (s *DriveRestrictions) MarshalJSON() ([]byte, error) { 1886 type NoMethod DriveRestrictions 1887 raw := NoMethod(*s) 1888 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1889} 1890 1891// DriveList: A list of shared drives. 1892type DriveList struct { 1893 // Items: The list of shared drives. If nextPageToken is populated, then 1894 // this list may be incomplete and an additional page of results should 1895 // be fetched. 1896 Items []*Drive `json:"items,omitempty"` 1897 1898 // Kind: This is always drive#driveList 1899 Kind string `json:"kind,omitempty"` 1900 1901 // NextPageToken: The page token for the next page of shared drives. 1902 // This will be absent if the end of the list has been reached. If the 1903 // token is rejected for any reason, it should be discarded, and 1904 // pagination should be restarted from the first page of results. 1905 NextPageToken string `json:"nextPageToken,omitempty"` 1906 1907 // ServerResponse contains the HTTP response code and headers from the 1908 // server. 1909 googleapi.ServerResponse `json:"-"` 1910 1911 // ForceSendFields is a list of field names (e.g. "Items") to 1912 // unconditionally include in API requests. By default, fields with 1913 // empty values are omitted from API requests. However, any non-pointer, 1914 // non-interface field appearing in ForceSendFields will be sent to the 1915 // server regardless of whether the field is empty or not. This may be 1916 // used to include empty fields in Patch requests. 1917 ForceSendFields []string `json:"-"` 1918 1919 // NullFields is a list of field names (e.g. "Items") to include in API 1920 // requests with the JSON null value. By default, fields with empty 1921 // values are omitted from API requests. However, any field with an 1922 // empty value appearing in NullFields will be sent to the server as 1923 // null. It is an error if a field in this list has a non-empty value. 1924 // This may be used to include null fields in Patch requests. 1925 NullFields []string `json:"-"` 1926} 1927 1928func (s *DriveList) MarshalJSON() ([]byte, error) { 1929 type NoMethod DriveList 1930 raw := NoMethod(*s) 1931 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1932} 1933 1934// File: The metadata for a file. 1935type File struct { 1936 // AlternateLink: A link for opening the file in a relevant Google 1937 // editor or viewer. 1938 AlternateLink string `json:"alternateLink,omitempty"` 1939 1940 // AppDataContents: Whether this file is in the Application Data folder. 1941 AppDataContents bool `json:"appDataContents,omitempty"` 1942 1943 // CanComment: Deprecated: use capabilities/canComment. 1944 CanComment bool `json:"canComment,omitempty"` 1945 1946 // CanReadRevisions: Deprecated: use capabilities/canReadRevisions. 1947 CanReadRevisions bool `json:"canReadRevisions,omitempty"` 1948 1949 // Capabilities: Capabilities the current user has on this file. Each 1950 // capability corresponds to a fine-grained action that a user may take. 1951 Capabilities *FileCapabilities `json:"capabilities,omitempty"` 1952 1953 // ContentRestrictions: Restrictions for accessing the content of the 1954 // file. Only populated if such a restriction exists. 1955 ContentRestrictions []*ContentRestriction `json:"contentRestrictions,omitempty"` 1956 1957 // CopyRequiresWriterPermission: Whether the options to copy, print, or 1958 // download this file, should be disabled for readers and commenters. 1959 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"` 1960 1961 // Copyable: Deprecated: use capabilities/canCopy. 1962 Copyable bool `json:"copyable,omitempty"` 1963 1964 // CreatedDate: Create time for this file (formatted RFC 3339 1965 // timestamp). 1966 CreatedDate string `json:"createdDate,omitempty"` 1967 1968 // DefaultOpenWithLink: A link to open this file with the user's default 1969 // app for this file. Only populated when the drive.apps.readonly scope 1970 // is used. 1971 DefaultOpenWithLink string `json:"defaultOpenWithLink,omitempty"` 1972 1973 // Description: A short description of the file. 1974 Description string `json:"description,omitempty"` 1975 1976 // DownloadUrl: Short lived download URL for the file. This field is 1977 // only populated for files with content stored in Google Drive; it is 1978 // not populated for Docs Editors or shortcut files. 1979 DownloadUrl string `json:"downloadUrl,omitempty"` 1980 1981 // DriveId: ID of the shared drive the file resides in. Only populated 1982 // for items in shared drives. 1983 DriveId string `json:"driveId,omitempty"` 1984 1985 // Editable: Deprecated: use capabilities/canEdit. 1986 Editable bool `json:"editable,omitempty"` 1987 1988 // EmbedLink: A link for embedding the file. 1989 EmbedLink string `json:"embedLink,omitempty"` 1990 1991 // Etag: ETag of the file. 1992 Etag string `json:"etag,omitempty"` 1993 1994 // ExplicitlyTrashed: Whether this file has been explicitly trashed, as 1995 // opposed to recursively trashed. 1996 ExplicitlyTrashed bool `json:"explicitlyTrashed,omitempty"` 1997 1998 // ExportLinks: Links for exporting Docs Editors files to specific 1999 // formats. 2000 ExportLinks map[string]string `json:"exportLinks,omitempty"` 2001 2002 // FileExtension: The final component of fullFileExtension with trailing 2003 // text that does not appear to be part of the extension removed. This 2004 // field is only populated for files with content stored in Google 2005 // Drive; it is not populated for Docs Editors or shortcut files. 2006 FileExtension string `json:"fileExtension,omitempty"` 2007 2008 // FileSize: The size of the file in bytes. This field is populated for 2009 // files with content stored in Google Drive and for files in Docs 2010 // Editors; it is not populated for shortcut files. 2011 FileSize int64 `json:"fileSize,omitempty,string"` 2012 2013 // FolderColorRgb: Folder color as an RGB hex string if the file is a 2014 // folder. The list of supported colors is available in the 2015 // folderColorPalette field of the About resource. If an unsupported 2016 // color is specified, it will be changed to the closest color in the 2017 // palette. Not populated for items in shared drives. 2018 FolderColorRgb string `json:"folderColorRgb,omitempty"` 2019 2020 // FullFileExtension: The full file extension; extracted from the title. 2021 // May contain multiple concatenated extensions, such as "tar.gz". 2022 // Removing an extension from the title does not clear this field; 2023 // however, changing the extension on the title does update this field. 2024 // This field is only populated for files with content stored in Google 2025 // Drive; it is not populated for Docs Editors or shortcut files. 2026 FullFileExtension string `json:"fullFileExtension,omitempty"` 2027 2028 // HasAugmentedPermissions: Whether there are permissions directly on 2029 // this file. This field is only populated for items in shared drives. 2030 HasAugmentedPermissions bool `json:"hasAugmentedPermissions,omitempty"` 2031 2032 // HasThumbnail: Whether this file has a thumbnail. This does not 2033 // indicate whether the requesting app has access to the thumbnail. To 2034 // check access, look for the presence of the thumbnailLink field. 2035 HasThumbnail bool `json:"hasThumbnail,omitempty"` 2036 2037 // HeadRevisionId: The ID of the file's head revision. This field is 2038 // only populated for files with content stored in Google Drive; it is 2039 // not populated for Docs Editors or shortcut files. 2040 HeadRevisionId string `json:"headRevisionId,omitempty"` 2041 2042 // IconLink: A link to the file's icon. 2043 IconLink string `json:"iconLink,omitempty"` 2044 2045 // Id: The ID of the file. 2046 Id string `json:"id,omitempty"` 2047 2048 // ImageMediaMetadata: Metadata about image media. This will only be 2049 // present for image types, and its contents will depend on what can be 2050 // parsed from the image content. 2051 ImageMediaMetadata *FileImageMediaMetadata `json:"imageMediaMetadata,omitempty"` 2052 2053 // IndexableText: Indexable text attributes for the file (can only be 2054 // written) 2055 IndexableText *FileIndexableText `json:"indexableText,omitempty"` 2056 2057 // IsAppAuthorized: Whether the file was created or opened by the 2058 // requesting app. 2059 IsAppAuthorized bool `json:"isAppAuthorized,omitempty"` 2060 2061 // Kind: The type of file. This is always drive#file. 2062 Kind string `json:"kind,omitempty"` 2063 2064 // Labels: A group of labels for the file. 2065 Labels *FileLabels `json:"labels,omitempty"` 2066 2067 // LastModifyingUser: The last user to modify this file. 2068 LastModifyingUser *User `json:"lastModifyingUser,omitempty"` 2069 2070 // LastModifyingUserName: Name of the last user to modify this file. 2071 LastModifyingUserName string `json:"lastModifyingUserName,omitempty"` 2072 2073 // LastViewedByMeDate: Last time this file was viewed by the user 2074 // (formatted RFC 3339 timestamp). 2075 LastViewedByMeDate string `json:"lastViewedByMeDate,omitempty"` 2076 2077 // MarkedViewedByMeDate: Deprecated. 2078 MarkedViewedByMeDate string `json:"markedViewedByMeDate,omitempty"` 2079 2080 // Md5Checksum: An MD5 checksum for the content of this file. This field 2081 // is only populated for files with content stored in Google Drive; it 2082 // is not populated for Docs Editors or shortcut files. 2083 Md5Checksum string `json:"md5Checksum,omitempty"` 2084 2085 // MimeType: The MIME type of the file. This is only mutable on update 2086 // when uploading new content. This field can be left blank, and the 2087 // mimetype will be determined from the uploaded content's MIME type. 2088 MimeType string `json:"mimeType,omitempty"` 2089 2090 // ModifiedByMeDate: Last time this file was modified by the user 2091 // (formatted RFC 3339 timestamp). Note that setting modifiedDate will 2092 // also update the modifiedByMe date for the user which set the date. 2093 ModifiedByMeDate string `json:"modifiedByMeDate,omitempty"` 2094 2095 // ModifiedDate: Last time this file was modified by anyone (formatted 2096 // RFC 3339 timestamp). This is only mutable on update when the 2097 // setModifiedDate parameter is set. 2098 ModifiedDate string `json:"modifiedDate,omitempty"` 2099 2100 // OpenWithLinks: A map of the id of each of the user's apps to a link 2101 // to open this file with that app. Only populated when the 2102 // drive.apps.readonly scope is used. 2103 OpenWithLinks map[string]string `json:"openWithLinks,omitempty"` 2104 2105 // OriginalFilename: The original filename of the uploaded content if 2106 // available, or else the original value of the title field. This is 2107 // only available for files with binary content in Google Drive. 2108 OriginalFilename string `json:"originalFilename,omitempty"` 2109 2110 // OwnedByMe: Whether the file is owned by the current user. Not 2111 // populated for items in shared drives. 2112 OwnedByMe bool `json:"ownedByMe,omitempty"` 2113 2114 // OwnerNames: Name(s) of the owner(s) of this file. Not populated for 2115 // items in shared drives. 2116 OwnerNames []string `json:"ownerNames,omitempty"` 2117 2118 // Owners: The owner(s) of this file. Not populated for items in shared 2119 // drives. 2120 Owners []*User `json:"owners,omitempty"` 2121 2122 // Parents: Collection of parent folders which contain this file. 2123 // If not specified as part of an insert request, the file will be 2124 // placed directly in the user's My Drive folder. If not specified as 2125 // part of a copy request, the file will inherit any discoverable 2126 // parents of the source file. Update requests can also use the 2127 // addParents and removeParents parameters to modify the parents list. 2128 Parents []*ParentReference `json:"parents,omitempty"` 2129 2130 // PermissionIds: List of permission IDs for users with access to this 2131 // file. 2132 PermissionIds []string `json:"permissionIds,omitempty"` 2133 2134 // Permissions: The list of permissions for users with access to this 2135 // file. Not populated for items in shared drives. 2136 Permissions []*Permission `json:"permissions,omitempty"` 2137 2138 // Properties: The list of properties. 2139 Properties []*Property `json:"properties,omitempty"` 2140 2141 // QuotaBytesUsed: The number of quota bytes used by this file. 2142 QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"` 2143 2144 // SelfLink: A link back to this file. 2145 SelfLink string `json:"selfLink,omitempty"` 2146 2147 // Shareable: Deprecated: use capabilities/canShare. 2148 Shareable bool `json:"shareable,omitempty"` 2149 2150 // Shared: Whether the file has been shared. Not populated for items in 2151 // shared drives. 2152 Shared bool `json:"shared,omitempty"` 2153 2154 // SharedWithMeDate: Time at which this file was shared with the user 2155 // (formatted RFC 3339 timestamp). 2156 SharedWithMeDate string `json:"sharedWithMeDate,omitempty"` 2157 2158 // SharingUser: User that shared the item with the current user, if 2159 // available. 2160 SharingUser *User `json:"sharingUser,omitempty"` 2161 2162 // ShortcutDetails: Shortcut file details. Only populated for shortcut 2163 // files, which have the mimeType field set to 2164 // application/vnd.google-apps.shortcut. 2165 ShortcutDetails *FileShortcutDetails `json:"shortcutDetails,omitempty"` 2166 2167 // Spaces: The list of spaces which contain the file. Supported values 2168 // are 'drive', 'appDataFolder' and 'photos'. 2169 Spaces []string `json:"spaces,omitempty"` 2170 2171 // TeamDriveId: Deprecated - use driveId instead. 2172 TeamDriveId string `json:"teamDriveId,omitempty"` 2173 2174 // Thumbnail: A thumbnail for the file. This will only be used if a 2175 // standard thumbnail cannot be generated. 2176 Thumbnail *FileThumbnail `json:"thumbnail,omitempty"` 2177 2178 // ThumbnailLink: A short-lived link to the file's thumbnail. Typically 2179 // lasts on the order of hours. Only populated when the requesting app 2180 // can access the file's content. If the file isn't shared publicly, the 2181 // URL returned in Files.thumbnailLink must be fetched using a 2182 // credentialed request. 2183 ThumbnailLink string `json:"thumbnailLink,omitempty"` 2184 2185 // ThumbnailVersion: The thumbnail version for use in thumbnail cache 2186 // invalidation. 2187 ThumbnailVersion int64 `json:"thumbnailVersion,omitempty,string"` 2188 2189 // Title: The title of this file. Note that for immutable items such as 2190 // the top level folders of shared drives, My Drive root folder, and 2191 // Application Data folder the title is constant. 2192 Title string `json:"title,omitempty"` 2193 2194 // TrashedDate: The time that the item was trashed (formatted RFC 3339 2195 // timestamp). Only populated for items in shared drives. 2196 TrashedDate string `json:"trashedDate,omitempty"` 2197 2198 // TrashingUser: If the file has been explicitly trashed, the user who 2199 // trashed it. Only populated for items in shared drives. 2200 TrashingUser *User `json:"trashingUser,omitempty"` 2201 2202 // UserPermission: The permissions for the authenticated user on this 2203 // file. 2204 UserPermission *Permission `json:"userPermission,omitempty"` 2205 2206 // Version: A monotonically increasing version number for the file. This 2207 // reflects every change made to the file on the server, even those not 2208 // visible to the requesting user. 2209 Version int64 `json:"version,omitempty,string"` 2210 2211 // VideoMediaMetadata: Metadata about video media. This will only be 2212 // present for video types. 2213 VideoMediaMetadata *FileVideoMediaMetadata `json:"videoMediaMetadata,omitempty"` 2214 2215 // WebContentLink: A link for downloading the content of the file in a 2216 // browser using cookie based authentication. In cases where the content 2217 // is shared publicly, the content can be downloaded without any 2218 // credentials. 2219 WebContentLink string `json:"webContentLink,omitempty"` 2220 2221 // WebViewLink: A link only available on public folders for viewing 2222 // their static web assets (HTML, CSS, JS, etc) via Google Drive's 2223 // Website Hosting. 2224 WebViewLink string `json:"webViewLink,omitempty"` 2225 2226 // WritersCanShare: Whether writers can share the document with other 2227 // users. Not populated for items in shared drives. 2228 WritersCanShare bool `json:"writersCanShare,omitempty"` 2229 2230 // ServerResponse contains the HTTP response code and headers from the 2231 // server. 2232 googleapi.ServerResponse `json:"-"` 2233 2234 // ForceSendFields is a list of field names (e.g. "AlternateLink") to 2235 // unconditionally include in API requests. By default, fields with 2236 // empty values are omitted from API requests. However, any non-pointer, 2237 // non-interface field appearing in ForceSendFields will be sent to the 2238 // server regardless of whether the field is empty or not. This may be 2239 // used to include empty fields in Patch requests. 2240 ForceSendFields []string `json:"-"` 2241 2242 // NullFields is a list of field names (e.g. "AlternateLink") to include 2243 // in API requests with the JSON null value. By default, fields with 2244 // empty values are omitted from API requests. However, any field with 2245 // an empty value appearing in NullFields will be sent to the server as 2246 // null. It is an error if a field in this list has a non-empty value. 2247 // This may be used to include null fields in Patch requests. 2248 NullFields []string `json:"-"` 2249} 2250 2251func (s *File) MarshalJSON() ([]byte, error) { 2252 type NoMethod File 2253 raw := NoMethod(*s) 2254 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2255} 2256 2257// FileCapabilities: Capabilities the current user has on this file. 2258// Each capability corresponds to a fine-grained action that a user may 2259// take. 2260type FileCapabilities struct { 2261 // CanAddChildren: Whether the current user can add children to this 2262 // folder. This is always false when the item is not a folder. 2263 CanAddChildren bool `json:"canAddChildren,omitempty"` 2264 2265 // CanAddFolderFromAnotherDrive: Whether the current user can add a 2266 // folder from another drive (different shared drive or My Drive) to 2267 // this folder. This is false when the item is not a folder. Only 2268 // populated for items in shared drives. 2269 CanAddFolderFromAnotherDrive bool `json:"canAddFolderFromAnotherDrive,omitempty"` 2270 2271 // CanAddMyDriveParent: Whether the current user can add a parent for 2272 // the item without removing an existing parent in the same request. Not 2273 // populated for shared drive files. 2274 CanAddMyDriveParent bool `json:"canAddMyDriveParent,omitempty"` 2275 2276 // CanChangeCopyRequiresWriterPermission: Whether the current user can 2277 // change the copyRequiresWriterPermission restriction of this file. 2278 CanChangeCopyRequiresWriterPermission bool `json:"canChangeCopyRequiresWriterPermission,omitempty"` 2279 2280 // CanChangeRestrictedDownload: Deprecated 2281 CanChangeRestrictedDownload bool `json:"canChangeRestrictedDownload,omitempty"` 2282 2283 // CanComment: Whether the current user can comment on this file. 2284 CanComment bool `json:"canComment,omitempty"` 2285 2286 // CanCopy: Whether the current user can copy this file. For an item in 2287 // a shared drive, whether the current user can copy non-folder 2288 // descendants of this item, or this item itself if it is not a folder. 2289 CanCopy bool `json:"canCopy,omitempty"` 2290 2291 // CanDelete: Whether the current user can delete this file. 2292 CanDelete bool `json:"canDelete,omitempty"` 2293 2294 // CanDeleteChildren: Whether the current user can delete children of 2295 // this folder. This is false when the item is not a folder. Only 2296 // populated for items in shared drives. 2297 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"` 2298 2299 // CanDownload: Whether the current user can download this file. 2300 CanDownload bool `json:"canDownload,omitempty"` 2301 2302 // CanEdit: Whether the current user can edit this file. Other factors 2303 // may limit the type of changes a user can make to a file. For example, 2304 // see canChangeCopyRequiresWriterPermission or canModifyContent. 2305 CanEdit bool `json:"canEdit,omitempty"` 2306 2307 // CanListChildren: Whether the current user can list the children of 2308 // this folder. This is always false when the item is not a folder. 2309 CanListChildren bool `json:"canListChildren,omitempty"` 2310 2311 // CanModifyContent: Whether the current user can modify the content of 2312 // this file. 2313 CanModifyContent bool `json:"canModifyContent,omitempty"` 2314 2315 // CanModifyContentRestriction: Whether the current user can modify 2316 // restrictions on content of this file. 2317 CanModifyContentRestriction bool `json:"canModifyContentRestriction,omitempty"` 2318 2319 // CanMoveChildrenOutOfDrive: Whether the current user can move children 2320 // of this folder outside of the shared drive. This is false when the 2321 // item is not a folder. Only populated for items in shared drives. 2322 CanMoveChildrenOutOfDrive bool `json:"canMoveChildrenOutOfDrive,omitempty"` 2323 2324 // CanMoveChildrenOutOfTeamDrive: Deprecated - use 2325 // canMoveChildrenOutOfDrive instead. 2326 CanMoveChildrenOutOfTeamDrive bool `json:"canMoveChildrenOutOfTeamDrive,omitempty"` 2327 2328 // CanMoveChildrenWithinDrive: Whether the current user can move 2329 // children of this folder within this drive. This is false when the 2330 // item is not a folder. Note that a request to move the child may still 2331 // fail depending on the current user's access to the child and to the 2332 // destination folder. 2333 CanMoveChildrenWithinDrive bool `json:"canMoveChildrenWithinDrive,omitempty"` 2334 2335 // CanMoveChildrenWithinTeamDrive: Deprecated - use 2336 // canMoveChildrenWithinDrive instead. 2337 CanMoveChildrenWithinTeamDrive bool `json:"canMoveChildrenWithinTeamDrive,omitempty"` 2338 2339 // CanMoveItemIntoTeamDrive: Deprecated - use canMoveItemOutOfDrive 2340 // instead. 2341 CanMoveItemIntoTeamDrive bool `json:"canMoveItemIntoTeamDrive,omitempty"` 2342 2343 // CanMoveItemOutOfDrive: Whether the current user can move this item 2344 // outside of this drive by changing its parent. Note that a request to 2345 // change the parent of the item may still fail depending on the new 2346 // parent that is being added. 2347 CanMoveItemOutOfDrive bool `json:"canMoveItemOutOfDrive,omitempty"` 2348 2349 // CanMoveItemOutOfTeamDrive: Deprecated - use canMoveItemOutOfDrive 2350 // instead. 2351 CanMoveItemOutOfTeamDrive bool `json:"canMoveItemOutOfTeamDrive,omitempty"` 2352 2353 // CanMoveItemWithinDrive: Whether the current user can move this item 2354 // within this drive. Note that a request to change the parent of the 2355 // item may still fail depending on the new parent that is being added 2356 // and the parent that is being removed. 2357 CanMoveItemWithinDrive bool `json:"canMoveItemWithinDrive,omitempty"` 2358 2359 // CanMoveItemWithinTeamDrive: Deprecated - use canMoveItemWithinDrive 2360 // instead. 2361 CanMoveItemWithinTeamDrive bool `json:"canMoveItemWithinTeamDrive,omitempty"` 2362 2363 // CanMoveTeamDriveItem: Deprecated - use canMoveItemWithinDrive or 2364 // canMoveItemOutOfDrive instead. 2365 CanMoveTeamDriveItem bool `json:"canMoveTeamDriveItem,omitempty"` 2366 2367 // CanReadDrive: Whether the current user can read the shared drive to 2368 // which this file belongs. Only populated for items in shared drives. 2369 CanReadDrive bool `json:"canReadDrive,omitempty"` 2370 2371 // CanReadRevisions: Whether the current user can read the revisions 2372 // resource of this file. For a shared drive item, whether revisions of 2373 // non-folder descendants of this item, or this item itself if it is not 2374 // a folder, can be read. 2375 CanReadRevisions bool `json:"canReadRevisions,omitempty"` 2376 2377 // CanReadTeamDrive: Deprecated - use canReadDrive instead. 2378 CanReadTeamDrive bool `json:"canReadTeamDrive,omitempty"` 2379 2380 // CanRemoveChildren: Whether the current user can remove children from 2381 // this folder. This is always false when the item is not a folder. For 2382 // a folder in a shared drive, use canDeleteChildren or canTrashChildren 2383 // instead. 2384 CanRemoveChildren bool `json:"canRemoveChildren,omitempty"` 2385 2386 // CanRemoveMyDriveParent: Whether the current user can remove a parent 2387 // from the item without adding another parent in the same request. Not 2388 // populated for shared drive files. 2389 CanRemoveMyDriveParent bool `json:"canRemoveMyDriveParent,omitempty"` 2390 2391 // CanRename: Whether the current user can rename this file. 2392 CanRename bool `json:"canRename,omitempty"` 2393 2394 // CanShare: Whether the current user can modify the sharing settings 2395 // for this file. 2396 CanShare bool `json:"canShare,omitempty"` 2397 2398 // CanTrash: Whether the current user can move this file to trash. 2399 CanTrash bool `json:"canTrash,omitempty"` 2400 2401 // CanTrashChildren: Whether the current user can trash children of this 2402 // folder. This is false when the item is not a folder. Only populated 2403 // for items in shared drives. 2404 CanTrashChildren bool `json:"canTrashChildren,omitempty"` 2405 2406 // CanUntrash: Whether the current user can restore this file from 2407 // trash. 2408 CanUntrash bool `json:"canUntrash,omitempty"` 2409 2410 // ForceSendFields is a list of field names (e.g. "CanAddChildren") to 2411 // unconditionally include in API requests. By default, fields with 2412 // empty values are omitted from API requests. However, any non-pointer, 2413 // non-interface field appearing in ForceSendFields will be sent to the 2414 // server regardless of whether the field is empty or not. This may be 2415 // used to include empty fields in Patch requests. 2416 ForceSendFields []string `json:"-"` 2417 2418 // NullFields is a list of field names (e.g. "CanAddChildren") to 2419 // include in API requests with the JSON null value. By default, fields 2420 // with empty values are omitted from API requests. However, any field 2421 // with an empty value appearing in NullFields will be sent to the 2422 // server as null. It is an error if a field in this list has a 2423 // non-empty value. This may be used to include null fields in Patch 2424 // requests. 2425 NullFields []string `json:"-"` 2426} 2427 2428func (s *FileCapabilities) MarshalJSON() ([]byte, error) { 2429 type NoMethod FileCapabilities 2430 raw := NoMethod(*s) 2431 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2432} 2433 2434// FileImageMediaMetadata: Metadata about image media. This will only be 2435// present for image types, and its contents will depend on what can be 2436// parsed from the image content. 2437type FileImageMediaMetadata struct { 2438 // Aperture: The aperture used to create the photo (f-number). 2439 Aperture float64 `json:"aperture,omitempty"` 2440 2441 // CameraMake: The make of the camera used to create the photo. 2442 CameraMake string `json:"cameraMake,omitempty"` 2443 2444 // CameraModel: The model of the camera used to create the photo. 2445 CameraModel string `json:"cameraModel,omitempty"` 2446 2447 // ColorSpace: The color space of the photo. 2448 ColorSpace string `json:"colorSpace,omitempty"` 2449 2450 // Date: The date and time the photo was taken (EXIF format timestamp). 2451 Date string `json:"date,omitempty"` 2452 2453 // ExposureBias: The exposure bias of the photo (APEX value). 2454 ExposureBias float64 `json:"exposureBias,omitempty"` 2455 2456 // ExposureMode: The exposure mode used to create the photo. 2457 ExposureMode string `json:"exposureMode,omitempty"` 2458 2459 // ExposureTime: The length of the exposure, in seconds. 2460 ExposureTime float64 `json:"exposureTime,omitempty"` 2461 2462 // FlashUsed: Whether a flash was used to create the photo. 2463 FlashUsed bool `json:"flashUsed,omitempty"` 2464 2465 // FocalLength: The focal length used to create the photo, in 2466 // millimeters. 2467 FocalLength float64 `json:"focalLength,omitempty"` 2468 2469 // Height: The height of the image in pixels. 2470 Height int64 `json:"height,omitempty"` 2471 2472 // IsoSpeed: The ISO speed used to create the photo. 2473 IsoSpeed int64 `json:"isoSpeed,omitempty"` 2474 2475 // Lens: The lens used to create the photo. 2476 Lens string `json:"lens,omitempty"` 2477 2478 // Location: Geographic location information stored in the image. 2479 Location *FileImageMediaMetadataLocation `json:"location,omitempty"` 2480 2481 // MaxApertureValue: The smallest f-number of the lens at the focal 2482 // length used to create the photo (APEX value). 2483 MaxApertureValue float64 `json:"maxApertureValue,omitempty"` 2484 2485 // MeteringMode: The metering mode used to create the photo. 2486 MeteringMode string `json:"meteringMode,omitempty"` 2487 2488 // Rotation: The number of clockwise 90 degree rotations applied from 2489 // the image's original orientation. 2490 Rotation int64 `json:"rotation,omitempty"` 2491 2492 // Sensor: The type of sensor used to create the photo. 2493 Sensor string `json:"sensor,omitempty"` 2494 2495 // SubjectDistance: The distance to the subject of the photo, in meters. 2496 SubjectDistance int64 `json:"subjectDistance,omitempty"` 2497 2498 // WhiteBalance: The white balance mode used to create the photo. 2499 WhiteBalance string `json:"whiteBalance,omitempty"` 2500 2501 // Width: The width of the image in pixels. 2502 Width int64 `json:"width,omitempty"` 2503 2504 // ForceSendFields is a list of field names (e.g. "Aperture") to 2505 // unconditionally include in API requests. By default, fields with 2506 // empty values are omitted from API requests. However, any non-pointer, 2507 // non-interface field appearing in ForceSendFields will be sent to the 2508 // server regardless of whether the field is empty or not. This may be 2509 // used to include empty fields in Patch requests. 2510 ForceSendFields []string `json:"-"` 2511 2512 // NullFields is a list of field names (e.g. "Aperture") to include in 2513 // API requests with the JSON null value. By default, fields with empty 2514 // values are omitted from API requests. However, any field with an 2515 // empty value appearing in NullFields will be sent to the server as 2516 // null. It is an error if a field in this list has a non-empty value. 2517 // This may be used to include null fields in Patch requests. 2518 NullFields []string `json:"-"` 2519} 2520 2521func (s *FileImageMediaMetadata) MarshalJSON() ([]byte, error) { 2522 type NoMethod FileImageMediaMetadata 2523 raw := NoMethod(*s) 2524 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2525} 2526 2527func (s *FileImageMediaMetadata) UnmarshalJSON(data []byte) error { 2528 type NoMethod FileImageMediaMetadata 2529 var s1 struct { 2530 Aperture gensupport.JSONFloat64 `json:"aperture"` 2531 ExposureBias gensupport.JSONFloat64 `json:"exposureBias"` 2532 ExposureTime gensupport.JSONFloat64 `json:"exposureTime"` 2533 FocalLength gensupport.JSONFloat64 `json:"focalLength"` 2534 MaxApertureValue gensupport.JSONFloat64 `json:"maxApertureValue"` 2535 *NoMethod 2536 } 2537 s1.NoMethod = (*NoMethod)(s) 2538 if err := json.Unmarshal(data, &s1); err != nil { 2539 return err 2540 } 2541 s.Aperture = float64(s1.Aperture) 2542 s.ExposureBias = float64(s1.ExposureBias) 2543 s.ExposureTime = float64(s1.ExposureTime) 2544 s.FocalLength = float64(s1.FocalLength) 2545 s.MaxApertureValue = float64(s1.MaxApertureValue) 2546 return nil 2547} 2548 2549// FileImageMediaMetadataLocation: Geographic location information 2550// stored in the image. 2551type FileImageMediaMetadataLocation struct { 2552 // Altitude: The altitude stored in the image. 2553 Altitude float64 `json:"altitude,omitempty"` 2554 2555 // Latitude: The latitude stored in the image. 2556 Latitude float64 `json:"latitude,omitempty"` 2557 2558 // Longitude: The longitude stored in the image. 2559 Longitude float64 `json:"longitude,omitempty"` 2560 2561 // ForceSendFields is a list of field names (e.g. "Altitude") to 2562 // unconditionally include in API requests. By default, fields with 2563 // empty values are omitted from API requests. However, any non-pointer, 2564 // non-interface field appearing in ForceSendFields will be sent to the 2565 // server regardless of whether the field is empty or not. This may be 2566 // used to include empty fields in Patch requests. 2567 ForceSendFields []string `json:"-"` 2568 2569 // NullFields is a list of field names (e.g. "Altitude") to include in 2570 // API requests with the JSON null value. By default, fields with empty 2571 // values are omitted from API requests. However, any field with an 2572 // empty value appearing in NullFields will be sent to the server as 2573 // null. It is an error if a field in this list has a non-empty value. 2574 // This may be used to include null fields in Patch requests. 2575 NullFields []string `json:"-"` 2576} 2577 2578func (s *FileImageMediaMetadataLocation) MarshalJSON() ([]byte, error) { 2579 type NoMethod FileImageMediaMetadataLocation 2580 raw := NoMethod(*s) 2581 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2582} 2583 2584func (s *FileImageMediaMetadataLocation) UnmarshalJSON(data []byte) error { 2585 type NoMethod FileImageMediaMetadataLocation 2586 var s1 struct { 2587 Altitude gensupport.JSONFloat64 `json:"altitude"` 2588 Latitude gensupport.JSONFloat64 `json:"latitude"` 2589 Longitude gensupport.JSONFloat64 `json:"longitude"` 2590 *NoMethod 2591 } 2592 s1.NoMethod = (*NoMethod)(s) 2593 if err := json.Unmarshal(data, &s1); err != nil { 2594 return err 2595 } 2596 s.Altitude = float64(s1.Altitude) 2597 s.Latitude = float64(s1.Latitude) 2598 s.Longitude = float64(s1.Longitude) 2599 return nil 2600} 2601 2602// FileIndexableText: Indexable text attributes for the file (can only 2603// be written) 2604type FileIndexableText struct { 2605 // Text: The text to be indexed for this file. 2606 Text string `json:"text,omitempty"` 2607 2608 // ForceSendFields is a list of field names (e.g. "Text") to 2609 // unconditionally include in API requests. By default, fields with 2610 // empty values are omitted from API requests. However, any non-pointer, 2611 // non-interface field appearing in ForceSendFields will be sent to the 2612 // server regardless of whether the field is empty or not. This may be 2613 // used to include empty fields in Patch requests. 2614 ForceSendFields []string `json:"-"` 2615 2616 // NullFields is a list of field names (e.g. "Text") to include in API 2617 // requests with the JSON null value. By default, fields with empty 2618 // values are omitted from API requests. However, any field with an 2619 // empty value appearing in NullFields will be sent to the server as 2620 // null. It is an error if a field in this list has a non-empty value. 2621 // This may be used to include null fields in Patch requests. 2622 NullFields []string `json:"-"` 2623} 2624 2625func (s *FileIndexableText) MarshalJSON() ([]byte, error) { 2626 type NoMethod FileIndexableText 2627 raw := NoMethod(*s) 2628 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2629} 2630 2631// FileLabels: A group of labels for the file. 2632type FileLabels struct { 2633 // Hidden: Deprecated. 2634 Hidden bool `json:"hidden,omitempty"` 2635 2636 // Modified: Whether the file has been modified by this user. 2637 Modified bool `json:"modified,omitempty"` 2638 2639 // Restricted: Deprecated - use copyRequiresWriterPermission instead. 2640 Restricted bool `json:"restricted,omitempty"` 2641 2642 // Starred: Whether this file is starred by the user. 2643 Starred bool `json:"starred,omitempty"` 2644 2645 // Trashed: Whether the file has been trashed, either explicitly or from 2646 // a trashed parent folder. Only the owner may trash a file. The trashed 2647 // item is excluded from all files.list responses returned for any user 2648 // who does not own the file. However, all users with access to the file 2649 // can see the trashed item metadata in an API response. All users with 2650 // access can copy, download, export, and share the file. 2651 Trashed bool `json:"trashed,omitempty"` 2652 2653 // Viewed: Whether this file has been viewed by this user. 2654 Viewed bool `json:"viewed,omitempty"` 2655 2656 // ForceSendFields is a list of field names (e.g. "Hidden") to 2657 // unconditionally include in API requests. By default, fields with 2658 // empty values are omitted from API requests. However, any non-pointer, 2659 // non-interface field appearing in ForceSendFields will be sent to the 2660 // server regardless of whether the field is empty or not. This may be 2661 // used to include empty fields in Patch requests. 2662 ForceSendFields []string `json:"-"` 2663 2664 // NullFields is a list of field names (e.g. "Hidden") to include in API 2665 // requests with the JSON null value. By default, fields with empty 2666 // values are omitted from API requests. However, any field with an 2667 // empty value appearing in NullFields will be sent to the server as 2668 // null. It is an error if a field in this list has a non-empty value. 2669 // This may be used to include null fields in Patch requests. 2670 NullFields []string `json:"-"` 2671} 2672 2673func (s *FileLabels) MarshalJSON() ([]byte, error) { 2674 type NoMethod FileLabels 2675 raw := NoMethod(*s) 2676 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2677} 2678 2679// FileShortcutDetails: Shortcut file details. Only populated for 2680// shortcut files, which have the mimeType field set to 2681// application/vnd.google-apps.shortcut. 2682type FileShortcutDetails struct { 2683 // TargetId: The ID of the file that this shortcut points to. 2684 TargetId string `json:"targetId,omitempty"` 2685 2686 // TargetMimeType: The MIME type of the file that this shortcut points 2687 // to. The value of this field is a snapshot of the target's MIME type, 2688 // captured when the shortcut is created. 2689 TargetMimeType string `json:"targetMimeType,omitempty"` 2690 2691 // ForceSendFields is a list of field names (e.g. "TargetId") to 2692 // unconditionally include in API requests. By default, fields with 2693 // empty values are omitted from API requests. However, any non-pointer, 2694 // non-interface field appearing in ForceSendFields will be sent to the 2695 // server regardless of whether the field is empty or not. This may be 2696 // used to include empty fields in Patch requests. 2697 ForceSendFields []string `json:"-"` 2698 2699 // NullFields is a list of field names (e.g. "TargetId") to include in 2700 // API requests with the JSON null value. By default, fields with empty 2701 // values are omitted from API requests. However, any field with an 2702 // empty value appearing in NullFields will be sent to the server as 2703 // null. It is an error if a field in this list has a non-empty value. 2704 // This may be used to include null fields in Patch requests. 2705 NullFields []string `json:"-"` 2706} 2707 2708func (s *FileShortcutDetails) MarshalJSON() ([]byte, error) { 2709 type NoMethod FileShortcutDetails 2710 raw := NoMethod(*s) 2711 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2712} 2713 2714// FileThumbnail: A thumbnail for the file. This will only be used if a 2715// standard thumbnail cannot be generated. 2716type FileThumbnail struct { 2717 // Image: The URL-safe Base64 encoded bytes of the thumbnail image. It 2718 // should conform to RFC 4648 section 5. 2719 Image string `json:"image,omitempty"` 2720 2721 // MimeType: The MIME type of the thumbnail. 2722 MimeType string `json:"mimeType,omitempty"` 2723 2724 // ForceSendFields is a list of field names (e.g. "Image") to 2725 // unconditionally include in API requests. By default, fields with 2726 // empty values are omitted from API requests. However, any non-pointer, 2727 // non-interface field appearing in ForceSendFields will be sent to the 2728 // server regardless of whether the field is empty or not. This may be 2729 // used to include empty fields in Patch requests. 2730 ForceSendFields []string `json:"-"` 2731 2732 // NullFields is a list of field names (e.g. "Image") to include in API 2733 // requests with the JSON null value. By default, fields with empty 2734 // values are omitted from API requests. However, any field with an 2735 // empty value appearing in NullFields will be sent to the server as 2736 // null. It is an error if a field in this list has a non-empty value. 2737 // This may be used to include null fields in Patch requests. 2738 NullFields []string `json:"-"` 2739} 2740 2741func (s *FileThumbnail) MarshalJSON() ([]byte, error) { 2742 type NoMethod FileThumbnail 2743 raw := NoMethod(*s) 2744 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2745} 2746 2747// FileVideoMediaMetadata: Metadata about video media. This will only be 2748// present for video types. 2749type FileVideoMediaMetadata struct { 2750 // DurationMillis: The duration of the video in milliseconds. 2751 DurationMillis int64 `json:"durationMillis,omitempty,string"` 2752 2753 // Height: The height of the video in pixels. 2754 Height int64 `json:"height,omitempty"` 2755 2756 // Width: The width of the video in pixels. 2757 Width int64 `json:"width,omitempty"` 2758 2759 // ForceSendFields is a list of field names (e.g. "DurationMillis") to 2760 // unconditionally include in API requests. By default, fields with 2761 // empty values are omitted from API requests. However, any non-pointer, 2762 // non-interface field appearing in ForceSendFields will be sent to the 2763 // server regardless of whether the field is empty or not. This may be 2764 // used to include empty fields in Patch requests. 2765 ForceSendFields []string `json:"-"` 2766 2767 // NullFields is a list of field names (e.g. "DurationMillis") to 2768 // include in API requests with the JSON null value. By default, fields 2769 // with empty values are omitted from API requests. However, any field 2770 // with an empty value appearing in NullFields will be sent to the 2771 // server as null. It is an error if a field in this list has a 2772 // non-empty value. This may be used to include null fields in Patch 2773 // requests. 2774 NullFields []string `json:"-"` 2775} 2776 2777func (s *FileVideoMediaMetadata) MarshalJSON() ([]byte, error) { 2778 type NoMethod FileVideoMediaMetadata 2779 raw := NoMethod(*s) 2780 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2781} 2782 2783// FileList: A list of files. 2784type FileList struct { 2785 // Etag: The ETag of the list. 2786 Etag string `json:"etag,omitempty"` 2787 2788 // IncompleteSearch: Whether the search process was incomplete. If true, 2789 // then some search results may be missing, since all documents were not 2790 // searched. This may occur when searching multiple drives with the 2791 // "allDrives" corpora, but all corpora could not be searched. When this 2792 // happens, it is suggested that clients narrow their query by choosing 2793 // a different corpus such as "default" or "drive". 2794 IncompleteSearch bool `json:"incompleteSearch,omitempty"` 2795 2796 // Items: The list of files. If nextPageToken is populated, then this 2797 // list may be incomplete and an additional page of results should be 2798 // fetched. 2799 Items []*File `json:"items,omitempty"` 2800 2801 // Kind: This is always drive#fileList. 2802 Kind string `json:"kind,omitempty"` 2803 2804 // NextLink: A link to the next page of files. 2805 NextLink string `json:"nextLink,omitempty"` 2806 2807 // NextPageToken: The page token for the next page of files. This will 2808 // be absent if the end of the files list has been reached. If the token 2809 // is rejected for any reason, it should be discarded, and pagination 2810 // should be restarted from the first page of results. 2811 NextPageToken string `json:"nextPageToken,omitempty"` 2812 2813 // SelfLink: A link back to this list. 2814 SelfLink string `json:"selfLink,omitempty"` 2815 2816 // ServerResponse contains the HTTP response code and headers from the 2817 // server. 2818 googleapi.ServerResponse `json:"-"` 2819 2820 // ForceSendFields is a list of field names (e.g. "Etag") to 2821 // unconditionally include in API requests. By default, fields with 2822 // empty values are omitted from API requests. However, any non-pointer, 2823 // non-interface field appearing in ForceSendFields will be sent to the 2824 // server regardless of whether the field is empty or not. This may be 2825 // used to include empty fields in Patch requests. 2826 ForceSendFields []string `json:"-"` 2827 2828 // NullFields is a list of field names (e.g. "Etag") to include in API 2829 // requests with the JSON null value. By default, fields with empty 2830 // values are omitted from API requests. However, any field with an 2831 // empty value appearing in NullFields will be sent to the server as 2832 // null. It is an error if a field in this list has a non-empty value. 2833 // This may be used to include null fields in Patch requests. 2834 NullFields []string `json:"-"` 2835} 2836 2837func (s *FileList) MarshalJSON() ([]byte, error) { 2838 type NoMethod FileList 2839 raw := NoMethod(*s) 2840 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2841} 2842 2843// GeneratedIds: A list of generated IDs which can be provided in insert 2844// requests 2845type GeneratedIds struct { 2846 // Ids: The IDs generated for the requesting user in the specified 2847 // space. 2848 Ids []string `json:"ids,omitempty"` 2849 2850 // Kind: This is always drive#generatedIds 2851 Kind string `json:"kind,omitempty"` 2852 2853 // Space: The type of file that can be created with these IDs. 2854 Space string `json:"space,omitempty"` 2855 2856 // ServerResponse contains the HTTP response code and headers from the 2857 // server. 2858 googleapi.ServerResponse `json:"-"` 2859 2860 // ForceSendFields is a list of field names (e.g. "Ids") to 2861 // unconditionally include in API requests. By default, fields with 2862 // empty values are omitted from API requests. However, any non-pointer, 2863 // non-interface field appearing in ForceSendFields will be sent to the 2864 // server regardless of whether the field is empty or not. This may be 2865 // used to include empty fields in Patch requests. 2866 ForceSendFields []string `json:"-"` 2867 2868 // NullFields is a list of field names (e.g. "Ids") to include in API 2869 // requests with the JSON null value. By default, fields with empty 2870 // values are omitted from API requests. However, any field with an 2871 // empty value appearing in NullFields will be sent to the server as 2872 // null. It is an error if a field in this list has a non-empty value. 2873 // This may be used to include null fields in Patch requests. 2874 NullFields []string `json:"-"` 2875} 2876 2877func (s *GeneratedIds) MarshalJSON() ([]byte, error) { 2878 type NoMethod GeneratedIds 2879 raw := NoMethod(*s) 2880 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2881} 2882 2883// ParentList: A list of a file's parents. 2884type ParentList struct { 2885 // Etag: The ETag of the list. 2886 Etag string `json:"etag,omitempty"` 2887 2888 // Items: The list of parents. 2889 Items []*ParentReference `json:"items,omitempty"` 2890 2891 // Kind: This is always drive#parentList. 2892 Kind string `json:"kind,omitempty"` 2893 2894 // SelfLink: A link back to this list. 2895 SelfLink string `json:"selfLink,omitempty"` 2896 2897 // ServerResponse contains the HTTP response code and headers from the 2898 // server. 2899 googleapi.ServerResponse `json:"-"` 2900 2901 // ForceSendFields is a list of field names (e.g. "Etag") to 2902 // unconditionally include in API requests. By default, fields with 2903 // empty values are omitted from API requests. However, any non-pointer, 2904 // non-interface field appearing in ForceSendFields will be sent to the 2905 // server regardless of whether the field is empty or not. This may be 2906 // used to include empty fields in Patch requests. 2907 ForceSendFields []string `json:"-"` 2908 2909 // NullFields is a list of field names (e.g. "Etag") to include in API 2910 // requests with the JSON null value. By default, fields with empty 2911 // values are omitted from API requests. However, any field with an 2912 // empty value appearing in NullFields will be sent to the server as 2913 // null. It is an error if a field in this list has a non-empty value. 2914 // This may be used to include null fields in Patch requests. 2915 NullFields []string `json:"-"` 2916} 2917 2918func (s *ParentList) MarshalJSON() ([]byte, error) { 2919 type NoMethod ParentList 2920 raw := NoMethod(*s) 2921 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2922} 2923 2924// ParentReference: A reference to a file's parent. 2925type ParentReference struct { 2926 // Id: The ID of the parent. 2927 Id string `json:"id,omitempty"` 2928 2929 // IsRoot: Whether or not the parent is the root folder. 2930 IsRoot bool `json:"isRoot,omitempty"` 2931 2932 // Kind: This is always drive#parentReference. 2933 Kind string `json:"kind,omitempty"` 2934 2935 // ParentLink: A link to the parent. 2936 ParentLink string `json:"parentLink,omitempty"` 2937 2938 // SelfLink: A link back to this reference. 2939 SelfLink string `json:"selfLink,omitempty"` 2940 2941 // ServerResponse contains the HTTP response code and headers from the 2942 // server. 2943 googleapi.ServerResponse `json:"-"` 2944 2945 // ForceSendFields is a list of field names (e.g. "Id") to 2946 // unconditionally include in API requests. By default, fields with 2947 // empty values are omitted from API requests. However, any non-pointer, 2948 // non-interface field appearing in ForceSendFields will be sent to the 2949 // server regardless of whether the field is empty or not. This may be 2950 // used to include empty fields in Patch requests. 2951 ForceSendFields []string `json:"-"` 2952 2953 // NullFields is a list of field names (e.g. "Id") to include in API 2954 // requests with the JSON null value. By default, fields with empty 2955 // values are omitted from API requests. However, any field with an 2956 // empty value appearing in NullFields will be sent to the server as 2957 // null. It is an error if a field in this list has a non-empty value. 2958 // This may be used to include null fields in Patch requests. 2959 NullFields []string `json:"-"` 2960} 2961 2962func (s *ParentReference) MarshalJSON() ([]byte, error) { 2963 type NoMethod ParentReference 2964 raw := NoMethod(*s) 2965 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2966} 2967 2968// Permission: A permission for a file. 2969type Permission struct { 2970 // AdditionalRoles: Additional roles for this user. Only commenter is 2971 // currently allowed, though more may be supported in the future. 2972 AdditionalRoles []string `json:"additionalRoles,omitempty"` 2973 2974 // AuthKey: Deprecated. 2975 AuthKey string `json:"authKey,omitempty"` 2976 2977 // Deleted: Whether the account associated with this permission has been 2978 // deleted. This field only pertains to user and group permissions. 2979 Deleted bool `json:"deleted,omitempty"` 2980 2981 // Domain: The domain name of the entity this permission refers to. This 2982 // is an output-only field which is present when the permission type is 2983 // user, group or domain. 2984 Domain string `json:"domain,omitempty"` 2985 2986 // EmailAddress: The email address of the user or group this permission 2987 // refers to. This is an output-only field which is present when the 2988 // permission type is user or group. 2989 EmailAddress string `json:"emailAddress,omitempty"` 2990 2991 // Etag: The ETag of the permission. 2992 Etag string `json:"etag,omitempty"` 2993 2994 // ExpirationDate: The time at which this permission will expire (RFC 2995 // 3339 date-time). Expiration dates have the following restrictions: 2996 // 2997 // - They cannot be set on shared drive items 2998 // - They can only be set on user and group permissions 2999 // - The date must be in the future 3000 // - The date cannot be more than a year in the future 3001 // - The date can only be set on drive.permissions.update or 3002 // drive.permissions.patch requests 3003 ExpirationDate string `json:"expirationDate,omitempty"` 3004 3005 // Id: The ID of the user this permission refers to, and identical to 3006 // the permissionId in the About and Files resources. When making a 3007 // drive.permissions.insert request, exactly one of the id or value 3008 // fields must be specified unless the permission type is anyone, in 3009 // which case both id and value are ignored. 3010 Id string `json:"id,omitempty"` 3011 3012 // Kind: This is always drive#permission. 3013 Kind string `json:"kind,omitempty"` 3014 3015 // Name: The name for this permission. 3016 Name string `json:"name,omitempty"` 3017 3018 // PermissionDetails: Details of whether the permissions on this shared 3019 // drive item are inherited or directly on this item. This is an 3020 // output-only field which is present only for shared drive items. 3021 PermissionDetails []*PermissionPermissionDetails `json:"permissionDetails,omitempty"` 3022 3023 // PhotoLink: A link to the profile photo, if available. 3024 PhotoLink string `json:"photoLink,omitempty"` 3025 3026 // Role: The primary role for this user. While new values may be 3027 // supported in the future, the following are currently allowed: 3028 // - owner 3029 // - organizer 3030 // - fileOrganizer 3031 // - writer 3032 // - reader 3033 Role string `json:"role,omitempty"` 3034 3035 // SelfLink: A link back to this permission. 3036 SelfLink string `json:"selfLink,omitempty"` 3037 3038 // TeamDrivePermissionDetails: Deprecated - use permissionDetails 3039 // instead. 3040 TeamDrivePermissionDetails []*PermissionTeamDrivePermissionDetails `json:"teamDrivePermissionDetails,omitempty"` 3041 3042 // Type: The account type. Allowed values are: 3043 // - user 3044 // - group 3045 // - domain 3046 // - anyone 3047 Type string `json:"type,omitempty"` 3048 3049 // Value: The email address or domain name for the entity. This is used 3050 // during inserts and is not populated in responses. When making a 3051 // drive.permissions.insert request, exactly one of the id or value 3052 // fields must be specified unless the permission type is anyone, in 3053 // which case both id and value are ignored. 3054 Value string `json:"value,omitempty"` 3055 3056 // View: Indicates the view for this permission. Only populated for 3057 // permissions that belong to a view. published is the only supported 3058 // value. 3059 View string `json:"view,omitempty"` 3060 3061 // WithLink: Whether the link is required for this permission. 3062 WithLink bool `json:"withLink,omitempty"` 3063 3064 // ServerResponse contains the HTTP response code and headers from the 3065 // server. 3066 googleapi.ServerResponse `json:"-"` 3067 3068 // ForceSendFields is a list of field names (e.g. "AdditionalRoles") to 3069 // unconditionally include in API requests. By default, fields with 3070 // empty values are omitted from API requests. However, any non-pointer, 3071 // non-interface field appearing in ForceSendFields will be sent to the 3072 // server regardless of whether the field is empty or not. This may be 3073 // used to include empty fields in Patch requests. 3074 ForceSendFields []string `json:"-"` 3075 3076 // NullFields is a list of field names (e.g. "AdditionalRoles") to 3077 // include in API requests with the JSON null value. By default, fields 3078 // with empty values are omitted from API requests. However, any field 3079 // with an empty value appearing in NullFields will be sent to the 3080 // server as null. It is an error if a field in this list has a 3081 // non-empty value. This may be used to include null fields in Patch 3082 // requests. 3083 NullFields []string `json:"-"` 3084} 3085 3086func (s *Permission) MarshalJSON() ([]byte, error) { 3087 type NoMethod Permission 3088 raw := NoMethod(*s) 3089 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3090} 3091 3092type PermissionPermissionDetails struct { 3093 // AdditionalRoles: Additional roles for this user. Only commenter is 3094 // currently possible, though more may be supported in the future. 3095 AdditionalRoles []string `json:"additionalRoles,omitempty"` 3096 3097 // Inherited: Whether this permission is inherited. This field is always 3098 // populated. This is an output-only field. 3099 Inherited bool `json:"inherited,omitempty"` 3100 3101 // InheritedFrom: The ID of the item from which this permission is 3102 // inherited. This is an output-only field. 3103 InheritedFrom string `json:"inheritedFrom,omitempty"` 3104 3105 // PermissionType: The permission type for this user. While new values 3106 // may be added in future, the following are currently possible: 3107 // - file 3108 // - member 3109 PermissionType string `json:"permissionType,omitempty"` 3110 3111 // Role: The primary role for this user. While new values may be added 3112 // in the future, the following are currently possible: 3113 // - organizer 3114 // - fileOrganizer 3115 // - writer 3116 // - reader 3117 Role string `json:"role,omitempty"` 3118 3119 // ForceSendFields is a list of field names (e.g. "AdditionalRoles") to 3120 // unconditionally include in API requests. By default, fields with 3121 // empty values are omitted from API requests. However, any non-pointer, 3122 // non-interface field appearing in ForceSendFields will be sent to the 3123 // server regardless of whether the field is empty or not. This may be 3124 // used to include empty fields in Patch requests. 3125 ForceSendFields []string `json:"-"` 3126 3127 // NullFields is a list of field names (e.g. "AdditionalRoles") to 3128 // include in API requests with the JSON null value. By default, fields 3129 // with empty values are omitted from API requests. However, any field 3130 // with an empty value appearing in NullFields will be sent to the 3131 // server as null. It is an error if a field in this list has a 3132 // non-empty value. This may be used to include null fields in Patch 3133 // requests. 3134 NullFields []string `json:"-"` 3135} 3136 3137func (s *PermissionPermissionDetails) MarshalJSON() ([]byte, error) { 3138 type NoMethod PermissionPermissionDetails 3139 raw := NoMethod(*s) 3140 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3141} 3142 3143type PermissionTeamDrivePermissionDetails struct { 3144 // AdditionalRoles: Deprecated - use permissionDetails/additionalRoles 3145 // instead. 3146 AdditionalRoles []string `json:"additionalRoles,omitempty"` 3147 3148 // Inherited: Deprecated - use permissionDetails/inherited instead. 3149 Inherited bool `json:"inherited,omitempty"` 3150 3151 // InheritedFrom: Deprecated - use permissionDetails/inheritedFrom 3152 // instead. 3153 InheritedFrom string `json:"inheritedFrom,omitempty"` 3154 3155 // Role: Deprecated - use permissionDetails/role instead. 3156 Role string `json:"role,omitempty"` 3157 3158 // TeamDrivePermissionType: Deprecated - use 3159 // permissionDetails/permissionType instead. 3160 TeamDrivePermissionType string `json:"teamDrivePermissionType,omitempty"` 3161 3162 // ForceSendFields is a list of field names (e.g. "AdditionalRoles") to 3163 // unconditionally include in API requests. By default, fields with 3164 // empty values are omitted from API requests. However, any non-pointer, 3165 // non-interface field appearing in ForceSendFields will be sent to the 3166 // server regardless of whether the field is empty or not. This may be 3167 // used to include empty fields in Patch requests. 3168 ForceSendFields []string `json:"-"` 3169 3170 // NullFields is a list of field names (e.g. "AdditionalRoles") to 3171 // include in API requests with the JSON null value. By default, fields 3172 // with empty values are omitted from API requests. However, any field 3173 // with an empty value appearing in NullFields will be sent to the 3174 // server as null. It is an error if a field in this list has a 3175 // non-empty value. This may be used to include null fields in Patch 3176 // requests. 3177 NullFields []string `json:"-"` 3178} 3179 3180func (s *PermissionTeamDrivePermissionDetails) MarshalJSON() ([]byte, error) { 3181 type NoMethod PermissionTeamDrivePermissionDetails 3182 raw := NoMethod(*s) 3183 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3184} 3185 3186// PermissionId: An ID for a user or group as seen in Permission items. 3187type PermissionId struct { 3188 // Id: The permission ID. 3189 Id string `json:"id,omitempty"` 3190 3191 // Kind: This is always drive#permissionId. 3192 Kind string `json:"kind,omitempty"` 3193 3194 // ServerResponse contains the HTTP response code and headers from the 3195 // server. 3196 googleapi.ServerResponse `json:"-"` 3197 3198 // ForceSendFields is a list of field names (e.g. "Id") to 3199 // unconditionally include in API requests. By default, fields with 3200 // empty values are omitted from API requests. However, any non-pointer, 3201 // non-interface field appearing in ForceSendFields will be sent to the 3202 // server regardless of whether the field is empty or not. This may be 3203 // used to include empty fields in Patch requests. 3204 ForceSendFields []string `json:"-"` 3205 3206 // NullFields is a list of field names (e.g. "Id") to include in API 3207 // requests with the JSON null value. By default, fields with empty 3208 // values are omitted from API requests. However, any field with an 3209 // empty value appearing in NullFields will be sent to the server as 3210 // null. It is an error if a field in this list has a non-empty value. 3211 // This may be used to include null fields in Patch requests. 3212 NullFields []string `json:"-"` 3213} 3214 3215func (s *PermissionId) MarshalJSON() ([]byte, error) { 3216 type NoMethod PermissionId 3217 raw := NoMethod(*s) 3218 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3219} 3220 3221// PermissionList: A list of permissions associated with a file. 3222type PermissionList struct { 3223 // Etag: The ETag of the list. 3224 Etag string `json:"etag,omitempty"` 3225 3226 // Items: The list of permissions. 3227 Items []*Permission `json:"items,omitempty"` 3228 3229 // Kind: This is always drive#permissionList. 3230 Kind string `json:"kind,omitempty"` 3231 3232 // NextPageToken: The page token for the next page of permissions. This 3233 // field will be absent if the end of the permissions list has been 3234 // reached. If the token is rejected for any reason, it should be 3235 // discarded, and pagination should be restarted from the first page of 3236 // results. 3237 NextPageToken string `json:"nextPageToken,omitempty"` 3238 3239 // SelfLink: A link back to this list. 3240 SelfLink string `json:"selfLink,omitempty"` 3241 3242 // ServerResponse contains the HTTP response code and headers from the 3243 // server. 3244 googleapi.ServerResponse `json:"-"` 3245 3246 // ForceSendFields is a list of field names (e.g. "Etag") to 3247 // unconditionally include in API requests. By default, fields with 3248 // empty values are omitted from API requests. However, any non-pointer, 3249 // non-interface field appearing in ForceSendFields will be sent to the 3250 // server regardless of whether the field is empty or not. This may be 3251 // used to include empty fields in Patch requests. 3252 ForceSendFields []string `json:"-"` 3253 3254 // NullFields is a list of field names (e.g. "Etag") to include in API 3255 // requests with the JSON null value. By default, fields with empty 3256 // values are omitted from API requests. However, any field with an 3257 // empty value appearing in NullFields will be sent to the server as 3258 // null. It is an error if a field in this list has a non-empty value. 3259 // This may be used to include null fields in Patch requests. 3260 NullFields []string `json:"-"` 3261} 3262 3263func (s *PermissionList) MarshalJSON() ([]byte, error) { 3264 type NoMethod PermissionList 3265 raw := NoMethod(*s) 3266 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3267} 3268 3269// Property: A key-value pair attached to a file that is either public 3270// or private to an application. 3271// The following limits apply to file properties: 3272// - Maximum of 100 properties total per file 3273// - Maximum of 30 private properties per app 3274// - Maximum of 30 public properties 3275// - Maximum of 124 bytes size limit on (key + value) string in UTF-8 3276// encoding for a single property. 3277type Property struct { 3278 // Etag: ETag of the property. 3279 Etag string `json:"etag,omitempty"` 3280 3281 // Key: The key of this property. 3282 Key string `json:"key,omitempty"` 3283 3284 // Kind: This is always drive#property. 3285 Kind string `json:"kind,omitempty"` 3286 3287 // SelfLink: The link back to this property. 3288 SelfLink string `json:"selfLink,omitempty"` 3289 3290 // Value: The value of this property. 3291 Value string `json:"value,omitempty"` 3292 3293 // Visibility: The visibility of this property. Allowed values are 3294 // PRIVATE and PUBLIC. (Default: PRIVATE). Private properties can only 3295 // be retrieved using an authenticated request. An authenticated request 3296 // uses an access token obtained with a OAuth 2 client ID. You cannot 3297 // use an API key to retrieve private properties. 3298 Visibility string `json:"visibility,omitempty"` 3299 3300 // ServerResponse contains the HTTP response code and headers from the 3301 // server. 3302 googleapi.ServerResponse `json:"-"` 3303 3304 // ForceSendFields is a list of field names (e.g. "Etag") to 3305 // unconditionally include in API requests. By default, fields with 3306 // empty values are omitted from API requests. However, any non-pointer, 3307 // non-interface field appearing in ForceSendFields will be sent to the 3308 // server regardless of whether the field is empty or not. This may be 3309 // used to include empty fields in Patch requests. 3310 ForceSendFields []string `json:"-"` 3311 3312 // NullFields is a list of field names (e.g. "Etag") to include in API 3313 // requests with the JSON null value. By default, fields with empty 3314 // values are omitted from API requests. However, any field with an 3315 // empty value appearing in NullFields will be sent to the server as 3316 // null. It is an error if a field in this list has a non-empty value. 3317 // This may be used to include null fields in Patch requests. 3318 NullFields []string `json:"-"` 3319} 3320 3321func (s *Property) MarshalJSON() ([]byte, error) { 3322 type NoMethod Property 3323 raw := NoMethod(*s) 3324 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3325} 3326 3327// PropertyList: A collection of properties, key-value pairs that are 3328// either public or private to an application. 3329type PropertyList struct { 3330 // Etag: The ETag of the list. 3331 Etag string `json:"etag,omitempty"` 3332 3333 // Items: The list of properties. 3334 Items []*Property `json:"items,omitempty"` 3335 3336 // Kind: This is always drive#propertyList. 3337 Kind string `json:"kind,omitempty"` 3338 3339 // SelfLink: The link back to this list. 3340 SelfLink string `json:"selfLink,omitempty"` 3341 3342 // ServerResponse contains the HTTP response code and headers from the 3343 // server. 3344 googleapi.ServerResponse `json:"-"` 3345 3346 // ForceSendFields is a list of field names (e.g. "Etag") to 3347 // unconditionally include in API requests. By default, fields with 3348 // empty values are omitted from API requests. However, any non-pointer, 3349 // non-interface field appearing in ForceSendFields will be sent to the 3350 // server regardless of whether the field is empty or not. This may be 3351 // used to include empty fields in Patch requests. 3352 ForceSendFields []string `json:"-"` 3353 3354 // NullFields is a list of field names (e.g. "Etag") to include in API 3355 // requests with the JSON null value. By default, fields with empty 3356 // values are omitted from API requests. However, any field with an 3357 // empty value appearing in NullFields will be sent to the server as 3358 // null. It is an error if a field in this list has a non-empty value. 3359 // This may be used to include null fields in Patch requests. 3360 NullFields []string `json:"-"` 3361} 3362 3363func (s *PropertyList) MarshalJSON() ([]byte, error) { 3364 type NoMethod PropertyList 3365 raw := NoMethod(*s) 3366 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3367} 3368 3369// Revision: A revision of a file. 3370type Revision struct { 3371 DownloadUrl string `json:"downloadUrl,omitempty"` 3372 3373 // Etag: The ETag of the revision. 3374 Etag string `json:"etag,omitempty"` 3375 3376 // ExportLinks: Links for exporting Docs Editors files to specific 3377 // formats. 3378 ExportLinks map[string]string `json:"exportLinks,omitempty"` 3379 3380 // FileSize: The size of the revision in bytes. This will only be 3381 // populated on files with content stored in Drive. 3382 FileSize int64 `json:"fileSize,omitempty,string"` 3383 3384 // Id: The ID of the revision. 3385 Id string `json:"id,omitempty"` 3386 3387 // Kind: This is always drive#revision. 3388 Kind string `json:"kind,omitempty"` 3389 3390 // LastModifyingUser: The last user to modify this revision. 3391 LastModifyingUser *User `json:"lastModifyingUser,omitempty"` 3392 3393 // LastModifyingUserName: Name of the last user to modify this revision. 3394 LastModifyingUserName string `json:"lastModifyingUserName,omitempty"` 3395 3396 // Md5Checksum: An MD5 checksum for the content of this revision. This 3397 // will only be populated on files with content stored in Drive. 3398 Md5Checksum string `json:"md5Checksum,omitempty"` 3399 3400 // MimeType: The MIME type of the revision. 3401 MimeType string `json:"mimeType,omitempty"` 3402 3403 // ModifiedDate: Last time this revision was modified (formatted RFC 3404 // 3339 timestamp). 3405 ModifiedDate string `json:"modifiedDate,omitempty"` 3406 3407 // OriginalFilename: The original filename when this revision was 3408 // created. This will only be populated on files with content stored in 3409 // Drive. 3410 OriginalFilename string `json:"originalFilename,omitempty"` 3411 3412 // Pinned: Whether this revision is pinned to prevent automatic purging. 3413 // This will only be populated and can only be modified on files with 3414 // content stored in Drive, excluding Docs Editors files. Revisions can 3415 // also be pinned when they are created through the 3416 // drive.files.insert/update/copy by using the pinned query parameter. 3417 // Pinned revisions are stored indefinitely using additional storage 3418 // quota, up to a maximum of 200 revisions. 3419 Pinned bool `json:"pinned,omitempty"` 3420 3421 // PublishAuto: Whether subsequent revisions will be automatically 3422 // republished. This is only populated and can only be modified for Docs 3423 // Editors files. 3424 PublishAuto bool `json:"publishAuto,omitempty"` 3425 3426 // Published: Whether this revision is published. This is only populated 3427 // and can only be modified for Docs Editors files. 3428 Published bool `json:"published,omitempty"` 3429 3430 // PublishedLink: A link to the published revision. This is only 3431 // populated for Google Sites files. 3432 PublishedLink string `json:"publishedLink,omitempty"` 3433 3434 // PublishedOutsideDomain: Whether this revision is published outside 3435 // the domain. This is only populated and can only be modified for Docs 3436 // Editors files. 3437 PublishedOutsideDomain bool `json:"publishedOutsideDomain,omitempty"` 3438 3439 // SelfLink: A link back to this revision. 3440 SelfLink string `json:"selfLink,omitempty"` 3441 3442 // ServerResponse contains the HTTP response code and headers from the 3443 // server. 3444 googleapi.ServerResponse `json:"-"` 3445 3446 // ForceSendFields is a list of field names (e.g. "DownloadUrl") to 3447 // unconditionally include in API requests. By default, fields with 3448 // empty values are omitted from API requests. However, any non-pointer, 3449 // non-interface field appearing in ForceSendFields will be sent to the 3450 // server regardless of whether the field is empty or not. This may be 3451 // used to include empty fields in Patch requests. 3452 ForceSendFields []string `json:"-"` 3453 3454 // NullFields is a list of field names (e.g. "DownloadUrl") to include 3455 // in API requests with the JSON null value. By default, fields with 3456 // empty values are omitted from API requests. However, any field with 3457 // an empty value appearing in NullFields will be sent to the server as 3458 // null. It is an error if a field in this list has a non-empty value. 3459 // This may be used to include null fields in Patch requests. 3460 NullFields []string `json:"-"` 3461} 3462 3463func (s *Revision) MarshalJSON() ([]byte, error) { 3464 type NoMethod Revision 3465 raw := NoMethod(*s) 3466 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3467} 3468 3469// RevisionList: A list of revisions of a file. 3470type RevisionList struct { 3471 // Etag: The ETag of the list. 3472 Etag string `json:"etag,omitempty"` 3473 3474 // Items: The list of revisions. If nextPageToken is populated, then 3475 // this list may be incomplete and an additional page of results should 3476 // be fetched. 3477 Items []*Revision `json:"items,omitempty"` 3478 3479 // Kind: This is always drive#revisionList. 3480 Kind string `json:"kind,omitempty"` 3481 3482 // NextPageToken: The page token for the next page of revisions. This 3483 // field will be absent if the end of the revisions list has been 3484 // reached. If the token is rejected for any reason, it should be 3485 // discarded and pagination should be restarted from the first page of 3486 // results. 3487 NextPageToken string `json:"nextPageToken,omitempty"` 3488 3489 // SelfLink: A link back to this list. 3490 SelfLink string `json:"selfLink,omitempty"` 3491 3492 // ServerResponse contains the HTTP response code and headers from the 3493 // server. 3494 googleapi.ServerResponse `json:"-"` 3495 3496 // ForceSendFields is a list of field names (e.g. "Etag") to 3497 // unconditionally include in API requests. By default, fields with 3498 // empty values are omitted from API requests. However, any non-pointer, 3499 // non-interface field appearing in ForceSendFields will be sent to the 3500 // server regardless of whether the field is empty or not. This may be 3501 // used to include empty fields in Patch requests. 3502 ForceSendFields []string `json:"-"` 3503 3504 // NullFields is a list of field names (e.g. "Etag") to include in API 3505 // requests with the JSON null value. By default, fields with empty 3506 // values are omitted from API requests. However, any field with an 3507 // empty value appearing in NullFields will be sent to the server as 3508 // null. It is an error if a field in this list has a non-empty value. 3509 // This may be used to include null fields in Patch requests. 3510 NullFields []string `json:"-"` 3511} 3512 3513func (s *RevisionList) MarshalJSON() ([]byte, error) { 3514 type NoMethod RevisionList 3515 raw := NoMethod(*s) 3516 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3517} 3518 3519type StartPageToken struct { 3520 // Kind: Identifies what kind of resource this is. Value: the fixed 3521 // string "drive#startPageToken". 3522 Kind string `json:"kind,omitempty"` 3523 3524 // StartPageToken: The starting page token for listing changes. 3525 StartPageToken string `json:"startPageToken,omitempty"` 3526 3527 // ServerResponse contains the HTTP response code and headers from the 3528 // server. 3529 googleapi.ServerResponse `json:"-"` 3530 3531 // ForceSendFields is a list of field names (e.g. "Kind") to 3532 // unconditionally include in API requests. By default, fields with 3533 // empty values are omitted from API requests. However, any non-pointer, 3534 // non-interface field appearing in ForceSendFields will be sent to the 3535 // server regardless of whether the field is empty or not. This may be 3536 // used to include empty fields in Patch requests. 3537 ForceSendFields []string `json:"-"` 3538 3539 // NullFields is a list of field names (e.g. "Kind") to include in API 3540 // requests with the JSON null value. By default, fields with empty 3541 // values are omitted from API requests. However, any field with an 3542 // empty value appearing in NullFields will be sent to the server as 3543 // null. It is an error if a field in this list has a non-empty value. 3544 // This may be used to include null fields in Patch requests. 3545 NullFields []string `json:"-"` 3546} 3547 3548func (s *StartPageToken) MarshalJSON() ([]byte, error) { 3549 type NoMethod StartPageToken 3550 raw := NoMethod(*s) 3551 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3552} 3553 3554// TeamDrive: Deprecated: use the drive collection instead. 3555type TeamDrive struct { 3556 // BackgroundImageFile: An image file and cropping parameters from which 3557 // a background image for this Team Drive is set. This is a write only 3558 // field; it can only be set on drive.teamdrives.update requests that 3559 // don't set themeId. When specified, all fields of the 3560 // backgroundImageFile must be set. 3561 BackgroundImageFile *TeamDriveBackgroundImageFile `json:"backgroundImageFile,omitempty"` 3562 3563 // BackgroundImageLink: A short-lived link to this Team Drive's 3564 // background image. 3565 BackgroundImageLink string `json:"backgroundImageLink,omitempty"` 3566 3567 // Capabilities: Capabilities the current user has on this Team Drive. 3568 Capabilities *TeamDriveCapabilities `json:"capabilities,omitempty"` 3569 3570 // ColorRgb: The color of this Team Drive as an RGB hex string. It can 3571 // only be set on a drive.teamdrives.update request that does not set 3572 // themeId. 3573 ColorRgb string `json:"colorRgb,omitempty"` 3574 3575 // CreatedDate: The time at which the Team Drive was created (RFC 3339 3576 // date-time). 3577 CreatedDate string `json:"createdDate,omitempty"` 3578 3579 // Id: The ID of this Team Drive which is also the ID of the top level 3580 // folder of this Team Drive. 3581 Id string `json:"id,omitempty"` 3582 3583 // Kind: This is always drive#teamDrive 3584 Kind string `json:"kind,omitempty"` 3585 3586 // Name: The name of this Team Drive. 3587 Name string `json:"name,omitempty"` 3588 3589 // Restrictions: A set of restrictions that apply to this Team Drive or 3590 // items inside this Team Drive. 3591 Restrictions *TeamDriveRestrictions `json:"restrictions,omitempty"` 3592 3593 // ThemeId: The ID of the theme from which the background image and 3594 // color will be set. The set of possible teamDriveThemes can be 3595 // retrieved from a drive.about.get response. When not specified on a 3596 // drive.teamdrives.insert request, a random theme is chosen from which 3597 // the background image and color are set. This is a write-only field; 3598 // it can only be set on requests that don't set colorRgb or 3599 // backgroundImageFile. 3600 ThemeId string `json:"themeId,omitempty"` 3601 3602 // ServerResponse contains the HTTP response code and headers from the 3603 // server. 3604 googleapi.ServerResponse `json:"-"` 3605 3606 // ForceSendFields is a list of field names (e.g. "BackgroundImageFile") 3607 // to unconditionally include in API requests. By default, fields with 3608 // empty values are omitted from API requests. However, any non-pointer, 3609 // non-interface field appearing in ForceSendFields will be sent to the 3610 // server regardless of whether the field is empty or not. This may be 3611 // used to include empty fields in Patch requests. 3612 ForceSendFields []string `json:"-"` 3613 3614 // NullFields is a list of field names (e.g. "BackgroundImageFile") to 3615 // include in API requests with the JSON null value. By default, fields 3616 // with empty values are omitted from API requests. However, any field 3617 // with an empty value appearing in NullFields will be sent to the 3618 // server as null. It is an error if a field in this list has a 3619 // non-empty value. This may be used to include null fields in Patch 3620 // requests. 3621 NullFields []string `json:"-"` 3622} 3623 3624func (s *TeamDrive) MarshalJSON() ([]byte, error) { 3625 type NoMethod TeamDrive 3626 raw := NoMethod(*s) 3627 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3628} 3629 3630// TeamDriveBackgroundImageFile: An image file and cropping parameters 3631// from which a background image for this Team Drive is set. This is a 3632// write only field; it can only be set on drive.teamdrives.update 3633// requests that don't set themeId. When specified, all fields of the 3634// backgroundImageFile must be set. 3635type TeamDriveBackgroundImageFile struct { 3636 // Id: The ID of an image file in Drive to use for the background image. 3637 Id string `json:"id,omitempty"` 3638 3639 // Width: The width of the cropped image in the closed range of 0 to 1. 3640 // This value represents the width of the cropped image divided by the 3641 // width of the entire image. The height is computed by applying a width 3642 // to height aspect ratio of 80 to 9. The resulting image must be at 3643 // least 1280 pixels wide and 144 pixels high. 3644 Width float64 `json:"width,omitempty"` 3645 3646 // XCoordinate: The X coordinate of the upper left corner of the 3647 // cropping area in the background image. This is a value in the closed 3648 // range of 0 to 1. This value represents the horizontal distance from 3649 // the left side of the entire image to the left side of the cropping 3650 // area divided by the width of the entire image. 3651 XCoordinate float64 `json:"xCoordinate,omitempty"` 3652 3653 // YCoordinate: The Y coordinate of the upper left corner of the 3654 // cropping area in the background image. This is a value in the closed 3655 // range of 0 to 1. This value represents the vertical distance from the 3656 // top side of the entire image to the top side of the cropping area 3657 // divided by the height of the entire image. 3658 YCoordinate float64 `json:"yCoordinate,omitempty"` 3659 3660 // ForceSendFields is a list of field names (e.g. "Id") to 3661 // unconditionally include in API requests. By default, fields with 3662 // empty values are omitted from API requests. However, any non-pointer, 3663 // non-interface field appearing in ForceSendFields will be sent to the 3664 // server regardless of whether the field is empty or not. This may be 3665 // used to include empty fields in Patch requests. 3666 ForceSendFields []string `json:"-"` 3667 3668 // NullFields is a list of field names (e.g. "Id") to include in API 3669 // requests with the JSON null value. By default, fields with empty 3670 // values are omitted from API requests. However, any field with an 3671 // empty value appearing in NullFields will be sent to the server as 3672 // null. It is an error if a field in this list has a non-empty value. 3673 // This may be used to include null fields in Patch requests. 3674 NullFields []string `json:"-"` 3675} 3676 3677func (s *TeamDriveBackgroundImageFile) MarshalJSON() ([]byte, error) { 3678 type NoMethod TeamDriveBackgroundImageFile 3679 raw := NoMethod(*s) 3680 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3681} 3682 3683func (s *TeamDriveBackgroundImageFile) UnmarshalJSON(data []byte) error { 3684 type NoMethod TeamDriveBackgroundImageFile 3685 var s1 struct { 3686 Width gensupport.JSONFloat64 `json:"width"` 3687 XCoordinate gensupport.JSONFloat64 `json:"xCoordinate"` 3688 YCoordinate gensupport.JSONFloat64 `json:"yCoordinate"` 3689 *NoMethod 3690 } 3691 s1.NoMethod = (*NoMethod)(s) 3692 if err := json.Unmarshal(data, &s1); err != nil { 3693 return err 3694 } 3695 s.Width = float64(s1.Width) 3696 s.XCoordinate = float64(s1.XCoordinate) 3697 s.YCoordinate = float64(s1.YCoordinate) 3698 return nil 3699} 3700 3701// TeamDriveCapabilities: Capabilities the current user has on this Team 3702// Drive. 3703type TeamDriveCapabilities struct { 3704 // CanAddChildren: Whether the current user can add children to folders 3705 // in this Team Drive. 3706 CanAddChildren bool `json:"canAddChildren,omitempty"` 3707 3708 // CanChangeCopyRequiresWriterPermissionRestriction: Whether the current 3709 // user can change the copyRequiresWriterPermission restriction of this 3710 // Team Drive. 3711 CanChangeCopyRequiresWriterPermissionRestriction bool `json:"canChangeCopyRequiresWriterPermissionRestriction,omitempty"` 3712 3713 // CanChangeDomainUsersOnlyRestriction: Whether the current user can 3714 // change the domainUsersOnly restriction of this Team Drive. 3715 CanChangeDomainUsersOnlyRestriction bool `json:"canChangeDomainUsersOnlyRestriction,omitempty"` 3716 3717 // CanChangeTeamDriveBackground: Whether the current user can change the 3718 // background of this Team Drive. 3719 CanChangeTeamDriveBackground bool `json:"canChangeTeamDriveBackground,omitempty"` 3720 3721 // CanChangeTeamMembersOnlyRestriction: Whether the current user can 3722 // change the teamMembersOnly restriction of this Team Drive. 3723 CanChangeTeamMembersOnlyRestriction bool `json:"canChangeTeamMembersOnlyRestriction,omitempty"` 3724 3725 // CanComment: Whether the current user can comment on files in this 3726 // Team Drive. 3727 CanComment bool `json:"canComment,omitempty"` 3728 3729 // CanCopy: Whether the current user can copy files in this Team Drive. 3730 CanCopy bool `json:"canCopy,omitempty"` 3731 3732 // CanDeleteChildren: Whether the current user can delete children from 3733 // folders in this Team Drive. 3734 CanDeleteChildren bool `json:"canDeleteChildren,omitempty"` 3735 3736 // CanDeleteTeamDrive: Whether the current user can delete this Team 3737 // Drive. Attempting to delete the Team Drive may still fail if there 3738 // are untrashed items inside the Team Drive. 3739 CanDeleteTeamDrive bool `json:"canDeleteTeamDrive,omitempty"` 3740 3741 // CanDownload: Whether the current user can download files in this Team 3742 // Drive. 3743 CanDownload bool `json:"canDownload,omitempty"` 3744 3745 // CanEdit: Whether the current user can edit files in this Team Drive 3746 CanEdit bool `json:"canEdit,omitempty"` 3747 3748 // CanListChildren: Whether the current user can list the children of 3749 // folders in this Team Drive. 3750 CanListChildren bool `json:"canListChildren,omitempty"` 3751 3752 // CanManageMembers: Whether the current user can add members to this 3753 // Team Drive or remove them or change their role. 3754 CanManageMembers bool `json:"canManageMembers,omitempty"` 3755 3756 // CanReadRevisions: Whether the current user can read the revisions 3757 // resource of files in this Team Drive. 3758 CanReadRevisions bool `json:"canReadRevisions,omitempty"` 3759 3760 // CanRemoveChildren: Deprecated - use canDeleteChildren or 3761 // canTrashChildren instead. 3762 CanRemoveChildren bool `json:"canRemoveChildren,omitempty"` 3763 3764 // CanRename: Whether the current user can rename files or folders in 3765 // this Team Drive. 3766 CanRename bool `json:"canRename,omitempty"` 3767 3768 // CanRenameTeamDrive: Whether the current user can rename this Team 3769 // Drive. 3770 CanRenameTeamDrive bool `json:"canRenameTeamDrive,omitempty"` 3771 3772 // CanShare: Whether the current user can share files or folders in this 3773 // Team Drive. 3774 CanShare bool `json:"canShare,omitempty"` 3775 3776 // CanTrashChildren: Whether the current user can trash children from 3777 // folders in this Team Drive. 3778 CanTrashChildren bool `json:"canTrashChildren,omitempty"` 3779 3780 // ForceSendFields is a list of field names (e.g. "CanAddChildren") to 3781 // unconditionally include in API requests. By default, fields with 3782 // empty values are omitted from API requests. However, any non-pointer, 3783 // non-interface field appearing in ForceSendFields will be sent to the 3784 // server regardless of whether the field is empty or not. This may be 3785 // used to include empty fields in Patch requests. 3786 ForceSendFields []string `json:"-"` 3787 3788 // NullFields is a list of field names (e.g. "CanAddChildren") to 3789 // include in API requests with the JSON null value. By default, fields 3790 // with empty values are omitted from API requests. However, any field 3791 // with an empty value appearing in NullFields will be sent to the 3792 // server as null. It is an error if a field in this list has a 3793 // non-empty value. This may be used to include null fields in Patch 3794 // requests. 3795 NullFields []string `json:"-"` 3796} 3797 3798func (s *TeamDriveCapabilities) MarshalJSON() ([]byte, error) { 3799 type NoMethod TeamDriveCapabilities 3800 raw := NoMethod(*s) 3801 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3802} 3803 3804// TeamDriveRestrictions: A set of restrictions that apply to this Team 3805// Drive or items inside this Team Drive. 3806type TeamDriveRestrictions struct { 3807 // AdminManagedRestrictions: Whether administrative privileges on this 3808 // Team Drive are required to modify restrictions. 3809 AdminManagedRestrictions bool `json:"adminManagedRestrictions,omitempty"` 3810 3811 // CopyRequiresWriterPermission: Whether the options to copy, print, or 3812 // download files inside this Team Drive, should be disabled for readers 3813 // and commenters. When this restriction is set to true, it will 3814 // override the similarly named field to true for any file inside this 3815 // Team Drive. 3816 CopyRequiresWriterPermission bool `json:"copyRequiresWriterPermission,omitempty"` 3817 3818 // DomainUsersOnly: Whether access to this Team Drive and items inside 3819 // this Team Drive is restricted to users of the domain to which this 3820 // Team Drive belongs. This restriction may be overridden by other 3821 // sharing policies controlled outside of this Team Drive. 3822 DomainUsersOnly bool `json:"domainUsersOnly,omitempty"` 3823 3824 // TeamMembersOnly: Whether access to items inside this Team Drive is 3825 // restricted to members of this Team Drive. 3826 TeamMembersOnly bool `json:"teamMembersOnly,omitempty"` 3827 3828 // ForceSendFields is a list of field names (e.g. 3829 // "AdminManagedRestrictions") to unconditionally include in API 3830 // requests. By default, fields with empty values are omitted from API 3831 // requests. However, any non-pointer, non-interface field appearing in 3832 // ForceSendFields will be sent to the server regardless of whether the 3833 // field is empty or not. This may be used to include empty fields in 3834 // Patch requests. 3835 ForceSendFields []string `json:"-"` 3836 3837 // NullFields is a list of field names (e.g. "AdminManagedRestrictions") 3838 // to include in API requests with the JSON null value. By default, 3839 // fields with empty values are omitted from API requests. However, any 3840 // field with an empty value appearing in NullFields will be sent to the 3841 // server as null. It is an error if a field in this list has a 3842 // non-empty value. This may be used to include null fields in Patch 3843 // requests. 3844 NullFields []string `json:"-"` 3845} 3846 3847func (s *TeamDriveRestrictions) MarshalJSON() ([]byte, error) { 3848 type NoMethod TeamDriveRestrictions 3849 raw := NoMethod(*s) 3850 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3851} 3852 3853// TeamDriveList: A list of Team Drives. 3854type TeamDriveList struct { 3855 // Items: The list of Team Drives. 3856 Items []*TeamDrive `json:"items,omitempty"` 3857 3858 // Kind: This is always drive#teamDriveList 3859 Kind string `json:"kind,omitempty"` 3860 3861 // NextPageToken: The page token for the next page of Team Drives. 3862 NextPageToken string `json:"nextPageToken,omitempty"` 3863 3864 // ServerResponse contains the HTTP response code and headers from the 3865 // server. 3866 googleapi.ServerResponse `json:"-"` 3867 3868 // ForceSendFields is a list of field names (e.g. "Items") to 3869 // unconditionally include in API requests. By default, fields with 3870 // empty values are omitted from API requests. However, any non-pointer, 3871 // non-interface field appearing in ForceSendFields will be sent to the 3872 // server regardless of whether the field is empty or not. This may be 3873 // used to include empty fields in Patch requests. 3874 ForceSendFields []string `json:"-"` 3875 3876 // NullFields is a list of field names (e.g. "Items") to include in API 3877 // requests with the JSON null value. By default, fields with empty 3878 // values are omitted from API requests. However, any field with an 3879 // empty value appearing in NullFields will be sent to the server as 3880 // null. It is an error if a field in this list has a non-empty value. 3881 // This may be used to include null fields in Patch requests. 3882 NullFields []string `json:"-"` 3883} 3884 3885func (s *TeamDriveList) MarshalJSON() ([]byte, error) { 3886 type NoMethod TeamDriveList 3887 raw := NoMethod(*s) 3888 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3889} 3890 3891// User: Information about a Drive user. 3892type User struct { 3893 // DisplayName: A plain text displayable name for this user. 3894 DisplayName string `json:"displayName,omitempty"` 3895 3896 // EmailAddress: The email address of the user. 3897 EmailAddress string `json:"emailAddress,omitempty"` 3898 3899 // IsAuthenticatedUser: Whether this user is the same as the 3900 // authenticated user for whom the request was made. 3901 IsAuthenticatedUser bool `json:"isAuthenticatedUser,omitempty"` 3902 3903 // Kind: This is always drive#user. 3904 Kind string `json:"kind,omitempty"` 3905 3906 // PermissionId: The user's ID as visible in the permissions collection. 3907 PermissionId string `json:"permissionId,omitempty"` 3908 3909 // Picture: The user's profile picture. 3910 Picture *UserPicture `json:"picture,omitempty"` 3911 3912 // ForceSendFields is a list of field names (e.g. "DisplayName") to 3913 // unconditionally include in API requests. By default, fields with 3914 // empty values are omitted from API requests. However, any non-pointer, 3915 // non-interface field appearing in ForceSendFields will be sent to the 3916 // server regardless of whether the field is empty or not. This may be 3917 // used to include empty fields in Patch requests. 3918 ForceSendFields []string `json:"-"` 3919 3920 // NullFields is a list of field names (e.g. "DisplayName") to include 3921 // in API requests with the JSON null value. By default, fields with 3922 // empty values are omitted from API requests. However, any field with 3923 // an empty value appearing in NullFields will be sent to the server as 3924 // null. It is an error if a field in this list has a non-empty value. 3925 // This may be used to include null fields in Patch requests. 3926 NullFields []string `json:"-"` 3927} 3928 3929func (s *User) MarshalJSON() ([]byte, error) { 3930 type NoMethod User 3931 raw := NoMethod(*s) 3932 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3933} 3934 3935// UserPicture: The user's profile picture. 3936type UserPicture struct { 3937 // Url: A URL that points to a profile picture of this user. 3938 Url string `json:"url,omitempty"` 3939 3940 // ForceSendFields is a list of field names (e.g. "Url") to 3941 // unconditionally include in API requests. By default, fields with 3942 // empty values are omitted from API requests. However, any non-pointer, 3943 // non-interface field appearing in ForceSendFields will be sent to the 3944 // server regardless of whether the field is empty or not. This may be 3945 // used to include empty fields in Patch requests. 3946 ForceSendFields []string `json:"-"` 3947 3948 // NullFields is a list of field names (e.g. "Url") to include in API 3949 // requests with the JSON null value. By default, fields with empty 3950 // values are omitted from API requests. However, any field with an 3951 // empty value appearing in NullFields will be sent to the server as 3952 // null. It is an error if a field in this list has a non-empty value. 3953 // This may be used to include null fields in Patch requests. 3954 NullFields []string `json:"-"` 3955} 3956 3957func (s *UserPicture) MarshalJSON() ([]byte, error) { 3958 type NoMethod UserPicture 3959 raw := NoMethod(*s) 3960 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3961} 3962 3963// method id "drive.about.get": 3964 3965type AboutGetCall struct { 3966 s *Service 3967 urlParams_ gensupport.URLParams 3968 ifNoneMatch_ string 3969 ctx_ context.Context 3970 header_ http.Header 3971} 3972 3973// Get: Gets the information about the current user along with Drive API 3974// settings 3975func (r *AboutService) Get() *AboutGetCall { 3976 c := &AboutGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3977 return c 3978} 3979 3980// IncludeSubscribed sets the optional parameter "includeSubscribed": 3981// Whether to count changes outside the My Drive hierarchy. When set to 3982// false, changes to files such as those in the Application Data folder 3983// or shared files which have not been added to My Drive will be omitted 3984// from the maxChangeIdCount. 3985func (c *AboutGetCall) IncludeSubscribed(includeSubscribed bool) *AboutGetCall { 3986 c.urlParams_.Set("includeSubscribed", fmt.Sprint(includeSubscribed)) 3987 return c 3988} 3989 3990// MaxChangeIdCount sets the optional parameter "maxChangeIdCount": 3991// Maximum number of remaining change IDs to count 3992func (c *AboutGetCall) MaxChangeIdCount(maxChangeIdCount int64) *AboutGetCall { 3993 c.urlParams_.Set("maxChangeIdCount", fmt.Sprint(maxChangeIdCount)) 3994 return c 3995} 3996 3997// StartChangeId sets the optional parameter "startChangeId": Change ID 3998// to start counting from when calculating number of remaining change 3999// IDs 4000func (c *AboutGetCall) StartChangeId(startChangeId int64) *AboutGetCall { 4001 c.urlParams_.Set("startChangeId", fmt.Sprint(startChangeId)) 4002 return c 4003} 4004 4005// Fields allows partial responses to be retrieved. See 4006// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4007// for more information. 4008func (c *AboutGetCall) Fields(s ...googleapi.Field) *AboutGetCall { 4009 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4010 return c 4011} 4012 4013// IfNoneMatch sets the optional parameter which makes the operation 4014// fail if the object's ETag matches the given value. This is useful for 4015// getting updates only after the object has changed since the last 4016// request. Use googleapi.IsNotModified to check whether the response 4017// error from Do is the result of In-None-Match. 4018func (c *AboutGetCall) IfNoneMatch(entityTag string) *AboutGetCall { 4019 c.ifNoneMatch_ = entityTag 4020 return c 4021} 4022 4023// Context sets the context to be used in this call's Do method. Any 4024// pending HTTP request will be aborted if the provided context is 4025// canceled. 4026func (c *AboutGetCall) Context(ctx context.Context) *AboutGetCall { 4027 c.ctx_ = ctx 4028 return c 4029} 4030 4031// Header returns an http.Header that can be modified by the caller to 4032// add HTTP headers to the request. 4033func (c *AboutGetCall) Header() http.Header { 4034 if c.header_ == nil { 4035 c.header_ = make(http.Header) 4036 } 4037 return c.header_ 4038} 4039 4040func (c *AboutGetCall) doRequest(alt string) (*http.Response, error) { 4041 reqHeaders := make(http.Header) 4042 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4043 for k, v := range c.header_ { 4044 reqHeaders[k] = v 4045 } 4046 reqHeaders.Set("User-Agent", c.s.userAgent()) 4047 if c.ifNoneMatch_ != "" { 4048 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4049 } 4050 var body io.Reader = nil 4051 c.urlParams_.Set("alt", alt) 4052 c.urlParams_.Set("prettyPrint", "false") 4053 urls := googleapi.ResolveRelative(c.s.BasePath, "about") 4054 urls += "?" + c.urlParams_.Encode() 4055 req, err := http.NewRequest("GET", urls, body) 4056 if err != nil { 4057 return nil, err 4058 } 4059 req.Header = reqHeaders 4060 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4061} 4062 4063// Do executes the "drive.about.get" call. 4064// Exactly one of *About or error will be non-nil. Any non-2xx status 4065// code is an error. Response headers are in either 4066// *About.ServerResponse.Header or (if a response was returned at all) 4067// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4068// check whether the returned error was because http.StatusNotModified 4069// was returned. 4070func (c *AboutGetCall) Do(opts ...googleapi.CallOption) (*About, error) { 4071 gensupport.SetOptions(c.urlParams_, opts...) 4072 res, err := c.doRequest("json") 4073 if res != nil && res.StatusCode == http.StatusNotModified { 4074 if res.Body != nil { 4075 res.Body.Close() 4076 } 4077 return nil, &googleapi.Error{ 4078 Code: res.StatusCode, 4079 Header: res.Header, 4080 } 4081 } 4082 if err != nil { 4083 return nil, err 4084 } 4085 defer googleapi.CloseBody(res) 4086 if err := googleapi.CheckResponse(res); err != nil { 4087 return nil, err 4088 } 4089 ret := &About{ 4090 ServerResponse: googleapi.ServerResponse{ 4091 Header: res.Header, 4092 HTTPStatusCode: res.StatusCode, 4093 }, 4094 } 4095 target := &ret 4096 if err := gensupport.DecodeResponse(target, res); err != nil { 4097 return nil, err 4098 } 4099 return ret, nil 4100 // { 4101 // "description": "Gets the information about the current user along with Drive API settings", 4102 // "httpMethod": "GET", 4103 // "id": "drive.about.get", 4104 // "parameters": { 4105 // "includeSubscribed": { 4106 // "default": "true", 4107 // "description": "Whether to count changes outside the My Drive hierarchy. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive will be omitted from the maxChangeIdCount.", 4108 // "location": "query", 4109 // "type": "boolean" 4110 // }, 4111 // "maxChangeIdCount": { 4112 // "default": "1", 4113 // "description": "Maximum number of remaining change IDs to count", 4114 // "format": "int64", 4115 // "location": "query", 4116 // "type": "string" 4117 // }, 4118 // "startChangeId": { 4119 // "description": "Change ID to start counting from when calculating number of remaining change IDs", 4120 // "format": "int64", 4121 // "location": "query", 4122 // "type": "string" 4123 // } 4124 // }, 4125 // "path": "about", 4126 // "response": { 4127 // "$ref": "About" 4128 // }, 4129 // "scopes": [ 4130 // "https://www.googleapis.com/auth/drive", 4131 // "https://www.googleapis.com/auth/drive.appdata", 4132 // "https://www.googleapis.com/auth/drive.file", 4133 // "https://www.googleapis.com/auth/drive.metadata", 4134 // "https://www.googleapis.com/auth/drive.metadata.readonly", 4135 // "https://www.googleapis.com/auth/drive.photos.readonly", 4136 // "https://www.googleapis.com/auth/drive.readonly" 4137 // ] 4138 // } 4139 4140} 4141 4142// method id "drive.apps.get": 4143 4144type AppsGetCall struct { 4145 s *Service 4146 appId string 4147 urlParams_ gensupport.URLParams 4148 ifNoneMatch_ string 4149 ctx_ context.Context 4150 header_ http.Header 4151} 4152 4153// Get: Gets a specific app. 4154// 4155// - appId: The ID of the app. 4156func (r *AppsService) Get(appId string) *AppsGetCall { 4157 c := &AppsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4158 c.appId = appId 4159 return c 4160} 4161 4162// Fields allows partial responses to be retrieved. See 4163// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4164// for more information. 4165func (c *AppsGetCall) Fields(s ...googleapi.Field) *AppsGetCall { 4166 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4167 return c 4168} 4169 4170// IfNoneMatch sets the optional parameter which makes the operation 4171// fail if the object's ETag matches the given value. This is useful for 4172// getting updates only after the object has changed since the last 4173// request. Use googleapi.IsNotModified to check whether the response 4174// error from Do is the result of In-None-Match. 4175func (c *AppsGetCall) IfNoneMatch(entityTag string) *AppsGetCall { 4176 c.ifNoneMatch_ = entityTag 4177 return c 4178} 4179 4180// Context sets the context to be used in this call's Do method. Any 4181// pending HTTP request will be aborted if the provided context is 4182// canceled. 4183func (c *AppsGetCall) Context(ctx context.Context) *AppsGetCall { 4184 c.ctx_ = ctx 4185 return c 4186} 4187 4188// Header returns an http.Header that can be modified by the caller to 4189// add HTTP headers to the request. 4190func (c *AppsGetCall) Header() http.Header { 4191 if c.header_ == nil { 4192 c.header_ = make(http.Header) 4193 } 4194 return c.header_ 4195} 4196 4197func (c *AppsGetCall) doRequest(alt string) (*http.Response, error) { 4198 reqHeaders := make(http.Header) 4199 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4200 for k, v := range c.header_ { 4201 reqHeaders[k] = v 4202 } 4203 reqHeaders.Set("User-Agent", c.s.userAgent()) 4204 if c.ifNoneMatch_ != "" { 4205 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4206 } 4207 var body io.Reader = nil 4208 c.urlParams_.Set("alt", alt) 4209 c.urlParams_.Set("prettyPrint", "false") 4210 urls := googleapi.ResolveRelative(c.s.BasePath, "apps/{appId}") 4211 urls += "?" + c.urlParams_.Encode() 4212 req, err := http.NewRequest("GET", urls, body) 4213 if err != nil { 4214 return nil, err 4215 } 4216 req.Header = reqHeaders 4217 googleapi.Expand(req.URL, map[string]string{ 4218 "appId": c.appId, 4219 }) 4220 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4221} 4222 4223// Do executes the "drive.apps.get" call. 4224// Exactly one of *App or error will be non-nil. Any non-2xx status code 4225// is an error. Response headers are in either 4226// *App.ServerResponse.Header or (if a response was returned at all) in 4227// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 4228// whether the returned error was because http.StatusNotModified was 4229// returned. 4230func (c *AppsGetCall) Do(opts ...googleapi.CallOption) (*App, error) { 4231 gensupport.SetOptions(c.urlParams_, opts...) 4232 res, err := c.doRequest("json") 4233 if res != nil && res.StatusCode == http.StatusNotModified { 4234 if res.Body != nil { 4235 res.Body.Close() 4236 } 4237 return nil, &googleapi.Error{ 4238 Code: res.StatusCode, 4239 Header: res.Header, 4240 } 4241 } 4242 if err != nil { 4243 return nil, err 4244 } 4245 defer googleapi.CloseBody(res) 4246 if err := googleapi.CheckResponse(res); err != nil { 4247 return nil, err 4248 } 4249 ret := &App{ 4250 ServerResponse: googleapi.ServerResponse{ 4251 Header: res.Header, 4252 HTTPStatusCode: res.StatusCode, 4253 }, 4254 } 4255 target := &ret 4256 if err := gensupport.DecodeResponse(target, res); err != nil { 4257 return nil, err 4258 } 4259 return ret, nil 4260 // { 4261 // "description": "Gets a specific app.", 4262 // "httpMethod": "GET", 4263 // "id": "drive.apps.get", 4264 // "parameterOrder": [ 4265 // "appId" 4266 // ], 4267 // "parameters": { 4268 // "appId": { 4269 // "description": "The ID of the app.", 4270 // "location": "path", 4271 // "required": true, 4272 // "type": "string" 4273 // } 4274 // }, 4275 // "path": "apps/{appId}", 4276 // "response": { 4277 // "$ref": "App" 4278 // }, 4279 // "scopes": [ 4280 // "https://www.googleapis.com/auth/drive", 4281 // "https://www.googleapis.com/auth/drive.appdata", 4282 // "https://www.googleapis.com/auth/drive.apps.readonly", 4283 // "https://www.googleapis.com/auth/drive.file", 4284 // "https://www.googleapis.com/auth/drive.metadata", 4285 // "https://www.googleapis.com/auth/drive.metadata.readonly", 4286 // "https://www.googleapis.com/auth/drive.readonly" 4287 // ] 4288 // } 4289 4290} 4291 4292// method id "drive.apps.list": 4293 4294type AppsListCall struct { 4295 s *Service 4296 urlParams_ gensupport.URLParams 4297 ifNoneMatch_ string 4298 ctx_ context.Context 4299 header_ http.Header 4300} 4301 4302// List: Lists a user's installed apps. 4303func (r *AppsService) List() *AppsListCall { 4304 c := &AppsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4305 return c 4306} 4307 4308// AppFilterExtensions sets the optional parameter 4309// "appFilterExtensions": A comma-separated list of file extensions for 4310// open with filtering. All apps within the given app query scope which 4311// can open any of the given file extensions will be included in the 4312// response. If appFilterMimeTypes are provided as well, the result is a 4313// union of the two resulting app lists. 4314func (c *AppsListCall) AppFilterExtensions(appFilterExtensions string) *AppsListCall { 4315 c.urlParams_.Set("appFilterExtensions", appFilterExtensions) 4316 return c 4317} 4318 4319// AppFilterMimeTypes sets the optional parameter "appFilterMimeTypes": 4320// A comma-separated list of MIME types for open with filtering. All 4321// apps within the given app query scope which can open any of the given 4322// MIME types will be included in the response. If appFilterExtensions 4323// are provided as well, the result is a union of the two resulting app 4324// lists. 4325func (c *AppsListCall) AppFilterMimeTypes(appFilterMimeTypes string) *AppsListCall { 4326 c.urlParams_.Set("appFilterMimeTypes", appFilterMimeTypes) 4327 return c 4328} 4329 4330// LanguageCode sets the optional parameter "languageCode": A language 4331// or locale code, as defined by BCP 47, with some extensions from 4332// Unicode's LDML format (http://www.unicode.org/reports/tr35/). 4333func (c *AppsListCall) LanguageCode(languageCode string) *AppsListCall { 4334 c.urlParams_.Set("languageCode", languageCode) 4335 return c 4336} 4337 4338// Fields allows partial responses to be retrieved. See 4339// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4340// for more information. 4341func (c *AppsListCall) Fields(s ...googleapi.Field) *AppsListCall { 4342 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4343 return c 4344} 4345 4346// IfNoneMatch sets the optional parameter which makes the operation 4347// fail if the object's ETag matches the given value. This is useful for 4348// getting updates only after the object has changed since the last 4349// request. Use googleapi.IsNotModified to check whether the response 4350// error from Do is the result of In-None-Match. 4351func (c *AppsListCall) IfNoneMatch(entityTag string) *AppsListCall { 4352 c.ifNoneMatch_ = entityTag 4353 return c 4354} 4355 4356// Context sets the context to be used in this call's Do method. Any 4357// pending HTTP request will be aborted if the provided context is 4358// canceled. 4359func (c *AppsListCall) Context(ctx context.Context) *AppsListCall { 4360 c.ctx_ = ctx 4361 return c 4362} 4363 4364// Header returns an http.Header that can be modified by the caller to 4365// add HTTP headers to the request. 4366func (c *AppsListCall) Header() http.Header { 4367 if c.header_ == nil { 4368 c.header_ = make(http.Header) 4369 } 4370 return c.header_ 4371} 4372 4373func (c *AppsListCall) doRequest(alt string) (*http.Response, error) { 4374 reqHeaders := make(http.Header) 4375 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4376 for k, v := range c.header_ { 4377 reqHeaders[k] = v 4378 } 4379 reqHeaders.Set("User-Agent", c.s.userAgent()) 4380 if c.ifNoneMatch_ != "" { 4381 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4382 } 4383 var body io.Reader = nil 4384 c.urlParams_.Set("alt", alt) 4385 c.urlParams_.Set("prettyPrint", "false") 4386 urls := googleapi.ResolveRelative(c.s.BasePath, "apps") 4387 urls += "?" + c.urlParams_.Encode() 4388 req, err := http.NewRequest("GET", urls, body) 4389 if err != nil { 4390 return nil, err 4391 } 4392 req.Header = reqHeaders 4393 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4394} 4395 4396// Do executes the "drive.apps.list" call. 4397// Exactly one of *AppList or error will be non-nil. Any non-2xx status 4398// code is an error. Response headers are in either 4399// *AppList.ServerResponse.Header or (if a response was returned at all) 4400// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4401// check whether the returned error was because http.StatusNotModified 4402// was returned. 4403func (c *AppsListCall) Do(opts ...googleapi.CallOption) (*AppList, error) { 4404 gensupport.SetOptions(c.urlParams_, opts...) 4405 res, err := c.doRequest("json") 4406 if res != nil && res.StatusCode == http.StatusNotModified { 4407 if res.Body != nil { 4408 res.Body.Close() 4409 } 4410 return nil, &googleapi.Error{ 4411 Code: res.StatusCode, 4412 Header: res.Header, 4413 } 4414 } 4415 if err != nil { 4416 return nil, err 4417 } 4418 defer googleapi.CloseBody(res) 4419 if err := googleapi.CheckResponse(res); err != nil { 4420 return nil, err 4421 } 4422 ret := &AppList{ 4423 ServerResponse: googleapi.ServerResponse{ 4424 Header: res.Header, 4425 HTTPStatusCode: res.StatusCode, 4426 }, 4427 } 4428 target := &ret 4429 if err := gensupport.DecodeResponse(target, res); err != nil { 4430 return nil, err 4431 } 4432 return ret, nil 4433 // { 4434 // "description": "Lists a user's installed apps.", 4435 // "httpMethod": "GET", 4436 // "id": "drive.apps.list", 4437 // "parameters": { 4438 // "appFilterExtensions": { 4439 // "default": "", 4440 // "description": "A comma-separated list of file extensions for open with filtering. All apps within the given app query scope which can open any of the given file extensions will be included in the response. If appFilterMimeTypes are provided as well, the result is a union of the two resulting app lists.", 4441 // "location": "query", 4442 // "type": "string" 4443 // }, 4444 // "appFilterMimeTypes": { 4445 // "default": "", 4446 // "description": "A comma-separated list of MIME types for open with filtering. All apps within the given app query scope which can open any of the given MIME types will be included in the response. If appFilterExtensions are provided as well, the result is a union of the two resulting app lists.", 4447 // "location": "query", 4448 // "type": "string" 4449 // }, 4450 // "languageCode": { 4451 // "description": "A language or locale code, as defined by BCP 47, with some extensions from Unicode's LDML format (http://www.unicode.org/reports/tr35/).", 4452 // "location": "query", 4453 // "type": "string" 4454 // } 4455 // }, 4456 // "path": "apps", 4457 // "response": { 4458 // "$ref": "AppList" 4459 // }, 4460 // "scopes": [ 4461 // "https://www.googleapis.com/auth/drive.apps.readonly" 4462 // ] 4463 // } 4464 4465} 4466 4467// method id "drive.changes.get": 4468 4469type ChangesGetCall struct { 4470 s *Service 4471 changeId string 4472 urlParams_ gensupport.URLParams 4473 ifNoneMatch_ string 4474 ctx_ context.Context 4475 header_ http.Header 4476} 4477 4478// Get: Deprecated - Use changes.getStartPageToken and changes.list to 4479// retrieve recent changes. 4480// 4481// - changeId: The ID of the change. 4482func (r *ChangesService) Get(changeId string) *ChangesGetCall { 4483 c := &ChangesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4484 c.changeId = changeId 4485 return c 4486} 4487 4488// DriveId sets the optional parameter "driveId": The shared drive from 4489// which the change is returned. 4490func (c *ChangesGetCall) DriveId(driveId string) *ChangesGetCall { 4491 c.urlParams_.Set("driveId", driveId) 4492 return c 4493} 4494 4495// SupportsAllDrives sets the optional parameter "supportsAllDrives": 4496// Whether the requesting application supports both My Drives and shared 4497// drives. 4498func (c *ChangesGetCall) SupportsAllDrives(supportsAllDrives bool) *ChangesGetCall { 4499 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 4500 return c 4501} 4502 4503// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 4504// Deprecated use supportsAllDrives instead. 4505func (c *ChangesGetCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesGetCall { 4506 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 4507 return c 4508} 4509 4510// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 4511// driveId instead. 4512func (c *ChangesGetCall) TeamDriveId(teamDriveId string) *ChangesGetCall { 4513 c.urlParams_.Set("teamDriveId", teamDriveId) 4514 return c 4515} 4516 4517// Fields allows partial responses to be retrieved. See 4518// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4519// for more information. 4520func (c *ChangesGetCall) Fields(s ...googleapi.Field) *ChangesGetCall { 4521 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4522 return c 4523} 4524 4525// IfNoneMatch sets the optional parameter which makes the operation 4526// fail if the object's ETag matches the given value. This is useful for 4527// getting updates only after the object has changed since the last 4528// request. Use googleapi.IsNotModified to check whether the response 4529// error from Do is the result of In-None-Match. 4530func (c *ChangesGetCall) IfNoneMatch(entityTag string) *ChangesGetCall { 4531 c.ifNoneMatch_ = entityTag 4532 return c 4533} 4534 4535// Context sets the context to be used in this call's Do method. Any 4536// pending HTTP request will be aborted if the provided context is 4537// canceled. 4538func (c *ChangesGetCall) Context(ctx context.Context) *ChangesGetCall { 4539 c.ctx_ = ctx 4540 return c 4541} 4542 4543// Header returns an http.Header that can be modified by the caller to 4544// add HTTP headers to the request. 4545func (c *ChangesGetCall) Header() http.Header { 4546 if c.header_ == nil { 4547 c.header_ = make(http.Header) 4548 } 4549 return c.header_ 4550} 4551 4552func (c *ChangesGetCall) doRequest(alt string) (*http.Response, error) { 4553 reqHeaders := make(http.Header) 4554 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4555 for k, v := range c.header_ { 4556 reqHeaders[k] = v 4557 } 4558 reqHeaders.Set("User-Agent", c.s.userAgent()) 4559 if c.ifNoneMatch_ != "" { 4560 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4561 } 4562 var body io.Reader = nil 4563 c.urlParams_.Set("alt", alt) 4564 c.urlParams_.Set("prettyPrint", "false") 4565 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/{changeId}") 4566 urls += "?" + c.urlParams_.Encode() 4567 req, err := http.NewRequest("GET", urls, body) 4568 if err != nil { 4569 return nil, err 4570 } 4571 req.Header = reqHeaders 4572 googleapi.Expand(req.URL, map[string]string{ 4573 "changeId": c.changeId, 4574 }) 4575 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4576} 4577 4578// Do executes the "drive.changes.get" call. 4579// Exactly one of *Change or error will be non-nil. Any non-2xx status 4580// code is an error. Response headers are in either 4581// *Change.ServerResponse.Header or (if a response was returned at all) 4582// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4583// check whether the returned error was because http.StatusNotModified 4584// was returned. 4585func (c *ChangesGetCall) Do(opts ...googleapi.CallOption) (*Change, error) { 4586 gensupport.SetOptions(c.urlParams_, opts...) 4587 res, err := c.doRequest("json") 4588 if res != nil && res.StatusCode == http.StatusNotModified { 4589 if res.Body != nil { 4590 res.Body.Close() 4591 } 4592 return nil, &googleapi.Error{ 4593 Code: res.StatusCode, 4594 Header: res.Header, 4595 } 4596 } 4597 if err != nil { 4598 return nil, err 4599 } 4600 defer googleapi.CloseBody(res) 4601 if err := googleapi.CheckResponse(res); err != nil { 4602 return nil, err 4603 } 4604 ret := &Change{ 4605 ServerResponse: googleapi.ServerResponse{ 4606 Header: res.Header, 4607 HTTPStatusCode: res.StatusCode, 4608 }, 4609 } 4610 target := &ret 4611 if err := gensupport.DecodeResponse(target, res); err != nil { 4612 return nil, err 4613 } 4614 return ret, nil 4615 // { 4616 // "description": "Deprecated - Use changes.getStartPageToken and changes.list to retrieve recent changes.", 4617 // "httpMethod": "GET", 4618 // "id": "drive.changes.get", 4619 // "parameterOrder": [ 4620 // "changeId" 4621 // ], 4622 // "parameters": { 4623 // "changeId": { 4624 // "description": "The ID of the change.", 4625 // "location": "path", 4626 // "required": true, 4627 // "type": "string" 4628 // }, 4629 // "driveId": { 4630 // "description": "The shared drive from which the change is returned.", 4631 // "location": "query", 4632 // "type": "string" 4633 // }, 4634 // "supportsAllDrives": { 4635 // "default": "false", 4636 // "description": "Whether the requesting application supports both My Drives and shared drives.", 4637 // "location": "query", 4638 // "type": "boolean" 4639 // }, 4640 // "supportsTeamDrives": { 4641 // "default": "false", 4642 // "description": "Deprecated use supportsAllDrives instead.", 4643 // "location": "query", 4644 // "type": "boolean" 4645 // }, 4646 // "teamDriveId": { 4647 // "description": "Deprecated use driveId instead.", 4648 // "location": "query", 4649 // "type": "string" 4650 // } 4651 // }, 4652 // "path": "changes/{changeId}", 4653 // "response": { 4654 // "$ref": "Change" 4655 // }, 4656 // "scopes": [ 4657 // "https://www.googleapis.com/auth/drive", 4658 // "https://www.googleapis.com/auth/drive.appdata", 4659 // "https://www.googleapis.com/auth/drive.apps.readonly", 4660 // "https://www.googleapis.com/auth/drive.file", 4661 // "https://www.googleapis.com/auth/drive.metadata", 4662 // "https://www.googleapis.com/auth/drive.metadata.readonly", 4663 // "https://www.googleapis.com/auth/drive.photos.readonly", 4664 // "https://www.googleapis.com/auth/drive.readonly" 4665 // ] 4666 // } 4667 4668} 4669 4670// method id "drive.changes.getStartPageToken": 4671 4672type ChangesGetStartPageTokenCall struct { 4673 s *Service 4674 urlParams_ gensupport.URLParams 4675 ifNoneMatch_ string 4676 ctx_ context.Context 4677 header_ http.Header 4678} 4679 4680// GetStartPageToken: Gets the starting pageToken for listing future 4681// changes. 4682func (r *ChangesService) GetStartPageToken() *ChangesGetStartPageTokenCall { 4683 c := &ChangesGetStartPageTokenCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4684 return c 4685} 4686 4687// DriveId sets the optional parameter "driveId": The ID of the shared 4688// drive for which the starting pageToken for listing future changes 4689// from that shared drive is returned. 4690func (c *ChangesGetStartPageTokenCall) DriveId(driveId string) *ChangesGetStartPageTokenCall { 4691 c.urlParams_.Set("driveId", driveId) 4692 return c 4693} 4694 4695// SupportsAllDrives sets the optional parameter "supportsAllDrives": 4696// Whether the requesting application supports both My Drives and shared 4697// drives. 4698func (c *ChangesGetStartPageTokenCall) SupportsAllDrives(supportsAllDrives bool) *ChangesGetStartPageTokenCall { 4699 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 4700 return c 4701} 4702 4703// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 4704// Deprecated use supportsAllDrives instead. 4705func (c *ChangesGetStartPageTokenCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesGetStartPageTokenCall { 4706 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 4707 return c 4708} 4709 4710// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 4711// driveId instead. 4712func (c *ChangesGetStartPageTokenCall) TeamDriveId(teamDriveId string) *ChangesGetStartPageTokenCall { 4713 c.urlParams_.Set("teamDriveId", teamDriveId) 4714 return c 4715} 4716 4717// Fields allows partial responses to be retrieved. See 4718// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4719// for more information. 4720func (c *ChangesGetStartPageTokenCall) Fields(s ...googleapi.Field) *ChangesGetStartPageTokenCall { 4721 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4722 return c 4723} 4724 4725// IfNoneMatch sets the optional parameter which makes the operation 4726// fail if the object's ETag matches the given value. This is useful for 4727// getting updates only after the object has changed since the last 4728// request. Use googleapi.IsNotModified to check whether the response 4729// error from Do is the result of In-None-Match. 4730func (c *ChangesGetStartPageTokenCall) IfNoneMatch(entityTag string) *ChangesGetStartPageTokenCall { 4731 c.ifNoneMatch_ = entityTag 4732 return c 4733} 4734 4735// Context sets the context to be used in this call's Do method. Any 4736// pending HTTP request will be aborted if the provided context is 4737// canceled. 4738func (c *ChangesGetStartPageTokenCall) Context(ctx context.Context) *ChangesGetStartPageTokenCall { 4739 c.ctx_ = ctx 4740 return c 4741} 4742 4743// Header returns an http.Header that can be modified by the caller to 4744// add HTTP headers to the request. 4745func (c *ChangesGetStartPageTokenCall) Header() http.Header { 4746 if c.header_ == nil { 4747 c.header_ = make(http.Header) 4748 } 4749 return c.header_ 4750} 4751 4752func (c *ChangesGetStartPageTokenCall) doRequest(alt string) (*http.Response, error) { 4753 reqHeaders := make(http.Header) 4754 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 4755 for k, v := range c.header_ { 4756 reqHeaders[k] = v 4757 } 4758 reqHeaders.Set("User-Agent", c.s.userAgent()) 4759 if c.ifNoneMatch_ != "" { 4760 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4761 } 4762 var body io.Reader = nil 4763 c.urlParams_.Set("alt", alt) 4764 c.urlParams_.Set("prettyPrint", "false") 4765 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/startPageToken") 4766 urls += "?" + c.urlParams_.Encode() 4767 req, err := http.NewRequest("GET", urls, body) 4768 if err != nil { 4769 return nil, err 4770 } 4771 req.Header = reqHeaders 4772 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4773} 4774 4775// Do executes the "drive.changes.getStartPageToken" call. 4776// Exactly one of *StartPageToken or error will be non-nil. Any non-2xx 4777// status code is an error. Response headers are in either 4778// *StartPageToken.ServerResponse.Header or (if a response was returned 4779// at all) in error.(*googleapi.Error).Header. Use 4780// googleapi.IsNotModified to check whether the returned error was 4781// because http.StatusNotModified was returned. 4782func (c *ChangesGetStartPageTokenCall) Do(opts ...googleapi.CallOption) (*StartPageToken, error) { 4783 gensupport.SetOptions(c.urlParams_, opts...) 4784 res, err := c.doRequest("json") 4785 if res != nil && res.StatusCode == http.StatusNotModified { 4786 if res.Body != nil { 4787 res.Body.Close() 4788 } 4789 return nil, &googleapi.Error{ 4790 Code: res.StatusCode, 4791 Header: res.Header, 4792 } 4793 } 4794 if err != nil { 4795 return nil, err 4796 } 4797 defer googleapi.CloseBody(res) 4798 if err := googleapi.CheckResponse(res); err != nil { 4799 return nil, err 4800 } 4801 ret := &StartPageToken{ 4802 ServerResponse: googleapi.ServerResponse{ 4803 Header: res.Header, 4804 HTTPStatusCode: res.StatusCode, 4805 }, 4806 } 4807 target := &ret 4808 if err := gensupport.DecodeResponse(target, res); err != nil { 4809 return nil, err 4810 } 4811 return ret, nil 4812 // { 4813 // "description": "Gets the starting pageToken for listing future changes.", 4814 // "httpMethod": "GET", 4815 // "id": "drive.changes.getStartPageToken", 4816 // "parameters": { 4817 // "driveId": { 4818 // "description": "The ID of the shared drive for which the starting pageToken for listing future changes from that shared drive is returned.", 4819 // "location": "query", 4820 // "type": "string" 4821 // }, 4822 // "supportsAllDrives": { 4823 // "default": "false", 4824 // "description": "Whether the requesting application supports both My Drives and shared drives.", 4825 // "location": "query", 4826 // "type": "boolean" 4827 // }, 4828 // "supportsTeamDrives": { 4829 // "default": "false", 4830 // "description": "Deprecated use supportsAllDrives instead.", 4831 // "location": "query", 4832 // "type": "boolean" 4833 // }, 4834 // "teamDriveId": { 4835 // "description": "Deprecated use driveId instead.", 4836 // "location": "query", 4837 // "type": "string" 4838 // } 4839 // }, 4840 // "path": "changes/startPageToken", 4841 // "response": { 4842 // "$ref": "StartPageToken" 4843 // }, 4844 // "scopes": [ 4845 // "https://www.googleapis.com/auth/drive", 4846 // "https://www.googleapis.com/auth/drive.appdata", 4847 // "https://www.googleapis.com/auth/drive.apps.readonly", 4848 // "https://www.googleapis.com/auth/drive.file", 4849 // "https://www.googleapis.com/auth/drive.metadata", 4850 // "https://www.googleapis.com/auth/drive.metadata.readonly", 4851 // "https://www.googleapis.com/auth/drive.photos.readonly", 4852 // "https://www.googleapis.com/auth/drive.readonly" 4853 // ] 4854 // } 4855 4856} 4857 4858// method id "drive.changes.list": 4859 4860type ChangesListCall struct { 4861 s *Service 4862 urlParams_ gensupport.URLParams 4863 ifNoneMatch_ string 4864 ctx_ context.Context 4865 header_ http.Header 4866} 4867 4868// List: Lists the changes for a user or shared drive. 4869func (r *ChangesService) List() *ChangesListCall { 4870 c := &ChangesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4871 return c 4872} 4873 4874// DriveId sets the optional parameter "driveId": The shared drive from 4875// which changes are returned. If specified the change IDs will be 4876// reflective of the shared drive; use the combined drive ID and change 4877// ID as an identifier. 4878func (c *ChangesListCall) DriveId(driveId string) *ChangesListCall { 4879 c.urlParams_.Set("driveId", driveId) 4880 return c 4881} 4882 4883// IncludeCorpusRemovals sets the optional parameter 4884// "includeCorpusRemovals": Whether changes should include the file 4885// resource if the file is still accessible by the user at the time of 4886// the request, even when a file was removed from the list of changes 4887// and there will be no further change entries for this file. 4888func (c *ChangesListCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesListCall { 4889 c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals)) 4890 return c 4891} 4892 4893// IncludeDeleted sets the optional parameter "includeDeleted": Whether 4894// to include changes indicating that items have been removed from the 4895// list of changes, for example by deletion or loss of access. 4896func (c *ChangesListCall) IncludeDeleted(includeDeleted bool) *ChangesListCall { 4897 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 4898 return c 4899} 4900 4901// IncludeItemsFromAllDrives sets the optional parameter 4902// "includeItemsFromAllDrives": Whether both My Drive and shared drive 4903// items should be included in results. 4904func (c *ChangesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesListCall { 4905 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives)) 4906 return c 4907} 4908 4909// IncludePermissionsForView sets the optional parameter 4910// "includePermissionsForView": Specifies which additional view's 4911// permissions to include in the response. Only 'published' is 4912// supported. 4913func (c *ChangesListCall) IncludePermissionsForView(includePermissionsForView string) *ChangesListCall { 4914 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 4915 return c 4916} 4917 4918// IncludeSubscribed sets the optional parameter "includeSubscribed": 4919// Whether to include changes outside the My Drive hierarchy in the 4920// result. When set to false, changes to files such as those in the 4921// Application Data folder or shared files which have not been added to 4922// My Drive are omitted from the result. 4923func (c *ChangesListCall) IncludeSubscribed(includeSubscribed bool) *ChangesListCall { 4924 c.urlParams_.Set("includeSubscribed", fmt.Sprint(includeSubscribed)) 4925 return c 4926} 4927 4928// IncludeTeamDriveItems sets the optional parameter 4929// "includeTeamDriveItems": Deprecated use includeItemsFromAllDrives 4930// instead. 4931func (c *ChangesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesListCall { 4932 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems)) 4933 return c 4934} 4935 4936// MaxResults sets the optional parameter "maxResults": Maximum number 4937// of changes to return. 4938func (c *ChangesListCall) MaxResults(maxResults int64) *ChangesListCall { 4939 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 4940 return c 4941} 4942 4943// PageToken sets the optional parameter "pageToken": The token for 4944// continuing a previous list request on the next page. This should be 4945// set to the value of 'nextPageToken' from the previous response or to 4946// the response from the getStartPageToken method. 4947func (c *ChangesListCall) PageToken(pageToken string) *ChangesListCall { 4948 c.urlParams_.Set("pageToken", pageToken) 4949 return c 4950} 4951 4952// Spaces sets the optional parameter "spaces": A comma-separated list 4953// of spaces to query. Supported values are 'drive', 'appDataFolder' and 4954// 'photos'. 4955func (c *ChangesListCall) Spaces(spaces string) *ChangesListCall { 4956 c.urlParams_.Set("spaces", spaces) 4957 return c 4958} 4959 4960// StartChangeId sets the optional parameter "startChangeId": Deprecated 4961// - use pageToken instead. 4962func (c *ChangesListCall) StartChangeId(startChangeId int64) *ChangesListCall { 4963 c.urlParams_.Set("startChangeId", fmt.Sprint(startChangeId)) 4964 return c 4965} 4966 4967// SupportsAllDrives sets the optional parameter "supportsAllDrives": 4968// Whether the requesting application supports both My Drives and shared 4969// drives. 4970func (c *ChangesListCall) SupportsAllDrives(supportsAllDrives bool) *ChangesListCall { 4971 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 4972 return c 4973} 4974 4975// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 4976// Deprecated use supportsAllDrives instead. 4977func (c *ChangesListCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesListCall { 4978 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 4979 return c 4980} 4981 4982// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 4983// driveId instead. 4984func (c *ChangesListCall) TeamDriveId(teamDriveId string) *ChangesListCall { 4985 c.urlParams_.Set("teamDriveId", teamDriveId) 4986 return c 4987} 4988 4989// Fields allows partial responses to be retrieved. See 4990// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4991// for more information. 4992func (c *ChangesListCall) Fields(s ...googleapi.Field) *ChangesListCall { 4993 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4994 return c 4995} 4996 4997// IfNoneMatch sets the optional parameter which makes the operation 4998// fail if the object's ETag matches the given value. This is useful for 4999// getting updates only after the object has changed since the last 5000// request. Use googleapi.IsNotModified to check whether the response 5001// error from Do is the result of In-None-Match. 5002func (c *ChangesListCall) IfNoneMatch(entityTag string) *ChangesListCall { 5003 c.ifNoneMatch_ = entityTag 5004 return c 5005} 5006 5007// Context sets the context to be used in this call's Do method. Any 5008// pending HTTP request will be aborted if the provided context is 5009// canceled. 5010func (c *ChangesListCall) Context(ctx context.Context) *ChangesListCall { 5011 c.ctx_ = ctx 5012 return c 5013} 5014 5015// Header returns an http.Header that can be modified by the caller to 5016// add HTTP headers to the request. 5017func (c *ChangesListCall) Header() http.Header { 5018 if c.header_ == nil { 5019 c.header_ = make(http.Header) 5020 } 5021 return c.header_ 5022} 5023 5024func (c *ChangesListCall) doRequest(alt string) (*http.Response, error) { 5025 reqHeaders := make(http.Header) 5026 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5027 for k, v := range c.header_ { 5028 reqHeaders[k] = v 5029 } 5030 reqHeaders.Set("User-Agent", c.s.userAgent()) 5031 if c.ifNoneMatch_ != "" { 5032 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5033 } 5034 var body io.Reader = nil 5035 c.urlParams_.Set("alt", alt) 5036 c.urlParams_.Set("prettyPrint", "false") 5037 urls := googleapi.ResolveRelative(c.s.BasePath, "changes") 5038 urls += "?" + c.urlParams_.Encode() 5039 req, err := http.NewRequest("GET", urls, body) 5040 if err != nil { 5041 return nil, err 5042 } 5043 req.Header = reqHeaders 5044 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5045} 5046 5047// Do executes the "drive.changes.list" call. 5048// Exactly one of *ChangeList or error will be non-nil. Any non-2xx 5049// status code is an error. Response headers are in either 5050// *ChangeList.ServerResponse.Header or (if a response was returned at 5051// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5052// to check whether the returned error was because 5053// http.StatusNotModified was returned. 5054func (c *ChangesListCall) Do(opts ...googleapi.CallOption) (*ChangeList, error) { 5055 gensupport.SetOptions(c.urlParams_, opts...) 5056 res, err := c.doRequest("json") 5057 if res != nil && res.StatusCode == http.StatusNotModified { 5058 if res.Body != nil { 5059 res.Body.Close() 5060 } 5061 return nil, &googleapi.Error{ 5062 Code: res.StatusCode, 5063 Header: res.Header, 5064 } 5065 } 5066 if err != nil { 5067 return nil, err 5068 } 5069 defer googleapi.CloseBody(res) 5070 if err := googleapi.CheckResponse(res); err != nil { 5071 return nil, err 5072 } 5073 ret := &ChangeList{ 5074 ServerResponse: googleapi.ServerResponse{ 5075 Header: res.Header, 5076 HTTPStatusCode: res.StatusCode, 5077 }, 5078 } 5079 target := &ret 5080 if err := gensupport.DecodeResponse(target, res); err != nil { 5081 return nil, err 5082 } 5083 return ret, nil 5084 // { 5085 // "description": "Lists the changes for a user or shared drive.", 5086 // "httpMethod": "GET", 5087 // "id": "drive.changes.list", 5088 // "parameters": { 5089 // "driveId": { 5090 // "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.", 5091 // "location": "query", 5092 // "type": "string" 5093 // }, 5094 // "includeCorpusRemovals": { 5095 // "default": "false", 5096 // "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.", 5097 // "location": "query", 5098 // "type": "boolean" 5099 // }, 5100 // "includeDeleted": { 5101 // "default": "true", 5102 // "description": "Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.", 5103 // "location": "query", 5104 // "type": "boolean" 5105 // }, 5106 // "includeItemsFromAllDrives": { 5107 // "default": "false", 5108 // "description": "Whether both My Drive and shared drive items should be included in results.", 5109 // "location": "query", 5110 // "type": "boolean" 5111 // }, 5112 // "includePermissionsForView": { 5113 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 5114 // "location": "query", 5115 // "type": "string" 5116 // }, 5117 // "includeSubscribed": { 5118 // "default": "true", 5119 // "description": "Whether to include changes outside the My Drive hierarchy in the result. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive are omitted from the result.", 5120 // "location": "query", 5121 // "type": "boolean" 5122 // }, 5123 // "includeTeamDriveItems": { 5124 // "default": "false", 5125 // "description": "Deprecated use includeItemsFromAllDrives instead.", 5126 // "location": "query", 5127 // "type": "boolean" 5128 // }, 5129 // "maxResults": { 5130 // "default": "100", 5131 // "description": "Maximum number of changes to return.", 5132 // "format": "int32", 5133 // "location": "query", 5134 // "minimum": "1", 5135 // "type": "integer" 5136 // }, 5137 // "pageToken": { 5138 // "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.", 5139 // "location": "query", 5140 // "type": "string" 5141 // }, 5142 // "spaces": { 5143 // "description": "A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.", 5144 // "location": "query", 5145 // "type": "string" 5146 // }, 5147 // "startChangeId": { 5148 // "description": "Deprecated - use pageToken instead.", 5149 // "format": "int64", 5150 // "location": "query", 5151 // "type": "string" 5152 // }, 5153 // "supportsAllDrives": { 5154 // "default": "false", 5155 // "description": "Whether the requesting application supports both My Drives and shared drives.", 5156 // "location": "query", 5157 // "type": "boolean" 5158 // }, 5159 // "supportsTeamDrives": { 5160 // "default": "false", 5161 // "description": "Deprecated use supportsAllDrives instead.", 5162 // "location": "query", 5163 // "type": "boolean" 5164 // }, 5165 // "teamDriveId": { 5166 // "description": "Deprecated use driveId instead.", 5167 // "location": "query", 5168 // "type": "string" 5169 // } 5170 // }, 5171 // "path": "changes", 5172 // "response": { 5173 // "$ref": "ChangeList" 5174 // }, 5175 // "scopes": [ 5176 // "https://www.googleapis.com/auth/drive", 5177 // "https://www.googleapis.com/auth/drive.appdata", 5178 // "https://www.googleapis.com/auth/drive.apps.readonly", 5179 // "https://www.googleapis.com/auth/drive.file", 5180 // "https://www.googleapis.com/auth/drive.metadata", 5181 // "https://www.googleapis.com/auth/drive.metadata.readonly", 5182 // "https://www.googleapis.com/auth/drive.photos.readonly", 5183 // "https://www.googleapis.com/auth/drive.readonly" 5184 // ], 5185 // "supportsSubscription": true 5186 // } 5187 5188} 5189 5190// Pages invokes f for each page of results. 5191// A non-nil error returned from f will halt the iteration. 5192// The provided context supersedes any context provided to the Context method. 5193func (c *ChangesListCall) Pages(ctx context.Context, f func(*ChangeList) error) error { 5194 c.ctx_ = ctx 5195 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5196 for { 5197 x, err := c.Do() 5198 if err != nil { 5199 return err 5200 } 5201 if err := f(x); err != nil { 5202 return err 5203 } 5204 if x.NextPageToken == "" { 5205 return nil 5206 } 5207 c.PageToken(x.NextPageToken) 5208 } 5209} 5210 5211// method id "drive.changes.watch": 5212 5213type ChangesWatchCall struct { 5214 s *Service 5215 channel *Channel 5216 urlParams_ gensupport.URLParams 5217 ctx_ context.Context 5218 header_ http.Header 5219} 5220 5221// Watch: Subscribe to changes for a user. 5222func (r *ChangesService) Watch(channel *Channel) *ChangesWatchCall { 5223 c := &ChangesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5224 c.channel = channel 5225 return c 5226} 5227 5228// DriveId sets the optional parameter "driveId": The shared drive from 5229// which changes are returned. If specified the change IDs will be 5230// reflective of the shared drive; use the combined drive ID and change 5231// ID as an identifier. 5232func (c *ChangesWatchCall) DriveId(driveId string) *ChangesWatchCall { 5233 c.urlParams_.Set("driveId", driveId) 5234 return c 5235} 5236 5237// IncludeCorpusRemovals sets the optional parameter 5238// "includeCorpusRemovals": Whether changes should include the file 5239// resource if the file is still accessible by the user at the time of 5240// the request, even when a file was removed from the list of changes 5241// and there will be no further change entries for this file. 5242func (c *ChangesWatchCall) IncludeCorpusRemovals(includeCorpusRemovals bool) *ChangesWatchCall { 5243 c.urlParams_.Set("includeCorpusRemovals", fmt.Sprint(includeCorpusRemovals)) 5244 return c 5245} 5246 5247// IncludeDeleted sets the optional parameter "includeDeleted": Whether 5248// to include changes indicating that items have been removed from the 5249// list of changes, for example by deletion or loss of access. 5250func (c *ChangesWatchCall) IncludeDeleted(includeDeleted bool) *ChangesWatchCall { 5251 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 5252 return c 5253} 5254 5255// IncludeItemsFromAllDrives sets the optional parameter 5256// "includeItemsFromAllDrives": Whether both My Drive and shared drive 5257// items should be included in results. 5258func (c *ChangesWatchCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *ChangesWatchCall { 5259 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives)) 5260 return c 5261} 5262 5263// IncludePermissionsForView sets the optional parameter 5264// "includePermissionsForView": Specifies which additional view's 5265// permissions to include in the response. Only 'published' is 5266// supported. 5267func (c *ChangesWatchCall) IncludePermissionsForView(includePermissionsForView string) *ChangesWatchCall { 5268 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 5269 return c 5270} 5271 5272// IncludeSubscribed sets the optional parameter "includeSubscribed": 5273// Whether to include changes outside the My Drive hierarchy in the 5274// result. When set to false, changes to files such as those in the 5275// Application Data folder or shared files which have not been added to 5276// My Drive are omitted from the result. 5277func (c *ChangesWatchCall) IncludeSubscribed(includeSubscribed bool) *ChangesWatchCall { 5278 c.urlParams_.Set("includeSubscribed", fmt.Sprint(includeSubscribed)) 5279 return c 5280} 5281 5282// IncludeTeamDriveItems sets the optional parameter 5283// "includeTeamDriveItems": Deprecated use includeItemsFromAllDrives 5284// instead. 5285func (c *ChangesWatchCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *ChangesWatchCall { 5286 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems)) 5287 return c 5288} 5289 5290// MaxResults sets the optional parameter "maxResults": Maximum number 5291// of changes to return. 5292func (c *ChangesWatchCall) MaxResults(maxResults int64) *ChangesWatchCall { 5293 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 5294 return c 5295} 5296 5297// PageToken sets the optional parameter "pageToken": The token for 5298// continuing a previous list request on the next page. This should be 5299// set to the value of 'nextPageToken' from the previous response or to 5300// the response from the getStartPageToken method. 5301func (c *ChangesWatchCall) PageToken(pageToken string) *ChangesWatchCall { 5302 c.urlParams_.Set("pageToken", pageToken) 5303 return c 5304} 5305 5306// Spaces sets the optional parameter "spaces": A comma-separated list 5307// of spaces to query. Supported values are 'drive', 'appDataFolder' and 5308// 'photos'. 5309func (c *ChangesWatchCall) Spaces(spaces string) *ChangesWatchCall { 5310 c.urlParams_.Set("spaces", spaces) 5311 return c 5312} 5313 5314// StartChangeId sets the optional parameter "startChangeId": Deprecated 5315// - use pageToken instead. 5316func (c *ChangesWatchCall) StartChangeId(startChangeId int64) *ChangesWatchCall { 5317 c.urlParams_.Set("startChangeId", fmt.Sprint(startChangeId)) 5318 return c 5319} 5320 5321// SupportsAllDrives sets the optional parameter "supportsAllDrives": 5322// Whether the requesting application supports both My Drives and shared 5323// drives. 5324func (c *ChangesWatchCall) SupportsAllDrives(supportsAllDrives bool) *ChangesWatchCall { 5325 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 5326 return c 5327} 5328 5329// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 5330// Deprecated use supportsAllDrives instead. 5331func (c *ChangesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *ChangesWatchCall { 5332 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 5333 return c 5334} 5335 5336// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 5337// driveId instead. 5338func (c *ChangesWatchCall) TeamDriveId(teamDriveId string) *ChangesWatchCall { 5339 c.urlParams_.Set("teamDriveId", teamDriveId) 5340 return c 5341} 5342 5343// Fields allows partial responses to be retrieved. See 5344// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5345// for more information. 5346func (c *ChangesWatchCall) Fields(s ...googleapi.Field) *ChangesWatchCall { 5347 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5348 return c 5349} 5350 5351// Context sets the context to be used in this call's Do method. Any 5352// pending HTTP request will be aborted if the provided context is 5353// canceled. 5354func (c *ChangesWatchCall) Context(ctx context.Context) *ChangesWatchCall { 5355 c.ctx_ = ctx 5356 return c 5357} 5358 5359// Header returns an http.Header that can be modified by the caller to 5360// add HTTP headers to the request. 5361func (c *ChangesWatchCall) Header() http.Header { 5362 if c.header_ == nil { 5363 c.header_ = make(http.Header) 5364 } 5365 return c.header_ 5366} 5367 5368func (c *ChangesWatchCall) doRequest(alt string) (*http.Response, error) { 5369 reqHeaders := make(http.Header) 5370 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5371 for k, v := range c.header_ { 5372 reqHeaders[k] = v 5373 } 5374 reqHeaders.Set("User-Agent", c.s.userAgent()) 5375 var body io.Reader = nil 5376 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 5377 if err != nil { 5378 return nil, err 5379 } 5380 reqHeaders.Set("Content-Type", "application/json") 5381 c.urlParams_.Set("alt", alt) 5382 c.urlParams_.Set("prettyPrint", "false") 5383 urls := googleapi.ResolveRelative(c.s.BasePath, "changes/watch") 5384 urls += "?" + c.urlParams_.Encode() 5385 req, err := http.NewRequest("POST", urls, body) 5386 if err != nil { 5387 return nil, err 5388 } 5389 req.Header = reqHeaders 5390 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5391} 5392 5393// Do executes the "drive.changes.watch" call. 5394// Exactly one of *Channel or error will be non-nil. Any non-2xx status 5395// code is an error. Response headers are in either 5396// *Channel.ServerResponse.Header or (if a response was returned at all) 5397// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5398// check whether the returned error was because http.StatusNotModified 5399// was returned. 5400func (c *ChangesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 5401 gensupport.SetOptions(c.urlParams_, opts...) 5402 res, err := c.doRequest("json") 5403 if res != nil && res.StatusCode == http.StatusNotModified { 5404 if res.Body != nil { 5405 res.Body.Close() 5406 } 5407 return nil, &googleapi.Error{ 5408 Code: res.StatusCode, 5409 Header: res.Header, 5410 } 5411 } 5412 if err != nil { 5413 return nil, err 5414 } 5415 defer googleapi.CloseBody(res) 5416 if err := googleapi.CheckResponse(res); err != nil { 5417 return nil, err 5418 } 5419 ret := &Channel{ 5420 ServerResponse: googleapi.ServerResponse{ 5421 Header: res.Header, 5422 HTTPStatusCode: res.StatusCode, 5423 }, 5424 } 5425 target := &ret 5426 if err := gensupport.DecodeResponse(target, res); err != nil { 5427 return nil, err 5428 } 5429 return ret, nil 5430 // { 5431 // "description": "Subscribe to changes for a user.", 5432 // "httpMethod": "POST", 5433 // "id": "drive.changes.watch", 5434 // "parameters": { 5435 // "driveId": { 5436 // "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.", 5437 // "location": "query", 5438 // "type": "string" 5439 // }, 5440 // "includeCorpusRemovals": { 5441 // "default": "false", 5442 // "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.", 5443 // "location": "query", 5444 // "type": "boolean" 5445 // }, 5446 // "includeDeleted": { 5447 // "default": "true", 5448 // "description": "Whether to include changes indicating that items have been removed from the list of changes, for example by deletion or loss of access.", 5449 // "location": "query", 5450 // "type": "boolean" 5451 // }, 5452 // "includeItemsFromAllDrives": { 5453 // "default": "false", 5454 // "description": "Whether both My Drive and shared drive items should be included in results.", 5455 // "location": "query", 5456 // "type": "boolean" 5457 // }, 5458 // "includePermissionsForView": { 5459 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 5460 // "location": "query", 5461 // "type": "string" 5462 // }, 5463 // "includeSubscribed": { 5464 // "default": "true", 5465 // "description": "Whether to include changes outside the My Drive hierarchy in the result. When set to false, changes to files such as those in the Application Data folder or shared files which have not been added to My Drive are omitted from the result.", 5466 // "location": "query", 5467 // "type": "boolean" 5468 // }, 5469 // "includeTeamDriveItems": { 5470 // "default": "false", 5471 // "description": "Deprecated use includeItemsFromAllDrives instead.", 5472 // "location": "query", 5473 // "type": "boolean" 5474 // }, 5475 // "maxResults": { 5476 // "default": "100", 5477 // "description": "Maximum number of changes to return.", 5478 // "format": "int32", 5479 // "location": "query", 5480 // "minimum": "1", 5481 // "type": "integer" 5482 // }, 5483 // "pageToken": { 5484 // "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.", 5485 // "location": "query", 5486 // "type": "string" 5487 // }, 5488 // "spaces": { 5489 // "description": "A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.", 5490 // "location": "query", 5491 // "type": "string" 5492 // }, 5493 // "startChangeId": { 5494 // "description": "Deprecated - use pageToken instead.", 5495 // "format": "int64", 5496 // "location": "query", 5497 // "type": "string" 5498 // }, 5499 // "supportsAllDrives": { 5500 // "default": "false", 5501 // "description": "Whether the requesting application supports both My Drives and shared drives.", 5502 // "location": "query", 5503 // "type": "boolean" 5504 // }, 5505 // "supportsTeamDrives": { 5506 // "default": "false", 5507 // "description": "Deprecated use supportsAllDrives instead.", 5508 // "location": "query", 5509 // "type": "boolean" 5510 // }, 5511 // "teamDriveId": { 5512 // "description": "Deprecated use driveId instead.", 5513 // "location": "query", 5514 // "type": "string" 5515 // } 5516 // }, 5517 // "path": "changes/watch", 5518 // "request": { 5519 // "$ref": "Channel", 5520 // "parameterName": "resource" 5521 // }, 5522 // "response": { 5523 // "$ref": "Channel" 5524 // }, 5525 // "scopes": [ 5526 // "https://www.googleapis.com/auth/drive", 5527 // "https://www.googleapis.com/auth/drive.appdata", 5528 // "https://www.googleapis.com/auth/drive.apps.readonly", 5529 // "https://www.googleapis.com/auth/drive.file", 5530 // "https://www.googleapis.com/auth/drive.metadata", 5531 // "https://www.googleapis.com/auth/drive.metadata.readonly", 5532 // "https://www.googleapis.com/auth/drive.photos.readonly", 5533 // "https://www.googleapis.com/auth/drive.readonly" 5534 // ], 5535 // "supportsSubscription": true 5536 // } 5537 5538} 5539 5540// method id "drive.channels.stop": 5541 5542type ChannelsStopCall struct { 5543 s *Service 5544 channel *Channel 5545 urlParams_ gensupport.URLParams 5546 ctx_ context.Context 5547 header_ http.Header 5548} 5549 5550// Stop: Stop watching resources through this channel 5551func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { 5552 c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5553 c.channel = channel 5554 return c 5555} 5556 5557// Fields allows partial responses to be retrieved. See 5558// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5559// for more information. 5560func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall { 5561 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5562 return c 5563} 5564 5565// Context sets the context to be used in this call's Do method. Any 5566// pending HTTP request will be aborted if the provided context is 5567// canceled. 5568func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall { 5569 c.ctx_ = ctx 5570 return c 5571} 5572 5573// Header returns an http.Header that can be modified by the caller to 5574// add HTTP headers to the request. 5575func (c *ChannelsStopCall) Header() http.Header { 5576 if c.header_ == nil { 5577 c.header_ = make(http.Header) 5578 } 5579 return c.header_ 5580} 5581 5582func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { 5583 reqHeaders := make(http.Header) 5584 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5585 for k, v := range c.header_ { 5586 reqHeaders[k] = v 5587 } 5588 reqHeaders.Set("User-Agent", c.s.userAgent()) 5589 var body io.Reader = nil 5590 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 5591 if err != nil { 5592 return nil, err 5593 } 5594 reqHeaders.Set("Content-Type", "application/json") 5595 c.urlParams_.Set("alt", alt) 5596 c.urlParams_.Set("prettyPrint", "false") 5597 urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop") 5598 urls += "?" + c.urlParams_.Encode() 5599 req, err := http.NewRequest("POST", urls, body) 5600 if err != nil { 5601 return nil, err 5602 } 5603 req.Header = reqHeaders 5604 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5605} 5606 5607// Do executes the "drive.channels.stop" call. 5608func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error { 5609 gensupport.SetOptions(c.urlParams_, opts...) 5610 res, err := c.doRequest("json") 5611 if err != nil { 5612 return err 5613 } 5614 defer googleapi.CloseBody(res) 5615 if err := googleapi.CheckResponse(res); err != nil { 5616 return err 5617 } 5618 return nil 5619 // { 5620 // "description": "Stop watching resources through this channel", 5621 // "httpMethod": "POST", 5622 // "id": "drive.channels.stop", 5623 // "path": "channels/stop", 5624 // "request": { 5625 // "$ref": "Channel", 5626 // "parameterName": "resource" 5627 // }, 5628 // "scopes": [ 5629 // "https://www.googleapis.com/auth/drive", 5630 // "https://www.googleapis.com/auth/drive.appdata", 5631 // "https://www.googleapis.com/auth/drive.apps.readonly", 5632 // "https://www.googleapis.com/auth/drive.file", 5633 // "https://www.googleapis.com/auth/drive.metadata", 5634 // "https://www.googleapis.com/auth/drive.metadata.readonly", 5635 // "https://www.googleapis.com/auth/drive.photos.readonly", 5636 // "https://www.googleapis.com/auth/drive.readonly" 5637 // ] 5638 // } 5639 5640} 5641 5642// method id "drive.children.delete": 5643 5644type ChildrenDeleteCall struct { 5645 s *Service 5646 folderId string 5647 childId string 5648 urlParams_ gensupport.URLParams 5649 ctx_ context.Context 5650 header_ http.Header 5651} 5652 5653// Delete: Removes a child from a folder. 5654// 5655// - childId: The ID of the child. 5656// - folderId: The ID of the folder. 5657func (r *ChildrenService) Delete(folderId string, childId string) *ChildrenDeleteCall { 5658 c := &ChildrenDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5659 c.folderId = folderId 5660 c.childId = childId 5661 return c 5662} 5663 5664// EnforceSingleParent sets the optional parameter 5665// "enforceSingleParent": Deprecated. If an item is not in a shared 5666// drive and its last parent is deleted but the item itself is not, the 5667// item will be placed under its owner's root. 5668func (c *ChildrenDeleteCall) EnforceSingleParent(enforceSingleParent bool) *ChildrenDeleteCall { 5669 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 5670 return c 5671} 5672 5673// Fields allows partial responses to be retrieved. See 5674// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5675// for more information. 5676func (c *ChildrenDeleteCall) Fields(s ...googleapi.Field) *ChildrenDeleteCall { 5677 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5678 return c 5679} 5680 5681// Context sets the context to be used in this call's Do method. Any 5682// pending HTTP request will be aborted if the provided context is 5683// canceled. 5684func (c *ChildrenDeleteCall) Context(ctx context.Context) *ChildrenDeleteCall { 5685 c.ctx_ = ctx 5686 return c 5687} 5688 5689// Header returns an http.Header that can be modified by the caller to 5690// add HTTP headers to the request. 5691func (c *ChildrenDeleteCall) Header() http.Header { 5692 if c.header_ == nil { 5693 c.header_ = make(http.Header) 5694 } 5695 return c.header_ 5696} 5697 5698func (c *ChildrenDeleteCall) doRequest(alt string) (*http.Response, error) { 5699 reqHeaders := make(http.Header) 5700 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5701 for k, v := range c.header_ { 5702 reqHeaders[k] = v 5703 } 5704 reqHeaders.Set("User-Agent", c.s.userAgent()) 5705 var body io.Reader = nil 5706 c.urlParams_.Set("alt", alt) 5707 c.urlParams_.Set("prettyPrint", "false") 5708 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children/{childId}") 5709 urls += "?" + c.urlParams_.Encode() 5710 req, err := http.NewRequest("DELETE", urls, body) 5711 if err != nil { 5712 return nil, err 5713 } 5714 req.Header = reqHeaders 5715 googleapi.Expand(req.URL, map[string]string{ 5716 "folderId": c.folderId, 5717 "childId": c.childId, 5718 }) 5719 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5720} 5721 5722// Do executes the "drive.children.delete" call. 5723func (c *ChildrenDeleteCall) Do(opts ...googleapi.CallOption) error { 5724 gensupport.SetOptions(c.urlParams_, opts...) 5725 res, err := c.doRequest("json") 5726 if err != nil { 5727 return err 5728 } 5729 defer googleapi.CloseBody(res) 5730 if err := googleapi.CheckResponse(res); err != nil { 5731 return err 5732 } 5733 return nil 5734 // { 5735 // "description": "Removes a child from a folder.", 5736 // "httpMethod": "DELETE", 5737 // "id": "drive.children.delete", 5738 // "parameterOrder": [ 5739 // "folderId", 5740 // "childId" 5741 // ], 5742 // "parameters": { 5743 // "childId": { 5744 // "description": "The ID of the child.", 5745 // "location": "path", 5746 // "required": true, 5747 // "type": "string" 5748 // }, 5749 // "enforceSingleParent": { 5750 // "default": "false", 5751 // "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.", 5752 // "location": "query", 5753 // "type": "boolean" 5754 // }, 5755 // "folderId": { 5756 // "description": "The ID of the folder.", 5757 // "location": "path", 5758 // "required": true, 5759 // "type": "string" 5760 // } 5761 // }, 5762 // "path": "files/{folderId}/children/{childId}", 5763 // "scopes": [ 5764 // "https://www.googleapis.com/auth/drive", 5765 // "https://www.googleapis.com/auth/drive.file" 5766 // ] 5767 // } 5768 5769} 5770 5771// method id "drive.children.get": 5772 5773type ChildrenGetCall struct { 5774 s *Service 5775 folderId string 5776 childId string 5777 urlParams_ gensupport.URLParams 5778 ifNoneMatch_ string 5779 ctx_ context.Context 5780 header_ http.Header 5781} 5782 5783// Get: Gets a specific child reference. 5784// 5785// - childId: The ID of the child. 5786// - folderId: The ID of the folder. 5787func (r *ChildrenService) Get(folderId string, childId string) *ChildrenGetCall { 5788 c := &ChildrenGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5789 c.folderId = folderId 5790 c.childId = childId 5791 return c 5792} 5793 5794// Fields allows partial responses to be retrieved. See 5795// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5796// for more information. 5797func (c *ChildrenGetCall) Fields(s ...googleapi.Field) *ChildrenGetCall { 5798 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5799 return c 5800} 5801 5802// IfNoneMatch sets the optional parameter which makes the operation 5803// fail if the object's ETag matches the given value. This is useful for 5804// getting updates only after the object has changed since the last 5805// request. Use googleapi.IsNotModified to check whether the response 5806// error from Do is the result of In-None-Match. 5807func (c *ChildrenGetCall) IfNoneMatch(entityTag string) *ChildrenGetCall { 5808 c.ifNoneMatch_ = entityTag 5809 return c 5810} 5811 5812// Context sets the context to be used in this call's Do method. Any 5813// pending HTTP request will be aborted if the provided context is 5814// canceled. 5815func (c *ChildrenGetCall) Context(ctx context.Context) *ChildrenGetCall { 5816 c.ctx_ = ctx 5817 return c 5818} 5819 5820// Header returns an http.Header that can be modified by the caller to 5821// add HTTP headers to the request. 5822func (c *ChildrenGetCall) Header() http.Header { 5823 if c.header_ == nil { 5824 c.header_ = make(http.Header) 5825 } 5826 return c.header_ 5827} 5828 5829func (c *ChildrenGetCall) doRequest(alt string) (*http.Response, error) { 5830 reqHeaders := make(http.Header) 5831 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 5832 for k, v := range c.header_ { 5833 reqHeaders[k] = v 5834 } 5835 reqHeaders.Set("User-Agent", c.s.userAgent()) 5836 if c.ifNoneMatch_ != "" { 5837 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5838 } 5839 var body io.Reader = nil 5840 c.urlParams_.Set("alt", alt) 5841 c.urlParams_.Set("prettyPrint", "false") 5842 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children/{childId}") 5843 urls += "?" + c.urlParams_.Encode() 5844 req, err := http.NewRequest("GET", urls, body) 5845 if err != nil { 5846 return nil, err 5847 } 5848 req.Header = reqHeaders 5849 googleapi.Expand(req.URL, map[string]string{ 5850 "folderId": c.folderId, 5851 "childId": c.childId, 5852 }) 5853 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5854} 5855 5856// Do executes the "drive.children.get" call. 5857// Exactly one of *ChildReference or error will be non-nil. Any non-2xx 5858// status code is an error. Response headers are in either 5859// *ChildReference.ServerResponse.Header or (if a response was returned 5860// at all) in error.(*googleapi.Error).Header. Use 5861// googleapi.IsNotModified to check whether the returned error was 5862// because http.StatusNotModified was returned. 5863func (c *ChildrenGetCall) Do(opts ...googleapi.CallOption) (*ChildReference, error) { 5864 gensupport.SetOptions(c.urlParams_, opts...) 5865 res, err := c.doRequest("json") 5866 if res != nil && res.StatusCode == http.StatusNotModified { 5867 if res.Body != nil { 5868 res.Body.Close() 5869 } 5870 return nil, &googleapi.Error{ 5871 Code: res.StatusCode, 5872 Header: res.Header, 5873 } 5874 } 5875 if err != nil { 5876 return nil, err 5877 } 5878 defer googleapi.CloseBody(res) 5879 if err := googleapi.CheckResponse(res); err != nil { 5880 return nil, err 5881 } 5882 ret := &ChildReference{ 5883 ServerResponse: googleapi.ServerResponse{ 5884 Header: res.Header, 5885 HTTPStatusCode: res.StatusCode, 5886 }, 5887 } 5888 target := &ret 5889 if err := gensupport.DecodeResponse(target, res); err != nil { 5890 return nil, err 5891 } 5892 return ret, nil 5893 // { 5894 // "description": "Gets a specific child reference.", 5895 // "httpMethod": "GET", 5896 // "id": "drive.children.get", 5897 // "parameterOrder": [ 5898 // "folderId", 5899 // "childId" 5900 // ], 5901 // "parameters": { 5902 // "childId": { 5903 // "description": "The ID of the child.", 5904 // "location": "path", 5905 // "required": true, 5906 // "type": "string" 5907 // }, 5908 // "folderId": { 5909 // "description": "The ID of the folder.", 5910 // "location": "path", 5911 // "required": true, 5912 // "type": "string" 5913 // } 5914 // }, 5915 // "path": "files/{folderId}/children/{childId}", 5916 // "response": { 5917 // "$ref": "ChildReference" 5918 // }, 5919 // "scopes": [ 5920 // "https://www.googleapis.com/auth/drive", 5921 // "https://www.googleapis.com/auth/drive.appdata", 5922 // "https://www.googleapis.com/auth/drive.file", 5923 // "https://www.googleapis.com/auth/drive.metadata", 5924 // "https://www.googleapis.com/auth/drive.metadata.readonly", 5925 // "https://www.googleapis.com/auth/drive.photos.readonly", 5926 // "https://www.googleapis.com/auth/drive.readonly" 5927 // ] 5928 // } 5929 5930} 5931 5932// method id "drive.children.insert": 5933 5934type ChildrenInsertCall struct { 5935 s *Service 5936 folderId string 5937 childreference *ChildReference 5938 urlParams_ gensupport.URLParams 5939 ctx_ context.Context 5940 header_ http.Header 5941} 5942 5943// Insert: Inserts a file into a folder. 5944// 5945// - folderId: The ID of the folder. 5946func (r *ChildrenService) Insert(folderId string, childreference *ChildReference) *ChildrenInsertCall { 5947 c := &ChildrenInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5948 c.folderId = folderId 5949 c.childreference = childreference 5950 return c 5951} 5952 5953// EnforceSingleParent sets the optional parameter 5954// "enforceSingleParent": Deprecated. Adding files to multiple folders 5955// is no longer supported. Use shortcuts instead. 5956func (c *ChildrenInsertCall) EnforceSingleParent(enforceSingleParent bool) *ChildrenInsertCall { 5957 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 5958 return c 5959} 5960 5961// SupportsAllDrives sets the optional parameter "supportsAllDrives": 5962// Whether the requesting application supports both My Drives and shared 5963// drives. 5964func (c *ChildrenInsertCall) SupportsAllDrives(supportsAllDrives bool) *ChildrenInsertCall { 5965 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 5966 return c 5967} 5968 5969// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 5970// Deprecated use supportsAllDrives instead. 5971func (c *ChildrenInsertCall) SupportsTeamDrives(supportsTeamDrives bool) *ChildrenInsertCall { 5972 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 5973 return c 5974} 5975 5976// Fields allows partial responses to be retrieved. See 5977// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5978// for more information. 5979func (c *ChildrenInsertCall) Fields(s ...googleapi.Field) *ChildrenInsertCall { 5980 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5981 return c 5982} 5983 5984// Context sets the context to be used in this call's Do method. Any 5985// pending HTTP request will be aborted if the provided context is 5986// canceled. 5987func (c *ChildrenInsertCall) Context(ctx context.Context) *ChildrenInsertCall { 5988 c.ctx_ = ctx 5989 return c 5990} 5991 5992// Header returns an http.Header that can be modified by the caller to 5993// add HTTP headers to the request. 5994func (c *ChildrenInsertCall) Header() http.Header { 5995 if c.header_ == nil { 5996 c.header_ = make(http.Header) 5997 } 5998 return c.header_ 5999} 6000 6001func (c *ChildrenInsertCall) doRequest(alt string) (*http.Response, error) { 6002 reqHeaders := make(http.Header) 6003 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6004 for k, v := range c.header_ { 6005 reqHeaders[k] = v 6006 } 6007 reqHeaders.Set("User-Agent", c.s.userAgent()) 6008 var body io.Reader = nil 6009 body, err := googleapi.WithoutDataWrapper.JSONReader(c.childreference) 6010 if err != nil { 6011 return nil, err 6012 } 6013 reqHeaders.Set("Content-Type", "application/json") 6014 c.urlParams_.Set("alt", alt) 6015 c.urlParams_.Set("prettyPrint", "false") 6016 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children") 6017 urls += "?" + c.urlParams_.Encode() 6018 req, err := http.NewRequest("POST", urls, body) 6019 if err != nil { 6020 return nil, err 6021 } 6022 req.Header = reqHeaders 6023 googleapi.Expand(req.URL, map[string]string{ 6024 "folderId": c.folderId, 6025 }) 6026 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6027} 6028 6029// Do executes the "drive.children.insert" call. 6030// Exactly one of *ChildReference or error will be non-nil. Any non-2xx 6031// status code is an error. Response headers are in either 6032// *ChildReference.ServerResponse.Header or (if a response was returned 6033// at all) in error.(*googleapi.Error).Header. Use 6034// googleapi.IsNotModified to check whether the returned error was 6035// because http.StatusNotModified was returned. 6036func (c *ChildrenInsertCall) Do(opts ...googleapi.CallOption) (*ChildReference, error) { 6037 gensupport.SetOptions(c.urlParams_, opts...) 6038 res, err := c.doRequest("json") 6039 if res != nil && res.StatusCode == http.StatusNotModified { 6040 if res.Body != nil { 6041 res.Body.Close() 6042 } 6043 return nil, &googleapi.Error{ 6044 Code: res.StatusCode, 6045 Header: res.Header, 6046 } 6047 } 6048 if err != nil { 6049 return nil, err 6050 } 6051 defer googleapi.CloseBody(res) 6052 if err := googleapi.CheckResponse(res); err != nil { 6053 return nil, err 6054 } 6055 ret := &ChildReference{ 6056 ServerResponse: googleapi.ServerResponse{ 6057 Header: res.Header, 6058 HTTPStatusCode: res.StatusCode, 6059 }, 6060 } 6061 target := &ret 6062 if err := gensupport.DecodeResponse(target, res); err != nil { 6063 return nil, err 6064 } 6065 return ret, nil 6066 // { 6067 // "description": "Inserts a file into a folder.", 6068 // "httpMethod": "POST", 6069 // "id": "drive.children.insert", 6070 // "parameterOrder": [ 6071 // "folderId" 6072 // ], 6073 // "parameters": { 6074 // "enforceSingleParent": { 6075 // "default": "false", 6076 // "description": "Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead.", 6077 // "location": "query", 6078 // "type": "boolean" 6079 // }, 6080 // "folderId": { 6081 // "description": "The ID of the folder.", 6082 // "location": "path", 6083 // "required": true, 6084 // "type": "string" 6085 // }, 6086 // "supportsAllDrives": { 6087 // "default": "false", 6088 // "description": "Whether the requesting application supports both My Drives and shared drives.", 6089 // "location": "query", 6090 // "type": "boolean" 6091 // }, 6092 // "supportsTeamDrives": { 6093 // "default": "false", 6094 // "description": "Deprecated use supportsAllDrives instead.", 6095 // "location": "query", 6096 // "type": "boolean" 6097 // } 6098 // }, 6099 // "path": "files/{folderId}/children", 6100 // "request": { 6101 // "$ref": "ChildReference" 6102 // }, 6103 // "response": { 6104 // "$ref": "ChildReference" 6105 // }, 6106 // "scopes": [ 6107 // "https://www.googleapis.com/auth/drive", 6108 // "https://www.googleapis.com/auth/drive.appdata", 6109 // "https://www.googleapis.com/auth/drive.file" 6110 // ] 6111 // } 6112 6113} 6114 6115// method id "drive.children.list": 6116 6117type ChildrenListCall struct { 6118 s *Service 6119 folderId string 6120 urlParams_ gensupport.URLParams 6121 ifNoneMatch_ string 6122 ctx_ context.Context 6123 header_ http.Header 6124} 6125 6126// List: Lists a folder's children. 6127// 6128// - folderId: The ID of the folder. 6129func (r *ChildrenService) List(folderId string) *ChildrenListCall { 6130 c := &ChildrenListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6131 c.folderId = folderId 6132 return c 6133} 6134 6135// MaxResults sets the optional parameter "maxResults": Maximum number 6136// of children to return. 6137func (c *ChildrenListCall) MaxResults(maxResults int64) *ChildrenListCall { 6138 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 6139 return c 6140} 6141 6142// OrderBy sets the optional parameter "orderBy": A comma-separated list 6143// of sort keys. Valid keys are 'createdDate', 'folder', 6144// 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 6145// 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 6146// 'title'. Each key sorts ascending by default, but may be reversed 6147// with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate 6148// desc,title. Please note that there is a current limitation for users 6149// with approximately one million files in which the requested sort 6150// order is ignored. 6151func (c *ChildrenListCall) OrderBy(orderBy string) *ChildrenListCall { 6152 c.urlParams_.Set("orderBy", orderBy) 6153 return c 6154} 6155 6156// PageToken sets the optional parameter "pageToken": Page token for 6157// children. 6158func (c *ChildrenListCall) PageToken(pageToken string) *ChildrenListCall { 6159 c.urlParams_.Set("pageToken", pageToken) 6160 return c 6161} 6162 6163// Q sets the optional parameter "q": Query string for searching 6164// children. 6165func (c *ChildrenListCall) Q(q string) *ChildrenListCall { 6166 c.urlParams_.Set("q", q) 6167 return c 6168} 6169 6170// Fields allows partial responses to be retrieved. See 6171// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6172// for more information. 6173func (c *ChildrenListCall) Fields(s ...googleapi.Field) *ChildrenListCall { 6174 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6175 return c 6176} 6177 6178// IfNoneMatch sets the optional parameter which makes the operation 6179// fail if the object's ETag matches the given value. This is useful for 6180// getting updates only after the object has changed since the last 6181// request. Use googleapi.IsNotModified to check whether the response 6182// error from Do is the result of In-None-Match. 6183func (c *ChildrenListCall) IfNoneMatch(entityTag string) *ChildrenListCall { 6184 c.ifNoneMatch_ = entityTag 6185 return c 6186} 6187 6188// Context sets the context to be used in this call's Do method. Any 6189// pending HTTP request will be aborted if the provided context is 6190// canceled. 6191func (c *ChildrenListCall) Context(ctx context.Context) *ChildrenListCall { 6192 c.ctx_ = ctx 6193 return c 6194} 6195 6196// Header returns an http.Header that can be modified by the caller to 6197// add HTTP headers to the request. 6198func (c *ChildrenListCall) Header() http.Header { 6199 if c.header_ == nil { 6200 c.header_ = make(http.Header) 6201 } 6202 return c.header_ 6203} 6204 6205func (c *ChildrenListCall) doRequest(alt string) (*http.Response, error) { 6206 reqHeaders := make(http.Header) 6207 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6208 for k, v := range c.header_ { 6209 reqHeaders[k] = v 6210 } 6211 reqHeaders.Set("User-Agent", c.s.userAgent()) 6212 if c.ifNoneMatch_ != "" { 6213 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6214 } 6215 var body io.Reader = nil 6216 c.urlParams_.Set("alt", alt) 6217 c.urlParams_.Set("prettyPrint", "false") 6218 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{folderId}/children") 6219 urls += "?" + c.urlParams_.Encode() 6220 req, err := http.NewRequest("GET", urls, body) 6221 if err != nil { 6222 return nil, err 6223 } 6224 req.Header = reqHeaders 6225 googleapi.Expand(req.URL, map[string]string{ 6226 "folderId": c.folderId, 6227 }) 6228 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6229} 6230 6231// Do executes the "drive.children.list" call. 6232// Exactly one of *ChildList or error will be non-nil. Any non-2xx 6233// status code is an error. Response headers are in either 6234// *ChildList.ServerResponse.Header or (if a response was returned at 6235// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6236// to check whether the returned error was because 6237// http.StatusNotModified was returned. 6238func (c *ChildrenListCall) Do(opts ...googleapi.CallOption) (*ChildList, error) { 6239 gensupport.SetOptions(c.urlParams_, opts...) 6240 res, err := c.doRequest("json") 6241 if res != nil && res.StatusCode == http.StatusNotModified { 6242 if res.Body != nil { 6243 res.Body.Close() 6244 } 6245 return nil, &googleapi.Error{ 6246 Code: res.StatusCode, 6247 Header: res.Header, 6248 } 6249 } 6250 if err != nil { 6251 return nil, err 6252 } 6253 defer googleapi.CloseBody(res) 6254 if err := googleapi.CheckResponse(res); err != nil { 6255 return nil, err 6256 } 6257 ret := &ChildList{ 6258 ServerResponse: googleapi.ServerResponse{ 6259 Header: res.Header, 6260 HTTPStatusCode: res.StatusCode, 6261 }, 6262 } 6263 target := &ret 6264 if err := gensupport.DecodeResponse(target, res); err != nil { 6265 return nil, err 6266 } 6267 return ret, nil 6268 // { 6269 // "description": "Lists a folder's children.", 6270 // "httpMethod": "GET", 6271 // "id": "drive.children.list", 6272 // "parameterOrder": [ 6273 // "folderId" 6274 // ], 6275 // "parameters": { 6276 // "folderId": { 6277 // "description": "The ID of the folder.", 6278 // "location": "path", 6279 // "required": true, 6280 // "type": "string" 6281 // }, 6282 // "maxResults": { 6283 // "default": "100", 6284 // "description": "Maximum number of children to return.", 6285 // "format": "int32", 6286 // "location": "query", 6287 // "minimum": "0", 6288 // "type": "integer" 6289 // }, 6290 // "orderBy": { 6291 // "description": "A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', and 'title'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.", 6292 // "location": "query", 6293 // "type": "string" 6294 // }, 6295 // "pageToken": { 6296 // "description": "Page token for children.", 6297 // "location": "query", 6298 // "type": "string" 6299 // }, 6300 // "q": { 6301 // "description": "Query string for searching children.", 6302 // "location": "query", 6303 // "type": "string" 6304 // } 6305 // }, 6306 // "path": "files/{folderId}/children", 6307 // "response": { 6308 // "$ref": "ChildList" 6309 // }, 6310 // "scopes": [ 6311 // "https://www.googleapis.com/auth/drive", 6312 // "https://www.googleapis.com/auth/drive.appdata", 6313 // "https://www.googleapis.com/auth/drive.file", 6314 // "https://www.googleapis.com/auth/drive.metadata", 6315 // "https://www.googleapis.com/auth/drive.metadata.readonly", 6316 // "https://www.googleapis.com/auth/drive.photos.readonly", 6317 // "https://www.googleapis.com/auth/drive.readonly" 6318 // ] 6319 // } 6320 6321} 6322 6323// Pages invokes f for each page of results. 6324// A non-nil error returned from f will halt the iteration. 6325// The provided context supersedes any context provided to the Context method. 6326func (c *ChildrenListCall) Pages(ctx context.Context, f func(*ChildList) error) error { 6327 c.ctx_ = ctx 6328 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6329 for { 6330 x, err := c.Do() 6331 if err != nil { 6332 return err 6333 } 6334 if err := f(x); err != nil { 6335 return err 6336 } 6337 if x.NextPageToken == "" { 6338 return nil 6339 } 6340 c.PageToken(x.NextPageToken) 6341 } 6342} 6343 6344// method id "drive.comments.delete": 6345 6346type CommentsDeleteCall struct { 6347 s *Service 6348 fileId string 6349 commentId string 6350 urlParams_ gensupport.URLParams 6351 ctx_ context.Context 6352 header_ http.Header 6353} 6354 6355// Delete: Deletes a comment. 6356// 6357// - commentId: The ID of the comment. 6358// - fileId: The ID of the file. 6359func (r *CommentsService) Delete(fileId string, commentId string) *CommentsDeleteCall { 6360 c := &CommentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6361 c.fileId = fileId 6362 c.commentId = commentId 6363 return c 6364} 6365 6366// Fields allows partial responses to be retrieved. See 6367// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6368// for more information. 6369func (c *CommentsDeleteCall) Fields(s ...googleapi.Field) *CommentsDeleteCall { 6370 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6371 return c 6372} 6373 6374// Context sets the context to be used in this call's Do method. Any 6375// pending HTTP request will be aborted if the provided context is 6376// canceled. 6377func (c *CommentsDeleteCall) Context(ctx context.Context) *CommentsDeleteCall { 6378 c.ctx_ = ctx 6379 return c 6380} 6381 6382// Header returns an http.Header that can be modified by the caller to 6383// add HTTP headers to the request. 6384func (c *CommentsDeleteCall) Header() http.Header { 6385 if c.header_ == nil { 6386 c.header_ = make(http.Header) 6387 } 6388 return c.header_ 6389} 6390 6391func (c *CommentsDeleteCall) doRequest(alt string) (*http.Response, error) { 6392 reqHeaders := make(http.Header) 6393 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6394 for k, v := range c.header_ { 6395 reqHeaders[k] = v 6396 } 6397 reqHeaders.Set("User-Agent", c.s.userAgent()) 6398 var body io.Reader = nil 6399 c.urlParams_.Set("alt", alt) 6400 c.urlParams_.Set("prettyPrint", "false") 6401 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") 6402 urls += "?" + c.urlParams_.Encode() 6403 req, err := http.NewRequest("DELETE", urls, body) 6404 if err != nil { 6405 return nil, err 6406 } 6407 req.Header = reqHeaders 6408 googleapi.Expand(req.URL, map[string]string{ 6409 "fileId": c.fileId, 6410 "commentId": c.commentId, 6411 }) 6412 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6413} 6414 6415// Do executes the "drive.comments.delete" call. 6416func (c *CommentsDeleteCall) Do(opts ...googleapi.CallOption) error { 6417 gensupport.SetOptions(c.urlParams_, opts...) 6418 res, err := c.doRequest("json") 6419 if err != nil { 6420 return err 6421 } 6422 defer googleapi.CloseBody(res) 6423 if err := googleapi.CheckResponse(res); err != nil { 6424 return err 6425 } 6426 return nil 6427 // { 6428 // "description": "Deletes a comment.", 6429 // "httpMethod": "DELETE", 6430 // "id": "drive.comments.delete", 6431 // "parameterOrder": [ 6432 // "fileId", 6433 // "commentId" 6434 // ], 6435 // "parameters": { 6436 // "commentId": { 6437 // "description": "The ID of the comment.", 6438 // "location": "path", 6439 // "required": true, 6440 // "type": "string" 6441 // }, 6442 // "fileId": { 6443 // "description": "The ID of the file.", 6444 // "location": "path", 6445 // "required": true, 6446 // "type": "string" 6447 // } 6448 // }, 6449 // "path": "files/{fileId}/comments/{commentId}", 6450 // "scopes": [ 6451 // "https://www.googleapis.com/auth/drive", 6452 // "https://www.googleapis.com/auth/drive.file" 6453 // ] 6454 // } 6455 6456} 6457 6458// method id "drive.comments.get": 6459 6460type CommentsGetCall struct { 6461 s *Service 6462 fileId string 6463 commentId string 6464 urlParams_ gensupport.URLParams 6465 ifNoneMatch_ string 6466 ctx_ context.Context 6467 header_ http.Header 6468} 6469 6470// Get: Gets a comment by ID. 6471// 6472// - commentId: The ID of the comment. 6473// - fileId: The ID of the file. 6474func (r *CommentsService) Get(fileId string, commentId string) *CommentsGetCall { 6475 c := &CommentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6476 c.fileId = fileId 6477 c.commentId = commentId 6478 return c 6479} 6480 6481// IncludeDeleted sets the optional parameter "includeDeleted": If set, 6482// this will succeed when retrieving a deleted comment, and will include 6483// any deleted replies. 6484func (c *CommentsGetCall) IncludeDeleted(includeDeleted bool) *CommentsGetCall { 6485 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 6486 return c 6487} 6488 6489// Fields allows partial responses to be retrieved. See 6490// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6491// for more information. 6492func (c *CommentsGetCall) Fields(s ...googleapi.Field) *CommentsGetCall { 6493 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6494 return c 6495} 6496 6497// IfNoneMatch sets the optional parameter which makes the operation 6498// fail if the object's ETag matches the given value. This is useful for 6499// getting updates only after the object has changed since the last 6500// request. Use googleapi.IsNotModified to check whether the response 6501// error from Do is the result of In-None-Match. 6502func (c *CommentsGetCall) IfNoneMatch(entityTag string) *CommentsGetCall { 6503 c.ifNoneMatch_ = entityTag 6504 return c 6505} 6506 6507// Context sets the context to be used in this call's Do method. Any 6508// pending HTTP request will be aborted if the provided context is 6509// canceled. 6510func (c *CommentsGetCall) Context(ctx context.Context) *CommentsGetCall { 6511 c.ctx_ = ctx 6512 return c 6513} 6514 6515// Header returns an http.Header that can be modified by the caller to 6516// add HTTP headers to the request. 6517func (c *CommentsGetCall) Header() http.Header { 6518 if c.header_ == nil { 6519 c.header_ = make(http.Header) 6520 } 6521 return c.header_ 6522} 6523 6524func (c *CommentsGetCall) doRequest(alt string) (*http.Response, error) { 6525 reqHeaders := make(http.Header) 6526 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6527 for k, v := range c.header_ { 6528 reqHeaders[k] = v 6529 } 6530 reqHeaders.Set("User-Agent", c.s.userAgent()) 6531 if c.ifNoneMatch_ != "" { 6532 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6533 } 6534 var body io.Reader = nil 6535 c.urlParams_.Set("alt", alt) 6536 c.urlParams_.Set("prettyPrint", "false") 6537 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") 6538 urls += "?" + c.urlParams_.Encode() 6539 req, err := http.NewRequest("GET", urls, body) 6540 if err != nil { 6541 return nil, err 6542 } 6543 req.Header = reqHeaders 6544 googleapi.Expand(req.URL, map[string]string{ 6545 "fileId": c.fileId, 6546 "commentId": c.commentId, 6547 }) 6548 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6549} 6550 6551// Do executes the "drive.comments.get" call. 6552// Exactly one of *Comment or error will be non-nil. Any non-2xx status 6553// code is an error. Response headers are in either 6554// *Comment.ServerResponse.Header or (if a response was returned at all) 6555// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6556// check whether the returned error was because http.StatusNotModified 6557// was returned. 6558func (c *CommentsGetCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 6559 gensupport.SetOptions(c.urlParams_, opts...) 6560 res, err := c.doRequest("json") 6561 if res != nil && res.StatusCode == http.StatusNotModified { 6562 if res.Body != nil { 6563 res.Body.Close() 6564 } 6565 return nil, &googleapi.Error{ 6566 Code: res.StatusCode, 6567 Header: res.Header, 6568 } 6569 } 6570 if err != nil { 6571 return nil, err 6572 } 6573 defer googleapi.CloseBody(res) 6574 if err := googleapi.CheckResponse(res); err != nil { 6575 return nil, err 6576 } 6577 ret := &Comment{ 6578 ServerResponse: googleapi.ServerResponse{ 6579 Header: res.Header, 6580 HTTPStatusCode: res.StatusCode, 6581 }, 6582 } 6583 target := &ret 6584 if err := gensupport.DecodeResponse(target, res); err != nil { 6585 return nil, err 6586 } 6587 return ret, nil 6588 // { 6589 // "description": "Gets a comment by ID.", 6590 // "httpMethod": "GET", 6591 // "id": "drive.comments.get", 6592 // "parameterOrder": [ 6593 // "fileId", 6594 // "commentId" 6595 // ], 6596 // "parameters": { 6597 // "commentId": { 6598 // "description": "The ID of the comment.", 6599 // "location": "path", 6600 // "required": true, 6601 // "type": "string" 6602 // }, 6603 // "fileId": { 6604 // "description": "The ID of the file.", 6605 // "location": "path", 6606 // "required": true, 6607 // "type": "string" 6608 // }, 6609 // "includeDeleted": { 6610 // "default": "false", 6611 // "description": "If set, this will succeed when retrieving a deleted comment, and will include any deleted replies.", 6612 // "location": "query", 6613 // "type": "boolean" 6614 // } 6615 // }, 6616 // "path": "files/{fileId}/comments/{commentId}", 6617 // "response": { 6618 // "$ref": "Comment" 6619 // }, 6620 // "scopes": [ 6621 // "https://www.googleapis.com/auth/drive", 6622 // "https://www.googleapis.com/auth/drive.file", 6623 // "https://www.googleapis.com/auth/drive.readonly" 6624 // ] 6625 // } 6626 6627} 6628 6629// method id "drive.comments.insert": 6630 6631type CommentsInsertCall struct { 6632 s *Service 6633 fileId string 6634 comment *Comment 6635 urlParams_ gensupport.URLParams 6636 ctx_ context.Context 6637 header_ http.Header 6638} 6639 6640// Insert: Creates a new comment on the given file. 6641// 6642// - fileId: The ID of the file. 6643func (r *CommentsService) Insert(fileId string, comment *Comment) *CommentsInsertCall { 6644 c := &CommentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6645 c.fileId = fileId 6646 c.comment = comment 6647 return c 6648} 6649 6650// Fields allows partial responses to be retrieved. See 6651// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6652// for more information. 6653func (c *CommentsInsertCall) Fields(s ...googleapi.Field) *CommentsInsertCall { 6654 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6655 return c 6656} 6657 6658// Context sets the context to be used in this call's Do method. Any 6659// pending HTTP request will be aborted if the provided context is 6660// canceled. 6661func (c *CommentsInsertCall) Context(ctx context.Context) *CommentsInsertCall { 6662 c.ctx_ = ctx 6663 return c 6664} 6665 6666// Header returns an http.Header that can be modified by the caller to 6667// add HTTP headers to the request. 6668func (c *CommentsInsertCall) Header() http.Header { 6669 if c.header_ == nil { 6670 c.header_ = make(http.Header) 6671 } 6672 return c.header_ 6673} 6674 6675func (c *CommentsInsertCall) doRequest(alt string) (*http.Response, error) { 6676 reqHeaders := make(http.Header) 6677 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6678 for k, v := range c.header_ { 6679 reqHeaders[k] = v 6680 } 6681 reqHeaders.Set("User-Agent", c.s.userAgent()) 6682 var body io.Reader = nil 6683 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) 6684 if err != nil { 6685 return nil, err 6686 } 6687 reqHeaders.Set("Content-Type", "application/json") 6688 c.urlParams_.Set("alt", alt) 6689 c.urlParams_.Set("prettyPrint", "false") 6690 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") 6691 urls += "?" + c.urlParams_.Encode() 6692 req, err := http.NewRequest("POST", urls, body) 6693 if err != nil { 6694 return nil, err 6695 } 6696 req.Header = reqHeaders 6697 googleapi.Expand(req.URL, map[string]string{ 6698 "fileId": c.fileId, 6699 }) 6700 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6701} 6702 6703// Do executes the "drive.comments.insert" call. 6704// Exactly one of *Comment or error will be non-nil. Any non-2xx status 6705// code is an error. Response headers are in either 6706// *Comment.ServerResponse.Header or (if a response was returned at all) 6707// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6708// check whether the returned error was because http.StatusNotModified 6709// was returned. 6710func (c *CommentsInsertCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 6711 gensupport.SetOptions(c.urlParams_, opts...) 6712 res, err := c.doRequest("json") 6713 if res != nil && res.StatusCode == http.StatusNotModified { 6714 if res.Body != nil { 6715 res.Body.Close() 6716 } 6717 return nil, &googleapi.Error{ 6718 Code: res.StatusCode, 6719 Header: res.Header, 6720 } 6721 } 6722 if err != nil { 6723 return nil, err 6724 } 6725 defer googleapi.CloseBody(res) 6726 if err := googleapi.CheckResponse(res); err != nil { 6727 return nil, err 6728 } 6729 ret := &Comment{ 6730 ServerResponse: googleapi.ServerResponse{ 6731 Header: res.Header, 6732 HTTPStatusCode: res.StatusCode, 6733 }, 6734 } 6735 target := &ret 6736 if err := gensupport.DecodeResponse(target, res); err != nil { 6737 return nil, err 6738 } 6739 return ret, nil 6740 // { 6741 // "description": "Creates a new comment on the given file.", 6742 // "httpMethod": "POST", 6743 // "id": "drive.comments.insert", 6744 // "parameterOrder": [ 6745 // "fileId" 6746 // ], 6747 // "parameters": { 6748 // "fileId": { 6749 // "description": "The ID of the file.", 6750 // "location": "path", 6751 // "required": true, 6752 // "type": "string" 6753 // } 6754 // }, 6755 // "path": "files/{fileId}/comments", 6756 // "request": { 6757 // "$ref": "Comment" 6758 // }, 6759 // "response": { 6760 // "$ref": "Comment" 6761 // }, 6762 // "scopes": [ 6763 // "https://www.googleapis.com/auth/drive", 6764 // "https://www.googleapis.com/auth/drive.file" 6765 // ] 6766 // } 6767 6768} 6769 6770// method id "drive.comments.list": 6771 6772type CommentsListCall struct { 6773 s *Service 6774 fileId string 6775 urlParams_ gensupport.URLParams 6776 ifNoneMatch_ string 6777 ctx_ context.Context 6778 header_ http.Header 6779} 6780 6781// List: Lists a file's comments. 6782// 6783// - fileId: The ID of the file. 6784func (r *CommentsService) List(fileId string) *CommentsListCall { 6785 c := &CommentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6786 c.fileId = fileId 6787 return c 6788} 6789 6790// IncludeDeleted sets the optional parameter "includeDeleted": If set, 6791// all comments and replies, including deleted comments and replies 6792// (with content stripped) will be returned. 6793func (c *CommentsListCall) IncludeDeleted(includeDeleted bool) *CommentsListCall { 6794 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 6795 return c 6796} 6797 6798// MaxResults sets the optional parameter "maxResults": The maximum 6799// number of discussions to include in the response, used for paging. 6800func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { 6801 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 6802 return c 6803} 6804 6805// PageToken sets the optional parameter "pageToken": The continuation 6806// token, used to page through large result sets. To get the next page 6807// of results, set this parameter to the value of "nextPageToken" from 6808// the previous response. 6809func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { 6810 c.urlParams_.Set("pageToken", pageToken) 6811 return c 6812} 6813 6814// UpdatedMin sets the optional parameter "updatedMin": Only discussions 6815// that were updated after this timestamp will be returned. Formatted as 6816// an RFC 3339 timestamp. 6817func (c *CommentsListCall) UpdatedMin(updatedMin string) *CommentsListCall { 6818 c.urlParams_.Set("updatedMin", updatedMin) 6819 return c 6820} 6821 6822// Fields allows partial responses to be retrieved. See 6823// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6824// for more information. 6825func (c *CommentsListCall) Fields(s ...googleapi.Field) *CommentsListCall { 6826 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6827 return c 6828} 6829 6830// IfNoneMatch sets the optional parameter which makes the operation 6831// fail if the object's ETag matches the given value. This is useful for 6832// getting updates only after the object has changed since the last 6833// request. Use googleapi.IsNotModified to check whether the response 6834// error from Do is the result of In-None-Match. 6835func (c *CommentsListCall) IfNoneMatch(entityTag string) *CommentsListCall { 6836 c.ifNoneMatch_ = entityTag 6837 return c 6838} 6839 6840// Context sets the context to be used in this call's Do method. Any 6841// pending HTTP request will be aborted if the provided context is 6842// canceled. 6843func (c *CommentsListCall) Context(ctx context.Context) *CommentsListCall { 6844 c.ctx_ = ctx 6845 return c 6846} 6847 6848// Header returns an http.Header that can be modified by the caller to 6849// add HTTP headers to the request. 6850func (c *CommentsListCall) Header() http.Header { 6851 if c.header_ == nil { 6852 c.header_ = make(http.Header) 6853 } 6854 return c.header_ 6855} 6856 6857func (c *CommentsListCall) doRequest(alt string) (*http.Response, error) { 6858 reqHeaders := make(http.Header) 6859 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 6860 for k, v := range c.header_ { 6861 reqHeaders[k] = v 6862 } 6863 reqHeaders.Set("User-Agent", c.s.userAgent()) 6864 if c.ifNoneMatch_ != "" { 6865 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6866 } 6867 var body io.Reader = nil 6868 c.urlParams_.Set("alt", alt) 6869 c.urlParams_.Set("prettyPrint", "false") 6870 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments") 6871 urls += "?" + c.urlParams_.Encode() 6872 req, err := http.NewRequest("GET", urls, body) 6873 if err != nil { 6874 return nil, err 6875 } 6876 req.Header = reqHeaders 6877 googleapi.Expand(req.URL, map[string]string{ 6878 "fileId": c.fileId, 6879 }) 6880 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6881} 6882 6883// Do executes the "drive.comments.list" call. 6884// Exactly one of *CommentList or error will be non-nil. Any non-2xx 6885// status code is an error. Response headers are in either 6886// *CommentList.ServerResponse.Header or (if a response was returned at 6887// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6888// to check whether the returned error was because 6889// http.StatusNotModified was returned. 6890func (c *CommentsListCall) Do(opts ...googleapi.CallOption) (*CommentList, error) { 6891 gensupport.SetOptions(c.urlParams_, opts...) 6892 res, err := c.doRequest("json") 6893 if res != nil && res.StatusCode == http.StatusNotModified { 6894 if res.Body != nil { 6895 res.Body.Close() 6896 } 6897 return nil, &googleapi.Error{ 6898 Code: res.StatusCode, 6899 Header: res.Header, 6900 } 6901 } 6902 if err != nil { 6903 return nil, err 6904 } 6905 defer googleapi.CloseBody(res) 6906 if err := googleapi.CheckResponse(res); err != nil { 6907 return nil, err 6908 } 6909 ret := &CommentList{ 6910 ServerResponse: googleapi.ServerResponse{ 6911 Header: res.Header, 6912 HTTPStatusCode: res.StatusCode, 6913 }, 6914 } 6915 target := &ret 6916 if err := gensupport.DecodeResponse(target, res); err != nil { 6917 return nil, err 6918 } 6919 return ret, nil 6920 // { 6921 // "description": "Lists a file's comments.", 6922 // "httpMethod": "GET", 6923 // "id": "drive.comments.list", 6924 // "parameterOrder": [ 6925 // "fileId" 6926 // ], 6927 // "parameters": { 6928 // "fileId": { 6929 // "description": "The ID of the file.", 6930 // "location": "path", 6931 // "required": true, 6932 // "type": "string" 6933 // }, 6934 // "includeDeleted": { 6935 // "default": "false", 6936 // "description": "If set, all comments and replies, including deleted comments and replies (with content stripped) will be returned.", 6937 // "location": "query", 6938 // "type": "boolean" 6939 // }, 6940 // "maxResults": { 6941 // "default": "20", 6942 // "description": "The maximum number of discussions to include in the response, used for paging.", 6943 // "format": "int32", 6944 // "location": "query", 6945 // "maximum": "100", 6946 // "minimum": "0", 6947 // "type": "integer" 6948 // }, 6949 // "pageToken": { 6950 // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", 6951 // "location": "query", 6952 // "type": "string" 6953 // }, 6954 // "updatedMin": { 6955 // "description": "Only discussions that were updated after this timestamp will be returned. Formatted as an RFC 3339 timestamp.", 6956 // "location": "query", 6957 // "type": "string" 6958 // } 6959 // }, 6960 // "path": "files/{fileId}/comments", 6961 // "response": { 6962 // "$ref": "CommentList" 6963 // }, 6964 // "scopes": [ 6965 // "https://www.googleapis.com/auth/drive", 6966 // "https://www.googleapis.com/auth/drive.file", 6967 // "https://www.googleapis.com/auth/drive.readonly" 6968 // ] 6969 // } 6970 6971} 6972 6973// Pages invokes f for each page of results. 6974// A non-nil error returned from f will halt the iteration. 6975// The provided context supersedes any context provided to the Context method. 6976func (c *CommentsListCall) Pages(ctx context.Context, f func(*CommentList) error) error { 6977 c.ctx_ = ctx 6978 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6979 for { 6980 x, err := c.Do() 6981 if err != nil { 6982 return err 6983 } 6984 if err := f(x); err != nil { 6985 return err 6986 } 6987 if x.NextPageToken == "" { 6988 return nil 6989 } 6990 c.PageToken(x.NextPageToken) 6991 } 6992} 6993 6994// method id "drive.comments.patch": 6995 6996type CommentsPatchCall struct { 6997 s *Service 6998 fileId string 6999 commentId string 7000 comment *Comment 7001 urlParams_ gensupport.URLParams 7002 ctx_ context.Context 7003 header_ http.Header 7004} 7005 7006// Patch: Updates an existing comment. 7007// 7008// - commentId: The ID of the comment. 7009// - fileId: The ID of the file. 7010func (r *CommentsService) Patch(fileId string, commentId string, comment *Comment) *CommentsPatchCall { 7011 c := &CommentsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7012 c.fileId = fileId 7013 c.commentId = commentId 7014 c.comment = comment 7015 return c 7016} 7017 7018// Fields allows partial responses to be retrieved. See 7019// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7020// for more information. 7021func (c *CommentsPatchCall) Fields(s ...googleapi.Field) *CommentsPatchCall { 7022 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7023 return c 7024} 7025 7026// Context sets the context to be used in this call's Do method. Any 7027// pending HTTP request will be aborted if the provided context is 7028// canceled. 7029func (c *CommentsPatchCall) Context(ctx context.Context) *CommentsPatchCall { 7030 c.ctx_ = ctx 7031 return c 7032} 7033 7034// Header returns an http.Header that can be modified by the caller to 7035// add HTTP headers to the request. 7036func (c *CommentsPatchCall) Header() http.Header { 7037 if c.header_ == nil { 7038 c.header_ = make(http.Header) 7039 } 7040 return c.header_ 7041} 7042 7043func (c *CommentsPatchCall) doRequest(alt string) (*http.Response, error) { 7044 reqHeaders := make(http.Header) 7045 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7046 for k, v := range c.header_ { 7047 reqHeaders[k] = v 7048 } 7049 reqHeaders.Set("User-Agent", c.s.userAgent()) 7050 var body io.Reader = nil 7051 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) 7052 if err != nil { 7053 return nil, err 7054 } 7055 reqHeaders.Set("Content-Type", "application/json") 7056 c.urlParams_.Set("alt", alt) 7057 c.urlParams_.Set("prettyPrint", "false") 7058 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") 7059 urls += "?" + c.urlParams_.Encode() 7060 req, err := http.NewRequest("PATCH", urls, body) 7061 if err != nil { 7062 return nil, err 7063 } 7064 req.Header = reqHeaders 7065 googleapi.Expand(req.URL, map[string]string{ 7066 "fileId": c.fileId, 7067 "commentId": c.commentId, 7068 }) 7069 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7070} 7071 7072// Do executes the "drive.comments.patch" call. 7073// Exactly one of *Comment or error will be non-nil. Any non-2xx status 7074// code is an error. Response headers are in either 7075// *Comment.ServerResponse.Header or (if a response was returned at all) 7076// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7077// check whether the returned error was because http.StatusNotModified 7078// was returned. 7079func (c *CommentsPatchCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 7080 gensupport.SetOptions(c.urlParams_, opts...) 7081 res, err := c.doRequest("json") 7082 if res != nil && res.StatusCode == http.StatusNotModified { 7083 if res.Body != nil { 7084 res.Body.Close() 7085 } 7086 return nil, &googleapi.Error{ 7087 Code: res.StatusCode, 7088 Header: res.Header, 7089 } 7090 } 7091 if err != nil { 7092 return nil, err 7093 } 7094 defer googleapi.CloseBody(res) 7095 if err := googleapi.CheckResponse(res); err != nil { 7096 return nil, err 7097 } 7098 ret := &Comment{ 7099 ServerResponse: googleapi.ServerResponse{ 7100 Header: res.Header, 7101 HTTPStatusCode: res.StatusCode, 7102 }, 7103 } 7104 target := &ret 7105 if err := gensupport.DecodeResponse(target, res); err != nil { 7106 return nil, err 7107 } 7108 return ret, nil 7109 // { 7110 // "description": "Updates an existing comment.", 7111 // "httpMethod": "PATCH", 7112 // "id": "drive.comments.patch", 7113 // "parameterOrder": [ 7114 // "fileId", 7115 // "commentId" 7116 // ], 7117 // "parameters": { 7118 // "commentId": { 7119 // "description": "The ID of the comment.", 7120 // "location": "path", 7121 // "required": true, 7122 // "type": "string" 7123 // }, 7124 // "fileId": { 7125 // "description": "The ID of the file.", 7126 // "location": "path", 7127 // "required": true, 7128 // "type": "string" 7129 // } 7130 // }, 7131 // "path": "files/{fileId}/comments/{commentId}", 7132 // "request": { 7133 // "$ref": "Comment" 7134 // }, 7135 // "response": { 7136 // "$ref": "Comment" 7137 // }, 7138 // "scopes": [ 7139 // "https://www.googleapis.com/auth/drive", 7140 // "https://www.googleapis.com/auth/drive.file" 7141 // ] 7142 // } 7143 7144} 7145 7146// method id "drive.comments.update": 7147 7148type CommentsUpdateCall struct { 7149 s *Service 7150 fileId string 7151 commentId string 7152 comment *Comment 7153 urlParams_ gensupport.URLParams 7154 ctx_ context.Context 7155 header_ http.Header 7156} 7157 7158// Update: Updates an existing comment. 7159// 7160// - commentId: The ID of the comment. 7161// - fileId: The ID of the file. 7162func (r *CommentsService) Update(fileId string, commentId string, comment *Comment) *CommentsUpdateCall { 7163 c := &CommentsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7164 c.fileId = fileId 7165 c.commentId = commentId 7166 c.comment = comment 7167 return c 7168} 7169 7170// Fields allows partial responses to be retrieved. See 7171// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7172// for more information. 7173func (c *CommentsUpdateCall) Fields(s ...googleapi.Field) *CommentsUpdateCall { 7174 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7175 return c 7176} 7177 7178// Context sets the context to be used in this call's Do method. Any 7179// pending HTTP request will be aborted if the provided context is 7180// canceled. 7181func (c *CommentsUpdateCall) Context(ctx context.Context) *CommentsUpdateCall { 7182 c.ctx_ = ctx 7183 return c 7184} 7185 7186// Header returns an http.Header that can be modified by the caller to 7187// add HTTP headers to the request. 7188func (c *CommentsUpdateCall) Header() http.Header { 7189 if c.header_ == nil { 7190 c.header_ = make(http.Header) 7191 } 7192 return c.header_ 7193} 7194 7195func (c *CommentsUpdateCall) doRequest(alt string) (*http.Response, error) { 7196 reqHeaders := make(http.Header) 7197 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7198 for k, v := range c.header_ { 7199 reqHeaders[k] = v 7200 } 7201 reqHeaders.Set("User-Agent", c.s.userAgent()) 7202 var body io.Reader = nil 7203 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) 7204 if err != nil { 7205 return nil, err 7206 } 7207 reqHeaders.Set("Content-Type", "application/json") 7208 c.urlParams_.Set("alt", alt) 7209 c.urlParams_.Set("prettyPrint", "false") 7210 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}") 7211 urls += "?" + c.urlParams_.Encode() 7212 req, err := http.NewRequest("PUT", urls, body) 7213 if err != nil { 7214 return nil, err 7215 } 7216 req.Header = reqHeaders 7217 googleapi.Expand(req.URL, map[string]string{ 7218 "fileId": c.fileId, 7219 "commentId": c.commentId, 7220 }) 7221 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7222} 7223 7224// Do executes the "drive.comments.update" call. 7225// Exactly one of *Comment or error will be non-nil. Any non-2xx status 7226// code is an error. Response headers are in either 7227// *Comment.ServerResponse.Header or (if a response was returned at all) 7228// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7229// check whether the returned error was because http.StatusNotModified 7230// was returned. 7231func (c *CommentsUpdateCall) Do(opts ...googleapi.CallOption) (*Comment, error) { 7232 gensupport.SetOptions(c.urlParams_, opts...) 7233 res, err := c.doRequest("json") 7234 if res != nil && res.StatusCode == http.StatusNotModified { 7235 if res.Body != nil { 7236 res.Body.Close() 7237 } 7238 return nil, &googleapi.Error{ 7239 Code: res.StatusCode, 7240 Header: res.Header, 7241 } 7242 } 7243 if err != nil { 7244 return nil, err 7245 } 7246 defer googleapi.CloseBody(res) 7247 if err := googleapi.CheckResponse(res); err != nil { 7248 return nil, err 7249 } 7250 ret := &Comment{ 7251 ServerResponse: googleapi.ServerResponse{ 7252 Header: res.Header, 7253 HTTPStatusCode: res.StatusCode, 7254 }, 7255 } 7256 target := &ret 7257 if err := gensupport.DecodeResponse(target, res); err != nil { 7258 return nil, err 7259 } 7260 return ret, nil 7261 // { 7262 // "description": "Updates an existing comment.", 7263 // "httpMethod": "PUT", 7264 // "id": "drive.comments.update", 7265 // "parameterOrder": [ 7266 // "fileId", 7267 // "commentId" 7268 // ], 7269 // "parameters": { 7270 // "commentId": { 7271 // "description": "The ID of the comment.", 7272 // "location": "path", 7273 // "required": true, 7274 // "type": "string" 7275 // }, 7276 // "fileId": { 7277 // "description": "The ID of the file.", 7278 // "location": "path", 7279 // "required": true, 7280 // "type": "string" 7281 // } 7282 // }, 7283 // "path": "files/{fileId}/comments/{commentId}", 7284 // "request": { 7285 // "$ref": "Comment" 7286 // }, 7287 // "response": { 7288 // "$ref": "Comment" 7289 // }, 7290 // "scopes": [ 7291 // "https://www.googleapis.com/auth/drive", 7292 // "https://www.googleapis.com/auth/drive.file" 7293 // ] 7294 // } 7295 7296} 7297 7298// method id "drive.drives.delete": 7299 7300type DrivesDeleteCall struct { 7301 s *Service 7302 driveId string 7303 urlParams_ gensupport.URLParams 7304 ctx_ context.Context 7305 header_ http.Header 7306} 7307 7308// Delete: Permanently deletes a shared drive for which the user is an 7309// organizer. The shared drive cannot contain any untrashed items. 7310// 7311// - driveId: The ID of the shared drive. 7312func (r *DrivesService) Delete(driveId string) *DrivesDeleteCall { 7313 c := &DrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7314 c.driveId = driveId 7315 return c 7316} 7317 7318// Fields allows partial responses to be retrieved. See 7319// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7320// for more information. 7321func (c *DrivesDeleteCall) Fields(s ...googleapi.Field) *DrivesDeleteCall { 7322 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7323 return c 7324} 7325 7326// Context sets the context to be used in this call's Do method. Any 7327// pending HTTP request will be aborted if the provided context is 7328// canceled. 7329func (c *DrivesDeleteCall) Context(ctx context.Context) *DrivesDeleteCall { 7330 c.ctx_ = ctx 7331 return c 7332} 7333 7334// Header returns an http.Header that can be modified by the caller to 7335// add HTTP headers to the request. 7336func (c *DrivesDeleteCall) Header() http.Header { 7337 if c.header_ == nil { 7338 c.header_ = make(http.Header) 7339 } 7340 return c.header_ 7341} 7342 7343func (c *DrivesDeleteCall) doRequest(alt string) (*http.Response, error) { 7344 reqHeaders := make(http.Header) 7345 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7346 for k, v := range c.header_ { 7347 reqHeaders[k] = v 7348 } 7349 reqHeaders.Set("User-Agent", c.s.userAgent()) 7350 var body io.Reader = nil 7351 c.urlParams_.Set("alt", alt) 7352 c.urlParams_.Set("prettyPrint", "false") 7353 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") 7354 urls += "?" + c.urlParams_.Encode() 7355 req, err := http.NewRequest("DELETE", urls, body) 7356 if err != nil { 7357 return nil, err 7358 } 7359 req.Header = reqHeaders 7360 googleapi.Expand(req.URL, map[string]string{ 7361 "driveId": c.driveId, 7362 }) 7363 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7364} 7365 7366// Do executes the "drive.drives.delete" call. 7367func (c *DrivesDeleteCall) Do(opts ...googleapi.CallOption) error { 7368 gensupport.SetOptions(c.urlParams_, opts...) 7369 res, err := c.doRequest("json") 7370 if err != nil { 7371 return err 7372 } 7373 defer googleapi.CloseBody(res) 7374 if err := googleapi.CheckResponse(res); err != nil { 7375 return err 7376 } 7377 return nil 7378 // { 7379 // "description": "Permanently deletes a shared drive for which the user is an organizer. The shared drive cannot contain any untrashed items.", 7380 // "httpMethod": "DELETE", 7381 // "id": "drive.drives.delete", 7382 // "parameterOrder": [ 7383 // "driveId" 7384 // ], 7385 // "parameters": { 7386 // "driveId": { 7387 // "description": "The ID of the shared drive.", 7388 // "location": "path", 7389 // "required": true, 7390 // "type": "string" 7391 // } 7392 // }, 7393 // "path": "drives/{driveId}", 7394 // "scopes": [ 7395 // "https://www.googleapis.com/auth/drive" 7396 // ] 7397 // } 7398 7399} 7400 7401// method id "drive.drives.get": 7402 7403type DrivesGetCall struct { 7404 s *Service 7405 driveId string 7406 urlParams_ gensupport.URLParams 7407 ifNoneMatch_ string 7408 ctx_ context.Context 7409 header_ http.Header 7410} 7411 7412// Get: Gets a shared drive's metadata by ID. 7413// 7414// - driveId: The ID of the shared drive. 7415func (r *DrivesService) Get(driveId string) *DrivesGetCall { 7416 c := &DrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7417 c.driveId = driveId 7418 return c 7419} 7420 7421// UseDomainAdminAccess sets the optional parameter 7422// "useDomainAdminAccess": Issue the request as a domain administrator; 7423// if set to true, then the requester will be granted access if they are 7424// an administrator of the domain to which the shared drive belongs. 7425func (c *DrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesGetCall { 7426 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 7427 return c 7428} 7429 7430// Fields allows partial responses to be retrieved. See 7431// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7432// for more information. 7433func (c *DrivesGetCall) Fields(s ...googleapi.Field) *DrivesGetCall { 7434 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7435 return c 7436} 7437 7438// IfNoneMatch sets the optional parameter which makes the operation 7439// fail if the object's ETag matches the given value. This is useful for 7440// getting updates only after the object has changed since the last 7441// request. Use googleapi.IsNotModified to check whether the response 7442// error from Do is the result of In-None-Match. 7443func (c *DrivesGetCall) IfNoneMatch(entityTag string) *DrivesGetCall { 7444 c.ifNoneMatch_ = entityTag 7445 return c 7446} 7447 7448// Context sets the context to be used in this call's Do method. Any 7449// pending HTTP request will be aborted if the provided context is 7450// canceled. 7451func (c *DrivesGetCall) Context(ctx context.Context) *DrivesGetCall { 7452 c.ctx_ = ctx 7453 return c 7454} 7455 7456// Header returns an http.Header that can be modified by the caller to 7457// add HTTP headers to the request. 7458func (c *DrivesGetCall) Header() http.Header { 7459 if c.header_ == nil { 7460 c.header_ = make(http.Header) 7461 } 7462 return c.header_ 7463} 7464 7465func (c *DrivesGetCall) doRequest(alt string) (*http.Response, error) { 7466 reqHeaders := make(http.Header) 7467 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7468 for k, v := range c.header_ { 7469 reqHeaders[k] = v 7470 } 7471 reqHeaders.Set("User-Agent", c.s.userAgent()) 7472 if c.ifNoneMatch_ != "" { 7473 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7474 } 7475 var body io.Reader = nil 7476 c.urlParams_.Set("alt", alt) 7477 c.urlParams_.Set("prettyPrint", "false") 7478 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") 7479 urls += "?" + c.urlParams_.Encode() 7480 req, err := http.NewRequest("GET", urls, body) 7481 if err != nil { 7482 return nil, err 7483 } 7484 req.Header = reqHeaders 7485 googleapi.Expand(req.URL, map[string]string{ 7486 "driveId": c.driveId, 7487 }) 7488 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7489} 7490 7491// Do executes the "drive.drives.get" call. 7492// Exactly one of *Drive or error will be non-nil. Any non-2xx status 7493// code is an error. Response headers are in either 7494// *Drive.ServerResponse.Header or (if a response was returned at all) 7495// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7496// check whether the returned error was because http.StatusNotModified 7497// was returned. 7498func (c *DrivesGetCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 7499 gensupport.SetOptions(c.urlParams_, opts...) 7500 res, err := c.doRequest("json") 7501 if res != nil && res.StatusCode == http.StatusNotModified { 7502 if res.Body != nil { 7503 res.Body.Close() 7504 } 7505 return nil, &googleapi.Error{ 7506 Code: res.StatusCode, 7507 Header: res.Header, 7508 } 7509 } 7510 if err != nil { 7511 return nil, err 7512 } 7513 defer googleapi.CloseBody(res) 7514 if err := googleapi.CheckResponse(res); err != nil { 7515 return nil, err 7516 } 7517 ret := &Drive{ 7518 ServerResponse: googleapi.ServerResponse{ 7519 Header: res.Header, 7520 HTTPStatusCode: res.StatusCode, 7521 }, 7522 } 7523 target := &ret 7524 if err := gensupport.DecodeResponse(target, res); err != nil { 7525 return nil, err 7526 } 7527 return ret, nil 7528 // { 7529 // "description": "Gets a shared drive's metadata by ID.", 7530 // "httpMethod": "GET", 7531 // "id": "drive.drives.get", 7532 // "parameterOrder": [ 7533 // "driveId" 7534 // ], 7535 // "parameters": { 7536 // "driveId": { 7537 // "description": "The ID of the shared drive.", 7538 // "location": "path", 7539 // "required": true, 7540 // "type": "string" 7541 // }, 7542 // "useDomainAdminAccess": { 7543 // "default": "false", 7544 // "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.", 7545 // "location": "query", 7546 // "type": "boolean" 7547 // } 7548 // }, 7549 // "path": "drives/{driveId}", 7550 // "response": { 7551 // "$ref": "Drive" 7552 // }, 7553 // "scopes": [ 7554 // "https://www.googleapis.com/auth/drive", 7555 // "https://www.googleapis.com/auth/drive.readonly" 7556 // ] 7557 // } 7558 7559} 7560 7561// method id "drive.drives.hide": 7562 7563type DrivesHideCall struct { 7564 s *Service 7565 driveId string 7566 urlParams_ gensupport.URLParams 7567 ctx_ context.Context 7568 header_ http.Header 7569} 7570 7571// Hide: Hides a shared drive from the default view. 7572// 7573// - driveId: The ID of the shared drive. 7574func (r *DrivesService) Hide(driveId string) *DrivesHideCall { 7575 c := &DrivesHideCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7576 c.driveId = driveId 7577 return c 7578} 7579 7580// Fields allows partial responses to be retrieved. See 7581// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7582// for more information. 7583func (c *DrivesHideCall) Fields(s ...googleapi.Field) *DrivesHideCall { 7584 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7585 return c 7586} 7587 7588// Context sets the context to be used in this call's Do method. Any 7589// pending HTTP request will be aborted if the provided context is 7590// canceled. 7591func (c *DrivesHideCall) Context(ctx context.Context) *DrivesHideCall { 7592 c.ctx_ = ctx 7593 return c 7594} 7595 7596// Header returns an http.Header that can be modified by the caller to 7597// add HTTP headers to the request. 7598func (c *DrivesHideCall) Header() http.Header { 7599 if c.header_ == nil { 7600 c.header_ = make(http.Header) 7601 } 7602 return c.header_ 7603} 7604 7605func (c *DrivesHideCall) doRequest(alt string) (*http.Response, error) { 7606 reqHeaders := make(http.Header) 7607 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7608 for k, v := range c.header_ { 7609 reqHeaders[k] = v 7610 } 7611 reqHeaders.Set("User-Agent", c.s.userAgent()) 7612 var body io.Reader = nil 7613 c.urlParams_.Set("alt", alt) 7614 c.urlParams_.Set("prettyPrint", "false") 7615 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/hide") 7616 urls += "?" + c.urlParams_.Encode() 7617 req, err := http.NewRequest("POST", urls, body) 7618 if err != nil { 7619 return nil, err 7620 } 7621 req.Header = reqHeaders 7622 googleapi.Expand(req.URL, map[string]string{ 7623 "driveId": c.driveId, 7624 }) 7625 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7626} 7627 7628// Do executes the "drive.drives.hide" call. 7629// Exactly one of *Drive or error will be non-nil. Any non-2xx status 7630// code is an error. Response headers are in either 7631// *Drive.ServerResponse.Header or (if a response was returned at all) 7632// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7633// check whether the returned error was because http.StatusNotModified 7634// was returned. 7635func (c *DrivesHideCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 7636 gensupport.SetOptions(c.urlParams_, opts...) 7637 res, err := c.doRequest("json") 7638 if res != nil && res.StatusCode == http.StatusNotModified { 7639 if res.Body != nil { 7640 res.Body.Close() 7641 } 7642 return nil, &googleapi.Error{ 7643 Code: res.StatusCode, 7644 Header: res.Header, 7645 } 7646 } 7647 if err != nil { 7648 return nil, err 7649 } 7650 defer googleapi.CloseBody(res) 7651 if err := googleapi.CheckResponse(res); err != nil { 7652 return nil, err 7653 } 7654 ret := &Drive{ 7655 ServerResponse: googleapi.ServerResponse{ 7656 Header: res.Header, 7657 HTTPStatusCode: res.StatusCode, 7658 }, 7659 } 7660 target := &ret 7661 if err := gensupport.DecodeResponse(target, res); err != nil { 7662 return nil, err 7663 } 7664 return ret, nil 7665 // { 7666 // "description": "Hides a shared drive from the default view.", 7667 // "httpMethod": "POST", 7668 // "id": "drive.drives.hide", 7669 // "parameterOrder": [ 7670 // "driveId" 7671 // ], 7672 // "parameters": { 7673 // "driveId": { 7674 // "description": "The ID of the shared drive.", 7675 // "location": "path", 7676 // "required": true, 7677 // "type": "string" 7678 // } 7679 // }, 7680 // "path": "drives/{driveId}/hide", 7681 // "response": { 7682 // "$ref": "Drive" 7683 // }, 7684 // "scopes": [ 7685 // "https://www.googleapis.com/auth/drive" 7686 // ] 7687 // } 7688 7689} 7690 7691// method id "drive.drives.insert": 7692 7693type DrivesInsertCall struct { 7694 s *Service 7695 drive *Drive 7696 urlParams_ gensupport.URLParams 7697 ctx_ context.Context 7698 header_ http.Header 7699} 7700 7701// Insert: Creates a new shared drive. 7702// 7703// - requestId: An ID, such as a random UUID, which uniquely identifies 7704// this user's request for idempotent creation of a shared drive. A 7705// repeated request by the same user and with the same request ID will 7706// avoid creating duplicates by attempting to create the same shared 7707// drive. If the shared drive already exists a 409 error will be 7708// returned. 7709func (r *DrivesService) Insert(requestId string, drive *Drive) *DrivesInsertCall { 7710 c := &DrivesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7711 c.urlParams_.Set("requestId", requestId) 7712 c.drive = drive 7713 return c 7714} 7715 7716// Fields allows partial responses to be retrieved. See 7717// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7718// for more information. 7719func (c *DrivesInsertCall) Fields(s ...googleapi.Field) *DrivesInsertCall { 7720 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7721 return c 7722} 7723 7724// Context sets the context to be used in this call's Do method. Any 7725// pending HTTP request will be aborted if the provided context is 7726// canceled. 7727func (c *DrivesInsertCall) Context(ctx context.Context) *DrivesInsertCall { 7728 c.ctx_ = ctx 7729 return c 7730} 7731 7732// Header returns an http.Header that can be modified by the caller to 7733// add HTTP headers to the request. 7734func (c *DrivesInsertCall) Header() http.Header { 7735 if c.header_ == nil { 7736 c.header_ = make(http.Header) 7737 } 7738 return c.header_ 7739} 7740 7741func (c *DrivesInsertCall) doRequest(alt string) (*http.Response, error) { 7742 reqHeaders := make(http.Header) 7743 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7744 for k, v := range c.header_ { 7745 reqHeaders[k] = v 7746 } 7747 reqHeaders.Set("User-Agent", c.s.userAgent()) 7748 var body io.Reader = nil 7749 body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive) 7750 if err != nil { 7751 return nil, err 7752 } 7753 reqHeaders.Set("Content-Type", "application/json") 7754 c.urlParams_.Set("alt", alt) 7755 c.urlParams_.Set("prettyPrint", "false") 7756 urls := googleapi.ResolveRelative(c.s.BasePath, "drives") 7757 urls += "?" + c.urlParams_.Encode() 7758 req, err := http.NewRequest("POST", urls, body) 7759 if err != nil { 7760 return nil, err 7761 } 7762 req.Header = reqHeaders 7763 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7764} 7765 7766// Do executes the "drive.drives.insert" call. 7767// Exactly one of *Drive or error will be non-nil. Any non-2xx status 7768// code is an error. Response headers are in either 7769// *Drive.ServerResponse.Header or (if a response was returned at all) 7770// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7771// check whether the returned error was because http.StatusNotModified 7772// was returned. 7773func (c *DrivesInsertCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 7774 gensupport.SetOptions(c.urlParams_, opts...) 7775 res, err := c.doRequest("json") 7776 if res != nil && res.StatusCode == http.StatusNotModified { 7777 if res.Body != nil { 7778 res.Body.Close() 7779 } 7780 return nil, &googleapi.Error{ 7781 Code: res.StatusCode, 7782 Header: res.Header, 7783 } 7784 } 7785 if err != nil { 7786 return nil, err 7787 } 7788 defer googleapi.CloseBody(res) 7789 if err := googleapi.CheckResponse(res); err != nil { 7790 return nil, err 7791 } 7792 ret := &Drive{ 7793 ServerResponse: googleapi.ServerResponse{ 7794 Header: res.Header, 7795 HTTPStatusCode: res.StatusCode, 7796 }, 7797 } 7798 target := &ret 7799 if err := gensupport.DecodeResponse(target, res); err != nil { 7800 return nil, err 7801 } 7802 return ret, nil 7803 // { 7804 // "description": "Creates a new shared drive.", 7805 // "httpMethod": "POST", 7806 // "id": "drive.drives.insert", 7807 // "parameterOrder": [ 7808 // "requestId" 7809 // ], 7810 // "parameters": { 7811 // "requestId": { 7812 // "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.", 7813 // "location": "query", 7814 // "required": true, 7815 // "type": "string" 7816 // } 7817 // }, 7818 // "path": "drives", 7819 // "request": { 7820 // "$ref": "Drive" 7821 // }, 7822 // "response": { 7823 // "$ref": "Drive" 7824 // }, 7825 // "scopes": [ 7826 // "https://www.googleapis.com/auth/drive" 7827 // ] 7828 // } 7829 7830} 7831 7832// method id "drive.drives.list": 7833 7834type DrivesListCall struct { 7835 s *Service 7836 urlParams_ gensupport.URLParams 7837 ifNoneMatch_ string 7838 ctx_ context.Context 7839 header_ http.Header 7840} 7841 7842// List: Lists the user's shared drives. 7843func (r *DrivesService) List() *DrivesListCall { 7844 c := &DrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7845 return c 7846} 7847 7848// MaxResults sets the optional parameter "maxResults": Maximum number 7849// of shared drives to return. 7850func (c *DrivesListCall) MaxResults(maxResults int64) *DrivesListCall { 7851 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 7852 return c 7853} 7854 7855// PageToken sets the optional parameter "pageToken": Page token for 7856// shared drives. 7857func (c *DrivesListCall) PageToken(pageToken string) *DrivesListCall { 7858 c.urlParams_.Set("pageToken", pageToken) 7859 return c 7860} 7861 7862// Q sets the optional parameter "q": Query string for searching shared 7863// drives. 7864func (c *DrivesListCall) Q(q string) *DrivesListCall { 7865 c.urlParams_.Set("q", q) 7866 return c 7867} 7868 7869// UseDomainAdminAccess sets the optional parameter 7870// "useDomainAdminAccess": Issue the request as a domain administrator; 7871// if set to true, then all shared drives of the domain in which the 7872// requester is an administrator are returned. 7873func (c *DrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesListCall { 7874 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 7875 return c 7876} 7877 7878// Fields allows partial responses to be retrieved. See 7879// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7880// for more information. 7881func (c *DrivesListCall) Fields(s ...googleapi.Field) *DrivesListCall { 7882 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7883 return c 7884} 7885 7886// IfNoneMatch sets the optional parameter which makes the operation 7887// fail if the object's ETag matches the given value. This is useful for 7888// getting updates only after the object has changed since the last 7889// request. Use googleapi.IsNotModified to check whether the response 7890// error from Do is the result of In-None-Match. 7891func (c *DrivesListCall) IfNoneMatch(entityTag string) *DrivesListCall { 7892 c.ifNoneMatch_ = entityTag 7893 return c 7894} 7895 7896// Context sets the context to be used in this call's Do method. Any 7897// pending HTTP request will be aborted if the provided context is 7898// canceled. 7899func (c *DrivesListCall) Context(ctx context.Context) *DrivesListCall { 7900 c.ctx_ = ctx 7901 return c 7902} 7903 7904// Header returns an http.Header that can be modified by the caller to 7905// add HTTP headers to the request. 7906func (c *DrivesListCall) Header() http.Header { 7907 if c.header_ == nil { 7908 c.header_ = make(http.Header) 7909 } 7910 return c.header_ 7911} 7912 7913func (c *DrivesListCall) doRequest(alt string) (*http.Response, error) { 7914 reqHeaders := make(http.Header) 7915 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 7916 for k, v := range c.header_ { 7917 reqHeaders[k] = v 7918 } 7919 reqHeaders.Set("User-Agent", c.s.userAgent()) 7920 if c.ifNoneMatch_ != "" { 7921 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7922 } 7923 var body io.Reader = nil 7924 c.urlParams_.Set("alt", alt) 7925 c.urlParams_.Set("prettyPrint", "false") 7926 urls := googleapi.ResolveRelative(c.s.BasePath, "drives") 7927 urls += "?" + c.urlParams_.Encode() 7928 req, err := http.NewRequest("GET", urls, body) 7929 if err != nil { 7930 return nil, err 7931 } 7932 req.Header = reqHeaders 7933 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7934} 7935 7936// Do executes the "drive.drives.list" call. 7937// Exactly one of *DriveList or error will be non-nil. Any non-2xx 7938// status code is an error. Response headers are in either 7939// *DriveList.ServerResponse.Header or (if a response was returned at 7940// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7941// to check whether the returned error was because 7942// http.StatusNotModified was returned. 7943func (c *DrivesListCall) Do(opts ...googleapi.CallOption) (*DriveList, error) { 7944 gensupport.SetOptions(c.urlParams_, opts...) 7945 res, err := c.doRequest("json") 7946 if res != nil && res.StatusCode == http.StatusNotModified { 7947 if res.Body != nil { 7948 res.Body.Close() 7949 } 7950 return nil, &googleapi.Error{ 7951 Code: res.StatusCode, 7952 Header: res.Header, 7953 } 7954 } 7955 if err != nil { 7956 return nil, err 7957 } 7958 defer googleapi.CloseBody(res) 7959 if err := googleapi.CheckResponse(res); err != nil { 7960 return nil, err 7961 } 7962 ret := &DriveList{ 7963 ServerResponse: googleapi.ServerResponse{ 7964 Header: res.Header, 7965 HTTPStatusCode: res.StatusCode, 7966 }, 7967 } 7968 target := &ret 7969 if err := gensupport.DecodeResponse(target, res); err != nil { 7970 return nil, err 7971 } 7972 return ret, nil 7973 // { 7974 // "description": "Lists the user's shared drives.", 7975 // "httpMethod": "GET", 7976 // "id": "drive.drives.list", 7977 // "parameters": { 7978 // "maxResults": { 7979 // "default": "10", 7980 // "description": "Maximum number of shared drives to return.", 7981 // "format": "int32", 7982 // "location": "query", 7983 // "maximum": "100", 7984 // "minimum": "1", 7985 // "type": "integer" 7986 // }, 7987 // "pageToken": { 7988 // "description": "Page token for shared drives.", 7989 // "location": "query", 7990 // "type": "string" 7991 // }, 7992 // "q": { 7993 // "description": "Query string for searching shared drives.", 7994 // "location": "query", 7995 // "type": "string" 7996 // }, 7997 // "useDomainAdminAccess": { 7998 // "default": "false", 7999 // "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.", 8000 // "location": "query", 8001 // "type": "boolean" 8002 // } 8003 // }, 8004 // "path": "drives", 8005 // "response": { 8006 // "$ref": "DriveList" 8007 // }, 8008 // "scopes": [ 8009 // "https://www.googleapis.com/auth/drive", 8010 // "https://www.googleapis.com/auth/drive.readonly" 8011 // ] 8012 // } 8013 8014} 8015 8016// Pages invokes f for each page of results. 8017// A non-nil error returned from f will halt the iteration. 8018// The provided context supersedes any context provided to the Context method. 8019func (c *DrivesListCall) Pages(ctx context.Context, f func(*DriveList) error) error { 8020 c.ctx_ = ctx 8021 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8022 for { 8023 x, err := c.Do() 8024 if err != nil { 8025 return err 8026 } 8027 if err := f(x); err != nil { 8028 return err 8029 } 8030 if x.NextPageToken == "" { 8031 return nil 8032 } 8033 c.PageToken(x.NextPageToken) 8034 } 8035} 8036 8037// method id "drive.drives.unhide": 8038 8039type DrivesUnhideCall struct { 8040 s *Service 8041 driveId string 8042 urlParams_ gensupport.URLParams 8043 ctx_ context.Context 8044 header_ http.Header 8045} 8046 8047// Unhide: Restores a shared drive to the default view. 8048// 8049// - driveId: The ID of the shared drive. 8050func (r *DrivesService) Unhide(driveId string) *DrivesUnhideCall { 8051 c := &DrivesUnhideCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8052 c.driveId = driveId 8053 return c 8054} 8055 8056// Fields allows partial responses to be retrieved. See 8057// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8058// for more information. 8059func (c *DrivesUnhideCall) Fields(s ...googleapi.Field) *DrivesUnhideCall { 8060 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8061 return c 8062} 8063 8064// Context sets the context to be used in this call's Do method. Any 8065// pending HTTP request will be aborted if the provided context is 8066// canceled. 8067func (c *DrivesUnhideCall) Context(ctx context.Context) *DrivesUnhideCall { 8068 c.ctx_ = ctx 8069 return c 8070} 8071 8072// Header returns an http.Header that can be modified by the caller to 8073// add HTTP headers to the request. 8074func (c *DrivesUnhideCall) Header() http.Header { 8075 if c.header_ == nil { 8076 c.header_ = make(http.Header) 8077 } 8078 return c.header_ 8079} 8080 8081func (c *DrivesUnhideCall) doRequest(alt string) (*http.Response, error) { 8082 reqHeaders := make(http.Header) 8083 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8084 for k, v := range c.header_ { 8085 reqHeaders[k] = v 8086 } 8087 reqHeaders.Set("User-Agent", c.s.userAgent()) 8088 var body io.Reader = nil 8089 c.urlParams_.Set("alt", alt) 8090 c.urlParams_.Set("prettyPrint", "false") 8091 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}/unhide") 8092 urls += "?" + c.urlParams_.Encode() 8093 req, err := http.NewRequest("POST", urls, body) 8094 if err != nil { 8095 return nil, err 8096 } 8097 req.Header = reqHeaders 8098 googleapi.Expand(req.URL, map[string]string{ 8099 "driveId": c.driveId, 8100 }) 8101 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8102} 8103 8104// Do executes the "drive.drives.unhide" call. 8105// Exactly one of *Drive or error will be non-nil. Any non-2xx status 8106// code is an error. Response headers are in either 8107// *Drive.ServerResponse.Header or (if a response was returned at all) 8108// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8109// check whether the returned error was because http.StatusNotModified 8110// was returned. 8111func (c *DrivesUnhideCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 8112 gensupport.SetOptions(c.urlParams_, opts...) 8113 res, err := c.doRequest("json") 8114 if res != nil && res.StatusCode == http.StatusNotModified { 8115 if res.Body != nil { 8116 res.Body.Close() 8117 } 8118 return nil, &googleapi.Error{ 8119 Code: res.StatusCode, 8120 Header: res.Header, 8121 } 8122 } 8123 if err != nil { 8124 return nil, err 8125 } 8126 defer googleapi.CloseBody(res) 8127 if err := googleapi.CheckResponse(res); err != nil { 8128 return nil, err 8129 } 8130 ret := &Drive{ 8131 ServerResponse: googleapi.ServerResponse{ 8132 Header: res.Header, 8133 HTTPStatusCode: res.StatusCode, 8134 }, 8135 } 8136 target := &ret 8137 if err := gensupport.DecodeResponse(target, res); err != nil { 8138 return nil, err 8139 } 8140 return ret, nil 8141 // { 8142 // "description": "Restores a shared drive to the default view.", 8143 // "httpMethod": "POST", 8144 // "id": "drive.drives.unhide", 8145 // "parameterOrder": [ 8146 // "driveId" 8147 // ], 8148 // "parameters": { 8149 // "driveId": { 8150 // "description": "The ID of the shared drive.", 8151 // "location": "path", 8152 // "required": true, 8153 // "type": "string" 8154 // } 8155 // }, 8156 // "path": "drives/{driveId}/unhide", 8157 // "response": { 8158 // "$ref": "Drive" 8159 // }, 8160 // "scopes": [ 8161 // "https://www.googleapis.com/auth/drive" 8162 // ] 8163 // } 8164 8165} 8166 8167// method id "drive.drives.update": 8168 8169type DrivesUpdateCall struct { 8170 s *Service 8171 driveId string 8172 drive *Drive 8173 urlParams_ gensupport.URLParams 8174 ctx_ context.Context 8175 header_ http.Header 8176} 8177 8178// Update: Updates the metadata for a shared drive. 8179// 8180// - driveId: The ID of the shared drive. 8181func (r *DrivesService) Update(driveId string, drive *Drive) *DrivesUpdateCall { 8182 c := &DrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8183 c.driveId = driveId 8184 c.drive = drive 8185 return c 8186} 8187 8188// UseDomainAdminAccess sets the optional parameter 8189// "useDomainAdminAccess": Issue the request as a domain administrator; 8190// if set to true, then the requester will be granted access if they are 8191// an administrator of the domain to which the shared drive belongs. 8192func (c *DrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *DrivesUpdateCall { 8193 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 8194 return c 8195} 8196 8197// Fields allows partial responses to be retrieved. See 8198// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8199// for more information. 8200func (c *DrivesUpdateCall) Fields(s ...googleapi.Field) *DrivesUpdateCall { 8201 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8202 return c 8203} 8204 8205// Context sets the context to be used in this call's Do method. Any 8206// pending HTTP request will be aborted if the provided context is 8207// canceled. 8208func (c *DrivesUpdateCall) Context(ctx context.Context) *DrivesUpdateCall { 8209 c.ctx_ = ctx 8210 return c 8211} 8212 8213// Header returns an http.Header that can be modified by the caller to 8214// add HTTP headers to the request. 8215func (c *DrivesUpdateCall) Header() http.Header { 8216 if c.header_ == nil { 8217 c.header_ = make(http.Header) 8218 } 8219 return c.header_ 8220} 8221 8222func (c *DrivesUpdateCall) doRequest(alt string) (*http.Response, error) { 8223 reqHeaders := make(http.Header) 8224 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8225 for k, v := range c.header_ { 8226 reqHeaders[k] = v 8227 } 8228 reqHeaders.Set("User-Agent", c.s.userAgent()) 8229 var body io.Reader = nil 8230 body, err := googleapi.WithoutDataWrapper.JSONReader(c.drive) 8231 if err != nil { 8232 return nil, err 8233 } 8234 reqHeaders.Set("Content-Type", "application/json") 8235 c.urlParams_.Set("alt", alt) 8236 c.urlParams_.Set("prettyPrint", "false") 8237 urls := googleapi.ResolveRelative(c.s.BasePath, "drives/{driveId}") 8238 urls += "?" + c.urlParams_.Encode() 8239 req, err := http.NewRequest("PUT", urls, body) 8240 if err != nil { 8241 return nil, err 8242 } 8243 req.Header = reqHeaders 8244 googleapi.Expand(req.URL, map[string]string{ 8245 "driveId": c.driveId, 8246 }) 8247 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8248} 8249 8250// Do executes the "drive.drives.update" call. 8251// Exactly one of *Drive or error will be non-nil. Any non-2xx status 8252// code is an error. Response headers are in either 8253// *Drive.ServerResponse.Header or (if a response was returned at all) 8254// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8255// check whether the returned error was because http.StatusNotModified 8256// was returned. 8257func (c *DrivesUpdateCall) Do(opts ...googleapi.CallOption) (*Drive, error) { 8258 gensupport.SetOptions(c.urlParams_, opts...) 8259 res, err := c.doRequest("json") 8260 if res != nil && res.StatusCode == http.StatusNotModified { 8261 if res.Body != nil { 8262 res.Body.Close() 8263 } 8264 return nil, &googleapi.Error{ 8265 Code: res.StatusCode, 8266 Header: res.Header, 8267 } 8268 } 8269 if err != nil { 8270 return nil, err 8271 } 8272 defer googleapi.CloseBody(res) 8273 if err := googleapi.CheckResponse(res); err != nil { 8274 return nil, err 8275 } 8276 ret := &Drive{ 8277 ServerResponse: googleapi.ServerResponse{ 8278 Header: res.Header, 8279 HTTPStatusCode: res.StatusCode, 8280 }, 8281 } 8282 target := &ret 8283 if err := gensupport.DecodeResponse(target, res); err != nil { 8284 return nil, err 8285 } 8286 return ret, nil 8287 // { 8288 // "description": "Updates the metadata for a shared drive.", 8289 // "httpMethod": "PUT", 8290 // "id": "drive.drives.update", 8291 // "parameterOrder": [ 8292 // "driveId" 8293 // ], 8294 // "parameters": { 8295 // "driveId": { 8296 // "description": "The ID of the shared drive.", 8297 // "location": "path", 8298 // "required": true, 8299 // "type": "string" 8300 // }, 8301 // "useDomainAdminAccess": { 8302 // "default": "false", 8303 // "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.", 8304 // "location": "query", 8305 // "type": "boolean" 8306 // } 8307 // }, 8308 // "path": "drives/{driveId}", 8309 // "request": { 8310 // "$ref": "Drive" 8311 // }, 8312 // "response": { 8313 // "$ref": "Drive" 8314 // }, 8315 // "scopes": [ 8316 // "https://www.googleapis.com/auth/drive" 8317 // ] 8318 // } 8319 8320} 8321 8322// method id "drive.files.copy": 8323 8324type FilesCopyCall struct { 8325 s *Service 8326 fileId string 8327 file *File 8328 urlParams_ gensupport.URLParams 8329 ctx_ context.Context 8330 header_ http.Header 8331} 8332 8333// Copy: Creates a copy of the specified file. Folders cannot be copied. 8334// 8335// - fileId: The ID of the file to copy. 8336func (r *FilesService) Copy(fileId string, file *File) *FilesCopyCall { 8337 c := &FilesCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8338 c.fileId = fileId 8339 c.file = file 8340 return c 8341} 8342 8343// Convert sets the optional parameter "convert": Whether to convert 8344// this file to the corresponding Docs Editors format. 8345func (c *FilesCopyCall) Convert(convert bool) *FilesCopyCall { 8346 c.urlParams_.Set("convert", fmt.Sprint(convert)) 8347 return c 8348} 8349 8350// EnforceSingleParent sets the optional parameter 8351// "enforceSingleParent": Deprecated. Copying files into multiple 8352// folders is no longer supported. Use shortcuts instead. 8353func (c *FilesCopyCall) EnforceSingleParent(enforceSingleParent bool) *FilesCopyCall { 8354 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 8355 return c 8356} 8357 8358// IncludePermissionsForView sets the optional parameter 8359// "includePermissionsForView": Specifies which additional view's 8360// permissions to include in the response. Only 'published' is 8361// supported. 8362func (c *FilesCopyCall) IncludePermissionsForView(includePermissionsForView string) *FilesCopyCall { 8363 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 8364 return c 8365} 8366 8367// Ocr sets the optional parameter "ocr": Whether to attempt OCR on 8368// .jpg, .png, .gif, or .pdf uploads. 8369func (c *FilesCopyCall) Ocr(ocr bool) *FilesCopyCall { 8370 c.urlParams_.Set("ocr", fmt.Sprint(ocr)) 8371 return c 8372} 8373 8374// OcrLanguage sets the optional parameter "ocrLanguage": If ocr is 8375// true, hints at the language to use. Valid values are BCP 47 codes. 8376func (c *FilesCopyCall) OcrLanguage(ocrLanguage string) *FilesCopyCall { 8377 c.urlParams_.Set("ocrLanguage", ocrLanguage) 8378 return c 8379} 8380 8381// Pinned sets the optional parameter "pinned": Whether to pin the head 8382// revision of the new copy. A file can have a maximum of 200 pinned 8383// revisions. 8384func (c *FilesCopyCall) Pinned(pinned bool) *FilesCopyCall { 8385 c.urlParams_.Set("pinned", fmt.Sprint(pinned)) 8386 return c 8387} 8388 8389// SupportsAllDrives sets the optional parameter "supportsAllDrives": 8390// Whether the requesting application supports both My Drives and shared 8391// drives. 8392func (c *FilesCopyCall) SupportsAllDrives(supportsAllDrives bool) *FilesCopyCall { 8393 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 8394 return c 8395} 8396 8397// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 8398// Deprecated use supportsAllDrives instead. 8399func (c *FilesCopyCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesCopyCall { 8400 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 8401 return c 8402} 8403 8404// TimedTextLanguage sets the optional parameter "timedTextLanguage": 8405// The language of the timed text. 8406func (c *FilesCopyCall) TimedTextLanguage(timedTextLanguage string) *FilesCopyCall { 8407 c.urlParams_.Set("timedTextLanguage", timedTextLanguage) 8408 return c 8409} 8410 8411// TimedTextTrackName sets the optional parameter "timedTextTrackName": 8412// The timed text track name. 8413func (c *FilesCopyCall) TimedTextTrackName(timedTextTrackName string) *FilesCopyCall { 8414 c.urlParams_.Set("timedTextTrackName", timedTextTrackName) 8415 return c 8416} 8417 8418// Visibility sets the optional parameter "visibility": The visibility 8419// of the new file. This parameter is only relevant when the source is 8420// not a native Google Doc and convert=false. 8421// 8422// Possible values: 8423// "DEFAULT" (default) - The visibility of the new file is determined 8424// by the user's default visibility/sharing policies. 8425// "PRIVATE" - The new file will be visible to only the owner. 8426func (c *FilesCopyCall) Visibility(visibility string) *FilesCopyCall { 8427 c.urlParams_.Set("visibility", visibility) 8428 return c 8429} 8430 8431// Fields allows partial responses to be retrieved. See 8432// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8433// for more information. 8434func (c *FilesCopyCall) Fields(s ...googleapi.Field) *FilesCopyCall { 8435 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8436 return c 8437} 8438 8439// Context sets the context to be used in this call's Do method. Any 8440// pending HTTP request will be aborted if the provided context is 8441// canceled. 8442func (c *FilesCopyCall) Context(ctx context.Context) *FilesCopyCall { 8443 c.ctx_ = ctx 8444 return c 8445} 8446 8447// Header returns an http.Header that can be modified by the caller to 8448// add HTTP headers to the request. 8449func (c *FilesCopyCall) Header() http.Header { 8450 if c.header_ == nil { 8451 c.header_ = make(http.Header) 8452 } 8453 return c.header_ 8454} 8455 8456func (c *FilesCopyCall) doRequest(alt string) (*http.Response, error) { 8457 reqHeaders := make(http.Header) 8458 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8459 for k, v := range c.header_ { 8460 reqHeaders[k] = v 8461 } 8462 reqHeaders.Set("User-Agent", c.s.userAgent()) 8463 var body io.Reader = nil 8464 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 8465 if err != nil { 8466 return nil, err 8467 } 8468 reqHeaders.Set("Content-Type", "application/json") 8469 c.urlParams_.Set("alt", alt) 8470 c.urlParams_.Set("prettyPrint", "false") 8471 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/copy") 8472 urls += "?" + c.urlParams_.Encode() 8473 req, err := http.NewRequest("POST", urls, body) 8474 if err != nil { 8475 return nil, err 8476 } 8477 req.Header = reqHeaders 8478 googleapi.Expand(req.URL, map[string]string{ 8479 "fileId": c.fileId, 8480 }) 8481 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8482} 8483 8484// Do executes the "drive.files.copy" call. 8485// Exactly one of *File or error will be non-nil. Any non-2xx status 8486// code is an error. Response headers are in either 8487// *File.ServerResponse.Header or (if a response was returned at all) in 8488// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 8489// whether the returned error was because http.StatusNotModified was 8490// returned. 8491func (c *FilesCopyCall) Do(opts ...googleapi.CallOption) (*File, error) { 8492 gensupport.SetOptions(c.urlParams_, opts...) 8493 res, err := c.doRequest("json") 8494 if res != nil && res.StatusCode == http.StatusNotModified { 8495 if res.Body != nil { 8496 res.Body.Close() 8497 } 8498 return nil, &googleapi.Error{ 8499 Code: res.StatusCode, 8500 Header: res.Header, 8501 } 8502 } 8503 if err != nil { 8504 return nil, err 8505 } 8506 defer googleapi.CloseBody(res) 8507 if err := googleapi.CheckResponse(res); err != nil { 8508 return nil, err 8509 } 8510 ret := &File{ 8511 ServerResponse: googleapi.ServerResponse{ 8512 Header: res.Header, 8513 HTTPStatusCode: res.StatusCode, 8514 }, 8515 } 8516 target := &ret 8517 if err := gensupport.DecodeResponse(target, res); err != nil { 8518 return nil, err 8519 } 8520 return ret, nil 8521 // { 8522 // "description": "Creates a copy of the specified file. Folders cannot be copied.", 8523 // "httpMethod": "POST", 8524 // "id": "drive.files.copy", 8525 // "parameterOrder": [ 8526 // "fileId" 8527 // ], 8528 // "parameters": { 8529 // "convert": { 8530 // "default": "false", 8531 // "description": "Whether to convert this file to the corresponding Docs Editors format.", 8532 // "location": "query", 8533 // "type": "boolean" 8534 // }, 8535 // "enforceSingleParent": { 8536 // "default": "false", 8537 // "description": "Deprecated. Copying files into multiple folders is no longer supported. Use shortcuts instead.", 8538 // "location": "query", 8539 // "type": "boolean" 8540 // }, 8541 // "fileId": { 8542 // "description": "The ID of the file to copy.", 8543 // "location": "path", 8544 // "required": true, 8545 // "type": "string" 8546 // }, 8547 // "includePermissionsForView": { 8548 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 8549 // "location": "query", 8550 // "type": "string" 8551 // }, 8552 // "ocr": { 8553 // "default": "false", 8554 // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", 8555 // "location": "query", 8556 // "type": "boolean" 8557 // }, 8558 // "ocrLanguage": { 8559 // "description": "If ocr is true, hints at the language to use. Valid values are BCP 47 codes.", 8560 // "location": "query", 8561 // "type": "string" 8562 // }, 8563 // "pinned": { 8564 // "default": "false", 8565 // "description": "Whether to pin the head revision of the new copy. A file can have a maximum of 200 pinned revisions.", 8566 // "location": "query", 8567 // "type": "boolean" 8568 // }, 8569 // "supportsAllDrives": { 8570 // "default": "false", 8571 // "description": "Whether the requesting application supports both My Drives and shared drives.", 8572 // "location": "query", 8573 // "type": "boolean" 8574 // }, 8575 // "supportsTeamDrives": { 8576 // "default": "false", 8577 // "description": "Deprecated use supportsAllDrives instead.", 8578 // "location": "query", 8579 // "type": "boolean" 8580 // }, 8581 // "timedTextLanguage": { 8582 // "description": "The language of the timed text.", 8583 // "location": "query", 8584 // "type": "string" 8585 // }, 8586 // "timedTextTrackName": { 8587 // "description": "The timed text track name.", 8588 // "location": "query", 8589 // "type": "string" 8590 // }, 8591 // "visibility": { 8592 // "default": "DEFAULT", 8593 // "description": "The visibility of the new file. This parameter is only relevant when the source is not a native Google Doc and convert=false.", 8594 // "enum": [ 8595 // "DEFAULT", 8596 // "PRIVATE" 8597 // ], 8598 // "enumDescriptions": [ 8599 // "The visibility of the new file is determined by the user's default visibility/sharing policies.", 8600 // "The new file will be visible to only the owner." 8601 // ], 8602 // "location": "query", 8603 // "type": "string" 8604 // } 8605 // }, 8606 // "path": "files/{fileId}/copy", 8607 // "request": { 8608 // "$ref": "File" 8609 // }, 8610 // "response": { 8611 // "$ref": "File" 8612 // }, 8613 // "scopes": [ 8614 // "https://www.googleapis.com/auth/drive", 8615 // "https://www.googleapis.com/auth/drive.appdata", 8616 // "https://www.googleapis.com/auth/drive.apps.readonly", 8617 // "https://www.googleapis.com/auth/drive.file", 8618 // "https://www.googleapis.com/auth/drive.photos.readonly" 8619 // ] 8620 // } 8621 8622} 8623 8624// method id "drive.files.delete": 8625 8626type FilesDeleteCall struct { 8627 s *Service 8628 fileId string 8629 urlParams_ gensupport.URLParams 8630 ctx_ context.Context 8631 header_ http.Header 8632} 8633 8634// Delete: Permanently deletes a file by ID. Skips the trash. The 8635// currently authenticated user must own the file or be an organizer on 8636// the parent for shared drive files. 8637// 8638// - fileId: The ID of the file to delete. 8639func (r *FilesService) Delete(fileId string) *FilesDeleteCall { 8640 c := &FilesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8641 c.fileId = fileId 8642 return c 8643} 8644 8645// EnforceSingleParent sets the optional parameter 8646// "enforceSingleParent": Deprecated. If an item is not in a shared 8647// drive and its last parent is deleted but the item itself is not, the 8648// item will be placed under its owner's root. 8649func (c *FilesDeleteCall) EnforceSingleParent(enforceSingleParent bool) *FilesDeleteCall { 8650 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 8651 return c 8652} 8653 8654// SupportsAllDrives sets the optional parameter "supportsAllDrives": 8655// Whether the requesting application supports both My Drives and shared 8656// drives. 8657func (c *FilesDeleteCall) SupportsAllDrives(supportsAllDrives bool) *FilesDeleteCall { 8658 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 8659 return c 8660} 8661 8662// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 8663// Deprecated use supportsAllDrives instead. 8664func (c *FilesDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesDeleteCall { 8665 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 8666 return c 8667} 8668 8669// Fields allows partial responses to be retrieved. See 8670// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8671// for more information. 8672func (c *FilesDeleteCall) Fields(s ...googleapi.Field) *FilesDeleteCall { 8673 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8674 return c 8675} 8676 8677// Context sets the context to be used in this call's Do method. Any 8678// pending HTTP request will be aborted if the provided context is 8679// canceled. 8680func (c *FilesDeleteCall) Context(ctx context.Context) *FilesDeleteCall { 8681 c.ctx_ = ctx 8682 return c 8683} 8684 8685// Header returns an http.Header that can be modified by the caller to 8686// add HTTP headers to the request. 8687func (c *FilesDeleteCall) Header() http.Header { 8688 if c.header_ == nil { 8689 c.header_ = make(http.Header) 8690 } 8691 return c.header_ 8692} 8693 8694func (c *FilesDeleteCall) doRequest(alt string) (*http.Response, error) { 8695 reqHeaders := make(http.Header) 8696 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8697 for k, v := range c.header_ { 8698 reqHeaders[k] = v 8699 } 8700 reqHeaders.Set("User-Agent", c.s.userAgent()) 8701 var body io.Reader = nil 8702 c.urlParams_.Set("alt", alt) 8703 c.urlParams_.Set("prettyPrint", "false") 8704 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") 8705 urls += "?" + c.urlParams_.Encode() 8706 req, err := http.NewRequest("DELETE", urls, body) 8707 if err != nil { 8708 return nil, err 8709 } 8710 req.Header = reqHeaders 8711 googleapi.Expand(req.URL, map[string]string{ 8712 "fileId": c.fileId, 8713 }) 8714 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8715} 8716 8717// Do executes the "drive.files.delete" call. 8718func (c *FilesDeleteCall) Do(opts ...googleapi.CallOption) error { 8719 gensupport.SetOptions(c.urlParams_, opts...) 8720 res, err := c.doRequest("json") 8721 if err != nil { 8722 return err 8723 } 8724 defer googleapi.CloseBody(res) 8725 if err := googleapi.CheckResponse(res); err != nil { 8726 return err 8727 } 8728 return nil 8729 // { 8730 // "description": "Permanently deletes a file by ID. Skips the trash. The currently authenticated user must own the file or be an organizer on the parent for shared drive files.", 8731 // "httpMethod": "DELETE", 8732 // "id": "drive.files.delete", 8733 // "parameterOrder": [ 8734 // "fileId" 8735 // ], 8736 // "parameters": { 8737 // "enforceSingleParent": { 8738 // "default": "false", 8739 // "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.", 8740 // "location": "query", 8741 // "type": "boolean" 8742 // }, 8743 // "fileId": { 8744 // "description": "The ID of the file to delete.", 8745 // "location": "path", 8746 // "required": true, 8747 // "type": "string" 8748 // }, 8749 // "supportsAllDrives": { 8750 // "default": "false", 8751 // "description": "Whether the requesting application supports both My Drives and shared drives.", 8752 // "location": "query", 8753 // "type": "boolean" 8754 // }, 8755 // "supportsTeamDrives": { 8756 // "default": "false", 8757 // "description": "Deprecated use supportsAllDrives instead.", 8758 // "location": "query", 8759 // "type": "boolean" 8760 // } 8761 // }, 8762 // "path": "files/{fileId}", 8763 // "scopes": [ 8764 // "https://www.googleapis.com/auth/drive", 8765 // "https://www.googleapis.com/auth/drive.appdata", 8766 // "https://www.googleapis.com/auth/drive.file" 8767 // ] 8768 // } 8769 8770} 8771 8772// method id "drive.files.emptyTrash": 8773 8774type FilesEmptyTrashCall struct { 8775 s *Service 8776 urlParams_ gensupport.URLParams 8777 ctx_ context.Context 8778 header_ http.Header 8779} 8780 8781// EmptyTrash: Permanently deletes all of the user's trashed files. 8782func (r *FilesService) EmptyTrash() *FilesEmptyTrashCall { 8783 c := &FilesEmptyTrashCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8784 return c 8785} 8786 8787// EnforceSingleParent sets the optional parameter 8788// "enforceSingleParent": Deprecated. If an item is not in a shared 8789// drive and its last parent is deleted but the item itself is not, the 8790// item will be placed under its owner's root. 8791func (c *FilesEmptyTrashCall) EnforceSingleParent(enforceSingleParent bool) *FilesEmptyTrashCall { 8792 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 8793 return c 8794} 8795 8796// Fields allows partial responses to be retrieved. See 8797// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8798// for more information. 8799func (c *FilesEmptyTrashCall) Fields(s ...googleapi.Field) *FilesEmptyTrashCall { 8800 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8801 return c 8802} 8803 8804// Context sets the context to be used in this call's Do method. Any 8805// pending HTTP request will be aborted if the provided context is 8806// canceled. 8807func (c *FilesEmptyTrashCall) Context(ctx context.Context) *FilesEmptyTrashCall { 8808 c.ctx_ = ctx 8809 return c 8810} 8811 8812// Header returns an http.Header that can be modified by the caller to 8813// add HTTP headers to the request. 8814func (c *FilesEmptyTrashCall) Header() http.Header { 8815 if c.header_ == nil { 8816 c.header_ = make(http.Header) 8817 } 8818 return c.header_ 8819} 8820 8821func (c *FilesEmptyTrashCall) doRequest(alt string) (*http.Response, error) { 8822 reqHeaders := make(http.Header) 8823 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8824 for k, v := range c.header_ { 8825 reqHeaders[k] = v 8826 } 8827 reqHeaders.Set("User-Agent", c.s.userAgent()) 8828 var body io.Reader = nil 8829 c.urlParams_.Set("alt", alt) 8830 c.urlParams_.Set("prettyPrint", "false") 8831 urls := googleapi.ResolveRelative(c.s.BasePath, "files/trash") 8832 urls += "?" + c.urlParams_.Encode() 8833 req, err := http.NewRequest("DELETE", urls, body) 8834 if err != nil { 8835 return nil, err 8836 } 8837 req.Header = reqHeaders 8838 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8839} 8840 8841// Do executes the "drive.files.emptyTrash" call. 8842func (c *FilesEmptyTrashCall) Do(opts ...googleapi.CallOption) error { 8843 gensupport.SetOptions(c.urlParams_, opts...) 8844 res, err := c.doRequest("json") 8845 if err != nil { 8846 return err 8847 } 8848 defer googleapi.CloseBody(res) 8849 if err := googleapi.CheckResponse(res); err != nil { 8850 return err 8851 } 8852 return nil 8853 // { 8854 // "description": "Permanently deletes all of the user's trashed files.", 8855 // "httpMethod": "DELETE", 8856 // "id": "drive.files.emptyTrash", 8857 // "parameters": { 8858 // "enforceSingleParent": { 8859 // "default": "false", 8860 // "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.", 8861 // "location": "query", 8862 // "type": "boolean" 8863 // } 8864 // }, 8865 // "path": "files/trash", 8866 // "scopes": [ 8867 // "https://www.googleapis.com/auth/drive" 8868 // ] 8869 // } 8870 8871} 8872 8873// method id "drive.files.export": 8874 8875type FilesExportCall struct { 8876 s *Service 8877 fileId string 8878 urlParams_ gensupport.URLParams 8879 ifNoneMatch_ string 8880 ctx_ context.Context 8881 header_ http.Header 8882} 8883 8884// Export: Exports a Google Doc to the requested MIME type and returns 8885// the exported content. Please note that the exported content is 8886// limited to 10MB. 8887// 8888// - fileId: The ID of the file. 8889// - mimeType: The MIME type of the format requested for this export. 8890func (r *FilesService) Export(fileId string, mimeType string) *FilesExportCall { 8891 c := &FilesExportCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8892 c.fileId = fileId 8893 c.urlParams_.Set("mimeType", mimeType) 8894 return c 8895} 8896 8897// Fields allows partial responses to be retrieved. See 8898// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8899// for more information. 8900func (c *FilesExportCall) Fields(s ...googleapi.Field) *FilesExportCall { 8901 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8902 return c 8903} 8904 8905// IfNoneMatch sets the optional parameter which makes the operation 8906// fail if the object's ETag matches the given value. This is useful for 8907// getting updates only after the object has changed since the last 8908// request. Use googleapi.IsNotModified to check whether the response 8909// error from Do is the result of In-None-Match. 8910func (c *FilesExportCall) IfNoneMatch(entityTag string) *FilesExportCall { 8911 c.ifNoneMatch_ = entityTag 8912 return c 8913} 8914 8915// Context sets the context to be used in this call's Do and Download 8916// methods. Any pending HTTP request will be aborted if the provided 8917// context is canceled. 8918func (c *FilesExportCall) Context(ctx context.Context) *FilesExportCall { 8919 c.ctx_ = ctx 8920 return c 8921} 8922 8923// Header returns an http.Header that can be modified by the caller to 8924// add HTTP headers to the request. 8925func (c *FilesExportCall) Header() http.Header { 8926 if c.header_ == nil { 8927 c.header_ = make(http.Header) 8928 } 8929 return c.header_ 8930} 8931 8932func (c *FilesExportCall) doRequest(alt string) (*http.Response, error) { 8933 reqHeaders := make(http.Header) 8934 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 8935 for k, v := range c.header_ { 8936 reqHeaders[k] = v 8937 } 8938 reqHeaders.Set("User-Agent", c.s.userAgent()) 8939 if c.ifNoneMatch_ != "" { 8940 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8941 } 8942 var body io.Reader = nil 8943 c.urlParams_.Set("alt", alt) 8944 c.urlParams_.Set("prettyPrint", "false") 8945 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/export") 8946 urls += "?" + c.urlParams_.Encode() 8947 req, err := http.NewRequest("GET", urls, body) 8948 if err != nil { 8949 return nil, err 8950 } 8951 req.Header = reqHeaders 8952 googleapi.Expand(req.URL, map[string]string{ 8953 "fileId": c.fileId, 8954 }) 8955 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8956} 8957 8958// Download fetches the API endpoint's "media" value, instead of the normal 8959// API response value. If the returned error is nil, the Response is guaranteed to 8960// have a 2xx status code. Callers must close the Response.Body as usual. 8961func (c *FilesExportCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 8962 gensupport.SetOptions(c.urlParams_, opts...) 8963 res, err := c.doRequest("media") 8964 if err != nil { 8965 return nil, err 8966 } 8967 if err := googleapi.CheckResponse(res); err != nil { 8968 res.Body.Close() 8969 return nil, err 8970 } 8971 return res, nil 8972} 8973 8974// Do executes the "drive.files.export" call. 8975func (c *FilesExportCall) Do(opts ...googleapi.CallOption) error { 8976 gensupport.SetOptions(c.urlParams_, opts...) 8977 res, err := c.doRequest("json") 8978 if err != nil { 8979 return err 8980 } 8981 defer googleapi.CloseBody(res) 8982 if err := googleapi.CheckResponse(res); err != nil { 8983 return err 8984 } 8985 return nil 8986 // { 8987 // "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.", 8988 // "httpMethod": "GET", 8989 // "id": "drive.files.export", 8990 // "parameterOrder": [ 8991 // "fileId", 8992 // "mimeType" 8993 // ], 8994 // "parameters": { 8995 // "fileId": { 8996 // "description": "The ID of the file.", 8997 // "location": "path", 8998 // "required": true, 8999 // "type": "string" 9000 // }, 9001 // "mimeType": { 9002 // "description": "The MIME type of the format requested for this export.", 9003 // "location": "query", 9004 // "required": true, 9005 // "type": "string" 9006 // } 9007 // }, 9008 // "path": "files/{fileId}/export", 9009 // "scopes": [ 9010 // "https://www.googleapis.com/auth/drive", 9011 // "https://www.googleapis.com/auth/drive.file", 9012 // "https://www.googleapis.com/auth/drive.readonly" 9013 // ], 9014 // "supportsMediaDownload": true 9015 // } 9016 9017} 9018 9019// method id "drive.files.generateIds": 9020 9021type FilesGenerateIdsCall struct { 9022 s *Service 9023 urlParams_ gensupport.URLParams 9024 ifNoneMatch_ string 9025 ctx_ context.Context 9026 header_ http.Header 9027} 9028 9029// GenerateIds: Generates a set of file IDs which can be provided in 9030// insert or copy requests. 9031func (r *FilesService) GenerateIds() *FilesGenerateIdsCall { 9032 c := &FilesGenerateIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9033 return c 9034} 9035 9036// MaxResults sets the optional parameter "maxResults": Maximum number 9037// of IDs to return. 9038func (c *FilesGenerateIdsCall) MaxResults(maxResults int64) *FilesGenerateIdsCall { 9039 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9040 return c 9041} 9042 9043// Space sets the optional parameter "space": The space in which the IDs 9044// can be used to create new files. Supported values are 'drive' and 9045// 'appDataFolder'. 9046func (c *FilesGenerateIdsCall) Space(space string) *FilesGenerateIdsCall { 9047 c.urlParams_.Set("space", space) 9048 return c 9049} 9050 9051// Fields allows partial responses to be retrieved. See 9052// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9053// for more information. 9054func (c *FilesGenerateIdsCall) Fields(s ...googleapi.Field) *FilesGenerateIdsCall { 9055 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9056 return c 9057} 9058 9059// IfNoneMatch sets the optional parameter which makes the operation 9060// fail if the object's ETag matches the given value. This is useful for 9061// getting updates only after the object has changed since the last 9062// request. Use googleapi.IsNotModified to check whether the response 9063// error from Do is the result of In-None-Match. 9064func (c *FilesGenerateIdsCall) IfNoneMatch(entityTag string) *FilesGenerateIdsCall { 9065 c.ifNoneMatch_ = entityTag 9066 return c 9067} 9068 9069// Context sets the context to be used in this call's Do method. Any 9070// pending HTTP request will be aborted if the provided context is 9071// canceled. 9072func (c *FilesGenerateIdsCall) Context(ctx context.Context) *FilesGenerateIdsCall { 9073 c.ctx_ = ctx 9074 return c 9075} 9076 9077// Header returns an http.Header that can be modified by the caller to 9078// add HTTP headers to the request. 9079func (c *FilesGenerateIdsCall) Header() http.Header { 9080 if c.header_ == nil { 9081 c.header_ = make(http.Header) 9082 } 9083 return c.header_ 9084} 9085 9086func (c *FilesGenerateIdsCall) doRequest(alt string) (*http.Response, error) { 9087 reqHeaders := make(http.Header) 9088 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9089 for k, v := range c.header_ { 9090 reqHeaders[k] = v 9091 } 9092 reqHeaders.Set("User-Agent", c.s.userAgent()) 9093 if c.ifNoneMatch_ != "" { 9094 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9095 } 9096 var body io.Reader = nil 9097 c.urlParams_.Set("alt", alt) 9098 c.urlParams_.Set("prettyPrint", "false") 9099 urls := googleapi.ResolveRelative(c.s.BasePath, "files/generateIds") 9100 urls += "?" + c.urlParams_.Encode() 9101 req, err := http.NewRequest("GET", urls, body) 9102 if err != nil { 9103 return nil, err 9104 } 9105 req.Header = reqHeaders 9106 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9107} 9108 9109// Do executes the "drive.files.generateIds" call. 9110// Exactly one of *GeneratedIds or error will be non-nil. Any non-2xx 9111// status code is an error. Response headers are in either 9112// *GeneratedIds.ServerResponse.Header or (if a response was returned at 9113// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9114// to check whether the returned error was because 9115// http.StatusNotModified was returned. 9116func (c *FilesGenerateIdsCall) Do(opts ...googleapi.CallOption) (*GeneratedIds, error) { 9117 gensupport.SetOptions(c.urlParams_, opts...) 9118 res, err := c.doRequest("json") 9119 if res != nil && res.StatusCode == http.StatusNotModified { 9120 if res.Body != nil { 9121 res.Body.Close() 9122 } 9123 return nil, &googleapi.Error{ 9124 Code: res.StatusCode, 9125 Header: res.Header, 9126 } 9127 } 9128 if err != nil { 9129 return nil, err 9130 } 9131 defer googleapi.CloseBody(res) 9132 if err := googleapi.CheckResponse(res); err != nil { 9133 return nil, err 9134 } 9135 ret := &GeneratedIds{ 9136 ServerResponse: googleapi.ServerResponse{ 9137 Header: res.Header, 9138 HTTPStatusCode: res.StatusCode, 9139 }, 9140 } 9141 target := &ret 9142 if err := gensupport.DecodeResponse(target, res); err != nil { 9143 return nil, err 9144 } 9145 return ret, nil 9146 // { 9147 // "description": "Generates a set of file IDs which can be provided in insert or copy requests.", 9148 // "httpMethod": "GET", 9149 // "id": "drive.files.generateIds", 9150 // "parameters": { 9151 // "maxResults": { 9152 // "default": "10", 9153 // "description": "Maximum number of IDs to return.", 9154 // "format": "int32", 9155 // "location": "query", 9156 // "maximum": "1000", 9157 // "minimum": "1", 9158 // "type": "integer" 9159 // }, 9160 // "space": { 9161 // "default": "drive", 9162 // "description": "The space in which the IDs can be used to create new files. Supported values are 'drive' and 'appDataFolder'.", 9163 // "location": "query", 9164 // "type": "string" 9165 // } 9166 // }, 9167 // "path": "files/generateIds", 9168 // "response": { 9169 // "$ref": "GeneratedIds" 9170 // }, 9171 // "scopes": [ 9172 // "https://www.googleapis.com/auth/drive", 9173 // "https://www.googleapis.com/auth/drive.appdata", 9174 // "https://www.googleapis.com/auth/drive.file" 9175 // ] 9176 // } 9177 9178} 9179 9180// method id "drive.files.get": 9181 9182type FilesGetCall struct { 9183 s *Service 9184 fileId string 9185 urlParams_ gensupport.URLParams 9186 ifNoneMatch_ string 9187 ctx_ context.Context 9188 header_ http.Header 9189} 9190 9191// Get: Gets a file's metadata by ID. 9192// 9193// - fileId: The ID for the file in question. 9194func (r *FilesService) Get(fileId string) *FilesGetCall { 9195 c := &FilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9196 c.fileId = fileId 9197 return c 9198} 9199 9200// AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": 9201// Whether the user is acknowledging the risk of downloading known 9202// malware or other abusive files. 9203func (c *FilesGetCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesGetCall { 9204 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse)) 9205 return c 9206} 9207 9208// IncludePermissionsForView sets the optional parameter 9209// "includePermissionsForView": Specifies which additional view's 9210// permissions to include in the response. Only 'published' is 9211// supported. 9212func (c *FilesGetCall) IncludePermissionsForView(includePermissionsForView string) *FilesGetCall { 9213 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 9214 return c 9215} 9216 9217// Projection sets the optional parameter "projection": This parameter 9218// is deprecated and has no function. 9219// 9220// Possible values: 9221// "BASIC" - Deprecated 9222// "FULL" - Deprecated 9223func (c *FilesGetCall) Projection(projection string) *FilesGetCall { 9224 c.urlParams_.Set("projection", projection) 9225 return c 9226} 9227 9228// RevisionId sets the optional parameter "revisionId": Specifies the 9229// Revision ID that should be downloaded. Ignored unless alt=media is 9230// specified. 9231func (c *FilesGetCall) RevisionId(revisionId string) *FilesGetCall { 9232 c.urlParams_.Set("revisionId", revisionId) 9233 return c 9234} 9235 9236// SupportsAllDrives sets the optional parameter "supportsAllDrives": 9237// Whether the requesting application supports both My Drives and shared 9238// drives. 9239func (c *FilesGetCall) SupportsAllDrives(supportsAllDrives bool) *FilesGetCall { 9240 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 9241 return c 9242} 9243 9244// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 9245// Deprecated use supportsAllDrives instead. 9246func (c *FilesGetCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesGetCall { 9247 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 9248 return c 9249} 9250 9251// UpdateViewedDate sets the optional parameter "updateViewedDate": 9252// Deprecated: Use files.update with modifiedDateBehavior=noChange, 9253// updateViewedDate=true and an empty request body. 9254func (c *FilesGetCall) UpdateViewedDate(updateViewedDate bool) *FilesGetCall { 9255 c.urlParams_.Set("updateViewedDate", fmt.Sprint(updateViewedDate)) 9256 return c 9257} 9258 9259// Fields allows partial responses to be retrieved. See 9260// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9261// for more information. 9262func (c *FilesGetCall) Fields(s ...googleapi.Field) *FilesGetCall { 9263 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9264 return c 9265} 9266 9267// IfNoneMatch sets the optional parameter which makes the operation 9268// fail if the object's ETag matches the given value. This is useful for 9269// getting updates only after the object has changed since the last 9270// request. Use googleapi.IsNotModified to check whether the response 9271// error from Do is the result of In-None-Match. 9272func (c *FilesGetCall) IfNoneMatch(entityTag string) *FilesGetCall { 9273 c.ifNoneMatch_ = entityTag 9274 return c 9275} 9276 9277// Context sets the context to be used in this call's Do and Download 9278// methods. Any pending HTTP request will be aborted if the provided 9279// context is canceled. 9280func (c *FilesGetCall) Context(ctx context.Context) *FilesGetCall { 9281 c.ctx_ = ctx 9282 return c 9283} 9284 9285// Header returns an http.Header that can be modified by the caller to 9286// add HTTP headers to the request. 9287func (c *FilesGetCall) Header() http.Header { 9288 if c.header_ == nil { 9289 c.header_ = make(http.Header) 9290 } 9291 return c.header_ 9292} 9293 9294func (c *FilesGetCall) doRequest(alt string) (*http.Response, error) { 9295 reqHeaders := make(http.Header) 9296 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9297 for k, v := range c.header_ { 9298 reqHeaders[k] = v 9299 } 9300 reqHeaders.Set("User-Agent", c.s.userAgent()) 9301 if c.ifNoneMatch_ != "" { 9302 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9303 } 9304 var body io.Reader = nil 9305 c.urlParams_.Set("alt", alt) 9306 c.urlParams_.Set("prettyPrint", "false") 9307 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") 9308 urls += "?" + c.urlParams_.Encode() 9309 req, err := http.NewRequest("GET", 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 }) 9317 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9318} 9319 9320// Download fetches the API endpoint's "media" value, instead of the normal 9321// API response value. If the returned error is nil, the Response is guaranteed to 9322// have a 2xx status code. Callers must close the Response.Body as usual. 9323func (c *FilesGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 9324 gensupport.SetOptions(c.urlParams_, opts...) 9325 res, err := c.doRequest("media") 9326 if err != nil { 9327 return nil, err 9328 } 9329 if err := googleapi.CheckResponse(res); err != nil { 9330 res.Body.Close() 9331 return nil, err 9332 } 9333 return res, nil 9334} 9335 9336// Do executes the "drive.files.get" call. 9337// Exactly one of *File or error will be non-nil. Any non-2xx status 9338// code is an error. Response headers are in either 9339// *File.ServerResponse.Header or (if a response was returned at all) in 9340// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9341// whether the returned error was because http.StatusNotModified was 9342// returned. 9343func (c *FilesGetCall) Do(opts ...googleapi.CallOption) (*File, error) { 9344 gensupport.SetOptions(c.urlParams_, opts...) 9345 res, err := c.doRequest("json") 9346 if res != nil && res.StatusCode == http.StatusNotModified { 9347 if res.Body != nil { 9348 res.Body.Close() 9349 } 9350 return nil, &googleapi.Error{ 9351 Code: res.StatusCode, 9352 Header: res.Header, 9353 } 9354 } 9355 if err != nil { 9356 return nil, err 9357 } 9358 defer googleapi.CloseBody(res) 9359 if err := googleapi.CheckResponse(res); err != nil { 9360 return nil, err 9361 } 9362 ret := &File{ 9363 ServerResponse: googleapi.ServerResponse{ 9364 Header: res.Header, 9365 HTTPStatusCode: res.StatusCode, 9366 }, 9367 } 9368 target := &ret 9369 if err := gensupport.DecodeResponse(target, res); err != nil { 9370 return nil, err 9371 } 9372 return ret, nil 9373 // { 9374 // "description": "Gets a file's metadata by ID.", 9375 // "httpMethod": "GET", 9376 // "id": "drive.files.get", 9377 // "parameterOrder": [ 9378 // "fileId" 9379 // ], 9380 // "parameters": { 9381 // "acknowledgeAbuse": { 9382 // "default": "false", 9383 // "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files.", 9384 // "location": "query", 9385 // "type": "boolean" 9386 // }, 9387 // "fileId": { 9388 // "description": "The ID for the file in question.", 9389 // "location": "path", 9390 // "required": true, 9391 // "type": "string" 9392 // }, 9393 // "includePermissionsForView": { 9394 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 9395 // "location": "query", 9396 // "type": "string" 9397 // }, 9398 // "projection": { 9399 // "description": "This parameter is deprecated and has no function.", 9400 // "enum": [ 9401 // "BASIC", 9402 // "FULL" 9403 // ], 9404 // "enumDescriptions": [ 9405 // "Deprecated", 9406 // "Deprecated" 9407 // ], 9408 // "location": "query", 9409 // "type": "string" 9410 // }, 9411 // "revisionId": { 9412 // "description": "Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.", 9413 // "location": "query", 9414 // "type": "string" 9415 // }, 9416 // "supportsAllDrives": { 9417 // "default": "false", 9418 // "description": "Whether the requesting application supports both My Drives and shared drives.", 9419 // "location": "query", 9420 // "type": "boolean" 9421 // }, 9422 // "supportsTeamDrives": { 9423 // "default": "false", 9424 // "description": "Deprecated use supportsAllDrives instead.", 9425 // "location": "query", 9426 // "type": "boolean" 9427 // }, 9428 // "updateViewedDate": { 9429 // "default": "false", 9430 // "description": "Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.", 9431 // "location": "query", 9432 // "type": "boolean" 9433 // } 9434 // }, 9435 // "path": "files/{fileId}", 9436 // "response": { 9437 // "$ref": "File" 9438 // }, 9439 // "scopes": [ 9440 // "https://www.googleapis.com/auth/drive", 9441 // "https://www.googleapis.com/auth/drive.appdata", 9442 // "https://www.googleapis.com/auth/drive.file", 9443 // "https://www.googleapis.com/auth/drive.metadata", 9444 // "https://www.googleapis.com/auth/drive.metadata.readonly", 9445 // "https://www.googleapis.com/auth/drive.photos.readonly", 9446 // "https://www.googleapis.com/auth/drive.readonly" 9447 // ], 9448 // "supportsMediaDownload": true, 9449 // "supportsSubscription": true, 9450 // "useMediaDownloadService": true 9451 // } 9452 9453} 9454 9455// method id "drive.files.insert": 9456 9457type FilesInsertCall struct { 9458 s *Service 9459 file *File 9460 urlParams_ gensupport.URLParams 9461 mediaInfo_ *gensupport.MediaInfo 9462 ctx_ context.Context 9463 header_ http.Header 9464} 9465 9466// Insert: Insert a new file. 9467func (r *FilesService) Insert(file *File) *FilesInsertCall { 9468 c := &FilesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9469 c.file = file 9470 return c 9471} 9472 9473// Convert sets the optional parameter "convert": Whether to convert 9474// this file to the corresponding Docs Editors format. 9475func (c *FilesInsertCall) Convert(convert bool) *FilesInsertCall { 9476 c.urlParams_.Set("convert", fmt.Sprint(convert)) 9477 return c 9478} 9479 9480// EnforceSingleParent sets the optional parameter 9481// "enforceSingleParent": Deprecated. Creating files in multiple folders 9482// is no longer supported. 9483func (c *FilesInsertCall) EnforceSingleParent(enforceSingleParent bool) *FilesInsertCall { 9484 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 9485 return c 9486} 9487 9488// IncludePermissionsForView sets the optional parameter 9489// "includePermissionsForView": Specifies which additional view's 9490// permissions to include in the response. Only 'published' is 9491// supported. 9492func (c *FilesInsertCall) IncludePermissionsForView(includePermissionsForView string) *FilesInsertCall { 9493 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 9494 return c 9495} 9496 9497// Ocr sets the optional parameter "ocr": Whether to attempt OCR on 9498// .jpg, .png, .gif, or .pdf uploads. 9499func (c *FilesInsertCall) Ocr(ocr bool) *FilesInsertCall { 9500 c.urlParams_.Set("ocr", fmt.Sprint(ocr)) 9501 return c 9502} 9503 9504// OcrLanguage sets the optional parameter "ocrLanguage": If ocr is 9505// true, hints at the language to use. Valid values are BCP 47 codes. 9506func (c *FilesInsertCall) OcrLanguage(ocrLanguage string) *FilesInsertCall { 9507 c.urlParams_.Set("ocrLanguage", ocrLanguage) 9508 return c 9509} 9510 9511// Pinned sets the optional parameter "pinned": Whether to pin the head 9512// revision of the uploaded file. A file can have a maximum of 200 9513// pinned revisions. 9514func (c *FilesInsertCall) Pinned(pinned bool) *FilesInsertCall { 9515 c.urlParams_.Set("pinned", fmt.Sprint(pinned)) 9516 return c 9517} 9518 9519// SupportsAllDrives sets the optional parameter "supportsAllDrives": 9520// Whether the requesting application supports both My Drives and shared 9521// drives. 9522func (c *FilesInsertCall) SupportsAllDrives(supportsAllDrives bool) *FilesInsertCall { 9523 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 9524 return c 9525} 9526 9527// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 9528// Deprecated use supportsAllDrives instead. 9529func (c *FilesInsertCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesInsertCall { 9530 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 9531 return c 9532} 9533 9534// TimedTextLanguage sets the optional parameter "timedTextLanguage": 9535// The language of the timed text. 9536func (c *FilesInsertCall) TimedTextLanguage(timedTextLanguage string) *FilesInsertCall { 9537 c.urlParams_.Set("timedTextLanguage", timedTextLanguage) 9538 return c 9539} 9540 9541// TimedTextTrackName sets the optional parameter "timedTextTrackName": 9542// The timed text track name. 9543func (c *FilesInsertCall) TimedTextTrackName(timedTextTrackName string) *FilesInsertCall { 9544 c.urlParams_.Set("timedTextTrackName", timedTextTrackName) 9545 return c 9546} 9547 9548// UseContentAsIndexableText sets the optional parameter 9549// "useContentAsIndexableText": Whether to use the content as indexable 9550// text. 9551func (c *FilesInsertCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesInsertCall { 9552 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText)) 9553 return c 9554} 9555 9556// Visibility sets the optional parameter "visibility": The visibility 9557// of the new file. This parameter is only relevant when convert=false. 9558// 9559// Possible values: 9560// "DEFAULT" (default) - The visibility of the new file is determined 9561// by the user's default visibility/sharing policies. 9562// "PRIVATE" - The new file will be visible to only the owner. 9563func (c *FilesInsertCall) Visibility(visibility string) *FilesInsertCall { 9564 c.urlParams_.Set("visibility", visibility) 9565 return c 9566} 9567 9568// Media specifies the media to upload in one or more chunks. The chunk 9569// size may be controlled by supplying a MediaOption generated by 9570// googleapi.ChunkSize. The chunk size defaults to 9571// googleapi.DefaultUploadChunkSize.The Content-Type header used in the 9572// upload request will be determined by sniffing the contents of r, 9573// unless a MediaOption generated by googleapi.ContentType is 9574// supplied. 9575// At most one of Media and ResumableMedia may be set. 9576func (c *FilesInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesInsertCall { 9577 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) 9578 return c 9579} 9580 9581// ResumableMedia specifies the media to upload in chunks and can be 9582// canceled with ctx. 9583// 9584// Deprecated: use Media instead. 9585// 9586// At most one of Media and ResumableMedia may be set. mediaType 9587// identifies the MIME media type of the upload, such as "image/png". If 9588// mediaType is "", it will be auto-detected. The provided ctx will 9589// supersede any context previously provided to the Context method. 9590func (c *FilesInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesInsertCall { 9591 c.ctx_ = ctx 9592 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) 9593 return c 9594} 9595 9596// ProgressUpdater provides a callback function that will be called 9597// after every chunk. It should be a low-latency function in order to 9598// not slow down the upload operation. This should only be called when 9599// using ResumableMedia (as opposed to Media). 9600func (c *FilesInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesInsertCall { 9601 c.mediaInfo_.SetProgressUpdater(pu) 9602 return c 9603} 9604 9605// Fields allows partial responses to be retrieved. See 9606// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9607// for more information. 9608func (c *FilesInsertCall) Fields(s ...googleapi.Field) *FilesInsertCall { 9609 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9610 return c 9611} 9612 9613// Context sets the context to be used in this call's Do method. Any 9614// pending HTTP request will be aborted if the provided context is 9615// canceled. 9616// This context will supersede any context previously provided to the 9617// ResumableMedia method. 9618func (c *FilesInsertCall) Context(ctx context.Context) *FilesInsertCall { 9619 c.ctx_ = ctx 9620 return c 9621} 9622 9623// Header returns an http.Header that can be modified by the caller to 9624// add HTTP headers to the request. 9625func (c *FilesInsertCall) Header() http.Header { 9626 if c.header_ == nil { 9627 c.header_ = make(http.Header) 9628 } 9629 return c.header_ 9630} 9631 9632func (c *FilesInsertCall) doRequest(alt string) (*http.Response, error) { 9633 reqHeaders := make(http.Header) 9634 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 9635 for k, v := range c.header_ { 9636 reqHeaders[k] = v 9637 } 9638 reqHeaders.Set("User-Agent", c.s.userAgent()) 9639 var body io.Reader = nil 9640 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 9641 if err != nil { 9642 return nil, err 9643 } 9644 reqHeaders.Set("Content-Type", "application/json") 9645 c.urlParams_.Set("alt", alt) 9646 c.urlParams_.Set("prettyPrint", "false") 9647 urls := googleapi.ResolveRelative(c.s.BasePath, "files") 9648 if c.mediaInfo_ != nil { 9649 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v2/files") 9650 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) 9651 } 9652 if body == nil { 9653 body = new(bytes.Buffer) 9654 reqHeaders.Set("Content-Type", "application/json") 9655 } 9656 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) 9657 defer cleanup() 9658 urls += "?" + c.urlParams_.Encode() 9659 req, err := http.NewRequest("POST", urls, body) 9660 if err != nil { 9661 return nil, err 9662 } 9663 req.Header = reqHeaders 9664 req.GetBody = getBody 9665 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9666} 9667 9668// Do executes the "drive.files.insert" call. 9669// Exactly one of *File or error will be non-nil. Any non-2xx status 9670// code is an error. Response headers are in either 9671// *File.ServerResponse.Header or (if a response was returned at all) in 9672// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 9673// whether the returned error was because http.StatusNotModified was 9674// returned. 9675func (c *FilesInsertCall) Do(opts ...googleapi.CallOption) (*File, error) { 9676 gensupport.SetOptions(c.urlParams_, opts...) 9677 res, err := c.doRequest("json") 9678 if res != nil && res.StatusCode == http.StatusNotModified { 9679 if res.Body != nil { 9680 res.Body.Close() 9681 } 9682 return nil, &googleapi.Error{ 9683 Code: res.StatusCode, 9684 Header: res.Header, 9685 } 9686 } 9687 if err != nil { 9688 return nil, err 9689 } 9690 defer googleapi.CloseBody(res) 9691 if err := googleapi.CheckResponse(res); err != nil { 9692 return nil, err 9693 } 9694 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) 9695 if rx != nil { 9696 rx.Client = c.s.client 9697 rx.UserAgent = c.s.userAgent() 9698 ctx := c.ctx_ 9699 if ctx == nil { 9700 ctx = context.TODO() 9701 } 9702 res, err = rx.Upload(ctx) 9703 if err != nil { 9704 return nil, err 9705 } 9706 defer res.Body.Close() 9707 if err := googleapi.CheckResponse(res); err != nil { 9708 return nil, err 9709 } 9710 } 9711 ret := &File{ 9712 ServerResponse: googleapi.ServerResponse{ 9713 Header: res.Header, 9714 HTTPStatusCode: res.StatusCode, 9715 }, 9716 } 9717 target := &ret 9718 if err := gensupport.DecodeResponse(target, res); err != nil { 9719 return nil, err 9720 } 9721 return ret, nil 9722 // { 9723 // "description": "Insert a new file.", 9724 // "httpMethod": "POST", 9725 // "id": "drive.files.insert", 9726 // "mediaUpload": { 9727 // "accept": [ 9728 // "*/*" 9729 // ], 9730 // "maxSize": "5120GB", 9731 // "protocols": { 9732 // "resumable": { 9733 // "multipart": true, 9734 // "path": "/resumable/upload/drive/v2/files" 9735 // }, 9736 // "simple": { 9737 // "multipart": true, 9738 // "path": "/upload/drive/v2/files" 9739 // } 9740 // } 9741 // }, 9742 // "parameters": { 9743 // "convert": { 9744 // "default": "false", 9745 // "description": "Whether to convert this file to the corresponding Docs Editors format.", 9746 // "location": "query", 9747 // "type": "boolean" 9748 // }, 9749 // "enforceSingleParent": { 9750 // "default": "false", 9751 // "description": "Deprecated. Creating files in multiple folders is no longer supported.", 9752 // "location": "query", 9753 // "type": "boolean" 9754 // }, 9755 // "includePermissionsForView": { 9756 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 9757 // "location": "query", 9758 // "type": "string" 9759 // }, 9760 // "ocr": { 9761 // "default": "false", 9762 // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", 9763 // "location": "query", 9764 // "type": "boolean" 9765 // }, 9766 // "ocrLanguage": { 9767 // "description": "If ocr is true, hints at the language to use. Valid values are BCP 47 codes.", 9768 // "location": "query", 9769 // "type": "string" 9770 // }, 9771 // "pinned": { 9772 // "default": "false", 9773 // "description": "Whether to pin the head revision of the uploaded file. A file can have a maximum of 200 pinned revisions.", 9774 // "location": "query", 9775 // "type": "boolean" 9776 // }, 9777 // "supportsAllDrives": { 9778 // "default": "false", 9779 // "description": "Whether the requesting application supports both My Drives and shared drives.", 9780 // "location": "query", 9781 // "type": "boolean" 9782 // }, 9783 // "supportsTeamDrives": { 9784 // "default": "false", 9785 // "description": "Deprecated use supportsAllDrives instead.", 9786 // "location": "query", 9787 // "type": "boolean" 9788 // }, 9789 // "timedTextLanguage": { 9790 // "description": "The language of the timed text.", 9791 // "location": "query", 9792 // "type": "string" 9793 // }, 9794 // "timedTextTrackName": { 9795 // "description": "The timed text track name.", 9796 // "location": "query", 9797 // "type": "string" 9798 // }, 9799 // "useContentAsIndexableText": { 9800 // "default": "false", 9801 // "description": "Whether to use the content as indexable text.", 9802 // "location": "query", 9803 // "type": "boolean" 9804 // }, 9805 // "visibility": { 9806 // "default": "DEFAULT", 9807 // "description": "The visibility of the new file. This parameter is only relevant when convert=false.", 9808 // "enum": [ 9809 // "DEFAULT", 9810 // "PRIVATE" 9811 // ], 9812 // "enumDescriptions": [ 9813 // "The visibility of the new file is determined by the user's default visibility/sharing policies.", 9814 // "The new file will be visible to only the owner." 9815 // ], 9816 // "location": "query", 9817 // "type": "string" 9818 // } 9819 // }, 9820 // "path": "files", 9821 // "request": { 9822 // "$ref": "File" 9823 // }, 9824 // "response": { 9825 // "$ref": "File" 9826 // }, 9827 // "scopes": [ 9828 // "https://www.googleapis.com/auth/drive", 9829 // "https://www.googleapis.com/auth/drive.appdata", 9830 // "https://www.googleapis.com/auth/drive.apps.readonly", 9831 // "https://www.googleapis.com/auth/drive.file" 9832 // ], 9833 // "supportsMediaUpload": true, 9834 // "supportsSubscription": true 9835 // } 9836 9837} 9838 9839// method id "drive.files.list": 9840 9841type FilesListCall struct { 9842 s *Service 9843 urlParams_ gensupport.URLParams 9844 ifNoneMatch_ string 9845 ctx_ context.Context 9846 header_ http.Header 9847} 9848 9849// List: Lists the user's files. 9850func (r *FilesService) List() *FilesListCall { 9851 c := &FilesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9852 return c 9853} 9854 9855// Corpora sets the optional parameter "corpora": Groupings of files to 9856// which the query applies. Supported groupings are: 'user' (files 9857// created by, opened by, or shared directly with the user), 'drive' 9858// (files in the specified shared drive as indicated by the 'driveId'), 9859// 'domain' (files shared to the user's domain), and 'allDrives' (A 9860// combination of 'user' and 'drive' for all drives where the user is a 9861// member). When able, use 'user' or 'drive', instead of 'allDrives', 9862// for efficiency. 9863func (c *FilesListCall) Corpora(corpora string) *FilesListCall { 9864 c.urlParams_.Set("corpora", corpora) 9865 return c 9866} 9867 9868// Corpus sets the optional parameter "corpus": The body of items 9869// (files/documents) to which the query applies. Deprecated: use 9870// 'corpora' instead. 9871// 9872// Possible values: 9873// "DEFAULT" - The items that the user has accessed. 9874// "DOMAIN" - Items shared to the user's domain. 9875func (c *FilesListCall) Corpus(corpus string) *FilesListCall { 9876 c.urlParams_.Set("corpus", corpus) 9877 return c 9878} 9879 9880// DriveId sets the optional parameter "driveId": ID of the shared drive 9881// to search. 9882func (c *FilesListCall) DriveId(driveId string) *FilesListCall { 9883 c.urlParams_.Set("driveId", driveId) 9884 return c 9885} 9886 9887// IncludeItemsFromAllDrives sets the optional parameter 9888// "includeItemsFromAllDrives": Whether both My Drive and shared drive 9889// items should be included in results. 9890func (c *FilesListCall) IncludeItemsFromAllDrives(includeItemsFromAllDrives bool) *FilesListCall { 9891 c.urlParams_.Set("includeItemsFromAllDrives", fmt.Sprint(includeItemsFromAllDrives)) 9892 return c 9893} 9894 9895// IncludePermissionsForView sets the optional parameter 9896// "includePermissionsForView": Specifies which additional view's 9897// permissions to include in the response. Only 'published' is 9898// supported. 9899func (c *FilesListCall) IncludePermissionsForView(includePermissionsForView string) *FilesListCall { 9900 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 9901 return c 9902} 9903 9904// IncludeTeamDriveItems sets the optional parameter 9905// "includeTeamDriveItems": Deprecated use includeItemsFromAllDrives 9906// instead. 9907func (c *FilesListCall) IncludeTeamDriveItems(includeTeamDriveItems bool) *FilesListCall { 9908 c.urlParams_.Set("includeTeamDriveItems", fmt.Sprint(includeTeamDriveItems)) 9909 return c 9910} 9911 9912// MaxResults sets the optional parameter "maxResults": The maximum 9913// number of files to return per page. Partial or empty result pages are 9914// possible even before the end of the files list has been reached. 9915func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall { 9916 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 9917 return c 9918} 9919 9920// OrderBy sets the optional parameter "orderBy": A comma-separated list 9921// of sort keys. Valid keys are 'createdDate', 'folder', 9922// 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 9923// 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', 'title', 9924// and 'title_natural'. Each key sorts ascending by default, but may be 9925// reversed with the 'desc' modifier. Example usage: 9926// ?orderBy=folder,modifiedDate desc,title. Please note that there is a 9927// current limitation for users with approximately one million files in 9928// which the requested sort order is ignored. 9929func (c *FilesListCall) OrderBy(orderBy string) *FilesListCall { 9930 c.urlParams_.Set("orderBy", orderBy) 9931 return c 9932} 9933 9934// PageToken sets the optional parameter "pageToken": Page token for 9935// files. 9936func (c *FilesListCall) PageToken(pageToken string) *FilesListCall { 9937 c.urlParams_.Set("pageToken", pageToken) 9938 return c 9939} 9940 9941// Projection sets the optional parameter "projection": This parameter 9942// is deprecated and has no function. 9943// 9944// Possible values: 9945// "BASIC" - Deprecated 9946// "FULL" - Deprecated 9947func (c *FilesListCall) Projection(projection string) *FilesListCall { 9948 c.urlParams_.Set("projection", projection) 9949 return c 9950} 9951 9952// Q sets the optional parameter "q": Query string for searching files. 9953func (c *FilesListCall) Q(q string) *FilesListCall { 9954 c.urlParams_.Set("q", q) 9955 return c 9956} 9957 9958// Spaces sets the optional parameter "spaces": A comma-separated list 9959// of spaces to query. Supported values are 'drive', 'appDataFolder' and 9960// 'photos'. 9961func (c *FilesListCall) Spaces(spaces string) *FilesListCall { 9962 c.urlParams_.Set("spaces", spaces) 9963 return c 9964} 9965 9966// SupportsAllDrives sets the optional parameter "supportsAllDrives": 9967// Whether the requesting application supports both My Drives and shared 9968// drives. 9969func (c *FilesListCall) SupportsAllDrives(supportsAllDrives bool) *FilesListCall { 9970 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 9971 return c 9972} 9973 9974// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 9975// Deprecated use supportsAllDrives instead. 9976func (c *FilesListCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesListCall { 9977 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 9978 return c 9979} 9980 9981// TeamDriveId sets the optional parameter "teamDriveId": Deprecated use 9982// driveId instead. 9983func (c *FilesListCall) TeamDriveId(teamDriveId string) *FilesListCall { 9984 c.urlParams_.Set("teamDriveId", teamDriveId) 9985 return c 9986} 9987 9988// Fields allows partial responses to be retrieved. See 9989// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9990// for more information. 9991func (c *FilesListCall) Fields(s ...googleapi.Field) *FilesListCall { 9992 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9993 return c 9994} 9995 9996// IfNoneMatch sets the optional parameter which makes the operation 9997// fail if the object's ETag matches the given value. This is useful for 9998// getting updates only after the object has changed since the last 9999// request. Use googleapi.IsNotModified to check whether the response 10000// error from Do is the result of In-None-Match. 10001func (c *FilesListCall) IfNoneMatch(entityTag string) *FilesListCall { 10002 c.ifNoneMatch_ = entityTag 10003 return c 10004} 10005 10006// Context sets the context to be used in this call's Do method. Any 10007// pending HTTP request will be aborted if the provided context is 10008// canceled. 10009func (c *FilesListCall) Context(ctx context.Context) *FilesListCall { 10010 c.ctx_ = ctx 10011 return c 10012} 10013 10014// Header returns an http.Header that can be modified by the caller to 10015// add HTTP headers to the request. 10016func (c *FilesListCall) Header() http.Header { 10017 if c.header_ == nil { 10018 c.header_ = make(http.Header) 10019 } 10020 return c.header_ 10021} 10022 10023func (c *FilesListCall) doRequest(alt string) (*http.Response, error) { 10024 reqHeaders := make(http.Header) 10025 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10026 for k, v := range c.header_ { 10027 reqHeaders[k] = v 10028 } 10029 reqHeaders.Set("User-Agent", c.s.userAgent()) 10030 if c.ifNoneMatch_ != "" { 10031 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10032 } 10033 var body io.Reader = nil 10034 c.urlParams_.Set("alt", alt) 10035 c.urlParams_.Set("prettyPrint", "false") 10036 urls := googleapi.ResolveRelative(c.s.BasePath, "files") 10037 urls += "?" + c.urlParams_.Encode() 10038 req, err := http.NewRequest("GET", urls, body) 10039 if err != nil { 10040 return nil, err 10041 } 10042 req.Header = reqHeaders 10043 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10044} 10045 10046// Do executes the "drive.files.list" call. 10047// Exactly one of *FileList or error will be non-nil. Any non-2xx status 10048// code is an error. Response headers are in either 10049// *FileList.ServerResponse.Header or (if a response was returned at 10050// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10051// to check whether the returned error was because 10052// http.StatusNotModified was returned. 10053func (c *FilesListCall) Do(opts ...googleapi.CallOption) (*FileList, error) { 10054 gensupport.SetOptions(c.urlParams_, opts...) 10055 res, err := c.doRequest("json") 10056 if res != nil && res.StatusCode == http.StatusNotModified { 10057 if res.Body != nil { 10058 res.Body.Close() 10059 } 10060 return nil, &googleapi.Error{ 10061 Code: res.StatusCode, 10062 Header: res.Header, 10063 } 10064 } 10065 if err != nil { 10066 return nil, err 10067 } 10068 defer googleapi.CloseBody(res) 10069 if err := googleapi.CheckResponse(res); err != nil { 10070 return nil, err 10071 } 10072 ret := &FileList{ 10073 ServerResponse: googleapi.ServerResponse{ 10074 Header: res.Header, 10075 HTTPStatusCode: res.StatusCode, 10076 }, 10077 } 10078 target := &ret 10079 if err := gensupport.DecodeResponse(target, res); err != nil { 10080 return nil, err 10081 } 10082 return ret, nil 10083 // { 10084 // "description": "Lists the user's files.", 10085 // "httpMethod": "GET", 10086 // "id": "drive.files.list", 10087 // "parameters": { 10088 // "corpora": { 10089 // "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.", 10090 // "location": "query", 10091 // "type": "string" 10092 // }, 10093 // "corpus": { 10094 // "description": "The body of items (files/documents) to which the query applies. Deprecated: use 'corpora' instead.", 10095 // "enum": [ 10096 // "DEFAULT", 10097 // "DOMAIN" 10098 // ], 10099 // "enumDescriptions": [ 10100 // "The items that the user has accessed.", 10101 // "Items shared to the user's domain." 10102 // ], 10103 // "location": "query", 10104 // "type": "string" 10105 // }, 10106 // "driveId": { 10107 // "description": "ID of the shared drive to search.", 10108 // "location": "query", 10109 // "type": "string" 10110 // }, 10111 // "includeItemsFromAllDrives": { 10112 // "default": "false", 10113 // "description": "Whether both My Drive and shared drive items should be included in results.", 10114 // "location": "query", 10115 // "type": "boolean" 10116 // }, 10117 // "includePermissionsForView": { 10118 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 10119 // "location": "query", 10120 // "type": "string" 10121 // }, 10122 // "includeTeamDriveItems": { 10123 // "default": "false", 10124 // "description": "Deprecated use includeItemsFromAllDrives instead.", 10125 // "location": "query", 10126 // "type": "boolean" 10127 // }, 10128 // "maxResults": { 10129 // "default": "100", 10130 // "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.", 10131 // "format": "int32", 10132 // "location": "query", 10133 // "minimum": "0", 10134 // "type": "integer" 10135 // }, 10136 // "orderBy": { 10137 // "description": "A comma-separated list of sort keys. Valid keys are 'createdDate', 'folder', 'lastViewedByMeDate', 'modifiedByMeDate', 'modifiedDate', 'quotaBytesUsed', 'recency', 'sharedWithMeDate', 'starred', 'title', and 'title_natural'. Each key sorts ascending by default, but may be reversed with the 'desc' modifier. Example usage: ?orderBy=folder,modifiedDate desc,title. Please note that there is a current limitation for users with approximately one million files in which the requested sort order is ignored.", 10138 // "location": "query", 10139 // "type": "string" 10140 // }, 10141 // "pageToken": { 10142 // "description": "Page token for files.", 10143 // "location": "query", 10144 // "type": "string" 10145 // }, 10146 // "projection": { 10147 // "description": "This parameter is deprecated and has no function.", 10148 // "enum": [ 10149 // "BASIC", 10150 // "FULL" 10151 // ], 10152 // "enumDescriptions": [ 10153 // "Deprecated", 10154 // "Deprecated" 10155 // ], 10156 // "location": "query", 10157 // "type": "string" 10158 // }, 10159 // "q": { 10160 // "description": "Query string for searching files.", 10161 // "location": "query", 10162 // "type": "string" 10163 // }, 10164 // "spaces": { 10165 // "description": "A comma-separated list of spaces to query. Supported values are 'drive', 'appDataFolder' and 'photos'.", 10166 // "location": "query", 10167 // "type": "string" 10168 // }, 10169 // "supportsAllDrives": { 10170 // "default": "false", 10171 // "description": "Whether the requesting application supports both My Drives and shared drives.", 10172 // "location": "query", 10173 // "type": "boolean" 10174 // }, 10175 // "supportsTeamDrives": { 10176 // "default": "false", 10177 // "description": "Deprecated use supportsAllDrives instead.", 10178 // "location": "query", 10179 // "type": "boolean" 10180 // }, 10181 // "teamDriveId": { 10182 // "description": "Deprecated use driveId instead.", 10183 // "location": "query", 10184 // "type": "string" 10185 // } 10186 // }, 10187 // "path": "files", 10188 // "response": { 10189 // "$ref": "FileList" 10190 // }, 10191 // "scopes": [ 10192 // "https://www.googleapis.com/auth/drive", 10193 // "https://www.googleapis.com/auth/drive.appdata", 10194 // "https://www.googleapis.com/auth/drive.apps.readonly", 10195 // "https://www.googleapis.com/auth/drive.file", 10196 // "https://www.googleapis.com/auth/drive.metadata", 10197 // "https://www.googleapis.com/auth/drive.metadata.readonly", 10198 // "https://www.googleapis.com/auth/drive.photos.readonly", 10199 // "https://www.googleapis.com/auth/drive.readonly" 10200 // ] 10201 // } 10202 10203} 10204 10205// Pages invokes f for each page of results. 10206// A non-nil error returned from f will halt the iteration. 10207// The provided context supersedes any context provided to the Context method. 10208func (c *FilesListCall) Pages(ctx context.Context, f func(*FileList) error) error { 10209 c.ctx_ = ctx 10210 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10211 for { 10212 x, err := c.Do() 10213 if err != nil { 10214 return err 10215 } 10216 if err := f(x); err != nil { 10217 return err 10218 } 10219 if x.NextPageToken == "" { 10220 return nil 10221 } 10222 c.PageToken(x.NextPageToken) 10223 } 10224} 10225 10226// method id "drive.files.patch": 10227 10228type FilesPatchCall struct { 10229 s *Service 10230 fileId string 10231 file *File 10232 urlParams_ gensupport.URLParams 10233 ctx_ context.Context 10234 header_ http.Header 10235} 10236 10237// Patch: Updates file metadata and/or content. This method supports 10238// patch semantics. 10239// 10240// - fileId: The ID of the file to update. 10241func (r *FilesService) Patch(fileId string, file *File) *FilesPatchCall { 10242 c := &FilesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10243 c.fileId = fileId 10244 c.file = file 10245 return c 10246} 10247 10248// AddParents sets the optional parameter "addParents": Comma-separated 10249// list of parent IDs to add. 10250func (c *FilesPatchCall) AddParents(addParents string) *FilesPatchCall { 10251 c.urlParams_.Set("addParents", addParents) 10252 return c 10253} 10254 10255// Convert sets the optional parameter "convert": This parameter is 10256// deprecated and has no function. 10257func (c *FilesPatchCall) Convert(convert bool) *FilesPatchCall { 10258 c.urlParams_.Set("convert", fmt.Sprint(convert)) 10259 return c 10260} 10261 10262// EnforceSingleParent sets the optional parameter 10263// "enforceSingleParent": Deprecated. Adding files to multiple folders 10264// is no longer supported. Use shortcuts instead. 10265func (c *FilesPatchCall) EnforceSingleParent(enforceSingleParent bool) *FilesPatchCall { 10266 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 10267 return c 10268} 10269 10270// IncludePermissionsForView sets the optional parameter 10271// "includePermissionsForView": Specifies which additional view's 10272// permissions to include in the response. Only 'published' is 10273// supported. 10274func (c *FilesPatchCall) IncludePermissionsForView(includePermissionsForView string) *FilesPatchCall { 10275 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 10276 return c 10277} 10278 10279// ModifiedDateBehavior sets the optional parameter 10280// "modifiedDateBehavior": Determines the behavior in which modifiedDate 10281// is updated. This overrides setModifiedDate. 10282// 10283// Possible values: 10284// "fromBody" - Set modifiedDate to the value provided in the body of 10285// the request. No change if no value was provided. 10286// "fromBodyIfNeeded" - Set modifiedDate to the value provided in the 10287// body of the request depending on other contents of the update. 10288// "fromBodyOrNow" - Set modifiedDate to the value provided in the 10289// body of the request, or to the current time if no value was provided. 10290// "noChange" - Maintain the previous value of modifiedDate. 10291// "now" - Set modifiedDate to the current time. 10292// "nowIfNeeded" - Set modifiedDate to the current time depending on 10293// contents of the update. 10294func (c *FilesPatchCall) ModifiedDateBehavior(modifiedDateBehavior string) *FilesPatchCall { 10295 c.urlParams_.Set("modifiedDateBehavior", modifiedDateBehavior) 10296 return c 10297} 10298 10299// NewRevision sets the optional parameter "newRevision": Whether a blob 10300// upload should create a new revision. If false, the blob data in the 10301// current head revision is replaced. If true or not set, a new blob is 10302// created as head revision, and previous unpinned revisions are 10303// preserved for a short period of time. Pinned revisions are stored 10304// indefinitely, using additional storage quota, up to a maximum of 200 10305// revisions. For details on how revisions are retained, see the Drive 10306// Help Center. Note that this field is ignored if there is no payload 10307// in the request. 10308func (c *FilesPatchCall) NewRevision(newRevision bool) *FilesPatchCall { 10309 c.urlParams_.Set("newRevision", fmt.Sprint(newRevision)) 10310 return c 10311} 10312 10313// Ocr sets the optional parameter "ocr": Whether to attempt OCR on 10314// .jpg, .png, .gif, or .pdf uploads. 10315func (c *FilesPatchCall) Ocr(ocr bool) *FilesPatchCall { 10316 c.urlParams_.Set("ocr", fmt.Sprint(ocr)) 10317 return c 10318} 10319 10320// OcrLanguage sets the optional parameter "ocrLanguage": If ocr is 10321// true, hints at the language to use. Valid values are BCP 47 codes. 10322func (c *FilesPatchCall) OcrLanguage(ocrLanguage string) *FilesPatchCall { 10323 c.urlParams_.Set("ocrLanguage", ocrLanguage) 10324 return c 10325} 10326 10327// Pinned sets the optional parameter "pinned": Whether to pin the new 10328// revision. A file can have a maximum of 200 pinned revisions. Note 10329// that this field is ignored if there is no payload in the request. 10330func (c *FilesPatchCall) Pinned(pinned bool) *FilesPatchCall { 10331 c.urlParams_.Set("pinned", fmt.Sprint(pinned)) 10332 return c 10333} 10334 10335// RemoveParents sets the optional parameter "removeParents": 10336// Comma-separated list of parent IDs to remove. 10337func (c *FilesPatchCall) RemoveParents(removeParents string) *FilesPatchCall { 10338 c.urlParams_.Set("removeParents", removeParents) 10339 return c 10340} 10341 10342// SetModifiedDate sets the optional parameter "setModifiedDate": 10343// Whether to set the modified date using the value supplied in the 10344// request body. Setting this field to true is equivalent to 10345// modifiedDateBehavior=fromBodyOrNow, and false is equivalent to 10346// modifiedDateBehavior=now. To prevent any changes to the modified date 10347// set modifiedDateBehavior=noChange. 10348func (c *FilesPatchCall) SetModifiedDate(setModifiedDate bool) *FilesPatchCall { 10349 c.urlParams_.Set("setModifiedDate", fmt.Sprint(setModifiedDate)) 10350 return c 10351} 10352 10353// SupportsAllDrives sets the optional parameter "supportsAllDrives": 10354// Whether the requesting application supports both My Drives and shared 10355// drives. 10356func (c *FilesPatchCall) SupportsAllDrives(supportsAllDrives bool) *FilesPatchCall { 10357 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 10358 return c 10359} 10360 10361// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 10362// Deprecated use supportsAllDrives instead. 10363func (c *FilesPatchCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesPatchCall { 10364 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 10365 return c 10366} 10367 10368// TimedTextLanguage sets the optional parameter "timedTextLanguage": 10369// The language of the timed text. 10370func (c *FilesPatchCall) TimedTextLanguage(timedTextLanguage string) *FilesPatchCall { 10371 c.urlParams_.Set("timedTextLanguage", timedTextLanguage) 10372 return c 10373} 10374 10375// TimedTextTrackName sets the optional parameter "timedTextTrackName": 10376// The timed text track name. 10377func (c *FilesPatchCall) TimedTextTrackName(timedTextTrackName string) *FilesPatchCall { 10378 c.urlParams_.Set("timedTextTrackName", timedTextTrackName) 10379 return c 10380} 10381 10382// UpdateViewedDate sets the optional parameter "updateViewedDate": 10383// Whether to update the view date after successfully updating the file. 10384func (c *FilesPatchCall) UpdateViewedDate(updateViewedDate bool) *FilesPatchCall { 10385 c.urlParams_.Set("updateViewedDate", fmt.Sprint(updateViewedDate)) 10386 return c 10387} 10388 10389// UseContentAsIndexableText sets the optional parameter 10390// "useContentAsIndexableText": Whether to use the content as indexable 10391// text. 10392func (c *FilesPatchCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesPatchCall { 10393 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText)) 10394 return c 10395} 10396 10397// Fields allows partial responses to be retrieved. See 10398// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10399// for more information. 10400func (c *FilesPatchCall) Fields(s ...googleapi.Field) *FilesPatchCall { 10401 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10402 return c 10403} 10404 10405// Context sets the context to be used in this call's Do method. Any 10406// pending HTTP request will be aborted if the provided context is 10407// canceled. 10408func (c *FilesPatchCall) Context(ctx context.Context) *FilesPatchCall { 10409 c.ctx_ = ctx 10410 return c 10411} 10412 10413// Header returns an http.Header that can be modified by the caller to 10414// add HTTP headers to the request. 10415func (c *FilesPatchCall) Header() http.Header { 10416 if c.header_ == nil { 10417 c.header_ = make(http.Header) 10418 } 10419 return c.header_ 10420} 10421 10422func (c *FilesPatchCall) doRequest(alt string) (*http.Response, error) { 10423 reqHeaders := make(http.Header) 10424 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10425 for k, v := range c.header_ { 10426 reqHeaders[k] = v 10427 } 10428 reqHeaders.Set("User-Agent", c.s.userAgent()) 10429 var body io.Reader = nil 10430 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 10431 if err != nil { 10432 return nil, err 10433 } 10434 reqHeaders.Set("Content-Type", "application/json") 10435 c.urlParams_.Set("alt", alt) 10436 c.urlParams_.Set("prettyPrint", "false") 10437 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") 10438 urls += "?" + c.urlParams_.Encode() 10439 req, err := http.NewRequest("PATCH", urls, body) 10440 if err != nil { 10441 return nil, err 10442 } 10443 req.Header = reqHeaders 10444 googleapi.Expand(req.URL, map[string]string{ 10445 "fileId": c.fileId, 10446 }) 10447 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10448} 10449 10450// Do executes the "drive.files.patch" call. 10451// Exactly one of *File or error will be non-nil. Any non-2xx status 10452// code is an error. Response headers are in either 10453// *File.ServerResponse.Header or (if a response was returned at all) in 10454// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10455// whether the returned error was because http.StatusNotModified was 10456// returned. 10457func (c *FilesPatchCall) Do(opts ...googleapi.CallOption) (*File, error) { 10458 gensupport.SetOptions(c.urlParams_, opts...) 10459 res, err := c.doRequest("json") 10460 if res != nil && res.StatusCode == http.StatusNotModified { 10461 if res.Body != nil { 10462 res.Body.Close() 10463 } 10464 return nil, &googleapi.Error{ 10465 Code: res.StatusCode, 10466 Header: res.Header, 10467 } 10468 } 10469 if err != nil { 10470 return nil, err 10471 } 10472 defer googleapi.CloseBody(res) 10473 if err := googleapi.CheckResponse(res); err != nil { 10474 return nil, err 10475 } 10476 ret := &File{ 10477 ServerResponse: googleapi.ServerResponse{ 10478 Header: res.Header, 10479 HTTPStatusCode: res.StatusCode, 10480 }, 10481 } 10482 target := &ret 10483 if err := gensupport.DecodeResponse(target, res); err != nil { 10484 return nil, err 10485 } 10486 return ret, nil 10487 // { 10488 // "description": "Updates file metadata and/or content. This method supports patch semantics.", 10489 // "httpMethod": "PATCH", 10490 // "id": "drive.files.patch", 10491 // "parameterOrder": [ 10492 // "fileId" 10493 // ], 10494 // "parameters": { 10495 // "addParents": { 10496 // "description": "Comma-separated list of parent IDs to add.", 10497 // "location": "query", 10498 // "type": "string" 10499 // }, 10500 // "convert": { 10501 // "default": "false", 10502 // "description": "This parameter is deprecated and has no function.", 10503 // "location": "query", 10504 // "type": "boolean" 10505 // }, 10506 // "enforceSingleParent": { 10507 // "default": "false", 10508 // "description": "Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead.", 10509 // "location": "query", 10510 // "type": "boolean" 10511 // }, 10512 // "fileId": { 10513 // "description": "The ID of the file to update.", 10514 // "location": "path", 10515 // "required": true, 10516 // "type": "string" 10517 // }, 10518 // "includePermissionsForView": { 10519 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 10520 // "location": "query", 10521 // "type": "string" 10522 // }, 10523 // "modifiedDateBehavior": { 10524 // "description": "Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.", 10525 // "enum": [ 10526 // "fromBody", 10527 // "fromBodyIfNeeded", 10528 // "fromBodyOrNow", 10529 // "noChange", 10530 // "now", 10531 // "nowIfNeeded" 10532 // ], 10533 // "enumDescriptions": [ 10534 // "Set modifiedDate to the value provided in the body of the request. No change if no value was provided.", 10535 // "Set modifiedDate to the value provided in the body of the request depending on other contents of the update.", 10536 // "Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.", 10537 // "Maintain the previous value of modifiedDate.", 10538 // "Set modifiedDate to the current time.", 10539 // "Set modifiedDate to the current time depending on contents of the update." 10540 // ], 10541 // "location": "query", 10542 // "type": "string" 10543 // }, 10544 // "newRevision": { 10545 // "default": "true", 10546 // "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center. Note that this field is ignored if there is no payload in the request.", 10547 // "location": "query", 10548 // "type": "boolean" 10549 // }, 10550 // "ocr": { 10551 // "default": "false", 10552 // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", 10553 // "location": "query", 10554 // "type": "boolean" 10555 // }, 10556 // "ocrLanguage": { 10557 // "description": "If ocr is true, hints at the language to use. Valid values are BCP 47 codes.", 10558 // "location": "query", 10559 // "type": "string" 10560 // }, 10561 // "pinned": { 10562 // "default": "false", 10563 // "description": "Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. Note that this field is ignored if there is no payload in the request.", 10564 // "location": "query", 10565 // "type": "boolean" 10566 // }, 10567 // "removeParents": { 10568 // "description": "Comma-separated list of parent IDs to remove.", 10569 // "location": "query", 10570 // "type": "string" 10571 // }, 10572 // "setModifiedDate": { 10573 // "default": "false", 10574 // "description": "Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange.", 10575 // "location": "query", 10576 // "type": "boolean" 10577 // }, 10578 // "supportsAllDrives": { 10579 // "default": "false", 10580 // "description": "Whether the requesting application supports both My Drives and shared drives.", 10581 // "location": "query", 10582 // "type": "boolean" 10583 // }, 10584 // "supportsTeamDrives": { 10585 // "default": "false", 10586 // "description": "Deprecated use supportsAllDrives instead.", 10587 // "location": "query", 10588 // "type": "boolean" 10589 // }, 10590 // "timedTextLanguage": { 10591 // "description": "The language of the timed text.", 10592 // "location": "query", 10593 // "type": "string" 10594 // }, 10595 // "timedTextTrackName": { 10596 // "description": "The timed text track name.", 10597 // "location": "query", 10598 // "type": "string" 10599 // }, 10600 // "updateViewedDate": { 10601 // "default": "true", 10602 // "description": "Whether to update the view date after successfully updating the file.", 10603 // "location": "query", 10604 // "type": "boolean" 10605 // }, 10606 // "useContentAsIndexableText": { 10607 // "default": "false", 10608 // "description": "Whether to use the content as indexable text.", 10609 // "location": "query", 10610 // "type": "boolean" 10611 // } 10612 // }, 10613 // "path": "files/{fileId}", 10614 // "request": { 10615 // "$ref": "File" 10616 // }, 10617 // "response": { 10618 // "$ref": "File" 10619 // }, 10620 // "scopes": [ 10621 // "https://www.googleapis.com/auth/drive", 10622 // "https://www.googleapis.com/auth/drive.appdata", 10623 // "https://www.googleapis.com/auth/drive.apps.readonly", 10624 // "https://www.googleapis.com/auth/drive.file", 10625 // "https://www.googleapis.com/auth/drive.metadata", 10626 // "https://www.googleapis.com/auth/drive.scripts" 10627 // ] 10628 // } 10629 10630} 10631 10632// method id "drive.files.touch": 10633 10634type FilesTouchCall struct { 10635 s *Service 10636 fileId string 10637 urlParams_ gensupport.URLParams 10638 ctx_ context.Context 10639 header_ http.Header 10640} 10641 10642// Touch: Set the file's updated time to the current server time. 10643// 10644// - fileId: The ID of the file to update. 10645func (r *FilesService) Touch(fileId string) *FilesTouchCall { 10646 c := &FilesTouchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10647 c.fileId = fileId 10648 return c 10649} 10650 10651// IncludePermissionsForView sets the optional parameter 10652// "includePermissionsForView": Specifies which additional view's 10653// permissions to include in the response. Only 'published' is 10654// supported. 10655func (c *FilesTouchCall) IncludePermissionsForView(includePermissionsForView string) *FilesTouchCall { 10656 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 10657 return c 10658} 10659 10660// SupportsAllDrives sets the optional parameter "supportsAllDrives": 10661// Whether the requesting application supports both My Drives and shared 10662// drives. 10663func (c *FilesTouchCall) SupportsAllDrives(supportsAllDrives bool) *FilesTouchCall { 10664 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 10665 return c 10666} 10667 10668// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 10669// Deprecated use supportsAllDrives instead. 10670func (c *FilesTouchCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesTouchCall { 10671 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 10672 return c 10673} 10674 10675// Fields allows partial responses to be retrieved. See 10676// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10677// for more information. 10678func (c *FilesTouchCall) Fields(s ...googleapi.Field) *FilesTouchCall { 10679 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10680 return c 10681} 10682 10683// Context sets the context to be used in this call's Do method. Any 10684// pending HTTP request will be aborted if the provided context is 10685// canceled. 10686func (c *FilesTouchCall) Context(ctx context.Context) *FilesTouchCall { 10687 c.ctx_ = ctx 10688 return c 10689} 10690 10691// Header returns an http.Header that can be modified by the caller to 10692// add HTTP headers to the request. 10693func (c *FilesTouchCall) Header() http.Header { 10694 if c.header_ == nil { 10695 c.header_ = make(http.Header) 10696 } 10697 return c.header_ 10698} 10699 10700func (c *FilesTouchCall) doRequest(alt string) (*http.Response, error) { 10701 reqHeaders := make(http.Header) 10702 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10703 for k, v := range c.header_ { 10704 reqHeaders[k] = v 10705 } 10706 reqHeaders.Set("User-Agent", c.s.userAgent()) 10707 var body io.Reader = nil 10708 c.urlParams_.Set("alt", alt) 10709 c.urlParams_.Set("prettyPrint", "false") 10710 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/touch") 10711 urls += "?" + c.urlParams_.Encode() 10712 req, err := http.NewRequest("POST", urls, body) 10713 if err != nil { 10714 return nil, err 10715 } 10716 req.Header = reqHeaders 10717 googleapi.Expand(req.URL, map[string]string{ 10718 "fileId": c.fileId, 10719 }) 10720 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10721} 10722 10723// Do executes the "drive.files.touch" call. 10724// Exactly one of *File or error will be non-nil. Any non-2xx status 10725// code is an error. Response headers are in either 10726// *File.ServerResponse.Header or (if a response was returned at all) in 10727// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10728// whether the returned error was because http.StatusNotModified was 10729// returned. 10730func (c *FilesTouchCall) Do(opts ...googleapi.CallOption) (*File, error) { 10731 gensupport.SetOptions(c.urlParams_, opts...) 10732 res, err := c.doRequest("json") 10733 if res != nil && res.StatusCode == http.StatusNotModified { 10734 if res.Body != nil { 10735 res.Body.Close() 10736 } 10737 return nil, &googleapi.Error{ 10738 Code: res.StatusCode, 10739 Header: res.Header, 10740 } 10741 } 10742 if err != nil { 10743 return nil, err 10744 } 10745 defer googleapi.CloseBody(res) 10746 if err := googleapi.CheckResponse(res); err != nil { 10747 return nil, err 10748 } 10749 ret := &File{ 10750 ServerResponse: googleapi.ServerResponse{ 10751 Header: res.Header, 10752 HTTPStatusCode: res.StatusCode, 10753 }, 10754 } 10755 target := &ret 10756 if err := gensupport.DecodeResponse(target, res); err != nil { 10757 return nil, err 10758 } 10759 return ret, nil 10760 // { 10761 // "description": "Set the file's updated time to the current server time.", 10762 // "httpMethod": "POST", 10763 // "id": "drive.files.touch", 10764 // "parameterOrder": [ 10765 // "fileId" 10766 // ], 10767 // "parameters": { 10768 // "fileId": { 10769 // "description": "The ID of the file to update.", 10770 // "location": "path", 10771 // "required": true, 10772 // "type": "string" 10773 // }, 10774 // "includePermissionsForView": { 10775 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 10776 // "location": "query", 10777 // "type": "string" 10778 // }, 10779 // "supportsAllDrives": { 10780 // "default": "false", 10781 // "description": "Whether the requesting application supports both My Drives and shared drives.", 10782 // "location": "query", 10783 // "type": "boolean" 10784 // }, 10785 // "supportsTeamDrives": { 10786 // "default": "false", 10787 // "description": "Deprecated use supportsAllDrives instead.", 10788 // "location": "query", 10789 // "type": "boolean" 10790 // } 10791 // }, 10792 // "path": "files/{fileId}/touch", 10793 // "response": { 10794 // "$ref": "File" 10795 // }, 10796 // "scopes": [ 10797 // "https://www.googleapis.com/auth/drive", 10798 // "https://www.googleapis.com/auth/drive.appdata", 10799 // "https://www.googleapis.com/auth/drive.apps.readonly", 10800 // "https://www.googleapis.com/auth/drive.file", 10801 // "https://www.googleapis.com/auth/drive.metadata" 10802 // ] 10803 // } 10804 10805} 10806 10807// method id "drive.files.trash": 10808 10809type FilesTrashCall struct { 10810 s *Service 10811 fileId string 10812 urlParams_ gensupport.URLParams 10813 ctx_ context.Context 10814 header_ http.Header 10815} 10816 10817// Trash: Moves a file to the trash. The currently authenticated user 10818// must own the file or be at least a fileOrganizer on the parent for 10819// shared drive files. Only the owner may trash a file. The trashed item 10820// is excluded from all files.list responses returned for any user who 10821// does not own the file. However, all users with access to the file can 10822// see the trashed item metadata in an API response. All users with 10823// access can copy, download, export, and share the file. 10824// 10825// - fileId: The ID of the file to trash. 10826func (r *FilesService) Trash(fileId string) *FilesTrashCall { 10827 c := &FilesTrashCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10828 c.fileId = fileId 10829 return c 10830} 10831 10832// IncludePermissionsForView sets the optional parameter 10833// "includePermissionsForView": Specifies which additional view's 10834// permissions to include in the response. Only 'published' is 10835// supported. 10836func (c *FilesTrashCall) IncludePermissionsForView(includePermissionsForView string) *FilesTrashCall { 10837 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 10838 return c 10839} 10840 10841// SupportsAllDrives sets the optional parameter "supportsAllDrives": 10842// Whether the requesting application supports both My Drives and shared 10843// drives. 10844func (c *FilesTrashCall) SupportsAllDrives(supportsAllDrives bool) *FilesTrashCall { 10845 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 10846 return c 10847} 10848 10849// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 10850// Deprecated use supportsAllDrives instead. 10851func (c *FilesTrashCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesTrashCall { 10852 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 10853 return c 10854} 10855 10856// Fields allows partial responses to be retrieved. See 10857// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10858// for more information. 10859func (c *FilesTrashCall) Fields(s ...googleapi.Field) *FilesTrashCall { 10860 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10861 return c 10862} 10863 10864// Context sets the context to be used in this call's Do method. Any 10865// pending HTTP request will be aborted if the provided context is 10866// canceled. 10867func (c *FilesTrashCall) Context(ctx context.Context) *FilesTrashCall { 10868 c.ctx_ = ctx 10869 return c 10870} 10871 10872// Header returns an http.Header that can be modified by the caller to 10873// add HTTP headers to the request. 10874func (c *FilesTrashCall) Header() http.Header { 10875 if c.header_ == nil { 10876 c.header_ = make(http.Header) 10877 } 10878 return c.header_ 10879} 10880 10881func (c *FilesTrashCall) doRequest(alt string) (*http.Response, error) { 10882 reqHeaders := make(http.Header) 10883 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 10884 for k, v := range c.header_ { 10885 reqHeaders[k] = v 10886 } 10887 reqHeaders.Set("User-Agent", c.s.userAgent()) 10888 var body io.Reader = nil 10889 c.urlParams_.Set("alt", alt) 10890 c.urlParams_.Set("prettyPrint", "false") 10891 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/trash") 10892 urls += "?" + c.urlParams_.Encode() 10893 req, err := http.NewRequest("POST", urls, body) 10894 if err != nil { 10895 return nil, err 10896 } 10897 req.Header = reqHeaders 10898 googleapi.Expand(req.URL, map[string]string{ 10899 "fileId": c.fileId, 10900 }) 10901 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10902} 10903 10904// Do executes the "drive.files.trash" call. 10905// Exactly one of *File or error will be non-nil. Any non-2xx status 10906// code is an error. Response headers are in either 10907// *File.ServerResponse.Header or (if a response was returned at all) in 10908// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10909// whether the returned error was because http.StatusNotModified was 10910// returned. 10911func (c *FilesTrashCall) Do(opts ...googleapi.CallOption) (*File, error) { 10912 gensupport.SetOptions(c.urlParams_, opts...) 10913 res, err := c.doRequest("json") 10914 if res != nil && res.StatusCode == http.StatusNotModified { 10915 if res.Body != nil { 10916 res.Body.Close() 10917 } 10918 return nil, &googleapi.Error{ 10919 Code: res.StatusCode, 10920 Header: res.Header, 10921 } 10922 } 10923 if err != nil { 10924 return nil, err 10925 } 10926 defer googleapi.CloseBody(res) 10927 if err := googleapi.CheckResponse(res); err != nil { 10928 return nil, err 10929 } 10930 ret := &File{ 10931 ServerResponse: googleapi.ServerResponse{ 10932 Header: res.Header, 10933 HTTPStatusCode: res.StatusCode, 10934 }, 10935 } 10936 target := &ret 10937 if err := gensupport.DecodeResponse(target, res); err != nil { 10938 return nil, err 10939 } 10940 return ret, nil 10941 // { 10942 // "description": "Moves a file to the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may trash a file. The trashed item is excluded from all files.list responses returned for any user who does not own the file. However, all users with access to the file can see the trashed item metadata in an API response. All users with access can copy, download, export, and share the file.", 10943 // "httpMethod": "POST", 10944 // "id": "drive.files.trash", 10945 // "parameterOrder": [ 10946 // "fileId" 10947 // ], 10948 // "parameters": { 10949 // "fileId": { 10950 // "description": "The ID of the file to trash.", 10951 // "location": "path", 10952 // "required": true, 10953 // "type": "string" 10954 // }, 10955 // "includePermissionsForView": { 10956 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 10957 // "location": "query", 10958 // "type": "string" 10959 // }, 10960 // "supportsAllDrives": { 10961 // "default": "false", 10962 // "description": "Whether the requesting application supports both My Drives and shared drives.", 10963 // "location": "query", 10964 // "type": "boolean" 10965 // }, 10966 // "supportsTeamDrives": { 10967 // "default": "false", 10968 // "description": "Deprecated use supportsAllDrives instead.", 10969 // "location": "query", 10970 // "type": "boolean" 10971 // } 10972 // }, 10973 // "path": "files/{fileId}/trash", 10974 // "response": { 10975 // "$ref": "File" 10976 // }, 10977 // "scopes": [ 10978 // "https://www.googleapis.com/auth/drive", 10979 // "https://www.googleapis.com/auth/drive.appdata", 10980 // "https://www.googleapis.com/auth/drive.apps.readonly", 10981 // "https://www.googleapis.com/auth/drive.file" 10982 // ] 10983 // } 10984 10985} 10986 10987// method id "drive.files.untrash": 10988 10989type FilesUntrashCall struct { 10990 s *Service 10991 fileId string 10992 urlParams_ gensupport.URLParams 10993 ctx_ context.Context 10994 header_ http.Header 10995} 10996 10997// Untrash: Restores a file from the trash. The currently authenticated 10998// user must own the file or be at least a fileOrganizer on the parent 10999// for shared drive files. Only the owner may untrash a file. 11000// 11001// - fileId: The ID of the file to untrash. 11002func (r *FilesService) Untrash(fileId string) *FilesUntrashCall { 11003 c := &FilesUntrashCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11004 c.fileId = fileId 11005 return c 11006} 11007 11008// IncludePermissionsForView sets the optional parameter 11009// "includePermissionsForView": Specifies which additional view's 11010// permissions to include in the response. Only 'published' is 11011// supported. 11012func (c *FilesUntrashCall) IncludePermissionsForView(includePermissionsForView string) *FilesUntrashCall { 11013 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 11014 return c 11015} 11016 11017// SupportsAllDrives sets the optional parameter "supportsAllDrives": 11018// Whether the requesting application supports both My Drives and shared 11019// drives. 11020func (c *FilesUntrashCall) SupportsAllDrives(supportsAllDrives bool) *FilesUntrashCall { 11021 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 11022 return c 11023} 11024 11025// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 11026// Deprecated use supportsAllDrives instead. 11027func (c *FilesUntrashCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesUntrashCall { 11028 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 11029 return c 11030} 11031 11032// Fields allows partial responses to be retrieved. See 11033// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11034// for more information. 11035func (c *FilesUntrashCall) Fields(s ...googleapi.Field) *FilesUntrashCall { 11036 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11037 return c 11038} 11039 11040// Context sets the context to be used in this call's Do method. Any 11041// pending HTTP request will be aborted if the provided context is 11042// canceled. 11043func (c *FilesUntrashCall) Context(ctx context.Context) *FilesUntrashCall { 11044 c.ctx_ = ctx 11045 return c 11046} 11047 11048// Header returns an http.Header that can be modified by the caller to 11049// add HTTP headers to the request. 11050func (c *FilesUntrashCall) Header() http.Header { 11051 if c.header_ == nil { 11052 c.header_ = make(http.Header) 11053 } 11054 return c.header_ 11055} 11056 11057func (c *FilesUntrashCall) doRequest(alt string) (*http.Response, error) { 11058 reqHeaders := make(http.Header) 11059 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 11060 for k, v := range c.header_ { 11061 reqHeaders[k] = v 11062 } 11063 reqHeaders.Set("User-Agent", c.s.userAgent()) 11064 var body io.Reader = nil 11065 c.urlParams_.Set("alt", alt) 11066 c.urlParams_.Set("prettyPrint", "false") 11067 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/untrash") 11068 urls += "?" + c.urlParams_.Encode() 11069 req, err := http.NewRequest("POST", urls, body) 11070 if err != nil { 11071 return nil, err 11072 } 11073 req.Header = reqHeaders 11074 googleapi.Expand(req.URL, map[string]string{ 11075 "fileId": c.fileId, 11076 }) 11077 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11078} 11079 11080// Do executes the "drive.files.untrash" call. 11081// Exactly one of *File or error will be non-nil. Any non-2xx status 11082// code is an error. Response headers are in either 11083// *File.ServerResponse.Header or (if a response was returned at all) in 11084// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11085// whether the returned error was because http.StatusNotModified was 11086// returned. 11087func (c *FilesUntrashCall) Do(opts ...googleapi.CallOption) (*File, error) { 11088 gensupport.SetOptions(c.urlParams_, opts...) 11089 res, err := c.doRequest("json") 11090 if res != nil && res.StatusCode == http.StatusNotModified { 11091 if res.Body != nil { 11092 res.Body.Close() 11093 } 11094 return nil, &googleapi.Error{ 11095 Code: res.StatusCode, 11096 Header: res.Header, 11097 } 11098 } 11099 if err != nil { 11100 return nil, err 11101 } 11102 defer googleapi.CloseBody(res) 11103 if err := googleapi.CheckResponse(res); err != nil { 11104 return nil, err 11105 } 11106 ret := &File{ 11107 ServerResponse: googleapi.ServerResponse{ 11108 Header: res.Header, 11109 HTTPStatusCode: res.StatusCode, 11110 }, 11111 } 11112 target := &ret 11113 if err := gensupport.DecodeResponse(target, res); err != nil { 11114 return nil, err 11115 } 11116 return ret, nil 11117 // { 11118 // "description": "Restores a file from the trash. The currently authenticated user must own the file or be at least a fileOrganizer on the parent for shared drive files. Only the owner may untrash a file.", 11119 // "httpMethod": "POST", 11120 // "id": "drive.files.untrash", 11121 // "parameterOrder": [ 11122 // "fileId" 11123 // ], 11124 // "parameters": { 11125 // "fileId": { 11126 // "description": "The ID of the file to untrash.", 11127 // "location": "path", 11128 // "required": true, 11129 // "type": "string" 11130 // }, 11131 // "includePermissionsForView": { 11132 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 11133 // "location": "query", 11134 // "type": "string" 11135 // }, 11136 // "supportsAllDrives": { 11137 // "default": "false", 11138 // "description": "Whether the requesting application supports both My Drives and shared drives.", 11139 // "location": "query", 11140 // "type": "boolean" 11141 // }, 11142 // "supportsTeamDrives": { 11143 // "default": "false", 11144 // "description": "Deprecated use supportsAllDrives instead.", 11145 // "location": "query", 11146 // "type": "boolean" 11147 // } 11148 // }, 11149 // "path": "files/{fileId}/untrash", 11150 // "response": { 11151 // "$ref": "File" 11152 // }, 11153 // "scopes": [ 11154 // "https://www.googleapis.com/auth/drive", 11155 // "https://www.googleapis.com/auth/drive.appdata", 11156 // "https://www.googleapis.com/auth/drive.apps.readonly", 11157 // "https://www.googleapis.com/auth/drive.file" 11158 // ] 11159 // } 11160 11161} 11162 11163// method id "drive.files.update": 11164 11165type FilesUpdateCall struct { 11166 s *Service 11167 fileId string 11168 file *File 11169 urlParams_ gensupport.URLParams 11170 mediaInfo_ *gensupport.MediaInfo 11171 ctx_ context.Context 11172 header_ http.Header 11173} 11174 11175// Update: Updates file metadata and/or content. 11176// 11177// - fileId: The ID of the file to update. 11178func (r *FilesService) Update(fileId string, file *File) *FilesUpdateCall { 11179 c := &FilesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11180 c.fileId = fileId 11181 c.file = file 11182 return c 11183} 11184 11185// AddParents sets the optional parameter "addParents": Comma-separated 11186// list of parent IDs to add. 11187func (c *FilesUpdateCall) AddParents(addParents string) *FilesUpdateCall { 11188 c.urlParams_.Set("addParents", addParents) 11189 return c 11190} 11191 11192// Convert sets the optional parameter "convert": This parameter is 11193// deprecated and has no function. 11194func (c *FilesUpdateCall) Convert(convert bool) *FilesUpdateCall { 11195 c.urlParams_.Set("convert", fmt.Sprint(convert)) 11196 return c 11197} 11198 11199// EnforceSingleParent sets the optional parameter 11200// "enforceSingleParent": Deprecated. Adding files to multiple folders 11201// is no longer supported. Use shortcuts instead. 11202func (c *FilesUpdateCall) EnforceSingleParent(enforceSingleParent bool) *FilesUpdateCall { 11203 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 11204 return c 11205} 11206 11207// IncludePermissionsForView sets the optional parameter 11208// "includePermissionsForView": Specifies which additional view's 11209// permissions to include in the response. Only 'published' is 11210// supported. 11211func (c *FilesUpdateCall) IncludePermissionsForView(includePermissionsForView string) *FilesUpdateCall { 11212 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 11213 return c 11214} 11215 11216// ModifiedDateBehavior sets the optional parameter 11217// "modifiedDateBehavior": Determines the behavior in which modifiedDate 11218// is updated. This overrides setModifiedDate. 11219// 11220// Possible values: 11221// "fromBody" - Set modifiedDate to the value provided in the body of 11222// the request. No change if no value was provided. 11223// "fromBodyIfNeeded" - Set modifiedDate to the value provided in the 11224// body of the request depending on other contents of the update. 11225// "fromBodyOrNow" - Set modifiedDate to the value provided in the 11226// body of the request, or to the current time if no value was provided. 11227// "noChange" - Maintain the previous value of modifiedDate. 11228// "now" - Set modifiedDate to the current time. 11229// "nowIfNeeded" - Set modifiedDate to the current time depending on 11230// contents of the update. 11231func (c *FilesUpdateCall) ModifiedDateBehavior(modifiedDateBehavior string) *FilesUpdateCall { 11232 c.urlParams_.Set("modifiedDateBehavior", modifiedDateBehavior) 11233 return c 11234} 11235 11236// NewRevision sets the optional parameter "newRevision": Whether a blob 11237// upload should create a new revision. If false, the blob data in the 11238// current head revision is replaced. If true or not set, a new blob is 11239// created as head revision, and previous unpinned revisions are 11240// preserved for a short period of time. Pinned revisions are stored 11241// indefinitely, using additional storage quota, up to a maximum of 200 11242// revisions. For details on how revisions are retained, see the Drive 11243// Help Center. Note that this field is ignored if there is no payload 11244// in the request. 11245func (c *FilesUpdateCall) NewRevision(newRevision bool) *FilesUpdateCall { 11246 c.urlParams_.Set("newRevision", fmt.Sprint(newRevision)) 11247 return c 11248} 11249 11250// Ocr sets the optional parameter "ocr": Whether to attempt OCR on 11251// .jpg, .png, .gif, or .pdf uploads. 11252func (c *FilesUpdateCall) Ocr(ocr bool) *FilesUpdateCall { 11253 c.urlParams_.Set("ocr", fmt.Sprint(ocr)) 11254 return c 11255} 11256 11257// OcrLanguage sets the optional parameter "ocrLanguage": If ocr is 11258// true, hints at the language to use. Valid values are BCP 47 codes. 11259func (c *FilesUpdateCall) OcrLanguage(ocrLanguage string) *FilesUpdateCall { 11260 c.urlParams_.Set("ocrLanguage", ocrLanguage) 11261 return c 11262} 11263 11264// Pinned sets the optional parameter "pinned": Whether to pin the new 11265// revision. A file can have a maximum of 200 pinned revisions. Note 11266// that this field is ignored if there is no payload in the request. 11267func (c *FilesUpdateCall) Pinned(pinned bool) *FilesUpdateCall { 11268 c.urlParams_.Set("pinned", fmt.Sprint(pinned)) 11269 return c 11270} 11271 11272// RemoveParents sets the optional parameter "removeParents": 11273// Comma-separated list of parent IDs to remove. 11274func (c *FilesUpdateCall) RemoveParents(removeParents string) *FilesUpdateCall { 11275 c.urlParams_.Set("removeParents", removeParents) 11276 return c 11277} 11278 11279// SetModifiedDate sets the optional parameter "setModifiedDate": 11280// Whether to set the modified date using the value supplied in the 11281// request body. Setting this field to true is equivalent to 11282// modifiedDateBehavior=fromBodyOrNow, and false is equivalent to 11283// modifiedDateBehavior=now. To prevent any changes to the modified date 11284// set modifiedDateBehavior=noChange. 11285func (c *FilesUpdateCall) SetModifiedDate(setModifiedDate bool) *FilesUpdateCall { 11286 c.urlParams_.Set("setModifiedDate", fmt.Sprint(setModifiedDate)) 11287 return c 11288} 11289 11290// SupportsAllDrives sets the optional parameter "supportsAllDrives": 11291// Whether the requesting application supports both My Drives and shared 11292// drives. 11293func (c *FilesUpdateCall) SupportsAllDrives(supportsAllDrives bool) *FilesUpdateCall { 11294 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 11295 return c 11296} 11297 11298// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 11299// Deprecated use supportsAllDrives instead. 11300func (c *FilesUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesUpdateCall { 11301 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 11302 return c 11303} 11304 11305// TimedTextLanguage sets the optional parameter "timedTextLanguage": 11306// The language of the timed text. 11307func (c *FilesUpdateCall) TimedTextLanguage(timedTextLanguage string) *FilesUpdateCall { 11308 c.urlParams_.Set("timedTextLanguage", timedTextLanguage) 11309 return c 11310} 11311 11312// TimedTextTrackName sets the optional parameter "timedTextTrackName": 11313// The timed text track name. 11314func (c *FilesUpdateCall) TimedTextTrackName(timedTextTrackName string) *FilesUpdateCall { 11315 c.urlParams_.Set("timedTextTrackName", timedTextTrackName) 11316 return c 11317} 11318 11319// UpdateViewedDate sets the optional parameter "updateViewedDate": 11320// Whether to update the view date after successfully updating the file. 11321func (c *FilesUpdateCall) UpdateViewedDate(updateViewedDate bool) *FilesUpdateCall { 11322 c.urlParams_.Set("updateViewedDate", fmt.Sprint(updateViewedDate)) 11323 return c 11324} 11325 11326// UseContentAsIndexableText sets the optional parameter 11327// "useContentAsIndexableText": Whether to use the content as indexable 11328// text. 11329func (c *FilesUpdateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesUpdateCall { 11330 c.urlParams_.Set("useContentAsIndexableText", fmt.Sprint(useContentAsIndexableText)) 11331 return c 11332} 11333 11334// Media specifies the media to upload in one or more chunks. The chunk 11335// size may be controlled by supplying a MediaOption generated by 11336// googleapi.ChunkSize. The chunk size defaults to 11337// googleapi.DefaultUploadChunkSize.The Content-Type header used in the 11338// upload request will be determined by sniffing the contents of r, 11339// unless a MediaOption generated by googleapi.ContentType is 11340// supplied. 11341// At most one of Media and ResumableMedia may be set. 11342func (c *FilesUpdateCall) Media(r io.Reader, options ...googleapi.MediaOption) *FilesUpdateCall { 11343 c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options) 11344 return c 11345} 11346 11347// ResumableMedia specifies the media to upload in chunks and can be 11348// canceled with ctx. 11349// 11350// Deprecated: use Media instead. 11351// 11352// At most one of Media and ResumableMedia may be set. mediaType 11353// identifies the MIME media type of the upload, such as "image/png". If 11354// mediaType is "", it will be auto-detected. The provided ctx will 11355// supersede any context previously provided to the Context method. 11356func (c *FilesUpdateCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *FilesUpdateCall { 11357 c.ctx_ = ctx 11358 c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType) 11359 return c 11360} 11361 11362// ProgressUpdater provides a callback function that will be called 11363// after every chunk. It should be a low-latency function in order to 11364// not slow down the upload operation. This should only be called when 11365// using ResumableMedia (as opposed to Media). 11366func (c *FilesUpdateCall) ProgressUpdater(pu googleapi.ProgressUpdater) *FilesUpdateCall { 11367 c.mediaInfo_.SetProgressUpdater(pu) 11368 return c 11369} 11370 11371// Fields allows partial responses to be retrieved. See 11372// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11373// for more information. 11374func (c *FilesUpdateCall) Fields(s ...googleapi.Field) *FilesUpdateCall { 11375 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11376 return c 11377} 11378 11379// Context sets the context to be used in this call's Do method. Any 11380// pending HTTP request will be aborted if the provided context is 11381// canceled. 11382// This context will supersede any context previously provided to the 11383// ResumableMedia method. 11384func (c *FilesUpdateCall) Context(ctx context.Context) *FilesUpdateCall { 11385 c.ctx_ = ctx 11386 return c 11387} 11388 11389// Header returns an http.Header that can be modified by the caller to 11390// add HTTP headers to the request. 11391func (c *FilesUpdateCall) Header() http.Header { 11392 if c.header_ == nil { 11393 c.header_ = make(http.Header) 11394 } 11395 return c.header_ 11396} 11397 11398func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) { 11399 reqHeaders := make(http.Header) 11400 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 11401 for k, v := range c.header_ { 11402 reqHeaders[k] = v 11403 } 11404 reqHeaders.Set("User-Agent", c.s.userAgent()) 11405 var body io.Reader = nil 11406 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 11407 if err != nil { 11408 return nil, err 11409 } 11410 reqHeaders.Set("Content-Type", "application/json") 11411 c.urlParams_.Set("alt", alt) 11412 c.urlParams_.Set("prettyPrint", "false") 11413 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}") 11414 if c.mediaInfo_ != nil { 11415 urls = googleapi.ResolveRelative(c.s.BasePath, "/upload/drive/v2/files/{fileId}") 11416 c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType()) 11417 } 11418 if body == nil { 11419 body = new(bytes.Buffer) 11420 reqHeaders.Set("Content-Type", "application/json") 11421 } 11422 body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body) 11423 defer cleanup() 11424 urls += "?" + c.urlParams_.Encode() 11425 req, err := http.NewRequest("PUT", urls, body) 11426 if err != nil { 11427 return nil, err 11428 } 11429 req.Header = reqHeaders 11430 req.GetBody = getBody 11431 googleapi.Expand(req.URL, map[string]string{ 11432 "fileId": c.fileId, 11433 }) 11434 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11435} 11436 11437// Do executes the "drive.files.update" call. 11438// Exactly one of *File or error will be non-nil. Any non-2xx status 11439// code is an error. Response headers are in either 11440// *File.ServerResponse.Header or (if a response was returned at all) in 11441// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11442// whether the returned error was because http.StatusNotModified was 11443// returned. 11444func (c *FilesUpdateCall) Do(opts ...googleapi.CallOption) (*File, error) { 11445 gensupport.SetOptions(c.urlParams_, opts...) 11446 res, err := c.doRequest("json") 11447 if res != nil && res.StatusCode == http.StatusNotModified { 11448 if res.Body != nil { 11449 res.Body.Close() 11450 } 11451 return nil, &googleapi.Error{ 11452 Code: res.StatusCode, 11453 Header: res.Header, 11454 } 11455 } 11456 if err != nil { 11457 return nil, err 11458 } 11459 defer googleapi.CloseBody(res) 11460 if err := googleapi.CheckResponse(res); err != nil { 11461 return nil, err 11462 } 11463 rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location")) 11464 if rx != nil { 11465 rx.Client = c.s.client 11466 rx.UserAgent = c.s.userAgent() 11467 ctx := c.ctx_ 11468 if ctx == nil { 11469 ctx = context.TODO() 11470 } 11471 res, err = rx.Upload(ctx) 11472 if err != nil { 11473 return nil, err 11474 } 11475 defer res.Body.Close() 11476 if err := googleapi.CheckResponse(res); err != nil { 11477 return nil, err 11478 } 11479 } 11480 ret := &File{ 11481 ServerResponse: googleapi.ServerResponse{ 11482 Header: res.Header, 11483 HTTPStatusCode: res.StatusCode, 11484 }, 11485 } 11486 target := &ret 11487 if err := gensupport.DecodeResponse(target, res); err != nil { 11488 return nil, err 11489 } 11490 return ret, nil 11491 // { 11492 // "description": "Updates file metadata and/or content.", 11493 // "httpMethod": "PUT", 11494 // "id": "drive.files.update", 11495 // "mediaUpload": { 11496 // "accept": [ 11497 // "*/*" 11498 // ], 11499 // "maxSize": "5120GB", 11500 // "protocols": { 11501 // "resumable": { 11502 // "multipart": true, 11503 // "path": "/resumable/upload/drive/v2/files/{fileId}" 11504 // }, 11505 // "simple": { 11506 // "multipart": true, 11507 // "path": "/upload/drive/v2/files/{fileId}" 11508 // } 11509 // } 11510 // }, 11511 // "parameterOrder": [ 11512 // "fileId" 11513 // ], 11514 // "parameters": { 11515 // "addParents": { 11516 // "description": "Comma-separated list of parent IDs to add.", 11517 // "location": "query", 11518 // "type": "string" 11519 // }, 11520 // "convert": { 11521 // "default": "false", 11522 // "description": "This parameter is deprecated and has no function.", 11523 // "location": "query", 11524 // "type": "boolean" 11525 // }, 11526 // "enforceSingleParent": { 11527 // "default": "false", 11528 // "description": "Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead.", 11529 // "location": "query", 11530 // "type": "boolean" 11531 // }, 11532 // "fileId": { 11533 // "description": "The ID of the file to update.", 11534 // "location": "path", 11535 // "required": true, 11536 // "type": "string" 11537 // }, 11538 // "includePermissionsForView": { 11539 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 11540 // "location": "query", 11541 // "type": "string" 11542 // }, 11543 // "modifiedDateBehavior": { 11544 // "description": "Determines the behavior in which modifiedDate is updated. This overrides setModifiedDate.", 11545 // "enum": [ 11546 // "fromBody", 11547 // "fromBodyIfNeeded", 11548 // "fromBodyOrNow", 11549 // "noChange", 11550 // "now", 11551 // "nowIfNeeded" 11552 // ], 11553 // "enumDescriptions": [ 11554 // "Set modifiedDate to the value provided in the body of the request. No change if no value was provided.", 11555 // "Set modifiedDate to the value provided in the body of the request depending on other contents of the update.", 11556 // "Set modifiedDate to the value provided in the body of the request, or to the current time if no value was provided.", 11557 // "Maintain the previous value of modifiedDate.", 11558 // "Set modifiedDate to the current time.", 11559 // "Set modifiedDate to the current time depending on contents of the update." 11560 // ], 11561 // "location": "query", 11562 // "type": "string" 11563 // }, 11564 // "newRevision": { 11565 // "default": "true", 11566 // "description": "Whether a blob upload should create a new revision. If false, the blob data in the current head revision is replaced. If true or not set, a new blob is created as head revision, and previous unpinned revisions are preserved for a short period of time. Pinned revisions are stored indefinitely, using additional storage quota, up to a maximum of 200 revisions. For details on how revisions are retained, see the Drive Help Center. Note that this field is ignored if there is no payload in the request.", 11567 // "location": "query", 11568 // "type": "boolean" 11569 // }, 11570 // "ocr": { 11571 // "default": "false", 11572 // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", 11573 // "location": "query", 11574 // "type": "boolean" 11575 // }, 11576 // "ocrLanguage": { 11577 // "description": "If ocr is true, hints at the language to use. Valid values are BCP 47 codes.", 11578 // "location": "query", 11579 // "type": "string" 11580 // }, 11581 // "pinned": { 11582 // "default": "false", 11583 // "description": "Whether to pin the new revision. A file can have a maximum of 200 pinned revisions. Note that this field is ignored if there is no payload in the request.", 11584 // "location": "query", 11585 // "type": "boolean" 11586 // }, 11587 // "removeParents": { 11588 // "description": "Comma-separated list of parent IDs to remove.", 11589 // "location": "query", 11590 // "type": "string" 11591 // }, 11592 // "setModifiedDate": { 11593 // "default": "false", 11594 // "description": "Whether to set the modified date using the value supplied in the request body. Setting this field to true is equivalent to modifiedDateBehavior=fromBodyOrNow, and false is equivalent to modifiedDateBehavior=now. To prevent any changes to the modified date set modifiedDateBehavior=noChange.", 11595 // "location": "query", 11596 // "type": "boolean" 11597 // }, 11598 // "supportsAllDrives": { 11599 // "default": "false", 11600 // "description": "Whether the requesting application supports both My Drives and shared drives.", 11601 // "location": "query", 11602 // "type": "boolean" 11603 // }, 11604 // "supportsTeamDrives": { 11605 // "default": "false", 11606 // "description": "Deprecated use supportsAllDrives instead.", 11607 // "location": "query", 11608 // "type": "boolean" 11609 // }, 11610 // "timedTextLanguage": { 11611 // "description": "The language of the timed text.", 11612 // "location": "query", 11613 // "type": "string" 11614 // }, 11615 // "timedTextTrackName": { 11616 // "description": "The timed text track name.", 11617 // "location": "query", 11618 // "type": "string" 11619 // }, 11620 // "updateViewedDate": { 11621 // "default": "true", 11622 // "description": "Whether to update the view date after successfully updating the file.", 11623 // "location": "query", 11624 // "type": "boolean" 11625 // }, 11626 // "useContentAsIndexableText": { 11627 // "default": "false", 11628 // "description": "Whether to use the content as indexable text.", 11629 // "location": "query", 11630 // "type": "boolean" 11631 // } 11632 // }, 11633 // "path": "files/{fileId}", 11634 // "request": { 11635 // "$ref": "File" 11636 // }, 11637 // "response": { 11638 // "$ref": "File" 11639 // }, 11640 // "scopes": [ 11641 // "https://www.googleapis.com/auth/drive", 11642 // "https://www.googleapis.com/auth/drive.appdata", 11643 // "https://www.googleapis.com/auth/drive.apps.readonly", 11644 // "https://www.googleapis.com/auth/drive.file", 11645 // "https://www.googleapis.com/auth/drive.metadata", 11646 // "https://www.googleapis.com/auth/drive.scripts" 11647 // ], 11648 // "supportsMediaUpload": true 11649 // } 11650 11651} 11652 11653// method id "drive.files.watch": 11654 11655type FilesWatchCall struct { 11656 s *Service 11657 fileId string 11658 channel *Channel 11659 urlParams_ gensupport.URLParams 11660 ctx_ context.Context 11661 header_ http.Header 11662} 11663 11664// Watch: Subscribe to changes on a file 11665// 11666// - fileId: The ID for the file in question. 11667func (r *FilesService) Watch(fileId string, channel *Channel) *FilesWatchCall { 11668 c := &FilesWatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11669 c.fileId = fileId 11670 c.channel = channel 11671 return c 11672} 11673 11674// AcknowledgeAbuse sets the optional parameter "acknowledgeAbuse": 11675// Whether the user is acknowledging the risk of downloading known 11676// malware or other abusive files. 11677func (c *FilesWatchCall) AcknowledgeAbuse(acknowledgeAbuse bool) *FilesWatchCall { 11678 c.urlParams_.Set("acknowledgeAbuse", fmt.Sprint(acknowledgeAbuse)) 11679 return c 11680} 11681 11682// IncludePermissionsForView sets the optional parameter 11683// "includePermissionsForView": Specifies which additional view's 11684// permissions to include in the response. Only 'published' is 11685// supported. 11686func (c *FilesWatchCall) IncludePermissionsForView(includePermissionsForView string) *FilesWatchCall { 11687 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 11688 return c 11689} 11690 11691// Projection sets the optional parameter "projection": This parameter 11692// is deprecated and has no function. 11693// 11694// Possible values: 11695// "BASIC" - Deprecated 11696// "FULL" - Deprecated 11697func (c *FilesWatchCall) Projection(projection string) *FilesWatchCall { 11698 c.urlParams_.Set("projection", projection) 11699 return c 11700} 11701 11702// RevisionId sets the optional parameter "revisionId": Specifies the 11703// Revision ID that should be downloaded. Ignored unless alt=media is 11704// specified. 11705func (c *FilesWatchCall) RevisionId(revisionId string) *FilesWatchCall { 11706 c.urlParams_.Set("revisionId", revisionId) 11707 return c 11708} 11709 11710// SupportsAllDrives sets the optional parameter "supportsAllDrives": 11711// Whether the requesting application supports both My Drives and shared 11712// drives. 11713func (c *FilesWatchCall) SupportsAllDrives(supportsAllDrives bool) *FilesWatchCall { 11714 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 11715 return c 11716} 11717 11718// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 11719// Deprecated use supportsAllDrives instead. 11720func (c *FilesWatchCall) SupportsTeamDrives(supportsTeamDrives bool) *FilesWatchCall { 11721 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 11722 return c 11723} 11724 11725// UpdateViewedDate sets the optional parameter "updateViewedDate": 11726// Deprecated: Use files.update with modifiedDateBehavior=noChange, 11727// updateViewedDate=true and an empty request body. 11728func (c *FilesWatchCall) UpdateViewedDate(updateViewedDate bool) *FilesWatchCall { 11729 c.urlParams_.Set("updateViewedDate", fmt.Sprint(updateViewedDate)) 11730 return c 11731} 11732 11733// Fields allows partial responses to be retrieved. See 11734// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11735// for more information. 11736func (c *FilesWatchCall) Fields(s ...googleapi.Field) *FilesWatchCall { 11737 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11738 return c 11739} 11740 11741// Context sets the context to be used in this call's Do and Download 11742// methods. Any pending HTTP request will be aborted if the provided 11743// context is canceled. 11744func (c *FilesWatchCall) Context(ctx context.Context) *FilesWatchCall { 11745 c.ctx_ = ctx 11746 return c 11747} 11748 11749// Header returns an http.Header that can be modified by the caller to 11750// add HTTP headers to the request. 11751func (c *FilesWatchCall) Header() http.Header { 11752 if c.header_ == nil { 11753 c.header_ = make(http.Header) 11754 } 11755 return c.header_ 11756} 11757 11758func (c *FilesWatchCall) doRequest(alt string) (*http.Response, error) { 11759 reqHeaders := make(http.Header) 11760 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 11761 for k, v := range c.header_ { 11762 reqHeaders[k] = v 11763 } 11764 reqHeaders.Set("User-Agent", c.s.userAgent()) 11765 var body io.Reader = nil 11766 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 11767 if err != nil { 11768 return nil, err 11769 } 11770 reqHeaders.Set("Content-Type", "application/json") 11771 c.urlParams_.Set("alt", alt) 11772 c.urlParams_.Set("prettyPrint", "false") 11773 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/watch") 11774 urls += "?" + c.urlParams_.Encode() 11775 req, err := http.NewRequest("POST", urls, body) 11776 if err != nil { 11777 return nil, err 11778 } 11779 req.Header = reqHeaders 11780 googleapi.Expand(req.URL, map[string]string{ 11781 "fileId": c.fileId, 11782 }) 11783 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11784} 11785 11786// Download fetches the API endpoint's "media" value, instead of the normal 11787// API response value. If the returned error is nil, the Response is guaranteed to 11788// have a 2xx status code. Callers must close the Response.Body as usual. 11789func (c *FilesWatchCall) Download(opts ...googleapi.CallOption) (*http.Response, error) { 11790 gensupport.SetOptions(c.urlParams_, opts...) 11791 res, err := c.doRequest("media") 11792 if err != nil { 11793 return nil, err 11794 } 11795 if err := googleapi.CheckResponse(res); err != nil { 11796 res.Body.Close() 11797 return nil, err 11798 } 11799 return res, nil 11800} 11801 11802// Do executes the "drive.files.watch" call. 11803// Exactly one of *Channel or error will be non-nil. Any non-2xx status 11804// code is an error. Response headers are in either 11805// *Channel.ServerResponse.Header or (if a response was returned at all) 11806// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11807// check whether the returned error was because http.StatusNotModified 11808// was returned. 11809func (c *FilesWatchCall) Do(opts ...googleapi.CallOption) (*Channel, error) { 11810 gensupport.SetOptions(c.urlParams_, opts...) 11811 res, err := c.doRequest("json") 11812 if res != nil && res.StatusCode == http.StatusNotModified { 11813 if res.Body != nil { 11814 res.Body.Close() 11815 } 11816 return nil, &googleapi.Error{ 11817 Code: res.StatusCode, 11818 Header: res.Header, 11819 } 11820 } 11821 if err != nil { 11822 return nil, err 11823 } 11824 defer googleapi.CloseBody(res) 11825 if err := googleapi.CheckResponse(res); err != nil { 11826 return nil, err 11827 } 11828 ret := &Channel{ 11829 ServerResponse: googleapi.ServerResponse{ 11830 Header: res.Header, 11831 HTTPStatusCode: res.StatusCode, 11832 }, 11833 } 11834 target := &ret 11835 if err := gensupport.DecodeResponse(target, res); err != nil { 11836 return nil, err 11837 } 11838 return ret, nil 11839 // { 11840 // "description": "Subscribe to changes on a file", 11841 // "httpMethod": "POST", 11842 // "id": "drive.files.watch", 11843 // "parameterOrder": [ 11844 // "fileId" 11845 // ], 11846 // "parameters": { 11847 // "acknowledgeAbuse": { 11848 // "default": "false", 11849 // "description": "Whether the user is acknowledging the risk of downloading known malware or other abusive files.", 11850 // "location": "query", 11851 // "type": "boolean" 11852 // }, 11853 // "fileId": { 11854 // "description": "The ID for the file in question.", 11855 // "location": "path", 11856 // "required": true, 11857 // "type": "string" 11858 // }, 11859 // "includePermissionsForView": { 11860 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 11861 // "location": "query", 11862 // "type": "string" 11863 // }, 11864 // "projection": { 11865 // "description": "This parameter is deprecated and has no function.", 11866 // "enum": [ 11867 // "BASIC", 11868 // "FULL" 11869 // ], 11870 // "enumDescriptions": [ 11871 // "Deprecated", 11872 // "Deprecated" 11873 // ], 11874 // "location": "query", 11875 // "type": "string" 11876 // }, 11877 // "revisionId": { 11878 // "description": "Specifies the Revision ID that should be downloaded. Ignored unless alt=media is specified.", 11879 // "location": "query", 11880 // "type": "string" 11881 // }, 11882 // "supportsAllDrives": { 11883 // "default": "false", 11884 // "description": "Whether the requesting application supports both My Drives and shared drives.", 11885 // "location": "query", 11886 // "type": "boolean" 11887 // }, 11888 // "supportsTeamDrives": { 11889 // "default": "false", 11890 // "description": "Deprecated use supportsAllDrives instead.", 11891 // "location": "query", 11892 // "type": "boolean" 11893 // }, 11894 // "updateViewedDate": { 11895 // "default": "false", 11896 // "description": "Deprecated: Use files.update with modifiedDateBehavior=noChange, updateViewedDate=true and an empty request body.", 11897 // "location": "query", 11898 // "type": "boolean" 11899 // } 11900 // }, 11901 // "path": "files/{fileId}/watch", 11902 // "request": { 11903 // "$ref": "Channel", 11904 // "parameterName": "resource" 11905 // }, 11906 // "response": { 11907 // "$ref": "Channel" 11908 // }, 11909 // "scopes": [ 11910 // "https://www.googleapis.com/auth/drive", 11911 // "https://www.googleapis.com/auth/drive.appdata", 11912 // "https://www.googleapis.com/auth/drive.file", 11913 // "https://www.googleapis.com/auth/drive.metadata", 11914 // "https://www.googleapis.com/auth/drive.metadata.readonly", 11915 // "https://www.googleapis.com/auth/drive.photos.readonly", 11916 // "https://www.googleapis.com/auth/drive.readonly" 11917 // ], 11918 // "supportsMediaDownload": true, 11919 // "supportsSubscription": true, 11920 // "useMediaDownloadService": true 11921 // } 11922 11923} 11924 11925// method id "drive.parents.delete": 11926 11927type ParentsDeleteCall struct { 11928 s *Service 11929 fileId string 11930 parentId string 11931 urlParams_ gensupport.URLParams 11932 ctx_ context.Context 11933 header_ http.Header 11934} 11935 11936// Delete: Removes a parent from a file. 11937// 11938// - fileId: The ID of the file. 11939// - parentId: The ID of the parent. 11940func (r *ParentsService) Delete(fileId string, parentId string) *ParentsDeleteCall { 11941 c := &ParentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11942 c.fileId = fileId 11943 c.parentId = parentId 11944 return c 11945} 11946 11947// EnforceSingleParent sets the optional parameter 11948// "enforceSingleParent": Deprecated. If an item is not in a shared 11949// drive and its last parent is deleted but the item itself is not, the 11950// item will be placed under its owner's root. 11951func (c *ParentsDeleteCall) EnforceSingleParent(enforceSingleParent bool) *ParentsDeleteCall { 11952 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 11953 return c 11954} 11955 11956// Fields allows partial responses to be retrieved. See 11957// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11958// for more information. 11959func (c *ParentsDeleteCall) Fields(s ...googleapi.Field) *ParentsDeleteCall { 11960 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11961 return c 11962} 11963 11964// Context sets the context to be used in this call's Do method. Any 11965// pending HTTP request will be aborted if the provided context is 11966// canceled. 11967func (c *ParentsDeleteCall) Context(ctx context.Context) *ParentsDeleteCall { 11968 c.ctx_ = ctx 11969 return c 11970} 11971 11972// Header returns an http.Header that can be modified by the caller to 11973// add HTTP headers to the request. 11974func (c *ParentsDeleteCall) Header() http.Header { 11975 if c.header_ == nil { 11976 c.header_ = make(http.Header) 11977 } 11978 return c.header_ 11979} 11980 11981func (c *ParentsDeleteCall) doRequest(alt string) (*http.Response, error) { 11982 reqHeaders := make(http.Header) 11983 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 11984 for k, v := range c.header_ { 11985 reqHeaders[k] = v 11986 } 11987 reqHeaders.Set("User-Agent", c.s.userAgent()) 11988 var body io.Reader = nil 11989 c.urlParams_.Set("alt", alt) 11990 c.urlParams_.Set("prettyPrint", "false") 11991 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents/{parentId}") 11992 urls += "?" + c.urlParams_.Encode() 11993 req, err := http.NewRequest("DELETE", urls, body) 11994 if err != nil { 11995 return nil, err 11996 } 11997 req.Header = reqHeaders 11998 googleapi.Expand(req.URL, map[string]string{ 11999 "fileId": c.fileId, 12000 "parentId": c.parentId, 12001 }) 12002 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12003} 12004 12005// Do executes the "drive.parents.delete" call. 12006func (c *ParentsDeleteCall) Do(opts ...googleapi.CallOption) error { 12007 gensupport.SetOptions(c.urlParams_, opts...) 12008 res, err := c.doRequest("json") 12009 if err != nil { 12010 return err 12011 } 12012 defer googleapi.CloseBody(res) 12013 if err := googleapi.CheckResponse(res); err != nil { 12014 return err 12015 } 12016 return nil 12017 // { 12018 // "description": "Removes a parent from a file.", 12019 // "httpMethod": "DELETE", 12020 // "id": "drive.parents.delete", 12021 // "parameterOrder": [ 12022 // "fileId", 12023 // "parentId" 12024 // ], 12025 // "parameters": { 12026 // "enforceSingleParent": { 12027 // "default": "false", 12028 // "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.", 12029 // "location": "query", 12030 // "type": "boolean" 12031 // }, 12032 // "fileId": { 12033 // "description": "The ID of the file.", 12034 // "location": "path", 12035 // "required": true, 12036 // "type": "string" 12037 // }, 12038 // "parentId": { 12039 // "description": "The ID of the parent.", 12040 // "location": "path", 12041 // "required": true, 12042 // "type": "string" 12043 // } 12044 // }, 12045 // "path": "files/{fileId}/parents/{parentId}", 12046 // "scopes": [ 12047 // "https://www.googleapis.com/auth/drive", 12048 // "https://www.googleapis.com/auth/drive.file" 12049 // ] 12050 // } 12051 12052} 12053 12054// method id "drive.parents.get": 12055 12056type ParentsGetCall struct { 12057 s *Service 12058 fileId string 12059 parentId string 12060 urlParams_ gensupport.URLParams 12061 ifNoneMatch_ string 12062 ctx_ context.Context 12063 header_ http.Header 12064} 12065 12066// Get: Gets a specific parent reference. 12067// 12068// - fileId: The ID of the file. 12069// - parentId: The ID of the parent. 12070func (r *ParentsService) Get(fileId string, parentId string) *ParentsGetCall { 12071 c := &ParentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12072 c.fileId = fileId 12073 c.parentId = parentId 12074 return c 12075} 12076 12077// Fields allows partial responses to be retrieved. See 12078// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12079// for more information. 12080func (c *ParentsGetCall) Fields(s ...googleapi.Field) *ParentsGetCall { 12081 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12082 return c 12083} 12084 12085// IfNoneMatch sets the optional parameter which makes the operation 12086// fail if the object's ETag matches the given value. This is useful for 12087// getting updates only after the object has changed since the last 12088// request. Use googleapi.IsNotModified to check whether the response 12089// error from Do is the result of In-None-Match. 12090func (c *ParentsGetCall) IfNoneMatch(entityTag string) *ParentsGetCall { 12091 c.ifNoneMatch_ = entityTag 12092 return c 12093} 12094 12095// Context sets the context to be used in this call's Do method. Any 12096// pending HTTP request will be aborted if the provided context is 12097// canceled. 12098func (c *ParentsGetCall) Context(ctx context.Context) *ParentsGetCall { 12099 c.ctx_ = ctx 12100 return c 12101} 12102 12103// Header returns an http.Header that can be modified by the caller to 12104// add HTTP headers to the request. 12105func (c *ParentsGetCall) Header() http.Header { 12106 if c.header_ == nil { 12107 c.header_ = make(http.Header) 12108 } 12109 return c.header_ 12110} 12111 12112func (c *ParentsGetCall) doRequest(alt string) (*http.Response, error) { 12113 reqHeaders := make(http.Header) 12114 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 12115 for k, v := range c.header_ { 12116 reqHeaders[k] = v 12117 } 12118 reqHeaders.Set("User-Agent", c.s.userAgent()) 12119 if c.ifNoneMatch_ != "" { 12120 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12121 } 12122 var body io.Reader = nil 12123 c.urlParams_.Set("alt", alt) 12124 c.urlParams_.Set("prettyPrint", "false") 12125 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents/{parentId}") 12126 urls += "?" + c.urlParams_.Encode() 12127 req, err := http.NewRequest("GET", urls, body) 12128 if err != nil { 12129 return nil, err 12130 } 12131 req.Header = reqHeaders 12132 googleapi.Expand(req.URL, map[string]string{ 12133 "fileId": c.fileId, 12134 "parentId": c.parentId, 12135 }) 12136 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12137} 12138 12139// Do executes the "drive.parents.get" call. 12140// Exactly one of *ParentReference or error will be non-nil. Any non-2xx 12141// status code is an error. Response headers are in either 12142// *ParentReference.ServerResponse.Header or (if a response was returned 12143// at all) in error.(*googleapi.Error).Header. Use 12144// googleapi.IsNotModified to check whether the returned error was 12145// because http.StatusNotModified was returned. 12146func (c *ParentsGetCall) Do(opts ...googleapi.CallOption) (*ParentReference, error) { 12147 gensupport.SetOptions(c.urlParams_, opts...) 12148 res, err := c.doRequest("json") 12149 if res != nil && res.StatusCode == http.StatusNotModified { 12150 if res.Body != nil { 12151 res.Body.Close() 12152 } 12153 return nil, &googleapi.Error{ 12154 Code: res.StatusCode, 12155 Header: res.Header, 12156 } 12157 } 12158 if err != nil { 12159 return nil, err 12160 } 12161 defer googleapi.CloseBody(res) 12162 if err := googleapi.CheckResponse(res); err != nil { 12163 return nil, err 12164 } 12165 ret := &ParentReference{ 12166 ServerResponse: googleapi.ServerResponse{ 12167 Header: res.Header, 12168 HTTPStatusCode: res.StatusCode, 12169 }, 12170 } 12171 target := &ret 12172 if err := gensupport.DecodeResponse(target, res); err != nil { 12173 return nil, err 12174 } 12175 return ret, nil 12176 // { 12177 // "description": "Gets a specific parent reference.", 12178 // "httpMethod": "GET", 12179 // "id": "drive.parents.get", 12180 // "parameterOrder": [ 12181 // "fileId", 12182 // "parentId" 12183 // ], 12184 // "parameters": { 12185 // "fileId": { 12186 // "description": "The ID of the file.", 12187 // "location": "path", 12188 // "required": true, 12189 // "type": "string" 12190 // }, 12191 // "parentId": { 12192 // "description": "The ID of the parent.", 12193 // "location": "path", 12194 // "required": true, 12195 // "type": "string" 12196 // } 12197 // }, 12198 // "path": "files/{fileId}/parents/{parentId}", 12199 // "response": { 12200 // "$ref": "ParentReference" 12201 // }, 12202 // "scopes": [ 12203 // "https://www.googleapis.com/auth/drive", 12204 // "https://www.googleapis.com/auth/drive.appdata", 12205 // "https://www.googleapis.com/auth/drive.file", 12206 // "https://www.googleapis.com/auth/drive.metadata", 12207 // "https://www.googleapis.com/auth/drive.metadata.readonly", 12208 // "https://www.googleapis.com/auth/drive.photos.readonly", 12209 // "https://www.googleapis.com/auth/drive.readonly" 12210 // ] 12211 // } 12212 12213} 12214 12215// method id "drive.parents.insert": 12216 12217type ParentsInsertCall struct { 12218 s *Service 12219 fileId string 12220 parentreference *ParentReference 12221 urlParams_ gensupport.URLParams 12222 ctx_ context.Context 12223 header_ http.Header 12224} 12225 12226// Insert: Adds a parent folder for a file. 12227// 12228// - fileId: The ID of the file. 12229func (r *ParentsService) Insert(fileId string, parentreference *ParentReference) *ParentsInsertCall { 12230 c := &ParentsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12231 c.fileId = fileId 12232 c.parentreference = parentreference 12233 return c 12234} 12235 12236// EnforceSingleParent sets the optional parameter 12237// "enforceSingleParent": Deprecated. Adding files to multiple folders 12238// is no longer supported. Use shortcuts instead. 12239func (c *ParentsInsertCall) EnforceSingleParent(enforceSingleParent bool) *ParentsInsertCall { 12240 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 12241 return c 12242} 12243 12244// SupportsAllDrives sets the optional parameter "supportsAllDrives": 12245// Whether the requesting application supports both My Drives and shared 12246// drives. 12247func (c *ParentsInsertCall) SupportsAllDrives(supportsAllDrives bool) *ParentsInsertCall { 12248 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 12249 return c 12250} 12251 12252// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 12253// Deprecated use supportsAllDrives instead. 12254func (c *ParentsInsertCall) SupportsTeamDrives(supportsTeamDrives bool) *ParentsInsertCall { 12255 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 12256 return c 12257} 12258 12259// Fields allows partial responses to be retrieved. See 12260// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12261// for more information. 12262func (c *ParentsInsertCall) Fields(s ...googleapi.Field) *ParentsInsertCall { 12263 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12264 return c 12265} 12266 12267// Context sets the context to be used in this call's Do method. Any 12268// pending HTTP request will be aborted if the provided context is 12269// canceled. 12270func (c *ParentsInsertCall) Context(ctx context.Context) *ParentsInsertCall { 12271 c.ctx_ = ctx 12272 return c 12273} 12274 12275// Header returns an http.Header that can be modified by the caller to 12276// add HTTP headers to the request. 12277func (c *ParentsInsertCall) Header() http.Header { 12278 if c.header_ == nil { 12279 c.header_ = make(http.Header) 12280 } 12281 return c.header_ 12282} 12283 12284func (c *ParentsInsertCall) doRequest(alt string) (*http.Response, error) { 12285 reqHeaders := make(http.Header) 12286 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 12287 for k, v := range c.header_ { 12288 reqHeaders[k] = v 12289 } 12290 reqHeaders.Set("User-Agent", c.s.userAgent()) 12291 var body io.Reader = nil 12292 body, err := googleapi.WithoutDataWrapper.JSONReader(c.parentreference) 12293 if err != nil { 12294 return nil, err 12295 } 12296 reqHeaders.Set("Content-Type", "application/json") 12297 c.urlParams_.Set("alt", alt) 12298 c.urlParams_.Set("prettyPrint", "false") 12299 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents") 12300 urls += "?" + c.urlParams_.Encode() 12301 req, err := http.NewRequest("POST", urls, body) 12302 if err != nil { 12303 return nil, err 12304 } 12305 req.Header = reqHeaders 12306 googleapi.Expand(req.URL, map[string]string{ 12307 "fileId": c.fileId, 12308 }) 12309 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12310} 12311 12312// Do executes the "drive.parents.insert" call. 12313// Exactly one of *ParentReference or error will be non-nil. Any non-2xx 12314// status code is an error. Response headers are in either 12315// *ParentReference.ServerResponse.Header or (if a response was returned 12316// at all) in error.(*googleapi.Error).Header. Use 12317// googleapi.IsNotModified to check whether the returned error was 12318// because http.StatusNotModified was returned. 12319func (c *ParentsInsertCall) Do(opts ...googleapi.CallOption) (*ParentReference, error) { 12320 gensupport.SetOptions(c.urlParams_, opts...) 12321 res, err := c.doRequest("json") 12322 if res != nil && res.StatusCode == http.StatusNotModified { 12323 if res.Body != nil { 12324 res.Body.Close() 12325 } 12326 return nil, &googleapi.Error{ 12327 Code: res.StatusCode, 12328 Header: res.Header, 12329 } 12330 } 12331 if err != nil { 12332 return nil, err 12333 } 12334 defer googleapi.CloseBody(res) 12335 if err := googleapi.CheckResponse(res); err != nil { 12336 return nil, err 12337 } 12338 ret := &ParentReference{ 12339 ServerResponse: googleapi.ServerResponse{ 12340 Header: res.Header, 12341 HTTPStatusCode: res.StatusCode, 12342 }, 12343 } 12344 target := &ret 12345 if err := gensupport.DecodeResponse(target, res); err != nil { 12346 return nil, err 12347 } 12348 return ret, nil 12349 // { 12350 // "description": "Adds a parent folder for a file.", 12351 // "httpMethod": "POST", 12352 // "id": "drive.parents.insert", 12353 // "parameterOrder": [ 12354 // "fileId" 12355 // ], 12356 // "parameters": { 12357 // "enforceSingleParent": { 12358 // "default": "false", 12359 // "description": "Deprecated. Adding files to multiple folders is no longer supported. Use shortcuts instead.", 12360 // "location": "query", 12361 // "type": "boolean" 12362 // }, 12363 // "fileId": { 12364 // "description": "The ID of the file.", 12365 // "location": "path", 12366 // "required": true, 12367 // "type": "string" 12368 // }, 12369 // "supportsAllDrives": { 12370 // "default": "false", 12371 // "description": "Whether the requesting application supports both My Drives and shared drives.", 12372 // "location": "query", 12373 // "type": "boolean" 12374 // }, 12375 // "supportsTeamDrives": { 12376 // "default": "false", 12377 // "description": "Deprecated use supportsAllDrives instead.", 12378 // "location": "query", 12379 // "type": "boolean" 12380 // } 12381 // }, 12382 // "path": "files/{fileId}/parents", 12383 // "request": { 12384 // "$ref": "ParentReference" 12385 // }, 12386 // "response": { 12387 // "$ref": "ParentReference" 12388 // }, 12389 // "scopes": [ 12390 // "https://www.googleapis.com/auth/drive", 12391 // "https://www.googleapis.com/auth/drive.appdata", 12392 // "https://www.googleapis.com/auth/drive.file" 12393 // ] 12394 // } 12395 12396} 12397 12398// method id "drive.parents.list": 12399 12400type ParentsListCall struct { 12401 s *Service 12402 fileId string 12403 urlParams_ gensupport.URLParams 12404 ifNoneMatch_ string 12405 ctx_ context.Context 12406 header_ http.Header 12407} 12408 12409// List: Lists a file's parents. 12410// 12411// - fileId: The ID of the file. 12412func (r *ParentsService) List(fileId string) *ParentsListCall { 12413 c := &ParentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12414 c.fileId = fileId 12415 return c 12416} 12417 12418// Fields allows partial responses to be retrieved. See 12419// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12420// for more information. 12421func (c *ParentsListCall) Fields(s ...googleapi.Field) *ParentsListCall { 12422 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12423 return c 12424} 12425 12426// IfNoneMatch sets the optional parameter which makes the operation 12427// fail if the object's ETag matches the given value. This is useful for 12428// getting updates only after the object has changed since the last 12429// request. Use googleapi.IsNotModified to check whether the response 12430// error from Do is the result of In-None-Match. 12431func (c *ParentsListCall) IfNoneMatch(entityTag string) *ParentsListCall { 12432 c.ifNoneMatch_ = entityTag 12433 return c 12434} 12435 12436// Context sets the context to be used in this call's Do method. Any 12437// pending HTTP request will be aborted if the provided context is 12438// canceled. 12439func (c *ParentsListCall) Context(ctx context.Context) *ParentsListCall { 12440 c.ctx_ = ctx 12441 return c 12442} 12443 12444// Header returns an http.Header that can be modified by the caller to 12445// add HTTP headers to the request. 12446func (c *ParentsListCall) Header() http.Header { 12447 if c.header_ == nil { 12448 c.header_ = make(http.Header) 12449 } 12450 return c.header_ 12451} 12452 12453func (c *ParentsListCall) doRequest(alt string) (*http.Response, error) { 12454 reqHeaders := make(http.Header) 12455 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 12456 for k, v := range c.header_ { 12457 reqHeaders[k] = v 12458 } 12459 reqHeaders.Set("User-Agent", c.s.userAgent()) 12460 if c.ifNoneMatch_ != "" { 12461 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12462 } 12463 var body io.Reader = nil 12464 c.urlParams_.Set("alt", alt) 12465 c.urlParams_.Set("prettyPrint", "false") 12466 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/parents") 12467 urls += "?" + c.urlParams_.Encode() 12468 req, err := http.NewRequest("GET", urls, body) 12469 if err != nil { 12470 return nil, err 12471 } 12472 req.Header = reqHeaders 12473 googleapi.Expand(req.URL, map[string]string{ 12474 "fileId": c.fileId, 12475 }) 12476 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12477} 12478 12479// Do executes the "drive.parents.list" call. 12480// Exactly one of *ParentList or error will be non-nil. Any non-2xx 12481// status code is an error. Response headers are in either 12482// *ParentList.ServerResponse.Header or (if a response was returned at 12483// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12484// to check whether the returned error was because 12485// http.StatusNotModified was returned. 12486func (c *ParentsListCall) Do(opts ...googleapi.CallOption) (*ParentList, error) { 12487 gensupport.SetOptions(c.urlParams_, opts...) 12488 res, err := c.doRequest("json") 12489 if res != nil && res.StatusCode == http.StatusNotModified { 12490 if res.Body != nil { 12491 res.Body.Close() 12492 } 12493 return nil, &googleapi.Error{ 12494 Code: res.StatusCode, 12495 Header: res.Header, 12496 } 12497 } 12498 if err != nil { 12499 return nil, err 12500 } 12501 defer googleapi.CloseBody(res) 12502 if err := googleapi.CheckResponse(res); err != nil { 12503 return nil, err 12504 } 12505 ret := &ParentList{ 12506 ServerResponse: googleapi.ServerResponse{ 12507 Header: res.Header, 12508 HTTPStatusCode: res.StatusCode, 12509 }, 12510 } 12511 target := &ret 12512 if err := gensupport.DecodeResponse(target, res); err != nil { 12513 return nil, err 12514 } 12515 return ret, nil 12516 // { 12517 // "description": "Lists a file's parents.", 12518 // "httpMethod": "GET", 12519 // "id": "drive.parents.list", 12520 // "parameterOrder": [ 12521 // "fileId" 12522 // ], 12523 // "parameters": { 12524 // "fileId": { 12525 // "description": "The ID of the file.", 12526 // "location": "path", 12527 // "required": true, 12528 // "type": "string" 12529 // } 12530 // }, 12531 // "path": "files/{fileId}/parents", 12532 // "response": { 12533 // "$ref": "ParentList" 12534 // }, 12535 // "scopes": [ 12536 // "https://www.googleapis.com/auth/drive", 12537 // "https://www.googleapis.com/auth/drive.appdata", 12538 // "https://www.googleapis.com/auth/drive.file", 12539 // "https://www.googleapis.com/auth/drive.metadata", 12540 // "https://www.googleapis.com/auth/drive.metadata.readonly", 12541 // "https://www.googleapis.com/auth/drive.photos.readonly", 12542 // "https://www.googleapis.com/auth/drive.readonly" 12543 // ] 12544 // } 12545 12546} 12547 12548// method id "drive.permissions.delete": 12549 12550type PermissionsDeleteCall struct { 12551 s *Service 12552 fileId string 12553 permissionId string 12554 urlParams_ gensupport.URLParams 12555 ctx_ context.Context 12556 header_ http.Header 12557} 12558 12559// Delete: Deletes a permission from a file or shared drive. 12560// 12561// - fileId: The ID for the file or shared drive. 12562// - permissionId: The ID for the permission. 12563func (r *PermissionsService) Delete(fileId string, permissionId string) *PermissionsDeleteCall { 12564 c := &PermissionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12565 c.fileId = fileId 12566 c.permissionId = permissionId 12567 return c 12568} 12569 12570// SupportsAllDrives sets the optional parameter "supportsAllDrives": 12571// Whether the requesting application supports both My Drives and shared 12572// drives. 12573func (c *PermissionsDeleteCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsDeleteCall { 12574 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 12575 return c 12576} 12577 12578// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 12579// Deprecated use supportsAllDrives instead. 12580func (c *PermissionsDeleteCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsDeleteCall { 12581 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 12582 return c 12583} 12584 12585// UseDomainAdminAccess sets the optional parameter 12586// "useDomainAdminAccess": Issue the request as a domain administrator; 12587// if set to true, then the requester will be granted access if the file 12588// ID parameter refers to a shared drive and the requester is an 12589// administrator of the domain to which the shared drive belongs. 12590func (c *PermissionsDeleteCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsDeleteCall { 12591 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 12592 return c 12593} 12594 12595// Fields allows partial responses to be retrieved. See 12596// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12597// for more information. 12598func (c *PermissionsDeleteCall) Fields(s ...googleapi.Field) *PermissionsDeleteCall { 12599 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12600 return c 12601} 12602 12603// Context sets the context to be used in this call's Do method. Any 12604// pending HTTP request will be aborted if the provided context is 12605// canceled. 12606func (c *PermissionsDeleteCall) Context(ctx context.Context) *PermissionsDeleteCall { 12607 c.ctx_ = ctx 12608 return c 12609} 12610 12611// Header returns an http.Header that can be modified by the caller to 12612// add HTTP headers to the request. 12613func (c *PermissionsDeleteCall) Header() http.Header { 12614 if c.header_ == nil { 12615 c.header_ = make(http.Header) 12616 } 12617 return c.header_ 12618} 12619 12620func (c *PermissionsDeleteCall) doRequest(alt string) (*http.Response, error) { 12621 reqHeaders := make(http.Header) 12622 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 12623 for k, v := range c.header_ { 12624 reqHeaders[k] = v 12625 } 12626 reqHeaders.Set("User-Agent", c.s.userAgent()) 12627 var body io.Reader = nil 12628 c.urlParams_.Set("alt", alt) 12629 c.urlParams_.Set("prettyPrint", "false") 12630 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") 12631 urls += "?" + c.urlParams_.Encode() 12632 req, err := http.NewRequest("DELETE", urls, body) 12633 if err != nil { 12634 return nil, err 12635 } 12636 req.Header = reqHeaders 12637 googleapi.Expand(req.URL, map[string]string{ 12638 "fileId": c.fileId, 12639 "permissionId": c.permissionId, 12640 }) 12641 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12642} 12643 12644// Do executes the "drive.permissions.delete" call. 12645func (c *PermissionsDeleteCall) Do(opts ...googleapi.CallOption) error { 12646 gensupport.SetOptions(c.urlParams_, opts...) 12647 res, err := c.doRequest("json") 12648 if err != nil { 12649 return err 12650 } 12651 defer googleapi.CloseBody(res) 12652 if err := googleapi.CheckResponse(res); err != nil { 12653 return err 12654 } 12655 return nil 12656 // { 12657 // "description": "Deletes a permission from a file or shared drive.", 12658 // "httpMethod": "DELETE", 12659 // "id": "drive.permissions.delete", 12660 // "parameterOrder": [ 12661 // "fileId", 12662 // "permissionId" 12663 // ], 12664 // "parameters": { 12665 // "fileId": { 12666 // "description": "The ID for the file or shared drive.", 12667 // "location": "path", 12668 // "required": true, 12669 // "type": "string" 12670 // }, 12671 // "permissionId": { 12672 // "description": "The ID for the permission.", 12673 // "location": "path", 12674 // "required": true, 12675 // "type": "string" 12676 // }, 12677 // "supportsAllDrives": { 12678 // "default": "false", 12679 // "description": "Whether the requesting application supports both My Drives and shared drives.", 12680 // "location": "query", 12681 // "type": "boolean" 12682 // }, 12683 // "supportsTeamDrives": { 12684 // "default": "false", 12685 // "description": "Deprecated use supportsAllDrives instead.", 12686 // "location": "query", 12687 // "type": "boolean" 12688 // }, 12689 // "useDomainAdminAccess": { 12690 // "default": "false", 12691 // "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.", 12692 // "location": "query", 12693 // "type": "boolean" 12694 // } 12695 // }, 12696 // "path": "files/{fileId}/permissions/{permissionId}", 12697 // "scopes": [ 12698 // "https://www.googleapis.com/auth/drive", 12699 // "https://www.googleapis.com/auth/drive.file" 12700 // ] 12701 // } 12702 12703} 12704 12705// method id "drive.permissions.get": 12706 12707type PermissionsGetCall struct { 12708 s *Service 12709 fileId string 12710 permissionId string 12711 urlParams_ gensupport.URLParams 12712 ifNoneMatch_ string 12713 ctx_ context.Context 12714 header_ http.Header 12715} 12716 12717// Get: Gets a permission by ID. 12718// 12719// - fileId: The ID for the file or shared drive. 12720// - permissionId: The ID for the permission. 12721func (r *PermissionsService) Get(fileId string, permissionId string) *PermissionsGetCall { 12722 c := &PermissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12723 c.fileId = fileId 12724 c.permissionId = permissionId 12725 return c 12726} 12727 12728// SupportsAllDrives sets the optional parameter "supportsAllDrives": 12729// Whether the requesting application supports both My Drives and shared 12730// drives. 12731func (c *PermissionsGetCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsGetCall { 12732 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 12733 return c 12734} 12735 12736// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 12737// Deprecated use supportsAllDrives instead. 12738func (c *PermissionsGetCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsGetCall { 12739 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 12740 return c 12741} 12742 12743// UseDomainAdminAccess sets the optional parameter 12744// "useDomainAdminAccess": Issue the request as a domain administrator; 12745// if set to true, then the requester will be granted access if the file 12746// ID parameter refers to a shared drive and the requester is an 12747// administrator of the domain to which the shared drive belongs. 12748func (c *PermissionsGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsGetCall { 12749 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 12750 return c 12751} 12752 12753// Fields allows partial responses to be retrieved. See 12754// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12755// for more information. 12756func (c *PermissionsGetCall) Fields(s ...googleapi.Field) *PermissionsGetCall { 12757 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12758 return c 12759} 12760 12761// IfNoneMatch sets the optional parameter which makes the operation 12762// fail if the object's ETag matches the given value. This is useful for 12763// getting updates only after the object has changed since the last 12764// request. Use googleapi.IsNotModified to check whether the response 12765// error from Do is the result of In-None-Match. 12766func (c *PermissionsGetCall) IfNoneMatch(entityTag string) *PermissionsGetCall { 12767 c.ifNoneMatch_ = entityTag 12768 return c 12769} 12770 12771// Context sets the context to be used in this call's Do method. Any 12772// pending HTTP request will be aborted if the provided context is 12773// canceled. 12774func (c *PermissionsGetCall) Context(ctx context.Context) *PermissionsGetCall { 12775 c.ctx_ = ctx 12776 return c 12777} 12778 12779// Header returns an http.Header that can be modified by the caller to 12780// add HTTP headers to the request. 12781func (c *PermissionsGetCall) Header() http.Header { 12782 if c.header_ == nil { 12783 c.header_ = make(http.Header) 12784 } 12785 return c.header_ 12786} 12787 12788func (c *PermissionsGetCall) doRequest(alt string) (*http.Response, error) { 12789 reqHeaders := make(http.Header) 12790 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 12791 for k, v := range c.header_ { 12792 reqHeaders[k] = v 12793 } 12794 reqHeaders.Set("User-Agent", c.s.userAgent()) 12795 if c.ifNoneMatch_ != "" { 12796 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12797 } 12798 var body io.Reader = nil 12799 c.urlParams_.Set("alt", alt) 12800 c.urlParams_.Set("prettyPrint", "false") 12801 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") 12802 urls += "?" + c.urlParams_.Encode() 12803 req, err := http.NewRequest("GET", urls, body) 12804 if err != nil { 12805 return nil, err 12806 } 12807 req.Header = reqHeaders 12808 googleapi.Expand(req.URL, map[string]string{ 12809 "fileId": c.fileId, 12810 "permissionId": c.permissionId, 12811 }) 12812 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12813} 12814 12815// Do executes the "drive.permissions.get" call. 12816// Exactly one of *Permission or error will be non-nil. Any non-2xx 12817// status code is an error. Response headers are in either 12818// *Permission.ServerResponse.Header or (if a response was returned at 12819// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12820// to check whether the returned error was because 12821// http.StatusNotModified was returned. 12822func (c *PermissionsGetCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 12823 gensupport.SetOptions(c.urlParams_, opts...) 12824 res, err := c.doRequest("json") 12825 if res != nil && res.StatusCode == http.StatusNotModified { 12826 if res.Body != nil { 12827 res.Body.Close() 12828 } 12829 return nil, &googleapi.Error{ 12830 Code: res.StatusCode, 12831 Header: res.Header, 12832 } 12833 } 12834 if err != nil { 12835 return nil, err 12836 } 12837 defer googleapi.CloseBody(res) 12838 if err := googleapi.CheckResponse(res); err != nil { 12839 return nil, err 12840 } 12841 ret := &Permission{ 12842 ServerResponse: googleapi.ServerResponse{ 12843 Header: res.Header, 12844 HTTPStatusCode: res.StatusCode, 12845 }, 12846 } 12847 target := &ret 12848 if err := gensupport.DecodeResponse(target, res); err != nil { 12849 return nil, err 12850 } 12851 return ret, nil 12852 // { 12853 // "description": "Gets a permission by ID.", 12854 // "httpMethod": "GET", 12855 // "id": "drive.permissions.get", 12856 // "parameterOrder": [ 12857 // "fileId", 12858 // "permissionId" 12859 // ], 12860 // "parameters": { 12861 // "fileId": { 12862 // "description": "The ID for the file or shared drive.", 12863 // "location": "path", 12864 // "required": true, 12865 // "type": "string" 12866 // }, 12867 // "permissionId": { 12868 // "description": "The ID for the permission.", 12869 // "location": "path", 12870 // "required": true, 12871 // "type": "string" 12872 // }, 12873 // "supportsAllDrives": { 12874 // "default": "false", 12875 // "description": "Whether the requesting application supports both My Drives and shared drives.", 12876 // "location": "query", 12877 // "type": "boolean" 12878 // }, 12879 // "supportsTeamDrives": { 12880 // "default": "false", 12881 // "description": "Deprecated use supportsAllDrives instead.", 12882 // "location": "query", 12883 // "type": "boolean" 12884 // }, 12885 // "useDomainAdminAccess": { 12886 // "default": "false", 12887 // "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.", 12888 // "location": "query", 12889 // "type": "boolean" 12890 // } 12891 // }, 12892 // "path": "files/{fileId}/permissions/{permissionId}", 12893 // "response": { 12894 // "$ref": "Permission" 12895 // }, 12896 // "scopes": [ 12897 // "https://www.googleapis.com/auth/drive", 12898 // "https://www.googleapis.com/auth/drive.file", 12899 // "https://www.googleapis.com/auth/drive.metadata", 12900 // "https://www.googleapis.com/auth/drive.metadata.readonly", 12901 // "https://www.googleapis.com/auth/drive.photos.readonly", 12902 // "https://www.googleapis.com/auth/drive.readonly" 12903 // ] 12904 // } 12905 12906} 12907 12908// method id "drive.permissions.getIdForEmail": 12909 12910type PermissionsGetIdForEmailCall struct { 12911 s *Service 12912 email string 12913 urlParams_ gensupport.URLParams 12914 ifNoneMatch_ string 12915 ctx_ context.Context 12916 header_ http.Header 12917} 12918 12919// GetIdForEmail: Returns the permission ID for an email address. 12920// 12921// - email: The email address for which to return a permission ID. 12922func (r *PermissionsService) GetIdForEmail(email string) *PermissionsGetIdForEmailCall { 12923 c := &PermissionsGetIdForEmailCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12924 c.email = email 12925 return c 12926} 12927 12928// Fields allows partial responses to be retrieved. See 12929// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12930// for more information. 12931func (c *PermissionsGetIdForEmailCall) Fields(s ...googleapi.Field) *PermissionsGetIdForEmailCall { 12932 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12933 return c 12934} 12935 12936// IfNoneMatch sets the optional parameter which makes the operation 12937// fail if the object's ETag matches the given value. This is useful for 12938// getting updates only after the object has changed since the last 12939// request. Use googleapi.IsNotModified to check whether the response 12940// error from Do is the result of In-None-Match. 12941func (c *PermissionsGetIdForEmailCall) IfNoneMatch(entityTag string) *PermissionsGetIdForEmailCall { 12942 c.ifNoneMatch_ = entityTag 12943 return c 12944} 12945 12946// Context sets the context to be used in this call's Do method. Any 12947// pending HTTP request will be aborted if the provided context is 12948// canceled. 12949func (c *PermissionsGetIdForEmailCall) Context(ctx context.Context) *PermissionsGetIdForEmailCall { 12950 c.ctx_ = ctx 12951 return c 12952} 12953 12954// Header returns an http.Header that can be modified by the caller to 12955// add HTTP headers to the request. 12956func (c *PermissionsGetIdForEmailCall) Header() http.Header { 12957 if c.header_ == nil { 12958 c.header_ = make(http.Header) 12959 } 12960 return c.header_ 12961} 12962 12963func (c *PermissionsGetIdForEmailCall) doRequest(alt string) (*http.Response, error) { 12964 reqHeaders := make(http.Header) 12965 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 12966 for k, v := range c.header_ { 12967 reqHeaders[k] = v 12968 } 12969 reqHeaders.Set("User-Agent", c.s.userAgent()) 12970 if c.ifNoneMatch_ != "" { 12971 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12972 } 12973 var body io.Reader = nil 12974 c.urlParams_.Set("alt", alt) 12975 c.urlParams_.Set("prettyPrint", "false") 12976 urls := googleapi.ResolveRelative(c.s.BasePath, "permissionIds/{email}") 12977 urls += "?" + c.urlParams_.Encode() 12978 req, err := http.NewRequest("GET", urls, body) 12979 if err != nil { 12980 return nil, err 12981 } 12982 req.Header = reqHeaders 12983 googleapi.Expand(req.URL, map[string]string{ 12984 "email": c.email, 12985 }) 12986 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12987} 12988 12989// Do executes the "drive.permissions.getIdForEmail" call. 12990// Exactly one of *PermissionId or error will be non-nil. Any non-2xx 12991// status code is an error. Response headers are in either 12992// *PermissionId.ServerResponse.Header or (if a response was returned at 12993// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12994// to check whether the returned error was because 12995// http.StatusNotModified was returned. 12996func (c *PermissionsGetIdForEmailCall) Do(opts ...googleapi.CallOption) (*PermissionId, error) { 12997 gensupport.SetOptions(c.urlParams_, opts...) 12998 res, err := c.doRequest("json") 12999 if res != nil && res.StatusCode == http.StatusNotModified { 13000 if res.Body != nil { 13001 res.Body.Close() 13002 } 13003 return nil, &googleapi.Error{ 13004 Code: res.StatusCode, 13005 Header: res.Header, 13006 } 13007 } 13008 if err != nil { 13009 return nil, err 13010 } 13011 defer googleapi.CloseBody(res) 13012 if err := googleapi.CheckResponse(res); err != nil { 13013 return nil, err 13014 } 13015 ret := &PermissionId{ 13016 ServerResponse: googleapi.ServerResponse{ 13017 Header: res.Header, 13018 HTTPStatusCode: res.StatusCode, 13019 }, 13020 } 13021 target := &ret 13022 if err := gensupport.DecodeResponse(target, res); err != nil { 13023 return nil, err 13024 } 13025 return ret, nil 13026 // { 13027 // "description": "Returns the permission ID for an email address.", 13028 // "httpMethod": "GET", 13029 // "id": "drive.permissions.getIdForEmail", 13030 // "parameterOrder": [ 13031 // "email" 13032 // ], 13033 // "parameters": { 13034 // "email": { 13035 // "description": "The email address for which to return a permission ID", 13036 // "location": "path", 13037 // "required": true, 13038 // "type": "string" 13039 // } 13040 // }, 13041 // "path": "permissionIds/{email}", 13042 // "response": { 13043 // "$ref": "PermissionId" 13044 // }, 13045 // "scopes": [ 13046 // "https://www.googleapis.com/auth/drive", 13047 // "https://www.googleapis.com/auth/drive.appdata", 13048 // "https://www.googleapis.com/auth/drive.apps.readonly", 13049 // "https://www.googleapis.com/auth/drive.file", 13050 // "https://www.googleapis.com/auth/drive.metadata", 13051 // "https://www.googleapis.com/auth/drive.metadata.readonly", 13052 // "https://www.googleapis.com/auth/drive.photos.readonly", 13053 // "https://www.googleapis.com/auth/drive.readonly" 13054 // ] 13055 // } 13056 13057} 13058 13059// method id "drive.permissions.insert": 13060 13061type PermissionsInsertCall struct { 13062 s *Service 13063 fileId string 13064 permission *Permission 13065 urlParams_ gensupport.URLParams 13066 ctx_ context.Context 13067 header_ http.Header 13068} 13069 13070// Insert: Inserts a permission for a file or shared drive. 13071// 13072// - fileId: The ID for the file or shared drive. 13073func (r *PermissionsService) Insert(fileId string, permission *Permission) *PermissionsInsertCall { 13074 c := &PermissionsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13075 c.fileId = fileId 13076 c.permission = permission 13077 return c 13078} 13079 13080// EmailMessage sets the optional parameter "emailMessage": A plain text 13081// custom message to include in notification emails. 13082func (c *PermissionsInsertCall) EmailMessage(emailMessage string) *PermissionsInsertCall { 13083 c.urlParams_.Set("emailMessage", emailMessage) 13084 return c 13085} 13086 13087// EnforceSingleParent sets the optional parameter 13088// "enforceSingleParent": Deprecated. See moveToNewOwnersRoot for 13089// details. 13090func (c *PermissionsInsertCall) EnforceSingleParent(enforceSingleParent bool) *PermissionsInsertCall { 13091 c.urlParams_.Set("enforceSingleParent", fmt.Sprint(enforceSingleParent)) 13092 return c 13093} 13094 13095// MoveToNewOwnersRoot sets the optional parameter 13096// "moveToNewOwnersRoot": This parameter will only take effect if the 13097// item is not in a shared drive and the request is attempting to 13098// transfer the ownership of the item. If set to true, the item will be 13099// moved to the new owner's My Drive root folder and all prior parents 13100// removed. If set to false, parents are not changed. 13101func (c *PermissionsInsertCall) MoveToNewOwnersRoot(moveToNewOwnersRoot bool) *PermissionsInsertCall { 13102 c.urlParams_.Set("moveToNewOwnersRoot", fmt.Sprint(moveToNewOwnersRoot)) 13103 return c 13104} 13105 13106// SendNotificationEmails sets the optional parameter 13107// "sendNotificationEmails": Whether to send notification emails when 13108// sharing to users or groups. This parameter is ignored and an email is 13109// sent if the role is owner. 13110func (c *PermissionsInsertCall) SendNotificationEmails(sendNotificationEmails bool) *PermissionsInsertCall { 13111 c.urlParams_.Set("sendNotificationEmails", fmt.Sprint(sendNotificationEmails)) 13112 return c 13113} 13114 13115// SupportsAllDrives sets the optional parameter "supportsAllDrives": 13116// Whether the requesting application supports both My Drives and shared 13117// drives. 13118func (c *PermissionsInsertCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsInsertCall { 13119 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 13120 return c 13121} 13122 13123// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 13124// Deprecated use supportsAllDrives instead. 13125func (c *PermissionsInsertCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsInsertCall { 13126 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 13127 return c 13128} 13129 13130// UseDomainAdminAccess sets the optional parameter 13131// "useDomainAdminAccess": Issue the request as a domain administrator; 13132// if set to true, then the requester will be granted access if the file 13133// ID parameter refers to a shared drive and the requester is an 13134// administrator of the domain to which the shared drive belongs. 13135func (c *PermissionsInsertCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsInsertCall { 13136 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 13137 return c 13138} 13139 13140// Fields allows partial responses to be retrieved. See 13141// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13142// for more information. 13143func (c *PermissionsInsertCall) Fields(s ...googleapi.Field) *PermissionsInsertCall { 13144 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13145 return c 13146} 13147 13148// Context sets the context to be used in this call's Do method. Any 13149// pending HTTP request will be aborted if the provided context is 13150// canceled. 13151func (c *PermissionsInsertCall) Context(ctx context.Context) *PermissionsInsertCall { 13152 c.ctx_ = ctx 13153 return c 13154} 13155 13156// Header returns an http.Header that can be modified by the caller to 13157// add HTTP headers to the request. 13158func (c *PermissionsInsertCall) Header() http.Header { 13159 if c.header_ == nil { 13160 c.header_ = make(http.Header) 13161 } 13162 return c.header_ 13163} 13164 13165func (c *PermissionsInsertCall) doRequest(alt string) (*http.Response, error) { 13166 reqHeaders := make(http.Header) 13167 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 13168 for k, v := range c.header_ { 13169 reqHeaders[k] = v 13170 } 13171 reqHeaders.Set("User-Agent", c.s.userAgent()) 13172 var body io.Reader = nil 13173 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) 13174 if err != nil { 13175 return nil, err 13176 } 13177 reqHeaders.Set("Content-Type", "application/json") 13178 c.urlParams_.Set("alt", alt) 13179 c.urlParams_.Set("prettyPrint", "false") 13180 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") 13181 urls += "?" + c.urlParams_.Encode() 13182 req, err := http.NewRequest("POST", urls, body) 13183 if err != nil { 13184 return nil, err 13185 } 13186 req.Header = reqHeaders 13187 googleapi.Expand(req.URL, map[string]string{ 13188 "fileId": c.fileId, 13189 }) 13190 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13191} 13192 13193// Do executes the "drive.permissions.insert" call. 13194// Exactly one of *Permission or error will be non-nil. Any non-2xx 13195// status code is an error. Response headers are in either 13196// *Permission.ServerResponse.Header or (if a response was returned at 13197// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13198// to check whether the returned error was because 13199// http.StatusNotModified was returned. 13200func (c *PermissionsInsertCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 13201 gensupport.SetOptions(c.urlParams_, opts...) 13202 res, err := c.doRequest("json") 13203 if res != nil && res.StatusCode == http.StatusNotModified { 13204 if res.Body != nil { 13205 res.Body.Close() 13206 } 13207 return nil, &googleapi.Error{ 13208 Code: res.StatusCode, 13209 Header: res.Header, 13210 } 13211 } 13212 if err != nil { 13213 return nil, err 13214 } 13215 defer googleapi.CloseBody(res) 13216 if err := googleapi.CheckResponse(res); err != nil { 13217 return nil, err 13218 } 13219 ret := &Permission{ 13220 ServerResponse: googleapi.ServerResponse{ 13221 Header: res.Header, 13222 HTTPStatusCode: res.StatusCode, 13223 }, 13224 } 13225 target := &ret 13226 if err := gensupport.DecodeResponse(target, res); err != nil { 13227 return nil, err 13228 } 13229 return ret, nil 13230 // { 13231 // "description": "Inserts a permission for a file or shared drive.", 13232 // "httpMethod": "POST", 13233 // "id": "drive.permissions.insert", 13234 // "parameterOrder": [ 13235 // "fileId" 13236 // ], 13237 // "parameters": { 13238 // "emailMessage": { 13239 // "description": "A plain text custom message to include in notification emails.", 13240 // "location": "query", 13241 // "type": "string" 13242 // }, 13243 // "enforceSingleParent": { 13244 // "default": "false", 13245 // "description": "Deprecated. See moveToNewOwnersRoot for details.", 13246 // "location": "query", 13247 // "type": "boolean" 13248 // }, 13249 // "fileId": { 13250 // "description": "The ID for the file or shared drive.", 13251 // "location": "path", 13252 // "required": true, 13253 // "type": "string" 13254 // }, 13255 // "moveToNewOwnersRoot": { 13256 // "default": "false", 13257 // "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.", 13258 // "location": "query", 13259 // "type": "boolean" 13260 // }, 13261 // "sendNotificationEmails": { 13262 // "default": "true", 13263 // "description": "Whether to send notification emails when sharing to users or groups. This parameter is ignored and an email is sent if the role is owner.", 13264 // "location": "query", 13265 // "type": "boolean" 13266 // }, 13267 // "supportsAllDrives": { 13268 // "default": "false", 13269 // "description": "Whether the requesting application supports both My Drives and shared drives.", 13270 // "location": "query", 13271 // "type": "boolean" 13272 // }, 13273 // "supportsTeamDrives": { 13274 // "default": "false", 13275 // "description": "Deprecated use supportsAllDrives instead.", 13276 // "location": "query", 13277 // "type": "boolean" 13278 // }, 13279 // "useDomainAdminAccess": { 13280 // "default": "false", 13281 // "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.", 13282 // "location": "query", 13283 // "type": "boolean" 13284 // } 13285 // }, 13286 // "path": "files/{fileId}/permissions", 13287 // "request": { 13288 // "$ref": "Permission" 13289 // }, 13290 // "response": { 13291 // "$ref": "Permission" 13292 // }, 13293 // "scopes": [ 13294 // "https://www.googleapis.com/auth/drive", 13295 // "https://www.googleapis.com/auth/drive.file" 13296 // ] 13297 // } 13298 13299} 13300 13301// method id "drive.permissions.list": 13302 13303type PermissionsListCall struct { 13304 s *Service 13305 fileId string 13306 urlParams_ gensupport.URLParams 13307 ifNoneMatch_ string 13308 ctx_ context.Context 13309 header_ http.Header 13310} 13311 13312// List: Lists a file's or shared drive's permissions. 13313// 13314// - fileId: The ID for the file or shared drive. 13315func (r *PermissionsService) List(fileId string) *PermissionsListCall { 13316 c := &PermissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13317 c.fileId = fileId 13318 return c 13319} 13320 13321// IncludePermissionsForView sets the optional parameter 13322// "includePermissionsForView": Specifies which additional view's 13323// permissions to include in the response. Only 'published' is 13324// supported. 13325func (c *PermissionsListCall) IncludePermissionsForView(includePermissionsForView string) *PermissionsListCall { 13326 c.urlParams_.Set("includePermissionsForView", includePermissionsForView) 13327 return c 13328} 13329 13330// MaxResults sets the optional parameter "maxResults": The maximum 13331// number of permissions to return per page. When not set for files in a 13332// shared drive, at most 100 results will be returned. When not set for 13333// files that are not in a shared drive, the entire list will be 13334// returned. 13335func (c *PermissionsListCall) MaxResults(maxResults int64) *PermissionsListCall { 13336 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 13337 return c 13338} 13339 13340// PageToken sets the optional parameter "pageToken": The token for 13341// continuing a previous list request on the next page. This should be 13342// set to the value of 'nextPageToken' from the previous response. 13343func (c *PermissionsListCall) PageToken(pageToken string) *PermissionsListCall { 13344 c.urlParams_.Set("pageToken", pageToken) 13345 return c 13346} 13347 13348// SupportsAllDrives sets the optional parameter "supportsAllDrives": 13349// Whether the requesting application supports both My Drives and shared 13350// drives. 13351func (c *PermissionsListCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsListCall { 13352 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 13353 return c 13354} 13355 13356// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 13357// Deprecated use supportsAllDrives instead. 13358func (c *PermissionsListCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsListCall { 13359 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 13360 return c 13361} 13362 13363// UseDomainAdminAccess sets the optional parameter 13364// "useDomainAdminAccess": Issue the request as a domain administrator; 13365// if set to true, then the requester will be granted access if the file 13366// ID parameter refers to a shared drive and the requester is an 13367// administrator of the domain to which the shared drive belongs. 13368func (c *PermissionsListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsListCall { 13369 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 13370 return c 13371} 13372 13373// Fields allows partial responses to be retrieved. See 13374// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13375// for more information. 13376func (c *PermissionsListCall) Fields(s ...googleapi.Field) *PermissionsListCall { 13377 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13378 return c 13379} 13380 13381// IfNoneMatch sets the optional parameter which makes the operation 13382// fail if the object's ETag matches the given value. This is useful for 13383// getting updates only after the object has changed since the last 13384// request. Use googleapi.IsNotModified to check whether the response 13385// error from Do is the result of In-None-Match. 13386func (c *PermissionsListCall) IfNoneMatch(entityTag string) *PermissionsListCall { 13387 c.ifNoneMatch_ = entityTag 13388 return c 13389} 13390 13391// Context sets the context to be used in this call's Do method. Any 13392// pending HTTP request will be aborted if the provided context is 13393// canceled. 13394func (c *PermissionsListCall) Context(ctx context.Context) *PermissionsListCall { 13395 c.ctx_ = ctx 13396 return c 13397} 13398 13399// Header returns an http.Header that can be modified by the caller to 13400// add HTTP headers to the request. 13401func (c *PermissionsListCall) Header() http.Header { 13402 if c.header_ == nil { 13403 c.header_ = make(http.Header) 13404 } 13405 return c.header_ 13406} 13407 13408func (c *PermissionsListCall) doRequest(alt string) (*http.Response, error) { 13409 reqHeaders := make(http.Header) 13410 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 13411 for k, v := range c.header_ { 13412 reqHeaders[k] = v 13413 } 13414 reqHeaders.Set("User-Agent", c.s.userAgent()) 13415 if c.ifNoneMatch_ != "" { 13416 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13417 } 13418 var body io.Reader = nil 13419 c.urlParams_.Set("alt", alt) 13420 c.urlParams_.Set("prettyPrint", "false") 13421 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions") 13422 urls += "?" + c.urlParams_.Encode() 13423 req, err := http.NewRequest("GET", urls, body) 13424 if err != nil { 13425 return nil, err 13426 } 13427 req.Header = reqHeaders 13428 googleapi.Expand(req.URL, map[string]string{ 13429 "fileId": c.fileId, 13430 }) 13431 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13432} 13433 13434// Do executes the "drive.permissions.list" call. 13435// Exactly one of *PermissionList or error will be non-nil. Any non-2xx 13436// status code is an error. Response headers are in either 13437// *PermissionList.ServerResponse.Header or (if a response was returned 13438// at all) in error.(*googleapi.Error).Header. Use 13439// googleapi.IsNotModified to check whether the returned error was 13440// because http.StatusNotModified was returned. 13441func (c *PermissionsListCall) Do(opts ...googleapi.CallOption) (*PermissionList, error) { 13442 gensupport.SetOptions(c.urlParams_, opts...) 13443 res, err := c.doRequest("json") 13444 if res != nil && res.StatusCode == http.StatusNotModified { 13445 if res.Body != nil { 13446 res.Body.Close() 13447 } 13448 return nil, &googleapi.Error{ 13449 Code: res.StatusCode, 13450 Header: res.Header, 13451 } 13452 } 13453 if err != nil { 13454 return nil, err 13455 } 13456 defer googleapi.CloseBody(res) 13457 if err := googleapi.CheckResponse(res); err != nil { 13458 return nil, err 13459 } 13460 ret := &PermissionList{ 13461 ServerResponse: googleapi.ServerResponse{ 13462 Header: res.Header, 13463 HTTPStatusCode: res.StatusCode, 13464 }, 13465 } 13466 target := &ret 13467 if err := gensupport.DecodeResponse(target, res); err != nil { 13468 return nil, err 13469 } 13470 return ret, nil 13471 // { 13472 // "description": "Lists a file's or shared drive's permissions.", 13473 // "httpMethod": "GET", 13474 // "id": "drive.permissions.list", 13475 // "parameterOrder": [ 13476 // "fileId" 13477 // ], 13478 // "parameters": { 13479 // "fileId": { 13480 // "description": "The ID for the file or shared drive.", 13481 // "location": "path", 13482 // "required": true, 13483 // "type": "string" 13484 // }, 13485 // "includePermissionsForView": { 13486 // "description": "Specifies which additional view's permissions to include in the response. Only 'published' is supported.", 13487 // "location": "query", 13488 // "type": "string" 13489 // }, 13490 // "maxResults": { 13491 // "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.", 13492 // "format": "int32", 13493 // "location": "query", 13494 // "maximum": "100", 13495 // "minimum": "1", 13496 // "type": "integer" 13497 // }, 13498 // "pageToken": { 13499 // "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.", 13500 // "location": "query", 13501 // "type": "string" 13502 // }, 13503 // "supportsAllDrives": { 13504 // "default": "false", 13505 // "description": "Whether the requesting application supports both My Drives and shared drives.", 13506 // "location": "query", 13507 // "type": "boolean" 13508 // }, 13509 // "supportsTeamDrives": { 13510 // "default": "false", 13511 // "description": "Deprecated use supportsAllDrives instead.", 13512 // "location": "query", 13513 // "type": "boolean" 13514 // }, 13515 // "useDomainAdminAccess": { 13516 // "default": "false", 13517 // "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.", 13518 // "location": "query", 13519 // "type": "boolean" 13520 // } 13521 // }, 13522 // "path": "files/{fileId}/permissions", 13523 // "response": { 13524 // "$ref": "PermissionList" 13525 // }, 13526 // "scopes": [ 13527 // "https://www.googleapis.com/auth/drive", 13528 // "https://www.googleapis.com/auth/drive.file", 13529 // "https://www.googleapis.com/auth/drive.metadata", 13530 // "https://www.googleapis.com/auth/drive.metadata.readonly", 13531 // "https://www.googleapis.com/auth/drive.photos.readonly", 13532 // "https://www.googleapis.com/auth/drive.readonly" 13533 // ] 13534 // } 13535 13536} 13537 13538// Pages invokes f for each page of results. 13539// A non-nil error returned from f will halt the iteration. 13540// The provided context supersedes any context provided to the Context method. 13541func (c *PermissionsListCall) Pages(ctx context.Context, f func(*PermissionList) error) error { 13542 c.ctx_ = ctx 13543 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 13544 for { 13545 x, err := c.Do() 13546 if err != nil { 13547 return err 13548 } 13549 if err := f(x); err != nil { 13550 return err 13551 } 13552 if x.NextPageToken == "" { 13553 return nil 13554 } 13555 c.PageToken(x.NextPageToken) 13556 } 13557} 13558 13559// method id "drive.permissions.patch": 13560 13561type PermissionsPatchCall struct { 13562 s *Service 13563 fileId string 13564 permissionId string 13565 permission *Permission 13566 urlParams_ gensupport.URLParams 13567 ctx_ context.Context 13568 header_ http.Header 13569} 13570 13571// Patch: Updates a permission using patch semantics. 13572// 13573// - fileId: The ID for the file or shared drive. 13574// - permissionId: The ID for the permission. 13575func (r *PermissionsService) Patch(fileId string, permissionId string, permission *Permission) *PermissionsPatchCall { 13576 c := &PermissionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13577 c.fileId = fileId 13578 c.permissionId = permissionId 13579 c.permission = permission 13580 return c 13581} 13582 13583// RemoveExpiration sets the optional parameter "removeExpiration": 13584// Whether to remove the expiration date. 13585func (c *PermissionsPatchCall) RemoveExpiration(removeExpiration bool) *PermissionsPatchCall { 13586 c.urlParams_.Set("removeExpiration", fmt.Sprint(removeExpiration)) 13587 return c 13588} 13589 13590// SupportsAllDrives sets the optional parameter "supportsAllDrives": 13591// Whether the requesting application supports both My Drives and shared 13592// drives. 13593func (c *PermissionsPatchCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsPatchCall { 13594 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 13595 return c 13596} 13597 13598// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 13599// Deprecated use supportsAllDrives instead. 13600func (c *PermissionsPatchCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsPatchCall { 13601 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 13602 return c 13603} 13604 13605// TransferOwnership sets the optional parameter "transferOwnership": 13606// Whether changing a role to 'owner' downgrades the current owners to 13607// writers. Does nothing if the specified role is not 'owner'. 13608func (c *PermissionsPatchCall) TransferOwnership(transferOwnership bool) *PermissionsPatchCall { 13609 c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership)) 13610 return c 13611} 13612 13613// UseDomainAdminAccess sets the optional parameter 13614// "useDomainAdminAccess": Issue the request as a domain administrator; 13615// if set to true, then the requester will be granted access if the file 13616// ID parameter refers to a shared drive and the requester is an 13617// administrator of the domain to which the shared drive belongs. 13618func (c *PermissionsPatchCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsPatchCall { 13619 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 13620 return c 13621} 13622 13623// Fields allows partial responses to be retrieved. See 13624// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13625// for more information. 13626func (c *PermissionsPatchCall) Fields(s ...googleapi.Field) *PermissionsPatchCall { 13627 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13628 return c 13629} 13630 13631// Context sets the context to be used in this call's Do method. Any 13632// pending HTTP request will be aborted if the provided context is 13633// canceled. 13634func (c *PermissionsPatchCall) Context(ctx context.Context) *PermissionsPatchCall { 13635 c.ctx_ = ctx 13636 return c 13637} 13638 13639// Header returns an http.Header that can be modified by the caller to 13640// add HTTP headers to the request. 13641func (c *PermissionsPatchCall) Header() http.Header { 13642 if c.header_ == nil { 13643 c.header_ = make(http.Header) 13644 } 13645 return c.header_ 13646} 13647 13648func (c *PermissionsPatchCall) doRequest(alt string) (*http.Response, error) { 13649 reqHeaders := make(http.Header) 13650 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 13651 for k, v := range c.header_ { 13652 reqHeaders[k] = v 13653 } 13654 reqHeaders.Set("User-Agent", c.s.userAgent()) 13655 var body io.Reader = nil 13656 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) 13657 if err != nil { 13658 return nil, err 13659 } 13660 reqHeaders.Set("Content-Type", "application/json") 13661 c.urlParams_.Set("alt", alt) 13662 c.urlParams_.Set("prettyPrint", "false") 13663 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") 13664 urls += "?" + c.urlParams_.Encode() 13665 req, err := http.NewRequest("PATCH", urls, body) 13666 if err != nil { 13667 return nil, err 13668 } 13669 req.Header = reqHeaders 13670 googleapi.Expand(req.URL, map[string]string{ 13671 "fileId": c.fileId, 13672 "permissionId": c.permissionId, 13673 }) 13674 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13675} 13676 13677// Do executes the "drive.permissions.patch" call. 13678// Exactly one of *Permission or error will be non-nil. Any non-2xx 13679// status code is an error. Response headers are in either 13680// *Permission.ServerResponse.Header or (if a response was returned at 13681// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13682// to check whether the returned error was because 13683// http.StatusNotModified was returned. 13684func (c *PermissionsPatchCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 13685 gensupport.SetOptions(c.urlParams_, opts...) 13686 res, err := c.doRequest("json") 13687 if res != nil && res.StatusCode == http.StatusNotModified { 13688 if res.Body != nil { 13689 res.Body.Close() 13690 } 13691 return nil, &googleapi.Error{ 13692 Code: res.StatusCode, 13693 Header: res.Header, 13694 } 13695 } 13696 if err != nil { 13697 return nil, err 13698 } 13699 defer googleapi.CloseBody(res) 13700 if err := googleapi.CheckResponse(res); err != nil { 13701 return nil, err 13702 } 13703 ret := &Permission{ 13704 ServerResponse: googleapi.ServerResponse{ 13705 Header: res.Header, 13706 HTTPStatusCode: res.StatusCode, 13707 }, 13708 } 13709 target := &ret 13710 if err := gensupport.DecodeResponse(target, res); err != nil { 13711 return nil, err 13712 } 13713 return ret, nil 13714 // { 13715 // "description": "Updates a permission using patch semantics.", 13716 // "httpMethod": "PATCH", 13717 // "id": "drive.permissions.patch", 13718 // "parameterOrder": [ 13719 // "fileId", 13720 // "permissionId" 13721 // ], 13722 // "parameters": { 13723 // "fileId": { 13724 // "description": "The ID for the file or shared drive.", 13725 // "location": "path", 13726 // "required": true, 13727 // "type": "string" 13728 // }, 13729 // "permissionId": { 13730 // "description": "The ID for the permission.", 13731 // "location": "path", 13732 // "required": true, 13733 // "type": "string" 13734 // }, 13735 // "removeExpiration": { 13736 // "default": "false", 13737 // "description": "Whether to remove the expiration date.", 13738 // "location": "query", 13739 // "type": "boolean" 13740 // }, 13741 // "supportsAllDrives": { 13742 // "default": "false", 13743 // "description": "Whether the requesting application supports both My Drives and shared drives.", 13744 // "location": "query", 13745 // "type": "boolean" 13746 // }, 13747 // "supportsTeamDrives": { 13748 // "default": "false", 13749 // "description": "Deprecated use supportsAllDrives instead.", 13750 // "location": "query", 13751 // "type": "boolean" 13752 // }, 13753 // "transferOwnership": { 13754 // "default": "false", 13755 // "description": "Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.", 13756 // "location": "query", 13757 // "type": "boolean" 13758 // }, 13759 // "useDomainAdminAccess": { 13760 // "default": "false", 13761 // "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.", 13762 // "location": "query", 13763 // "type": "boolean" 13764 // } 13765 // }, 13766 // "path": "files/{fileId}/permissions/{permissionId}", 13767 // "request": { 13768 // "$ref": "Permission" 13769 // }, 13770 // "response": { 13771 // "$ref": "Permission" 13772 // }, 13773 // "scopes": [ 13774 // "https://www.googleapis.com/auth/drive", 13775 // "https://www.googleapis.com/auth/drive.file" 13776 // ] 13777 // } 13778 13779} 13780 13781// method id "drive.permissions.update": 13782 13783type PermissionsUpdateCall struct { 13784 s *Service 13785 fileId string 13786 permissionId string 13787 permission *Permission 13788 urlParams_ gensupport.URLParams 13789 ctx_ context.Context 13790 header_ http.Header 13791} 13792 13793// Update: Updates a permission. 13794// 13795// - fileId: The ID for the file or shared drive. 13796// - permissionId: The ID for the permission. 13797func (r *PermissionsService) Update(fileId string, permissionId string, permission *Permission) *PermissionsUpdateCall { 13798 c := &PermissionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13799 c.fileId = fileId 13800 c.permissionId = permissionId 13801 c.permission = permission 13802 return c 13803} 13804 13805// RemoveExpiration sets the optional parameter "removeExpiration": 13806// Whether to remove the expiration date. 13807func (c *PermissionsUpdateCall) RemoveExpiration(removeExpiration bool) *PermissionsUpdateCall { 13808 c.urlParams_.Set("removeExpiration", fmt.Sprint(removeExpiration)) 13809 return c 13810} 13811 13812// SupportsAllDrives sets the optional parameter "supportsAllDrives": 13813// Whether the requesting application supports both My Drives and shared 13814// drives. 13815func (c *PermissionsUpdateCall) SupportsAllDrives(supportsAllDrives bool) *PermissionsUpdateCall { 13816 c.urlParams_.Set("supportsAllDrives", fmt.Sprint(supportsAllDrives)) 13817 return c 13818} 13819 13820// SupportsTeamDrives sets the optional parameter "supportsTeamDrives": 13821// Deprecated use supportsAllDrives instead. 13822func (c *PermissionsUpdateCall) SupportsTeamDrives(supportsTeamDrives bool) *PermissionsUpdateCall { 13823 c.urlParams_.Set("supportsTeamDrives", fmt.Sprint(supportsTeamDrives)) 13824 return c 13825} 13826 13827// TransferOwnership sets the optional parameter "transferOwnership": 13828// Whether changing a role to 'owner' downgrades the current owners to 13829// writers. Does nothing if the specified role is not 'owner'. 13830func (c *PermissionsUpdateCall) TransferOwnership(transferOwnership bool) *PermissionsUpdateCall { 13831 c.urlParams_.Set("transferOwnership", fmt.Sprint(transferOwnership)) 13832 return c 13833} 13834 13835// UseDomainAdminAccess sets the optional parameter 13836// "useDomainAdminAccess": Issue the request as a domain administrator; 13837// if set to true, then the requester will be granted access if the file 13838// ID parameter refers to a shared drive and the requester is an 13839// administrator of the domain to which the shared drive belongs. 13840func (c *PermissionsUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *PermissionsUpdateCall { 13841 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 13842 return c 13843} 13844 13845// Fields allows partial responses to be retrieved. See 13846// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13847// for more information. 13848func (c *PermissionsUpdateCall) Fields(s ...googleapi.Field) *PermissionsUpdateCall { 13849 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13850 return c 13851} 13852 13853// Context sets the context to be used in this call's Do method. Any 13854// pending HTTP request will be aborted if the provided context is 13855// canceled. 13856func (c *PermissionsUpdateCall) Context(ctx context.Context) *PermissionsUpdateCall { 13857 c.ctx_ = ctx 13858 return c 13859} 13860 13861// Header returns an http.Header that can be modified by the caller to 13862// add HTTP headers to the request. 13863func (c *PermissionsUpdateCall) Header() http.Header { 13864 if c.header_ == nil { 13865 c.header_ = make(http.Header) 13866 } 13867 return c.header_ 13868} 13869 13870func (c *PermissionsUpdateCall) doRequest(alt string) (*http.Response, error) { 13871 reqHeaders := make(http.Header) 13872 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 13873 for k, v := range c.header_ { 13874 reqHeaders[k] = v 13875 } 13876 reqHeaders.Set("User-Agent", c.s.userAgent()) 13877 var body io.Reader = nil 13878 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) 13879 if err != nil { 13880 return nil, err 13881 } 13882 reqHeaders.Set("Content-Type", "application/json") 13883 c.urlParams_.Set("alt", alt) 13884 c.urlParams_.Set("prettyPrint", "false") 13885 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/permissions/{permissionId}") 13886 urls += "?" + c.urlParams_.Encode() 13887 req, err := http.NewRequest("PUT", urls, body) 13888 if err != nil { 13889 return nil, err 13890 } 13891 req.Header = reqHeaders 13892 googleapi.Expand(req.URL, map[string]string{ 13893 "fileId": c.fileId, 13894 "permissionId": c.permissionId, 13895 }) 13896 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13897} 13898 13899// Do executes the "drive.permissions.update" call. 13900// Exactly one of *Permission or error will be non-nil. Any non-2xx 13901// status code is an error. Response headers are in either 13902// *Permission.ServerResponse.Header or (if a response was returned at 13903// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 13904// to check whether the returned error was because 13905// http.StatusNotModified was returned. 13906func (c *PermissionsUpdateCall) Do(opts ...googleapi.CallOption) (*Permission, error) { 13907 gensupport.SetOptions(c.urlParams_, opts...) 13908 res, err := c.doRequest("json") 13909 if res != nil && res.StatusCode == http.StatusNotModified { 13910 if res.Body != nil { 13911 res.Body.Close() 13912 } 13913 return nil, &googleapi.Error{ 13914 Code: res.StatusCode, 13915 Header: res.Header, 13916 } 13917 } 13918 if err != nil { 13919 return nil, err 13920 } 13921 defer googleapi.CloseBody(res) 13922 if err := googleapi.CheckResponse(res); err != nil { 13923 return nil, err 13924 } 13925 ret := &Permission{ 13926 ServerResponse: googleapi.ServerResponse{ 13927 Header: res.Header, 13928 HTTPStatusCode: res.StatusCode, 13929 }, 13930 } 13931 target := &ret 13932 if err := gensupport.DecodeResponse(target, res); err != nil { 13933 return nil, err 13934 } 13935 return ret, nil 13936 // { 13937 // "description": "Updates a permission.", 13938 // "httpMethod": "PUT", 13939 // "id": "drive.permissions.update", 13940 // "parameterOrder": [ 13941 // "fileId", 13942 // "permissionId" 13943 // ], 13944 // "parameters": { 13945 // "fileId": { 13946 // "description": "The ID for the file or shared drive.", 13947 // "location": "path", 13948 // "required": true, 13949 // "type": "string" 13950 // }, 13951 // "permissionId": { 13952 // "description": "The ID for the permission.", 13953 // "location": "path", 13954 // "required": true, 13955 // "type": "string" 13956 // }, 13957 // "removeExpiration": { 13958 // "default": "false", 13959 // "description": "Whether to remove the expiration date.", 13960 // "location": "query", 13961 // "type": "boolean" 13962 // }, 13963 // "supportsAllDrives": { 13964 // "default": "false", 13965 // "description": "Whether the requesting application supports both My Drives and shared drives.", 13966 // "location": "query", 13967 // "type": "boolean" 13968 // }, 13969 // "supportsTeamDrives": { 13970 // "default": "false", 13971 // "description": "Deprecated use supportsAllDrives instead.", 13972 // "location": "query", 13973 // "type": "boolean" 13974 // }, 13975 // "transferOwnership": { 13976 // "default": "false", 13977 // "description": "Whether changing a role to 'owner' downgrades the current owners to writers. Does nothing if the specified role is not 'owner'.", 13978 // "location": "query", 13979 // "type": "boolean" 13980 // }, 13981 // "useDomainAdminAccess": { 13982 // "default": "false", 13983 // "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.", 13984 // "location": "query", 13985 // "type": "boolean" 13986 // } 13987 // }, 13988 // "path": "files/{fileId}/permissions/{permissionId}", 13989 // "request": { 13990 // "$ref": "Permission" 13991 // }, 13992 // "response": { 13993 // "$ref": "Permission" 13994 // }, 13995 // "scopes": [ 13996 // "https://www.googleapis.com/auth/drive", 13997 // "https://www.googleapis.com/auth/drive.file" 13998 // ] 13999 // } 14000 14001} 14002 14003// method id "drive.properties.delete": 14004 14005type PropertiesDeleteCall struct { 14006 s *Service 14007 fileId string 14008 propertyKey string 14009 urlParams_ gensupport.URLParams 14010 ctx_ context.Context 14011 header_ http.Header 14012} 14013 14014// Delete: Deletes a property. 14015// 14016// - fileId: The ID of the file. 14017// - propertyKey: The key of the property. 14018func (r *PropertiesService) Delete(fileId string, propertyKey string) *PropertiesDeleteCall { 14019 c := &PropertiesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14020 c.fileId = fileId 14021 c.propertyKey = propertyKey 14022 return c 14023} 14024 14025// Visibility sets the optional parameter "visibility": The visibility 14026// of the property. 14027func (c *PropertiesDeleteCall) Visibility(visibility string) *PropertiesDeleteCall { 14028 c.urlParams_.Set("visibility", visibility) 14029 return c 14030} 14031 14032// Fields allows partial responses to be retrieved. See 14033// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14034// for more information. 14035func (c *PropertiesDeleteCall) Fields(s ...googleapi.Field) *PropertiesDeleteCall { 14036 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14037 return c 14038} 14039 14040// Context sets the context to be used in this call's Do method. Any 14041// pending HTTP request will be aborted if the provided context is 14042// canceled. 14043func (c *PropertiesDeleteCall) Context(ctx context.Context) *PropertiesDeleteCall { 14044 c.ctx_ = ctx 14045 return c 14046} 14047 14048// Header returns an http.Header that can be modified by the caller to 14049// add HTTP headers to the request. 14050func (c *PropertiesDeleteCall) Header() http.Header { 14051 if c.header_ == nil { 14052 c.header_ = make(http.Header) 14053 } 14054 return c.header_ 14055} 14056 14057func (c *PropertiesDeleteCall) doRequest(alt string) (*http.Response, error) { 14058 reqHeaders := make(http.Header) 14059 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14060 for k, v := range c.header_ { 14061 reqHeaders[k] = v 14062 } 14063 reqHeaders.Set("User-Agent", c.s.userAgent()) 14064 var body io.Reader = nil 14065 c.urlParams_.Set("alt", alt) 14066 c.urlParams_.Set("prettyPrint", "false") 14067 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") 14068 urls += "?" + c.urlParams_.Encode() 14069 req, err := http.NewRequest("DELETE", urls, body) 14070 if err != nil { 14071 return nil, err 14072 } 14073 req.Header = reqHeaders 14074 googleapi.Expand(req.URL, map[string]string{ 14075 "fileId": c.fileId, 14076 "propertyKey": c.propertyKey, 14077 }) 14078 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14079} 14080 14081// Do executes the "drive.properties.delete" call. 14082func (c *PropertiesDeleteCall) Do(opts ...googleapi.CallOption) error { 14083 gensupport.SetOptions(c.urlParams_, opts...) 14084 res, err := c.doRequest("json") 14085 if err != nil { 14086 return err 14087 } 14088 defer googleapi.CloseBody(res) 14089 if err := googleapi.CheckResponse(res); err != nil { 14090 return err 14091 } 14092 return nil 14093 // { 14094 // "description": "Deletes a property.", 14095 // "httpMethod": "DELETE", 14096 // "id": "drive.properties.delete", 14097 // "parameterOrder": [ 14098 // "fileId", 14099 // "propertyKey" 14100 // ], 14101 // "parameters": { 14102 // "fileId": { 14103 // "description": "The ID of the file.", 14104 // "location": "path", 14105 // "required": true, 14106 // "type": "string" 14107 // }, 14108 // "propertyKey": { 14109 // "description": "The key of the property.", 14110 // "location": "path", 14111 // "required": true, 14112 // "type": "string" 14113 // }, 14114 // "visibility": { 14115 // "default": "private", 14116 // "description": "The visibility of the property.", 14117 // "location": "query", 14118 // "type": "string" 14119 // } 14120 // }, 14121 // "path": "files/{fileId}/properties/{propertyKey}", 14122 // "scopes": [ 14123 // "https://www.googleapis.com/auth/drive", 14124 // "https://www.googleapis.com/auth/drive.appdata", 14125 // "https://www.googleapis.com/auth/drive.file", 14126 // "https://www.googleapis.com/auth/drive.metadata" 14127 // ] 14128 // } 14129 14130} 14131 14132// method id "drive.properties.get": 14133 14134type PropertiesGetCall struct { 14135 s *Service 14136 fileId string 14137 propertyKey string 14138 urlParams_ gensupport.URLParams 14139 ifNoneMatch_ string 14140 ctx_ context.Context 14141 header_ http.Header 14142} 14143 14144// Get: Gets a property by its key. 14145// 14146// - fileId: The ID of the file. 14147// - propertyKey: The key of the property. 14148func (r *PropertiesService) Get(fileId string, propertyKey string) *PropertiesGetCall { 14149 c := &PropertiesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14150 c.fileId = fileId 14151 c.propertyKey = propertyKey 14152 return c 14153} 14154 14155// Visibility sets the optional parameter "visibility": The visibility 14156// of the property. 14157func (c *PropertiesGetCall) Visibility(visibility string) *PropertiesGetCall { 14158 c.urlParams_.Set("visibility", visibility) 14159 return c 14160} 14161 14162// Fields allows partial responses to be retrieved. See 14163// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14164// for more information. 14165func (c *PropertiesGetCall) Fields(s ...googleapi.Field) *PropertiesGetCall { 14166 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14167 return c 14168} 14169 14170// IfNoneMatch sets the optional parameter which makes the operation 14171// fail if the object's ETag matches the given value. This is useful for 14172// getting updates only after the object has changed since the last 14173// request. Use googleapi.IsNotModified to check whether the response 14174// error from Do is the result of In-None-Match. 14175func (c *PropertiesGetCall) IfNoneMatch(entityTag string) *PropertiesGetCall { 14176 c.ifNoneMatch_ = entityTag 14177 return c 14178} 14179 14180// Context sets the context to be used in this call's Do method. Any 14181// pending HTTP request will be aborted if the provided context is 14182// canceled. 14183func (c *PropertiesGetCall) Context(ctx context.Context) *PropertiesGetCall { 14184 c.ctx_ = ctx 14185 return c 14186} 14187 14188// Header returns an http.Header that can be modified by the caller to 14189// add HTTP headers to the request. 14190func (c *PropertiesGetCall) Header() http.Header { 14191 if c.header_ == nil { 14192 c.header_ = make(http.Header) 14193 } 14194 return c.header_ 14195} 14196 14197func (c *PropertiesGetCall) doRequest(alt string) (*http.Response, error) { 14198 reqHeaders := make(http.Header) 14199 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14200 for k, v := range c.header_ { 14201 reqHeaders[k] = v 14202 } 14203 reqHeaders.Set("User-Agent", c.s.userAgent()) 14204 if c.ifNoneMatch_ != "" { 14205 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14206 } 14207 var body io.Reader = nil 14208 c.urlParams_.Set("alt", alt) 14209 c.urlParams_.Set("prettyPrint", "false") 14210 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") 14211 urls += "?" + c.urlParams_.Encode() 14212 req, err := http.NewRequest("GET", urls, body) 14213 if err != nil { 14214 return nil, err 14215 } 14216 req.Header = reqHeaders 14217 googleapi.Expand(req.URL, map[string]string{ 14218 "fileId": c.fileId, 14219 "propertyKey": c.propertyKey, 14220 }) 14221 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14222} 14223 14224// Do executes the "drive.properties.get" call. 14225// Exactly one of *Property or error will be non-nil. Any non-2xx status 14226// code is an error. Response headers are in either 14227// *Property.ServerResponse.Header or (if a response was returned at 14228// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14229// to check whether the returned error was because 14230// http.StatusNotModified was returned. 14231func (c *PropertiesGetCall) Do(opts ...googleapi.CallOption) (*Property, error) { 14232 gensupport.SetOptions(c.urlParams_, opts...) 14233 res, err := c.doRequest("json") 14234 if res != nil && res.StatusCode == http.StatusNotModified { 14235 if res.Body != nil { 14236 res.Body.Close() 14237 } 14238 return nil, &googleapi.Error{ 14239 Code: res.StatusCode, 14240 Header: res.Header, 14241 } 14242 } 14243 if err != nil { 14244 return nil, err 14245 } 14246 defer googleapi.CloseBody(res) 14247 if err := googleapi.CheckResponse(res); err != nil { 14248 return nil, err 14249 } 14250 ret := &Property{ 14251 ServerResponse: googleapi.ServerResponse{ 14252 Header: res.Header, 14253 HTTPStatusCode: res.StatusCode, 14254 }, 14255 } 14256 target := &ret 14257 if err := gensupport.DecodeResponse(target, res); err != nil { 14258 return nil, err 14259 } 14260 return ret, nil 14261 // { 14262 // "description": "Gets a property by its key.", 14263 // "httpMethod": "GET", 14264 // "id": "drive.properties.get", 14265 // "parameterOrder": [ 14266 // "fileId", 14267 // "propertyKey" 14268 // ], 14269 // "parameters": { 14270 // "fileId": { 14271 // "description": "The ID of the file.", 14272 // "location": "path", 14273 // "required": true, 14274 // "type": "string" 14275 // }, 14276 // "propertyKey": { 14277 // "description": "The key of the property.", 14278 // "location": "path", 14279 // "required": true, 14280 // "type": "string" 14281 // }, 14282 // "visibility": { 14283 // "default": "private", 14284 // "description": "The visibility of the property.", 14285 // "location": "query", 14286 // "type": "string" 14287 // } 14288 // }, 14289 // "path": "files/{fileId}/properties/{propertyKey}", 14290 // "response": { 14291 // "$ref": "Property" 14292 // }, 14293 // "scopes": [ 14294 // "https://www.googleapis.com/auth/drive", 14295 // "https://www.googleapis.com/auth/drive.appdata", 14296 // "https://www.googleapis.com/auth/drive.file", 14297 // "https://www.googleapis.com/auth/drive.metadata", 14298 // "https://www.googleapis.com/auth/drive.metadata.readonly", 14299 // "https://www.googleapis.com/auth/drive.photos.readonly", 14300 // "https://www.googleapis.com/auth/drive.readonly" 14301 // ] 14302 // } 14303 14304} 14305 14306// method id "drive.properties.insert": 14307 14308type PropertiesInsertCall struct { 14309 s *Service 14310 fileId string 14311 property *Property 14312 urlParams_ gensupport.URLParams 14313 ctx_ context.Context 14314 header_ http.Header 14315} 14316 14317// Insert: Adds a property to a file, or updates it if it already 14318// exists. 14319// 14320// - fileId: The ID of the file. 14321func (r *PropertiesService) Insert(fileId string, property *Property) *PropertiesInsertCall { 14322 c := &PropertiesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14323 c.fileId = fileId 14324 c.property = property 14325 return c 14326} 14327 14328// Fields allows partial responses to be retrieved. See 14329// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14330// for more information. 14331func (c *PropertiesInsertCall) Fields(s ...googleapi.Field) *PropertiesInsertCall { 14332 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14333 return c 14334} 14335 14336// Context sets the context to be used in this call's Do method. Any 14337// pending HTTP request will be aborted if the provided context is 14338// canceled. 14339func (c *PropertiesInsertCall) Context(ctx context.Context) *PropertiesInsertCall { 14340 c.ctx_ = ctx 14341 return c 14342} 14343 14344// Header returns an http.Header that can be modified by the caller to 14345// add HTTP headers to the request. 14346func (c *PropertiesInsertCall) Header() http.Header { 14347 if c.header_ == nil { 14348 c.header_ = make(http.Header) 14349 } 14350 return c.header_ 14351} 14352 14353func (c *PropertiesInsertCall) doRequest(alt string) (*http.Response, error) { 14354 reqHeaders := make(http.Header) 14355 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14356 for k, v := range c.header_ { 14357 reqHeaders[k] = v 14358 } 14359 reqHeaders.Set("User-Agent", c.s.userAgent()) 14360 var body io.Reader = nil 14361 body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) 14362 if err != nil { 14363 return nil, err 14364 } 14365 reqHeaders.Set("Content-Type", "application/json") 14366 c.urlParams_.Set("alt", alt) 14367 c.urlParams_.Set("prettyPrint", "false") 14368 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties") 14369 urls += "?" + c.urlParams_.Encode() 14370 req, err := http.NewRequest("POST", urls, body) 14371 if err != nil { 14372 return nil, err 14373 } 14374 req.Header = reqHeaders 14375 googleapi.Expand(req.URL, map[string]string{ 14376 "fileId": c.fileId, 14377 }) 14378 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14379} 14380 14381// Do executes the "drive.properties.insert" call. 14382// Exactly one of *Property or error will be non-nil. Any non-2xx status 14383// code is an error. Response headers are in either 14384// *Property.ServerResponse.Header or (if a response was returned at 14385// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14386// to check whether the returned error was because 14387// http.StatusNotModified was returned. 14388func (c *PropertiesInsertCall) Do(opts ...googleapi.CallOption) (*Property, error) { 14389 gensupport.SetOptions(c.urlParams_, opts...) 14390 res, err := c.doRequest("json") 14391 if res != nil && res.StatusCode == http.StatusNotModified { 14392 if res.Body != nil { 14393 res.Body.Close() 14394 } 14395 return nil, &googleapi.Error{ 14396 Code: res.StatusCode, 14397 Header: res.Header, 14398 } 14399 } 14400 if err != nil { 14401 return nil, err 14402 } 14403 defer googleapi.CloseBody(res) 14404 if err := googleapi.CheckResponse(res); err != nil { 14405 return nil, err 14406 } 14407 ret := &Property{ 14408 ServerResponse: googleapi.ServerResponse{ 14409 Header: res.Header, 14410 HTTPStatusCode: res.StatusCode, 14411 }, 14412 } 14413 target := &ret 14414 if err := gensupport.DecodeResponse(target, res); err != nil { 14415 return nil, err 14416 } 14417 return ret, nil 14418 // { 14419 // "description": "Adds a property to a file, or updates it if it already exists.", 14420 // "httpMethod": "POST", 14421 // "id": "drive.properties.insert", 14422 // "parameterOrder": [ 14423 // "fileId" 14424 // ], 14425 // "parameters": { 14426 // "fileId": { 14427 // "description": "The ID of the file.", 14428 // "location": "path", 14429 // "required": true, 14430 // "type": "string" 14431 // } 14432 // }, 14433 // "path": "files/{fileId}/properties", 14434 // "request": { 14435 // "$ref": "Property" 14436 // }, 14437 // "response": { 14438 // "$ref": "Property" 14439 // }, 14440 // "scopes": [ 14441 // "https://www.googleapis.com/auth/drive", 14442 // "https://www.googleapis.com/auth/drive.appdata", 14443 // "https://www.googleapis.com/auth/drive.file", 14444 // "https://www.googleapis.com/auth/drive.metadata" 14445 // ] 14446 // } 14447 14448} 14449 14450// method id "drive.properties.list": 14451 14452type PropertiesListCall struct { 14453 s *Service 14454 fileId string 14455 urlParams_ gensupport.URLParams 14456 ifNoneMatch_ string 14457 ctx_ context.Context 14458 header_ http.Header 14459} 14460 14461// List: Lists a file's properties. 14462// 14463// - fileId: The ID of the file. 14464func (r *PropertiesService) List(fileId string) *PropertiesListCall { 14465 c := &PropertiesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14466 c.fileId = fileId 14467 return c 14468} 14469 14470// Fields allows partial responses to be retrieved. See 14471// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14472// for more information. 14473func (c *PropertiesListCall) Fields(s ...googleapi.Field) *PropertiesListCall { 14474 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14475 return c 14476} 14477 14478// IfNoneMatch sets the optional parameter which makes the operation 14479// fail if the object's ETag matches the given value. This is useful for 14480// getting updates only after the object has changed since the last 14481// request. Use googleapi.IsNotModified to check whether the response 14482// error from Do is the result of In-None-Match. 14483func (c *PropertiesListCall) IfNoneMatch(entityTag string) *PropertiesListCall { 14484 c.ifNoneMatch_ = entityTag 14485 return c 14486} 14487 14488// Context sets the context to be used in this call's Do method. Any 14489// pending HTTP request will be aborted if the provided context is 14490// canceled. 14491func (c *PropertiesListCall) Context(ctx context.Context) *PropertiesListCall { 14492 c.ctx_ = ctx 14493 return c 14494} 14495 14496// Header returns an http.Header that can be modified by the caller to 14497// add HTTP headers to the request. 14498func (c *PropertiesListCall) Header() http.Header { 14499 if c.header_ == nil { 14500 c.header_ = make(http.Header) 14501 } 14502 return c.header_ 14503} 14504 14505func (c *PropertiesListCall) doRequest(alt string) (*http.Response, error) { 14506 reqHeaders := make(http.Header) 14507 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14508 for k, v := range c.header_ { 14509 reqHeaders[k] = v 14510 } 14511 reqHeaders.Set("User-Agent", c.s.userAgent()) 14512 if c.ifNoneMatch_ != "" { 14513 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14514 } 14515 var body io.Reader = nil 14516 c.urlParams_.Set("alt", alt) 14517 c.urlParams_.Set("prettyPrint", "false") 14518 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties") 14519 urls += "?" + c.urlParams_.Encode() 14520 req, err := http.NewRequest("GET", urls, body) 14521 if err != nil { 14522 return nil, err 14523 } 14524 req.Header = reqHeaders 14525 googleapi.Expand(req.URL, map[string]string{ 14526 "fileId": c.fileId, 14527 }) 14528 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14529} 14530 14531// Do executes the "drive.properties.list" call. 14532// Exactly one of *PropertyList or error will be non-nil. Any non-2xx 14533// status code is an error. Response headers are in either 14534// *PropertyList.ServerResponse.Header or (if a response was returned at 14535// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14536// to check whether the returned error was because 14537// http.StatusNotModified was returned. 14538func (c *PropertiesListCall) Do(opts ...googleapi.CallOption) (*PropertyList, error) { 14539 gensupport.SetOptions(c.urlParams_, opts...) 14540 res, err := c.doRequest("json") 14541 if res != nil && res.StatusCode == http.StatusNotModified { 14542 if res.Body != nil { 14543 res.Body.Close() 14544 } 14545 return nil, &googleapi.Error{ 14546 Code: res.StatusCode, 14547 Header: res.Header, 14548 } 14549 } 14550 if err != nil { 14551 return nil, err 14552 } 14553 defer googleapi.CloseBody(res) 14554 if err := googleapi.CheckResponse(res); err != nil { 14555 return nil, err 14556 } 14557 ret := &PropertyList{ 14558 ServerResponse: googleapi.ServerResponse{ 14559 Header: res.Header, 14560 HTTPStatusCode: res.StatusCode, 14561 }, 14562 } 14563 target := &ret 14564 if err := gensupport.DecodeResponse(target, res); err != nil { 14565 return nil, err 14566 } 14567 return ret, nil 14568 // { 14569 // "description": "Lists a file's properties.", 14570 // "httpMethod": "GET", 14571 // "id": "drive.properties.list", 14572 // "parameterOrder": [ 14573 // "fileId" 14574 // ], 14575 // "parameters": { 14576 // "fileId": { 14577 // "description": "The ID of the file.", 14578 // "location": "path", 14579 // "required": true, 14580 // "type": "string" 14581 // } 14582 // }, 14583 // "path": "files/{fileId}/properties", 14584 // "response": { 14585 // "$ref": "PropertyList" 14586 // }, 14587 // "scopes": [ 14588 // "https://www.googleapis.com/auth/drive", 14589 // "https://www.googleapis.com/auth/drive.appdata", 14590 // "https://www.googleapis.com/auth/drive.file", 14591 // "https://www.googleapis.com/auth/drive.metadata", 14592 // "https://www.googleapis.com/auth/drive.metadata.readonly", 14593 // "https://www.googleapis.com/auth/drive.photos.readonly", 14594 // "https://www.googleapis.com/auth/drive.readonly" 14595 // ] 14596 // } 14597 14598} 14599 14600// method id "drive.properties.patch": 14601 14602type PropertiesPatchCall struct { 14603 s *Service 14604 fileId string 14605 propertyKey string 14606 property *Property 14607 urlParams_ gensupport.URLParams 14608 ctx_ context.Context 14609 header_ http.Header 14610} 14611 14612// Patch: Updates a property. 14613// 14614// - fileId: The ID of the file. 14615// - propertyKey: The key of the property. 14616func (r *PropertiesService) Patch(fileId string, propertyKey string, property *Property) *PropertiesPatchCall { 14617 c := &PropertiesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14618 c.fileId = fileId 14619 c.propertyKey = propertyKey 14620 c.property = property 14621 return c 14622} 14623 14624// Visibility sets the optional parameter "visibility": The visibility 14625// of the property. Allowed values are PRIVATE and PUBLIC. (Default: 14626// PRIVATE) 14627func (c *PropertiesPatchCall) Visibility(visibility string) *PropertiesPatchCall { 14628 c.urlParams_.Set("visibility", visibility) 14629 return c 14630} 14631 14632// Fields allows partial responses to be retrieved. See 14633// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14634// for more information. 14635func (c *PropertiesPatchCall) Fields(s ...googleapi.Field) *PropertiesPatchCall { 14636 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14637 return c 14638} 14639 14640// Context sets the context to be used in this call's Do method. Any 14641// pending HTTP request will be aborted if the provided context is 14642// canceled. 14643func (c *PropertiesPatchCall) Context(ctx context.Context) *PropertiesPatchCall { 14644 c.ctx_ = ctx 14645 return c 14646} 14647 14648// Header returns an http.Header that can be modified by the caller to 14649// add HTTP headers to the request. 14650func (c *PropertiesPatchCall) Header() http.Header { 14651 if c.header_ == nil { 14652 c.header_ = make(http.Header) 14653 } 14654 return c.header_ 14655} 14656 14657func (c *PropertiesPatchCall) doRequest(alt string) (*http.Response, error) { 14658 reqHeaders := make(http.Header) 14659 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14660 for k, v := range c.header_ { 14661 reqHeaders[k] = v 14662 } 14663 reqHeaders.Set("User-Agent", c.s.userAgent()) 14664 var body io.Reader = nil 14665 body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) 14666 if err != nil { 14667 return nil, err 14668 } 14669 reqHeaders.Set("Content-Type", "application/json") 14670 c.urlParams_.Set("alt", alt) 14671 c.urlParams_.Set("prettyPrint", "false") 14672 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") 14673 urls += "?" + c.urlParams_.Encode() 14674 req, err := http.NewRequest("PATCH", urls, body) 14675 if err != nil { 14676 return nil, err 14677 } 14678 req.Header = reqHeaders 14679 googleapi.Expand(req.URL, map[string]string{ 14680 "fileId": c.fileId, 14681 "propertyKey": c.propertyKey, 14682 }) 14683 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14684} 14685 14686// Do executes the "drive.properties.patch" call. 14687// Exactly one of *Property or error will be non-nil. Any non-2xx status 14688// code is an error. Response headers are in either 14689// *Property.ServerResponse.Header or (if a response was returned at 14690// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14691// to check whether the returned error was because 14692// http.StatusNotModified was returned. 14693func (c *PropertiesPatchCall) Do(opts ...googleapi.CallOption) (*Property, error) { 14694 gensupport.SetOptions(c.urlParams_, opts...) 14695 res, err := c.doRequest("json") 14696 if res != nil && res.StatusCode == http.StatusNotModified { 14697 if res.Body != nil { 14698 res.Body.Close() 14699 } 14700 return nil, &googleapi.Error{ 14701 Code: res.StatusCode, 14702 Header: res.Header, 14703 } 14704 } 14705 if err != nil { 14706 return nil, err 14707 } 14708 defer googleapi.CloseBody(res) 14709 if err := googleapi.CheckResponse(res); err != nil { 14710 return nil, err 14711 } 14712 ret := &Property{ 14713 ServerResponse: googleapi.ServerResponse{ 14714 Header: res.Header, 14715 HTTPStatusCode: res.StatusCode, 14716 }, 14717 } 14718 target := &ret 14719 if err := gensupport.DecodeResponse(target, res); err != nil { 14720 return nil, err 14721 } 14722 return ret, nil 14723 // { 14724 // "description": "Updates a property.", 14725 // "httpMethod": "PATCH", 14726 // "id": "drive.properties.patch", 14727 // "parameterOrder": [ 14728 // "fileId", 14729 // "propertyKey" 14730 // ], 14731 // "parameters": { 14732 // "fileId": { 14733 // "description": "The ID of the file.", 14734 // "location": "path", 14735 // "required": true, 14736 // "type": "string" 14737 // }, 14738 // "propertyKey": { 14739 // "description": "The key of the property.", 14740 // "location": "path", 14741 // "required": true, 14742 // "type": "string" 14743 // }, 14744 // "visibility": { 14745 // "default": "private", 14746 // "description": "The visibility of the property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE)", 14747 // "location": "query", 14748 // "type": "string" 14749 // } 14750 // }, 14751 // "path": "files/{fileId}/properties/{propertyKey}", 14752 // "request": { 14753 // "$ref": "Property" 14754 // }, 14755 // "response": { 14756 // "$ref": "Property" 14757 // }, 14758 // "scopes": [ 14759 // "https://www.googleapis.com/auth/drive", 14760 // "https://www.googleapis.com/auth/drive.appdata", 14761 // "https://www.googleapis.com/auth/drive.file", 14762 // "https://www.googleapis.com/auth/drive.metadata" 14763 // ] 14764 // } 14765 14766} 14767 14768// method id "drive.properties.update": 14769 14770type PropertiesUpdateCall struct { 14771 s *Service 14772 fileId string 14773 propertyKey string 14774 property *Property 14775 urlParams_ gensupport.URLParams 14776 ctx_ context.Context 14777 header_ http.Header 14778} 14779 14780// Update: Updates a property. 14781// 14782// - fileId: The ID of the file. 14783// - propertyKey: The key of the property. 14784func (r *PropertiesService) Update(fileId string, propertyKey string, property *Property) *PropertiesUpdateCall { 14785 c := &PropertiesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14786 c.fileId = fileId 14787 c.propertyKey = propertyKey 14788 c.property = property 14789 return c 14790} 14791 14792// Visibility sets the optional parameter "visibility": The visibility 14793// of the property. Allowed values are PRIVATE and PUBLIC. (Default: 14794// PRIVATE) 14795func (c *PropertiesUpdateCall) Visibility(visibility string) *PropertiesUpdateCall { 14796 c.urlParams_.Set("visibility", visibility) 14797 return c 14798} 14799 14800// Fields allows partial responses to be retrieved. See 14801// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14802// for more information. 14803func (c *PropertiesUpdateCall) Fields(s ...googleapi.Field) *PropertiesUpdateCall { 14804 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14805 return c 14806} 14807 14808// Context sets the context to be used in this call's Do method. Any 14809// pending HTTP request will be aborted if the provided context is 14810// canceled. 14811func (c *PropertiesUpdateCall) Context(ctx context.Context) *PropertiesUpdateCall { 14812 c.ctx_ = ctx 14813 return c 14814} 14815 14816// Header returns an http.Header that can be modified by the caller to 14817// add HTTP headers to the request. 14818func (c *PropertiesUpdateCall) Header() http.Header { 14819 if c.header_ == nil { 14820 c.header_ = make(http.Header) 14821 } 14822 return c.header_ 14823} 14824 14825func (c *PropertiesUpdateCall) doRequest(alt string) (*http.Response, error) { 14826 reqHeaders := make(http.Header) 14827 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14828 for k, v := range c.header_ { 14829 reqHeaders[k] = v 14830 } 14831 reqHeaders.Set("User-Agent", c.s.userAgent()) 14832 var body io.Reader = nil 14833 body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) 14834 if err != nil { 14835 return nil, err 14836 } 14837 reqHeaders.Set("Content-Type", "application/json") 14838 c.urlParams_.Set("alt", alt) 14839 c.urlParams_.Set("prettyPrint", "false") 14840 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/properties/{propertyKey}") 14841 urls += "?" + c.urlParams_.Encode() 14842 req, err := http.NewRequest("PUT", urls, body) 14843 if err != nil { 14844 return nil, err 14845 } 14846 req.Header = reqHeaders 14847 googleapi.Expand(req.URL, map[string]string{ 14848 "fileId": c.fileId, 14849 "propertyKey": c.propertyKey, 14850 }) 14851 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14852} 14853 14854// Do executes the "drive.properties.update" call. 14855// Exactly one of *Property or error will be non-nil. Any non-2xx status 14856// code is an error. Response headers are in either 14857// *Property.ServerResponse.Header or (if a response was returned at 14858// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14859// to check whether the returned error was because 14860// http.StatusNotModified was returned. 14861func (c *PropertiesUpdateCall) Do(opts ...googleapi.CallOption) (*Property, error) { 14862 gensupport.SetOptions(c.urlParams_, opts...) 14863 res, err := c.doRequest("json") 14864 if res != nil && res.StatusCode == http.StatusNotModified { 14865 if res.Body != nil { 14866 res.Body.Close() 14867 } 14868 return nil, &googleapi.Error{ 14869 Code: res.StatusCode, 14870 Header: res.Header, 14871 } 14872 } 14873 if err != nil { 14874 return nil, err 14875 } 14876 defer googleapi.CloseBody(res) 14877 if err := googleapi.CheckResponse(res); err != nil { 14878 return nil, err 14879 } 14880 ret := &Property{ 14881 ServerResponse: googleapi.ServerResponse{ 14882 Header: res.Header, 14883 HTTPStatusCode: res.StatusCode, 14884 }, 14885 } 14886 target := &ret 14887 if err := gensupport.DecodeResponse(target, res); err != nil { 14888 return nil, err 14889 } 14890 return ret, nil 14891 // { 14892 // "description": "Updates a property.", 14893 // "httpMethod": "PUT", 14894 // "id": "drive.properties.update", 14895 // "parameterOrder": [ 14896 // "fileId", 14897 // "propertyKey" 14898 // ], 14899 // "parameters": { 14900 // "fileId": { 14901 // "description": "The ID of the file.", 14902 // "location": "path", 14903 // "required": true, 14904 // "type": "string" 14905 // }, 14906 // "propertyKey": { 14907 // "description": "The key of the property.", 14908 // "location": "path", 14909 // "required": true, 14910 // "type": "string" 14911 // }, 14912 // "visibility": { 14913 // "default": "private", 14914 // "description": "The visibility of the property. Allowed values are PRIVATE and PUBLIC. (Default: PRIVATE)", 14915 // "location": "query", 14916 // "type": "string" 14917 // } 14918 // }, 14919 // "path": "files/{fileId}/properties/{propertyKey}", 14920 // "request": { 14921 // "$ref": "Property" 14922 // }, 14923 // "response": { 14924 // "$ref": "Property" 14925 // }, 14926 // "scopes": [ 14927 // "https://www.googleapis.com/auth/drive", 14928 // "https://www.googleapis.com/auth/drive.appdata", 14929 // "https://www.googleapis.com/auth/drive.file", 14930 // "https://www.googleapis.com/auth/drive.metadata" 14931 // ] 14932 // } 14933 14934} 14935 14936// method id "drive.replies.delete": 14937 14938type RepliesDeleteCall struct { 14939 s *Service 14940 fileId string 14941 commentId string 14942 replyId string 14943 urlParams_ gensupport.URLParams 14944 ctx_ context.Context 14945 header_ http.Header 14946} 14947 14948// Delete: Deletes a reply. 14949// 14950// - commentId: The ID of the comment. 14951// - fileId: The ID of the file. 14952// - replyId: The ID of the reply. 14953func (r *RepliesService) Delete(fileId string, commentId string, replyId string) *RepliesDeleteCall { 14954 c := &RepliesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14955 c.fileId = fileId 14956 c.commentId = commentId 14957 c.replyId = replyId 14958 return c 14959} 14960 14961// Fields allows partial responses to be retrieved. See 14962// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14963// for more information. 14964func (c *RepliesDeleteCall) Fields(s ...googleapi.Field) *RepliesDeleteCall { 14965 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14966 return c 14967} 14968 14969// Context sets the context to be used in this call's Do method. Any 14970// pending HTTP request will be aborted if the provided context is 14971// canceled. 14972func (c *RepliesDeleteCall) Context(ctx context.Context) *RepliesDeleteCall { 14973 c.ctx_ = ctx 14974 return c 14975} 14976 14977// Header returns an http.Header that can be modified by the caller to 14978// add HTTP headers to the request. 14979func (c *RepliesDeleteCall) Header() http.Header { 14980 if c.header_ == nil { 14981 c.header_ = make(http.Header) 14982 } 14983 return c.header_ 14984} 14985 14986func (c *RepliesDeleteCall) doRequest(alt string) (*http.Response, error) { 14987 reqHeaders := make(http.Header) 14988 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 14989 for k, v := range c.header_ { 14990 reqHeaders[k] = v 14991 } 14992 reqHeaders.Set("User-Agent", c.s.userAgent()) 14993 var body io.Reader = nil 14994 c.urlParams_.Set("alt", alt) 14995 c.urlParams_.Set("prettyPrint", "false") 14996 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") 14997 urls += "?" + c.urlParams_.Encode() 14998 req, err := http.NewRequest("DELETE", urls, body) 14999 if err != nil { 15000 return nil, err 15001 } 15002 req.Header = reqHeaders 15003 googleapi.Expand(req.URL, map[string]string{ 15004 "fileId": c.fileId, 15005 "commentId": c.commentId, 15006 "replyId": c.replyId, 15007 }) 15008 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15009} 15010 15011// Do executes the "drive.replies.delete" call. 15012func (c *RepliesDeleteCall) Do(opts ...googleapi.CallOption) error { 15013 gensupport.SetOptions(c.urlParams_, opts...) 15014 res, err := c.doRequest("json") 15015 if err != nil { 15016 return err 15017 } 15018 defer googleapi.CloseBody(res) 15019 if err := googleapi.CheckResponse(res); err != nil { 15020 return err 15021 } 15022 return nil 15023 // { 15024 // "description": "Deletes a reply.", 15025 // "httpMethod": "DELETE", 15026 // "id": "drive.replies.delete", 15027 // "parameterOrder": [ 15028 // "fileId", 15029 // "commentId", 15030 // "replyId" 15031 // ], 15032 // "parameters": { 15033 // "commentId": { 15034 // "description": "The ID of the comment.", 15035 // "location": "path", 15036 // "required": true, 15037 // "type": "string" 15038 // }, 15039 // "fileId": { 15040 // "description": "The ID of the file.", 15041 // "location": "path", 15042 // "required": true, 15043 // "type": "string" 15044 // }, 15045 // "replyId": { 15046 // "description": "The ID of the reply.", 15047 // "location": "path", 15048 // "required": true, 15049 // "type": "string" 15050 // } 15051 // }, 15052 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 15053 // "scopes": [ 15054 // "https://www.googleapis.com/auth/drive", 15055 // "https://www.googleapis.com/auth/drive.file" 15056 // ] 15057 // } 15058 15059} 15060 15061// method id "drive.replies.get": 15062 15063type RepliesGetCall struct { 15064 s *Service 15065 fileId string 15066 commentId string 15067 replyId string 15068 urlParams_ gensupport.URLParams 15069 ifNoneMatch_ string 15070 ctx_ context.Context 15071 header_ http.Header 15072} 15073 15074// Get: Gets a reply. 15075// 15076// - commentId: The ID of the comment. 15077// - fileId: The ID of the file. 15078// - replyId: The ID of the reply. 15079func (r *RepliesService) Get(fileId string, commentId string, replyId string) *RepliesGetCall { 15080 c := &RepliesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15081 c.fileId = fileId 15082 c.commentId = commentId 15083 c.replyId = replyId 15084 return c 15085} 15086 15087// IncludeDeleted sets the optional parameter "includeDeleted": If set, 15088// this will succeed when retrieving a deleted reply. 15089func (c *RepliesGetCall) IncludeDeleted(includeDeleted bool) *RepliesGetCall { 15090 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 15091 return c 15092} 15093 15094// Fields allows partial responses to be retrieved. See 15095// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15096// for more information. 15097func (c *RepliesGetCall) Fields(s ...googleapi.Field) *RepliesGetCall { 15098 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15099 return c 15100} 15101 15102// IfNoneMatch sets the optional parameter which makes the operation 15103// fail if the object's ETag matches the given value. This is useful for 15104// getting updates only after the object has changed since the last 15105// request. Use googleapi.IsNotModified to check whether the response 15106// error from Do is the result of In-None-Match. 15107func (c *RepliesGetCall) IfNoneMatch(entityTag string) *RepliesGetCall { 15108 c.ifNoneMatch_ = entityTag 15109 return c 15110} 15111 15112// Context sets the context to be used in this call's Do method. Any 15113// pending HTTP request will be aborted if the provided context is 15114// canceled. 15115func (c *RepliesGetCall) Context(ctx context.Context) *RepliesGetCall { 15116 c.ctx_ = ctx 15117 return c 15118} 15119 15120// Header returns an http.Header that can be modified by the caller to 15121// add HTTP headers to the request. 15122func (c *RepliesGetCall) Header() http.Header { 15123 if c.header_ == nil { 15124 c.header_ = make(http.Header) 15125 } 15126 return c.header_ 15127} 15128 15129func (c *RepliesGetCall) doRequest(alt string) (*http.Response, error) { 15130 reqHeaders := make(http.Header) 15131 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 15132 for k, v := range c.header_ { 15133 reqHeaders[k] = v 15134 } 15135 reqHeaders.Set("User-Agent", c.s.userAgent()) 15136 if c.ifNoneMatch_ != "" { 15137 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15138 } 15139 var body io.Reader = nil 15140 c.urlParams_.Set("alt", alt) 15141 c.urlParams_.Set("prettyPrint", "false") 15142 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") 15143 urls += "?" + c.urlParams_.Encode() 15144 req, err := http.NewRequest("GET", urls, body) 15145 if err != nil { 15146 return nil, err 15147 } 15148 req.Header = reqHeaders 15149 googleapi.Expand(req.URL, map[string]string{ 15150 "fileId": c.fileId, 15151 "commentId": c.commentId, 15152 "replyId": c.replyId, 15153 }) 15154 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15155} 15156 15157// Do executes the "drive.replies.get" call. 15158// Exactly one of *CommentReply or error will be non-nil. Any non-2xx 15159// status code is an error. Response headers are in either 15160// *CommentReply.ServerResponse.Header or (if a response was returned at 15161// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15162// to check whether the returned error was because 15163// http.StatusNotModified was returned. 15164func (c *RepliesGetCall) Do(opts ...googleapi.CallOption) (*CommentReply, error) { 15165 gensupport.SetOptions(c.urlParams_, opts...) 15166 res, err := c.doRequest("json") 15167 if res != nil && res.StatusCode == http.StatusNotModified { 15168 if res.Body != nil { 15169 res.Body.Close() 15170 } 15171 return nil, &googleapi.Error{ 15172 Code: res.StatusCode, 15173 Header: res.Header, 15174 } 15175 } 15176 if err != nil { 15177 return nil, err 15178 } 15179 defer googleapi.CloseBody(res) 15180 if err := googleapi.CheckResponse(res); err != nil { 15181 return nil, err 15182 } 15183 ret := &CommentReply{ 15184 ServerResponse: googleapi.ServerResponse{ 15185 Header: res.Header, 15186 HTTPStatusCode: res.StatusCode, 15187 }, 15188 } 15189 target := &ret 15190 if err := gensupport.DecodeResponse(target, res); err != nil { 15191 return nil, err 15192 } 15193 return ret, nil 15194 // { 15195 // "description": "Gets a reply.", 15196 // "httpMethod": "GET", 15197 // "id": "drive.replies.get", 15198 // "parameterOrder": [ 15199 // "fileId", 15200 // "commentId", 15201 // "replyId" 15202 // ], 15203 // "parameters": { 15204 // "commentId": { 15205 // "description": "The ID of the comment.", 15206 // "location": "path", 15207 // "required": true, 15208 // "type": "string" 15209 // }, 15210 // "fileId": { 15211 // "description": "The ID of the file.", 15212 // "location": "path", 15213 // "required": true, 15214 // "type": "string" 15215 // }, 15216 // "includeDeleted": { 15217 // "default": "false", 15218 // "description": "If set, this will succeed when retrieving a deleted reply.", 15219 // "location": "query", 15220 // "type": "boolean" 15221 // }, 15222 // "replyId": { 15223 // "description": "The ID of the reply.", 15224 // "location": "path", 15225 // "required": true, 15226 // "type": "string" 15227 // } 15228 // }, 15229 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 15230 // "response": { 15231 // "$ref": "CommentReply" 15232 // }, 15233 // "scopes": [ 15234 // "https://www.googleapis.com/auth/drive", 15235 // "https://www.googleapis.com/auth/drive.file", 15236 // "https://www.googleapis.com/auth/drive.readonly" 15237 // ] 15238 // } 15239 15240} 15241 15242// method id "drive.replies.insert": 15243 15244type RepliesInsertCall struct { 15245 s *Service 15246 fileId string 15247 commentId string 15248 commentreply *CommentReply 15249 urlParams_ gensupport.URLParams 15250 ctx_ context.Context 15251 header_ http.Header 15252} 15253 15254// Insert: Creates a new reply to the given comment. 15255// 15256// - commentId: The ID of the comment. 15257// - fileId: The ID of the file. 15258func (r *RepliesService) Insert(fileId string, commentId string, commentreply *CommentReply) *RepliesInsertCall { 15259 c := &RepliesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15260 c.fileId = fileId 15261 c.commentId = commentId 15262 c.commentreply = commentreply 15263 return c 15264} 15265 15266// Fields allows partial responses to be retrieved. See 15267// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15268// for more information. 15269func (c *RepliesInsertCall) Fields(s ...googleapi.Field) *RepliesInsertCall { 15270 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15271 return c 15272} 15273 15274// Context sets the context to be used in this call's Do method. Any 15275// pending HTTP request will be aborted if the provided context is 15276// canceled. 15277func (c *RepliesInsertCall) Context(ctx context.Context) *RepliesInsertCall { 15278 c.ctx_ = ctx 15279 return c 15280} 15281 15282// Header returns an http.Header that can be modified by the caller to 15283// add HTTP headers to the request. 15284func (c *RepliesInsertCall) Header() http.Header { 15285 if c.header_ == nil { 15286 c.header_ = make(http.Header) 15287 } 15288 return c.header_ 15289} 15290 15291func (c *RepliesInsertCall) doRequest(alt string) (*http.Response, error) { 15292 reqHeaders := make(http.Header) 15293 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 15294 for k, v := range c.header_ { 15295 reqHeaders[k] = v 15296 } 15297 reqHeaders.Set("User-Agent", c.s.userAgent()) 15298 var body io.Reader = nil 15299 body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) 15300 if err != nil { 15301 return nil, err 15302 } 15303 reqHeaders.Set("Content-Type", "application/json") 15304 c.urlParams_.Set("alt", alt) 15305 c.urlParams_.Set("prettyPrint", "false") 15306 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") 15307 urls += "?" + c.urlParams_.Encode() 15308 req, err := http.NewRequest("POST", urls, body) 15309 if err != nil { 15310 return nil, err 15311 } 15312 req.Header = reqHeaders 15313 googleapi.Expand(req.URL, map[string]string{ 15314 "fileId": c.fileId, 15315 "commentId": c.commentId, 15316 }) 15317 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15318} 15319 15320// Do executes the "drive.replies.insert" call. 15321// Exactly one of *CommentReply or error will be non-nil. Any non-2xx 15322// status code is an error. Response headers are in either 15323// *CommentReply.ServerResponse.Header or (if a response was returned at 15324// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15325// to check whether the returned error was because 15326// http.StatusNotModified was returned. 15327func (c *RepliesInsertCall) Do(opts ...googleapi.CallOption) (*CommentReply, error) { 15328 gensupport.SetOptions(c.urlParams_, opts...) 15329 res, err := c.doRequest("json") 15330 if res != nil && res.StatusCode == http.StatusNotModified { 15331 if res.Body != nil { 15332 res.Body.Close() 15333 } 15334 return nil, &googleapi.Error{ 15335 Code: res.StatusCode, 15336 Header: res.Header, 15337 } 15338 } 15339 if err != nil { 15340 return nil, err 15341 } 15342 defer googleapi.CloseBody(res) 15343 if err := googleapi.CheckResponse(res); err != nil { 15344 return nil, err 15345 } 15346 ret := &CommentReply{ 15347 ServerResponse: googleapi.ServerResponse{ 15348 Header: res.Header, 15349 HTTPStatusCode: res.StatusCode, 15350 }, 15351 } 15352 target := &ret 15353 if err := gensupport.DecodeResponse(target, res); err != nil { 15354 return nil, err 15355 } 15356 return ret, nil 15357 // { 15358 // "description": "Creates a new reply to the given comment.", 15359 // "httpMethod": "POST", 15360 // "id": "drive.replies.insert", 15361 // "parameterOrder": [ 15362 // "fileId", 15363 // "commentId" 15364 // ], 15365 // "parameters": { 15366 // "commentId": { 15367 // "description": "The ID of the comment.", 15368 // "location": "path", 15369 // "required": true, 15370 // "type": "string" 15371 // }, 15372 // "fileId": { 15373 // "description": "The ID of the file.", 15374 // "location": "path", 15375 // "required": true, 15376 // "type": "string" 15377 // } 15378 // }, 15379 // "path": "files/{fileId}/comments/{commentId}/replies", 15380 // "request": { 15381 // "$ref": "CommentReply" 15382 // }, 15383 // "response": { 15384 // "$ref": "CommentReply" 15385 // }, 15386 // "scopes": [ 15387 // "https://www.googleapis.com/auth/drive", 15388 // "https://www.googleapis.com/auth/drive.file" 15389 // ] 15390 // } 15391 15392} 15393 15394// method id "drive.replies.list": 15395 15396type RepliesListCall struct { 15397 s *Service 15398 fileId string 15399 commentId string 15400 urlParams_ gensupport.URLParams 15401 ifNoneMatch_ string 15402 ctx_ context.Context 15403 header_ http.Header 15404} 15405 15406// List: Lists all of the replies to a comment. 15407// 15408// - commentId: The ID of the comment. 15409// - fileId: The ID of the file. 15410func (r *RepliesService) List(fileId string, commentId string) *RepliesListCall { 15411 c := &RepliesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15412 c.fileId = fileId 15413 c.commentId = commentId 15414 return c 15415} 15416 15417// IncludeDeleted sets the optional parameter "includeDeleted": If set, 15418// all replies, including deleted replies (with content stripped) will 15419// be returned. 15420func (c *RepliesListCall) IncludeDeleted(includeDeleted bool) *RepliesListCall { 15421 c.urlParams_.Set("includeDeleted", fmt.Sprint(includeDeleted)) 15422 return c 15423} 15424 15425// MaxResults sets the optional parameter "maxResults": The maximum 15426// number of replies to include in the response, used for paging. 15427func (c *RepliesListCall) MaxResults(maxResults int64) *RepliesListCall { 15428 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 15429 return c 15430} 15431 15432// PageToken sets the optional parameter "pageToken": The continuation 15433// token, used to page through large result sets. To get the next page 15434// of results, set this parameter to the value of "nextPageToken" from 15435// the previous response. 15436func (c *RepliesListCall) PageToken(pageToken string) *RepliesListCall { 15437 c.urlParams_.Set("pageToken", pageToken) 15438 return c 15439} 15440 15441// Fields allows partial responses to be retrieved. See 15442// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15443// for more information. 15444func (c *RepliesListCall) Fields(s ...googleapi.Field) *RepliesListCall { 15445 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15446 return c 15447} 15448 15449// IfNoneMatch sets the optional parameter which makes the operation 15450// fail if the object's ETag matches the given value. This is useful for 15451// getting updates only after the object has changed since the last 15452// request. Use googleapi.IsNotModified to check whether the response 15453// error from Do is the result of In-None-Match. 15454func (c *RepliesListCall) IfNoneMatch(entityTag string) *RepliesListCall { 15455 c.ifNoneMatch_ = entityTag 15456 return c 15457} 15458 15459// Context sets the context to be used in this call's Do method. Any 15460// pending HTTP request will be aborted if the provided context is 15461// canceled. 15462func (c *RepliesListCall) Context(ctx context.Context) *RepliesListCall { 15463 c.ctx_ = ctx 15464 return c 15465} 15466 15467// Header returns an http.Header that can be modified by the caller to 15468// add HTTP headers to the request. 15469func (c *RepliesListCall) Header() http.Header { 15470 if c.header_ == nil { 15471 c.header_ = make(http.Header) 15472 } 15473 return c.header_ 15474} 15475 15476func (c *RepliesListCall) doRequest(alt string) (*http.Response, error) { 15477 reqHeaders := make(http.Header) 15478 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 15479 for k, v := range c.header_ { 15480 reqHeaders[k] = v 15481 } 15482 reqHeaders.Set("User-Agent", c.s.userAgent()) 15483 if c.ifNoneMatch_ != "" { 15484 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 15485 } 15486 var body io.Reader = nil 15487 c.urlParams_.Set("alt", alt) 15488 c.urlParams_.Set("prettyPrint", "false") 15489 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies") 15490 urls += "?" + c.urlParams_.Encode() 15491 req, err := http.NewRequest("GET", urls, body) 15492 if err != nil { 15493 return nil, err 15494 } 15495 req.Header = reqHeaders 15496 googleapi.Expand(req.URL, map[string]string{ 15497 "fileId": c.fileId, 15498 "commentId": c.commentId, 15499 }) 15500 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15501} 15502 15503// Do executes the "drive.replies.list" call. 15504// Exactly one of *CommentReplyList or error will be non-nil. Any 15505// non-2xx status code is an error. Response headers are in either 15506// *CommentReplyList.ServerResponse.Header or (if a response was 15507// returned at all) in error.(*googleapi.Error).Header. Use 15508// googleapi.IsNotModified to check whether the returned error was 15509// because http.StatusNotModified was returned. 15510func (c *RepliesListCall) Do(opts ...googleapi.CallOption) (*CommentReplyList, error) { 15511 gensupport.SetOptions(c.urlParams_, opts...) 15512 res, err := c.doRequest("json") 15513 if res != nil && res.StatusCode == http.StatusNotModified { 15514 if res.Body != nil { 15515 res.Body.Close() 15516 } 15517 return nil, &googleapi.Error{ 15518 Code: res.StatusCode, 15519 Header: res.Header, 15520 } 15521 } 15522 if err != nil { 15523 return nil, err 15524 } 15525 defer googleapi.CloseBody(res) 15526 if err := googleapi.CheckResponse(res); err != nil { 15527 return nil, err 15528 } 15529 ret := &CommentReplyList{ 15530 ServerResponse: googleapi.ServerResponse{ 15531 Header: res.Header, 15532 HTTPStatusCode: res.StatusCode, 15533 }, 15534 } 15535 target := &ret 15536 if err := gensupport.DecodeResponse(target, res); err != nil { 15537 return nil, err 15538 } 15539 return ret, nil 15540 // { 15541 // "description": "Lists all of the replies to a comment.", 15542 // "httpMethod": "GET", 15543 // "id": "drive.replies.list", 15544 // "parameterOrder": [ 15545 // "fileId", 15546 // "commentId" 15547 // ], 15548 // "parameters": { 15549 // "commentId": { 15550 // "description": "The ID of the comment.", 15551 // "location": "path", 15552 // "required": true, 15553 // "type": "string" 15554 // }, 15555 // "fileId": { 15556 // "description": "The ID of the file.", 15557 // "location": "path", 15558 // "required": true, 15559 // "type": "string" 15560 // }, 15561 // "includeDeleted": { 15562 // "default": "false", 15563 // "description": "If set, all replies, including deleted replies (with content stripped) will be returned.", 15564 // "location": "query", 15565 // "type": "boolean" 15566 // }, 15567 // "maxResults": { 15568 // "default": "20", 15569 // "description": "The maximum number of replies to include in the response, used for paging.", 15570 // "format": "int32", 15571 // "location": "query", 15572 // "maximum": "100", 15573 // "minimum": "0", 15574 // "type": "integer" 15575 // }, 15576 // "pageToken": { 15577 // "description": "The continuation token, used to page through large result sets. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", 15578 // "location": "query", 15579 // "type": "string" 15580 // } 15581 // }, 15582 // "path": "files/{fileId}/comments/{commentId}/replies", 15583 // "response": { 15584 // "$ref": "CommentReplyList" 15585 // }, 15586 // "scopes": [ 15587 // "https://www.googleapis.com/auth/drive", 15588 // "https://www.googleapis.com/auth/drive.file", 15589 // "https://www.googleapis.com/auth/drive.readonly" 15590 // ] 15591 // } 15592 15593} 15594 15595// Pages invokes f for each page of results. 15596// A non-nil error returned from f will halt the iteration. 15597// The provided context supersedes any context provided to the Context method. 15598func (c *RepliesListCall) Pages(ctx context.Context, f func(*CommentReplyList) error) error { 15599 c.ctx_ = ctx 15600 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 15601 for { 15602 x, err := c.Do() 15603 if err != nil { 15604 return err 15605 } 15606 if err := f(x); err != nil { 15607 return err 15608 } 15609 if x.NextPageToken == "" { 15610 return nil 15611 } 15612 c.PageToken(x.NextPageToken) 15613 } 15614} 15615 15616// method id "drive.replies.patch": 15617 15618type RepliesPatchCall struct { 15619 s *Service 15620 fileId string 15621 commentId string 15622 replyId string 15623 commentreply *CommentReply 15624 urlParams_ gensupport.URLParams 15625 ctx_ context.Context 15626 header_ http.Header 15627} 15628 15629// Patch: Updates an existing reply. 15630// 15631// - commentId: The ID of the comment. 15632// - fileId: The ID of the file. 15633// - replyId: The ID of the reply. 15634func (r *RepliesService) Patch(fileId string, commentId string, replyId string, commentreply *CommentReply) *RepliesPatchCall { 15635 c := &RepliesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15636 c.fileId = fileId 15637 c.commentId = commentId 15638 c.replyId = replyId 15639 c.commentreply = commentreply 15640 return c 15641} 15642 15643// Fields allows partial responses to be retrieved. See 15644// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15645// for more information. 15646func (c *RepliesPatchCall) Fields(s ...googleapi.Field) *RepliesPatchCall { 15647 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15648 return c 15649} 15650 15651// Context sets the context to be used in this call's Do method. Any 15652// pending HTTP request will be aborted if the provided context is 15653// canceled. 15654func (c *RepliesPatchCall) Context(ctx context.Context) *RepliesPatchCall { 15655 c.ctx_ = ctx 15656 return c 15657} 15658 15659// Header returns an http.Header that can be modified by the caller to 15660// add HTTP headers to the request. 15661func (c *RepliesPatchCall) Header() http.Header { 15662 if c.header_ == nil { 15663 c.header_ = make(http.Header) 15664 } 15665 return c.header_ 15666} 15667 15668func (c *RepliesPatchCall) doRequest(alt string) (*http.Response, error) { 15669 reqHeaders := make(http.Header) 15670 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 15671 for k, v := range c.header_ { 15672 reqHeaders[k] = v 15673 } 15674 reqHeaders.Set("User-Agent", c.s.userAgent()) 15675 var body io.Reader = nil 15676 body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) 15677 if err != nil { 15678 return nil, err 15679 } 15680 reqHeaders.Set("Content-Type", "application/json") 15681 c.urlParams_.Set("alt", alt) 15682 c.urlParams_.Set("prettyPrint", "false") 15683 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") 15684 urls += "?" + c.urlParams_.Encode() 15685 req, err := http.NewRequest("PATCH", urls, body) 15686 if err != nil { 15687 return nil, err 15688 } 15689 req.Header = reqHeaders 15690 googleapi.Expand(req.URL, map[string]string{ 15691 "fileId": c.fileId, 15692 "commentId": c.commentId, 15693 "replyId": c.replyId, 15694 }) 15695 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15696} 15697 15698// Do executes the "drive.replies.patch" call. 15699// Exactly one of *CommentReply or error will be non-nil. Any non-2xx 15700// status code is an error. Response headers are in either 15701// *CommentReply.ServerResponse.Header or (if a response was returned at 15702// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15703// to check whether the returned error was because 15704// http.StatusNotModified was returned. 15705func (c *RepliesPatchCall) Do(opts ...googleapi.CallOption) (*CommentReply, error) { 15706 gensupport.SetOptions(c.urlParams_, opts...) 15707 res, err := c.doRequest("json") 15708 if res != nil && res.StatusCode == http.StatusNotModified { 15709 if res.Body != nil { 15710 res.Body.Close() 15711 } 15712 return nil, &googleapi.Error{ 15713 Code: res.StatusCode, 15714 Header: res.Header, 15715 } 15716 } 15717 if err != nil { 15718 return nil, err 15719 } 15720 defer googleapi.CloseBody(res) 15721 if err := googleapi.CheckResponse(res); err != nil { 15722 return nil, err 15723 } 15724 ret := &CommentReply{ 15725 ServerResponse: googleapi.ServerResponse{ 15726 Header: res.Header, 15727 HTTPStatusCode: res.StatusCode, 15728 }, 15729 } 15730 target := &ret 15731 if err := gensupport.DecodeResponse(target, res); err != nil { 15732 return nil, err 15733 } 15734 return ret, nil 15735 // { 15736 // "description": "Updates an existing reply.", 15737 // "httpMethod": "PATCH", 15738 // "id": "drive.replies.patch", 15739 // "parameterOrder": [ 15740 // "fileId", 15741 // "commentId", 15742 // "replyId" 15743 // ], 15744 // "parameters": { 15745 // "commentId": { 15746 // "description": "The ID of the comment.", 15747 // "location": "path", 15748 // "required": true, 15749 // "type": "string" 15750 // }, 15751 // "fileId": { 15752 // "description": "The ID of the file.", 15753 // "location": "path", 15754 // "required": true, 15755 // "type": "string" 15756 // }, 15757 // "replyId": { 15758 // "description": "The ID of the reply.", 15759 // "location": "path", 15760 // "required": true, 15761 // "type": "string" 15762 // } 15763 // }, 15764 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 15765 // "request": { 15766 // "$ref": "CommentReply" 15767 // }, 15768 // "response": { 15769 // "$ref": "CommentReply" 15770 // }, 15771 // "scopes": [ 15772 // "https://www.googleapis.com/auth/drive", 15773 // "https://www.googleapis.com/auth/drive.file" 15774 // ] 15775 // } 15776 15777} 15778 15779// method id "drive.replies.update": 15780 15781type RepliesUpdateCall struct { 15782 s *Service 15783 fileId string 15784 commentId string 15785 replyId string 15786 commentreply *CommentReply 15787 urlParams_ gensupport.URLParams 15788 ctx_ context.Context 15789 header_ http.Header 15790} 15791 15792// Update: Updates an existing reply. 15793// 15794// - commentId: The ID of the comment. 15795// - fileId: The ID of the file. 15796// - replyId: The ID of the reply. 15797func (r *RepliesService) Update(fileId string, commentId string, replyId string, commentreply *CommentReply) *RepliesUpdateCall { 15798 c := &RepliesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15799 c.fileId = fileId 15800 c.commentId = commentId 15801 c.replyId = replyId 15802 c.commentreply = commentreply 15803 return c 15804} 15805 15806// Fields allows partial responses to be retrieved. See 15807// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15808// for more information. 15809func (c *RepliesUpdateCall) Fields(s ...googleapi.Field) *RepliesUpdateCall { 15810 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15811 return c 15812} 15813 15814// Context sets the context to be used in this call's Do method. Any 15815// pending HTTP request will be aborted if the provided context is 15816// canceled. 15817func (c *RepliesUpdateCall) Context(ctx context.Context) *RepliesUpdateCall { 15818 c.ctx_ = ctx 15819 return c 15820} 15821 15822// Header returns an http.Header that can be modified by the caller to 15823// add HTTP headers to the request. 15824func (c *RepliesUpdateCall) Header() http.Header { 15825 if c.header_ == nil { 15826 c.header_ = make(http.Header) 15827 } 15828 return c.header_ 15829} 15830 15831func (c *RepliesUpdateCall) doRequest(alt string) (*http.Response, error) { 15832 reqHeaders := make(http.Header) 15833 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 15834 for k, v := range c.header_ { 15835 reqHeaders[k] = v 15836 } 15837 reqHeaders.Set("User-Agent", c.s.userAgent()) 15838 var body io.Reader = nil 15839 body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) 15840 if err != nil { 15841 return nil, err 15842 } 15843 reqHeaders.Set("Content-Type", "application/json") 15844 c.urlParams_.Set("alt", alt) 15845 c.urlParams_.Set("prettyPrint", "false") 15846 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/comments/{commentId}/replies/{replyId}") 15847 urls += "?" + c.urlParams_.Encode() 15848 req, err := http.NewRequest("PUT", urls, body) 15849 if err != nil { 15850 return nil, err 15851 } 15852 req.Header = reqHeaders 15853 googleapi.Expand(req.URL, map[string]string{ 15854 "fileId": c.fileId, 15855 "commentId": c.commentId, 15856 "replyId": c.replyId, 15857 }) 15858 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15859} 15860 15861// Do executes the "drive.replies.update" call. 15862// Exactly one of *CommentReply or error will be non-nil. Any non-2xx 15863// status code is an error. Response headers are in either 15864// *CommentReply.ServerResponse.Header or (if a response was returned at 15865// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 15866// to check whether the returned error was because 15867// http.StatusNotModified was returned. 15868func (c *RepliesUpdateCall) Do(opts ...googleapi.CallOption) (*CommentReply, error) { 15869 gensupport.SetOptions(c.urlParams_, opts...) 15870 res, err := c.doRequest("json") 15871 if res != nil && res.StatusCode == http.StatusNotModified { 15872 if res.Body != nil { 15873 res.Body.Close() 15874 } 15875 return nil, &googleapi.Error{ 15876 Code: res.StatusCode, 15877 Header: res.Header, 15878 } 15879 } 15880 if err != nil { 15881 return nil, err 15882 } 15883 defer googleapi.CloseBody(res) 15884 if err := googleapi.CheckResponse(res); err != nil { 15885 return nil, err 15886 } 15887 ret := &CommentReply{ 15888 ServerResponse: googleapi.ServerResponse{ 15889 Header: res.Header, 15890 HTTPStatusCode: res.StatusCode, 15891 }, 15892 } 15893 target := &ret 15894 if err := gensupport.DecodeResponse(target, res); err != nil { 15895 return nil, err 15896 } 15897 return ret, nil 15898 // { 15899 // "description": "Updates an existing reply.", 15900 // "httpMethod": "PUT", 15901 // "id": "drive.replies.update", 15902 // "parameterOrder": [ 15903 // "fileId", 15904 // "commentId", 15905 // "replyId" 15906 // ], 15907 // "parameters": { 15908 // "commentId": { 15909 // "description": "The ID of the comment.", 15910 // "location": "path", 15911 // "required": true, 15912 // "type": "string" 15913 // }, 15914 // "fileId": { 15915 // "description": "The ID of the file.", 15916 // "location": "path", 15917 // "required": true, 15918 // "type": "string" 15919 // }, 15920 // "replyId": { 15921 // "description": "The ID of the reply.", 15922 // "location": "path", 15923 // "required": true, 15924 // "type": "string" 15925 // } 15926 // }, 15927 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 15928 // "request": { 15929 // "$ref": "CommentReply" 15930 // }, 15931 // "response": { 15932 // "$ref": "CommentReply" 15933 // }, 15934 // "scopes": [ 15935 // "https://www.googleapis.com/auth/drive", 15936 // "https://www.googleapis.com/auth/drive.file" 15937 // ] 15938 // } 15939 15940} 15941 15942// method id "drive.revisions.delete": 15943 15944type RevisionsDeleteCall struct { 15945 s *Service 15946 fileId string 15947 revisionId string 15948 urlParams_ gensupport.URLParams 15949 ctx_ context.Context 15950 header_ http.Header 15951} 15952 15953// Delete: Permanently deletes a file version. You can only delete 15954// revisions for files with binary content, like images or videos. 15955// Revisions for other files, like Google Docs or Sheets, and the last 15956// remaining file version can't be deleted. 15957// 15958// - fileId: The ID of the file. 15959// - revisionId: The ID of the revision. 15960func (r *RevisionsService) Delete(fileId string, revisionId string) *RevisionsDeleteCall { 15961 c := &RevisionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15962 c.fileId = fileId 15963 c.revisionId = revisionId 15964 return c 15965} 15966 15967// Fields allows partial responses to be retrieved. See 15968// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15969// for more information. 15970func (c *RevisionsDeleteCall) Fields(s ...googleapi.Field) *RevisionsDeleteCall { 15971 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15972 return c 15973} 15974 15975// Context sets the context to be used in this call's Do method. Any 15976// pending HTTP request will be aborted if the provided context is 15977// canceled. 15978func (c *RevisionsDeleteCall) Context(ctx context.Context) *RevisionsDeleteCall { 15979 c.ctx_ = ctx 15980 return c 15981} 15982 15983// Header returns an http.Header that can be modified by the caller to 15984// add HTTP headers to the request. 15985func (c *RevisionsDeleteCall) Header() http.Header { 15986 if c.header_ == nil { 15987 c.header_ = make(http.Header) 15988 } 15989 return c.header_ 15990} 15991 15992func (c *RevisionsDeleteCall) doRequest(alt string) (*http.Response, error) { 15993 reqHeaders := make(http.Header) 15994 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 15995 for k, v := range c.header_ { 15996 reqHeaders[k] = v 15997 } 15998 reqHeaders.Set("User-Agent", c.s.userAgent()) 15999 var body io.Reader = nil 16000 c.urlParams_.Set("alt", alt) 16001 c.urlParams_.Set("prettyPrint", "false") 16002 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") 16003 urls += "?" + c.urlParams_.Encode() 16004 req, err := http.NewRequest("DELETE", urls, body) 16005 if err != nil { 16006 return nil, err 16007 } 16008 req.Header = reqHeaders 16009 googleapi.Expand(req.URL, map[string]string{ 16010 "fileId": c.fileId, 16011 "revisionId": c.revisionId, 16012 }) 16013 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16014} 16015 16016// Do executes the "drive.revisions.delete" call. 16017func (c *RevisionsDeleteCall) Do(opts ...googleapi.CallOption) error { 16018 gensupport.SetOptions(c.urlParams_, opts...) 16019 res, err := c.doRequest("json") 16020 if err != nil { 16021 return err 16022 } 16023 defer googleapi.CloseBody(res) 16024 if err := googleapi.CheckResponse(res); err != nil { 16025 return err 16026 } 16027 return nil 16028 // { 16029 // "description": "Permanently deletes a file version. You can only delete revisions for files with binary content, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.", 16030 // "httpMethod": "DELETE", 16031 // "id": "drive.revisions.delete", 16032 // "parameterOrder": [ 16033 // "fileId", 16034 // "revisionId" 16035 // ], 16036 // "parameters": { 16037 // "fileId": { 16038 // "description": "The ID of the file.", 16039 // "location": "path", 16040 // "required": true, 16041 // "type": "string" 16042 // }, 16043 // "revisionId": { 16044 // "description": "The ID of the revision.", 16045 // "location": "path", 16046 // "required": true, 16047 // "type": "string" 16048 // } 16049 // }, 16050 // "path": "files/{fileId}/revisions/{revisionId}", 16051 // "scopes": [ 16052 // "https://www.googleapis.com/auth/drive", 16053 // "https://www.googleapis.com/auth/drive.appdata", 16054 // "https://www.googleapis.com/auth/drive.file" 16055 // ] 16056 // } 16057 16058} 16059 16060// method id "drive.revisions.get": 16061 16062type RevisionsGetCall struct { 16063 s *Service 16064 fileId string 16065 revisionId string 16066 urlParams_ gensupport.URLParams 16067 ifNoneMatch_ string 16068 ctx_ context.Context 16069 header_ http.Header 16070} 16071 16072// Get: Gets a specific revision. 16073// 16074// - fileId: The ID of the file. 16075// - revisionId: The ID of the revision. 16076func (r *RevisionsService) Get(fileId string, revisionId string) *RevisionsGetCall { 16077 c := &RevisionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16078 c.fileId = fileId 16079 c.revisionId = revisionId 16080 return c 16081} 16082 16083// Fields allows partial responses to be retrieved. See 16084// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16085// for more information. 16086func (c *RevisionsGetCall) Fields(s ...googleapi.Field) *RevisionsGetCall { 16087 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16088 return c 16089} 16090 16091// IfNoneMatch sets the optional parameter which makes the operation 16092// fail if the object's ETag matches the given value. This is useful for 16093// getting updates only after the object has changed since the last 16094// request. Use googleapi.IsNotModified to check whether the response 16095// error from Do is the result of In-None-Match. 16096func (c *RevisionsGetCall) IfNoneMatch(entityTag string) *RevisionsGetCall { 16097 c.ifNoneMatch_ = entityTag 16098 return c 16099} 16100 16101// Context sets the context to be used in this call's Do method. Any 16102// pending HTTP request will be aborted if the provided context is 16103// canceled. 16104func (c *RevisionsGetCall) Context(ctx context.Context) *RevisionsGetCall { 16105 c.ctx_ = ctx 16106 return c 16107} 16108 16109// Header returns an http.Header that can be modified by the caller to 16110// add HTTP headers to the request. 16111func (c *RevisionsGetCall) Header() http.Header { 16112 if c.header_ == nil { 16113 c.header_ = make(http.Header) 16114 } 16115 return c.header_ 16116} 16117 16118func (c *RevisionsGetCall) doRequest(alt string) (*http.Response, error) { 16119 reqHeaders := make(http.Header) 16120 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 16121 for k, v := range c.header_ { 16122 reqHeaders[k] = v 16123 } 16124 reqHeaders.Set("User-Agent", c.s.userAgent()) 16125 if c.ifNoneMatch_ != "" { 16126 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 16127 } 16128 var body io.Reader = nil 16129 c.urlParams_.Set("alt", alt) 16130 c.urlParams_.Set("prettyPrint", "false") 16131 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") 16132 urls += "?" + c.urlParams_.Encode() 16133 req, err := http.NewRequest("GET", urls, body) 16134 if err != nil { 16135 return nil, err 16136 } 16137 req.Header = reqHeaders 16138 googleapi.Expand(req.URL, map[string]string{ 16139 "fileId": c.fileId, 16140 "revisionId": c.revisionId, 16141 }) 16142 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16143} 16144 16145// Do executes the "drive.revisions.get" call. 16146// Exactly one of *Revision or error will be non-nil. Any non-2xx status 16147// code is an error. Response headers are in either 16148// *Revision.ServerResponse.Header or (if a response was returned at 16149// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 16150// to check whether the returned error was because 16151// http.StatusNotModified was returned. 16152func (c *RevisionsGetCall) Do(opts ...googleapi.CallOption) (*Revision, error) { 16153 gensupport.SetOptions(c.urlParams_, opts...) 16154 res, err := c.doRequest("json") 16155 if res != nil && res.StatusCode == http.StatusNotModified { 16156 if res.Body != nil { 16157 res.Body.Close() 16158 } 16159 return nil, &googleapi.Error{ 16160 Code: res.StatusCode, 16161 Header: res.Header, 16162 } 16163 } 16164 if err != nil { 16165 return nil, err 16166 } 16167 defer googleapi.CloseBody(res) 16168 if err := googleapi.CheckResponse(res); err != nil { 16169 return nil, err 16170 } 16171 ret := &Revision{ 16172 ServerResponse: googleapi.ServerResponse{ 16173 Header: res.Header, 16174 HTTPStatusCode: res.StatusCode, 16175 }, 16176 } 16177 target := &ret 16178 if err := gensupport.DecodeResponse(target, res); err != nil { 16179 return nil, err 16180 } 16181 return ret, nil 16182 // { 16183 // "description": "Gets a specific revision.", 16184 // "httpMethod": "GET", 16185 // "id": "drive.revisions.get", 16186 // "parameterOrder": [ 16187 // "fileId", 16188 // "revisionId" 16189 // ], 16190 // "parameters": { 16191 // "fileId": { 16192 // "description": "The ID of the file.", 16193 // "location": "path", 16194 // "required": true, 16195 // "type": "string" 16196 // }, 16197 // "revisionId": { 16198 // "description": "The ID of the revision.", 16199 // "location": "path", 16200 // "required": true, 16201 // "type": "string" 16202 // } 16203 // }, 16204 // "path": "files/{fileId}/revisions/{revisionId}", 16205 // "response": { 16206 // "$ref": "Revision" 16207 // }, 16208 // "scopes": [ 16209 // "https://www.googleapis.com/auth/drive", 16210 // "https://www.googleapis.com/auth/drive.appdata", 16211 // "https://www.googleapis.com/auth/drive.file", 16212 // "https://www.googleapis.com/auth/drive.metadata", 16213 // "https://www.googleapis.com/auth/drive.metadata.readonly", 16214 // "https://www.googleapis.com/auth/drive.photos.readonly", 16215 // "https://www.googleapis.com/auth/drive.readonly" 16216 // ] 16217 // } 16218 16219} 16220 16221// method id "drive.revisions.list": 16222 16223type RevisionsListCall struct { 16224 s *Service 16225 fileId string 16226 urlParams_ gensupport.URLParams 16227 ifNoneMatch_ string 16228 ctx_ context.Context 16229 header_ http.Header 16230} 16231 16232// List: Lists a file's revisions. 16233// 16234// - fileId: The ID of the file. 16235func (r *RevisionsService) List(fileId string) *RevisionsListCall { 16236 c := &RevisionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16237 c.fileId = fileId 16238 return c 16239} 16240 16241// MaxResults sets the optional parameter "maxResults": Maximum number 16242// of revisions to return. 16243func (c *RevisionsListCall) MaxResults(maxResults int64) *RevisionsListCall { 16244 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 16245 return c 16246} 16247 16248// PageToken sets the optional parameter "pageToken": Page token for 16249// revisions. To get the next page of results, set this parameter to the 16250// value of "nextPageToken" from the previous response. 16251func (c *RevisionsListCall) PageToken(pageToken string) *RevisionsListCall { 16252 c.urlParams_.Set("pageToken", pageToken) 16253 return c 16254} 16255 16256// Fields allows partial responses to be retrieved. See 16257// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16258// for more information. 16259func (c *RevisionsListCall) Fields(s ...googleapi.Field) *RevisionsListCall { 16260 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16261 return c 16262} 16263 16264// IfNoneMatch sets the optional parameter which makes the operation 16265// fail if the object's ETag matches the given value. This is useful for 16266// getting updates only after the object has changed since the last 16267// request. Use googleapi.IsNotModified to check whether the response 16268// error from Do is the result of In-None-Match. 16269func (c *RevisionsListCall) IfNoneMatch(entityTag string) *RevisionsListCall { 16270 c.ifNoneMatch_ = entityTag 16271 return c 16272} 16273 16274// Context sets the context to be used in this call's Do method. Any 16275// pending HTTP request will be aborted if the provided context is 16276// canceled. 16277func (c *RevisionsListCall) Context(ctx context.Context) *RevisionsListCall { 16278 c.ctx_ = ctx 16279 return c 16280} 16281 16282// Header returns an http.Header that can be modified by the caller to 16283// add HTTP headers to the request. 16284func (c *RevisionsListCall) Header() http.Header { 16285 if c.header_ == nil { 16286 c.header_ = make(http.Header) 16287 } 16288 return c.header_ 16289} 16290 16291func (c *RevisionsListCall) doRequest(alt string) (*http.Response, error) { 16292 reqHeaders := make(http.Header) 16293 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 16294 for k, v := range c.header_ { 16295 reqHeaders[k] = v 16296 } 16297 reqHeaders.Set("User-Agent", c.s.userAgent()) 16298 if c.ifNoneMatch_ != "" { 16299 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 16300 } 16301 var body io.Reader = nil 16302 c.urlParams_.Set("alt", alt) 16303 c.urlParams_.Set("prettyPrint", "false") 16304 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions") 16305 urls += "?" + c.urlParams_.Encode() 16306 req, err := http.NewRequest("GET", urls, body) 16307 if err != nil { 16308 return nil, err 16309 } 16310 req.Header = reqHeaders 16311 googleapi.Expand(req.URL, map[string]string{ 16312 "fileId": c.fileId, 16313 }) 16314 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16315} 16316 16317// Do executes the "drive.revisions.list" call. 16318// Exactly one of *RevisionList or error will be non-nil. Any non-2xx 16319// status code is an error. Response headers are in either 16320// *RevisionList.ServerResponse.Header or (if a response was returned at 16321// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 16322// to check whether the returned error was because 16323// http.StatusNotModified was returned. 16324func (c *RevisionsListCall) Do(opts ...googleapi.CallOption) (*RevisionList, error) { 16325 gensupport.SetOptions(c.urlParams_, opts...) 16326 res, err := c.doRequest("json") 16327 if res != nil && res.StatusCode == http.StatusNotModified { 16328 if res.Body != nil { 16329 res.Body.Close() 16330 } 16331 return nil, &googleapi.Error{ 16332 Code: res.StatusCode, 16333 Header: res.Header, 16334 } 16335 } 16336 if err != nil { 16337 return nil, err 16338 } 16339 defer googleapi.CloseBody(res) 16340 if err := googleapi.CheckResponse(res); err != nil { 16341 return nil, err 16342 } 16343 ret := &RevisionList{ 16344 ServerResponse: googleapi.ServerResponse{ 16345 Header: res.Header, 16346 HTTPStatusCode: res.StatusCode, 16347 }, 16348 } 16349 target := &ret 16350 if err := gensupport.DecodeResponse(target, res); err != nil { 16351 return nil, err 16352 } 16353 return ret, nil 16354 // { 16355 // "description": "Lists a file's revisions.", 16356 // "httpMethod": "GET", 16357 // "id": "drive.revisions.list", 16358 // "parameterOrder": [ 16359 // "fileId" 16360 // ], 16361 // "parameters": { 16362 // "fileId": { 16363 // "description": "The ID of the file.", 16364 // "location": "path", 16365 // "required": true, 16366 // "type": "string" 16367 // }, 16368 // "maxResults": { 16369 // "default": "200", 16370 // "description": "Maximum number of revisions to return.", 16371 // "format": "int32", 16372 // "location": "query", 16373 // "maximum": "1000", 16374 // "minimum": "1", 16375 // "type": "integer" 16376 // }, 16377 // "pageToken": { 16378 // "description": "Page token for revisions. To get the next page of results, set this parameter to the value of \"nextPageToken\" from the previous response.", 16379 // "location": "query", 16380 // "type": "string" 16381 // } 16382 // }, 16383 // "path": "files/{fileId}/revisions", 16384 // "response": { 16385 // "$ref": "RevisionList" 16386 // }, 16387 // "scopes": [ 16388 // "https://www.googleapis.com/auth/drive", 16389 // "https://www.googleapis.com/auth/drive.appdata", 16390 // "https://www.googleapis.com/auth/drive.file", 16391 // "https://www.googleapis.com/auth/drive.metadata", 16392 // "https://www.googleapis.com/auth/drive.metadata.readonly", 16393 // "https://www.googleapis.com/auth/drive.photos.readonly", 16394 // "https://www.googleapis.com/auth/drive.readonly" 16395 // ] 16396 // } 16397 16398} 16399 16400// Pages invokes f for each page of results. 16401// A non-nil error returned from f will halt the iteration. 16402// The provided context supersedes any context provided to the Context method. 16403func (c *RevisionsListCall) Pages(ctx context.Context, f func(*RevisionList) error) error { 16404 c.ctx_ = ctx 16405 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 16406 for { 16407 x, err := c.Do() 16408 if err != nil { 16409 return err 16410 } 16411 if err := f(x); err != nil { 16412 return err 16413 } 16414 if x.NextPageToken == "" { 16415 return nil 16416 } 16417 c.PageToken(x.NextPageToken) 16418 } 16419} 16420 16421// method id "drive.revisions.patch": 16422 16423type RevisionsPatchCall struct { 16424 s *Service 16425 fileId string 16426 revisionId string 16427 revision *Revision 16428 urlParams_ gensupport.URLParams 16429 ctx_ context.Context 16430 header_ http.Header 16431} 16432 16433// Patch: Updates a revision. 16434// 16435// - fileId: The ID for the file. 16436// - revisionId: The ID for the revision. 16437func (r *RevisionsService) Patch(fileId string, revisionId string, revision *Revision) *RevisionsPatchCall { 16438 c := &RevisionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16439 c.fileId = fileId 16440 c.revisionId = revisionId 16441 c.revision = revision 16442 return c 16443} 16444 16445// Fields allows partial responses to be retrieved. See 16446// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16447// for more information. 16448func (c *RevisionsPatchCall) Fields(s ...googleapi.Field) *RevisionsPatchCall { 16449 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16450 return c 16451} 16452 16453// Context sets the context to be used in this call's Do method. Any 16454// pending HTTP request will be aborted if the provided context is 16455// canceled. 16456func (c *RevisionsPatchCall) Context(ctx context.Context) *RevisionsPatchCall { 16457 c.ctx_ = ctx 16458 return c 16459} 16460 16461// Header returns an http.Header that can be modified by the caller to 16462// add HTTP headers to the request. 16463func (c *RevisionsPatchCall) Header() http.Header { 16464 if c.header_ == nil { 16465 c.header_ = make(http.Header) 16466 } 16467 return c.header_ 16468} 16469 16470func (c *RevisionsPatchCall) doRequest(alt string) (*http.Response, error) { 16471 reqHeaders := make(http.Header) 16472 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 16473 for k, v := range c.header_ { 16474 reqHeaders[k] = v 16475 } 16476 reqHeaders.Set("User-Agent", c.s.userAgent()) 16477 var body io.Reader = nil 16478 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision) 16479 if err != nil { 16480 return nil, err 16481 } 16482 reqHeaders.Set("Content-Type", "application/json") 16483 c.urlParams_.Set("alt", alt) 16484 c.urlParams_.Set("prettyPrint", "false") 16485 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") 16486 urls += "?" + c.urlParams_.Encode() 16487 req, err := http.NewRequest("PATCH", urls, body) 16488 if err != nil { 16489 return nil, err 16490 } 16491 req.Header = reqHeaders 16492 googleapi.Expand(req.URL, map[string]string{ 16493 "fileId": c.fileId, 16494 "revisionId": c.revisionId, 16495 }) 16496 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16497} 16498 16499// Do executes the "drive.revisions.patch" call. 16500// Exactly one of *Revision or error will be non-nil. Any non-2xx status 16501// code is an error. Response headers are in either 16502// *Revision.ServerResponse.Header or (if a response was returned at 16503// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 16504// to check whether the returned error was because 16505// http.StatusNotModified was returned. 16506func (c *RevisionsPatchCall) Do(opts ...googleapi.CallOption) (*Revision, error) { 16507 gensupport.SetOptions(c.urlParams_, opts...) 16508 res, err := c.doRequest("json") 16509 if res != nil && res.StatusCode == http.StatusNotModified { 16510 if res.Body != nil { 16511 res.Body.Close() 16512 } 16513 return nil, &googleapi.Error{ 16514 Code: res.StatusCode, 16515 Header: res.Header, 16516 } 16517 } 16518 if err != nil { 16519 return nil, err 16520 } 16521 defer googleapi.CloseBody(res) 16522 if err := googleapi.CheckResponse(res); err != nil { 16523 return nil, err 16524 } 16525 ret := &Revision{ 16526 ServerResponse: googleapi.ServerResponse{ 16527 Header: res.Header, 16528 HTTPStatusCode: res.StatusCode, 16529 }, 16530 } 16531 target := &ret 16532 if err := gensupport.DecodeResponse(target, res); err != nil { 16533 return nil, err 16534 } 16535 return ret, nil 16536 // { 16537 // "description": "Updates a revision.", 16538 // "httpMethod": "PATCH", 16539 // "id": "drive.revisions.patch", 16540 // "parameterOrder": [ 16541 // "fileId", 16542 // "revisionId" 16543 // ], 16544 // "parameters": { 16545 // "fileId": { 16546 // "description": "The ID for the file.", 16547 // "location": "path", 16548 // "required": true, 16549 // "type": "string" 16550 // }, 16551 // "revisionId": { 16552 // "description": "The ID for the revision.", 16553 // "location": "path", 16554 // "required": true, 16555 // "type": "string" 16556 // } 16557 // }, 16558 // "path": "files/{fileId}/revisions/{revisionId}", 16559 // "request": { 16560 // "$ref": "Revision" 16561 // }, 16562 // "response": { 16563 // "$ref": "Revision" 16564 // }, 16565 // "scopes": [ 16566 // "https://www.googleapis.com/auth/drive", 16567 // "https://www.googleapis.com/auth/drive.appdata", 16568 // "https://www.googleapis.com/auth/drive.file" 16569 // ] 16570 // } 16571 16572} 16573 16574// method id "drive.revisions.update": 16575 16576type RevisionsUpdateCall struct { 16577 s *Service 16578 fileId string 16579 revisionId string 16580 revision *Revision 16581 urlParams_ gensupport.URLParams 16582 ctx_ context.Context 16583 header_ http.Header 16584} 16585 16586// Update: Updates a revision. 16587// 16588// - fileId: The ID for the file. 16589// - revisionId: The ID for the revision. 16590func (r *RevisionsService) Update(fileId string, revisionId string, revision *Revision) *RevisionsUpdateCall { 16591 c := &RevisionsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16592 c.fileId = fileId 16593 c.revisionId = revisionId 16594 c.revision = revision 16595 return c 16596} 16597 16598// Fields allows partial responses to be retrieved. See 16599// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16600// for more information. 16601func (c *RevisionsUpdateCall) Fields(s ...googleapi.Field) *RevisionsUpdateCall { 16602 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16603 return c 16604} 16605 16606// Context sets the context to be used in this call's Do method. Any 16607// pending HTTP request will be aborted if the provided context is 16608// canceled. 16609func (c *RevisionsUpdateCall) Context(ctx context.Context) *RevisionsUpdateCall { 16610 c.ctx_ = ctx 16611 return c 16612} 16613 16614// Header returns an http.Header that can be modified by the caller to 16615// add HTTP headers to the request. 16616func (c *RevisionsUpdateCall) Header() http.Header { 16617 if c.header_ == nil { 16618 c.header_ = make(http.Header) 16619 } 16620 return c.header_ 16621} 16622 16623func (c *RevisionsUpdateCall) doRequest(alt string) (*http.Response, error) { 16624 reqHeaders := make(http.Header) 16625 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 16626 for k, v := range c.header_ { 16627 reqHeaders[k] = v 16628 } 16629 reqHeaders.Set("User-Agent", c.s.userAgent()) 16630 var body io.Reader = nil 16631 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision) 16632 if err != nil { 16633 return nil, err 16634 } 16635 reqHeaders.Set("Content-Type", "application/json") 16636 c.urlParams_.Set("alt", alt) 16637 c.urlParams_.Set("prettyPrint", "false") 16638 urls := googleapi.ResolveRelative(c.s.BasePath, "files/{fileId}/revisions/{revisionId}") 16639 urls += "?" + c.urlParams_.Encode() 16640 req, err := http.NewRequest("PUT", urls, body) 16641 if err != nil { 16642 return nil, err 16643 } 16644 req.Header = reqHeaders 16645 googleapi.Expand(req.URL, map[string]string{ 16646 "fileId": c.fileId, 16647 "revisionId": c.revisionId, 16648 }) 16649 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16650} 16651 16652// Do executes the "drive.revisions.update" call. 16653// Exactly one of *Revision or error will be non-nil. Any non-2xx status 16654// code is an error. Response headers are in either 16655// *Revision.ServerResponse.Header or (if a response was returned at 16656// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 16657// to check whether the returned error was because 16658// http.StatusNotModified was returned. 16659func (c *RevisionsUpdateCall) Do(opts ...googleapi.CallOption) (*Revision, error) { 16660 gensupport.SetOptions(c.urlParams_, opts...) 16661 res, err := c.doRequest("json") 16662 if res != nil && res.StatusCode == http.StatusNotModified { 16663 if res.Body != nil { 16664 res.Body.Close() 16665 } 16666 return nil, &googleapi.Error{ 16667 Code: res.StatusCode, 16668 Header: res.Header, 16669 } 16670 } 16671 if err != nil { 16672 return nil, err 16673 } 16674 defer googleapi.CloseBody(res) 16675 if err := googleapi.CheckResponse(res); err != nil { 16676 return nil, err 16677 } 16678 ret := &Revision{ 16679 ServerResponse: googleapi.ServerResponse{ 16680 Header: res.Header, 16681 HTTPStatusCode: res.StatusCode, 16682 }, 16683 } 16684 target := &ret 16685 if err := gensupport.DecodeResponse(target, res); err != nil { 16686 return nil, err 16687 } 16688 return ret, nil 16689 // { 16690 // "description": "Updates a revision.", 16691 // "httpMethod": "PUT", 16692 // "id": "drive.revisions.update", 16693 // "parameterOrder": [ 16694 // "fileId", 16695 // "revisionId" 16696 // ], 16697 // "parameters": { 16698 // "fileId": { 16699 // "description": "The ID for the file.", 16700 // "location": "path", 16701 // "required": true, 16702 // "type": "string" 16703 // }, 16704 // "revisionId": { 16705 // "description": "The ID for the revision.", 16706 // "location": "path", 16707 // "required": true, 16708 // "type": "string" 16709 // } 16710 // }, 16711 // "path": "files/{fileId}/revisions/{revisionId}", 16712 // "request": { 16713 // "$ref": "Revision" 16714 // }, 16715 // "response": { 16716 // "$ref": "Revision" 16717 // }, 16718 // "scopes": [ 16719 // "https://www.googleapis.com/auth/drive", 16720 // "https://www.googleapis.com/auth/drive.appdata", 16721 // "https://www.googleapis.com/auth/drive.file" 16722 // ] 16723 // } 16724 16725} 16726 16727// method id "drive.teamdrives.delete": 16728 16729type TeamdrivesDeleteCall struct { 16730 s *Service 16731 teamDriveId string 16732 urlParams_ gensupport.URLParams 16733 ctx_ context.Context 16734 header_ http.Header 16735} 16736 16737// Delete: Deprecated use drives.delete instead. 16738// 16739// - teamDriveId: The ID of the Team Drive. 16740func (r *TeamdrivesService) Delete(teamDriveId string) *TeamdrivesDeleteCall { 16741 c := &TeamdrivesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16742 c.teamDriveId = teamDriveId 16743 return c 16744} 16745 16746// Fields allows partial responses to be retrieved. See 16747// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16748// for more information. 16749func (c *TeamdrivesDeleteCall) Fields(s ...googleapi.Field) *TeamdrivesDeleteCall { 16750 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16751 return c 16752} 16753 16754// Context sets the context to be used in this call's Do method. Any 16755// pending HTTP request will be aborted if the provided context is 16756// canceled. 16757func (c *TeamdrivesDeleteCall) Context(ctx context.Context) *TeamdrivesDeleteCall { 16758 c.ctx_ = ctx 16759 return c 16760} 16761 16762// Header returns an http.Header that can be modified by the caller to 16763// add HTTP headers to the request. 16764func (c *TeamdrivesDeleteCall) Header() http.Header { 16765 if c.header_ == nil { 16766 c.header_ = make(http.Header) 16767 } 16768 return c.header_ 16769} 16770 16771func (c *TeamdrivesDeleteCall) doRequest(alt string) (*http.Response, error) { 16772 reqHeaders := make(http.Header) 16773 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 16774 for k, v := range c.header_ { 16775 reqHeaders[k] = v 16776 } 16777 reqHeaders.Set("User-Agent", c.s.userAgent()) 16778 var body io.Reader = nil 16779 c.urlParams_.Set("alt", alt) 16780 c.urlParams_.Set("prettyPrint", "false") 16781 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") 16782 urls += "?" + c.urlParams_.Encode() 16783 req, err := http.NewRequest("DELETE", urls, body) 16784 if err != nil { 16785 return nil, err 16786 } 16787 req.Header = reqHeaders 16788 googleapi.Expand(req.URL, map[string]string{ 16789 "teamDriveId": c.teamDriveId, 16790 }) 16791 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16792} 16793 16794// Do executes the "drive.teamdrives.delete" call. 16795func (c *TeamdrivesDeleteCall) Do(opts ...googleapi.CallOption) error { 16796 gensupport.SetOptions(c.urlParams_, opts...) 16797 res, err := c.doRequest("json") 16798 if err != nil { 16799 return err 16800 } 16801 defer googleapi.CloseBody(res) 16802 if err := googleapi.CheckResponse(res); err != nil { 16803 return err 16804 } 16805 return nil 16806 // { 16807 // "description": "Deprecated use drives.delete instead.", 16808 // "httpMethod": "DELETE", 16809 // "id": "drive.teamdrives.delete", 16810 // "parameterOrder": [ 16811 // "teamDriveId" 16812 // ], 16813 // "parameters": { 16814 // "teamDriveId": { 16815 // "description": "The ID of the Team Drive", 16816 // "location": "path", 16817 // "required": true, 16818 // "type": "string" 16819 // } 16820 // }, 16821 // "path": "teamdrives/{teamDriveId}", 16822 // "scopes": [ 16823 // "https://www.googleapis.com/auth/drive" 16824 // ] 16825 // } 16826 16827} 16828 16829// method id "drive.teamdrives.get": 16830 16831type TeamdrivesGetCall struct { 16832 s *Service 16833 teamDriveId string 16834 urlParams_ gensupport.URLParams 16835 ifNoneMatch_ string 16836 ctx_ context.Context 16837 header_ http.Header 16838} 16839 16840// Get: Deprecated use drives.get instead. 16841// 16842// - teamDriveId: The ID of the Team Drive. 16843func (r *TeamdrivesService) Get(teamDriveId string) *TeamdrivesGetCall { 16844 c := &TeamdrivesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 16845 c.teamDriveId = teamDriveId 16846 return c 16847} 16848 16849// UseDomainAdminAccess sets the optional parameter 16850// "useDomainAdminAccess": Issue the request as a domain administrator; 16851// if set to true, then the requester will be granted access if they are 16852// an administrator of the domain to which the Team Drive belongs. 16853func (c *TeamdrivesGetCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesGetCall { 16854 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 16855 return c 16856} 16857 16858// Fields allows partial responses to be retrieved. See 16859// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 16860// for more information. 16861func (c *TeamdrivesGetCall) Fields(s ...googleapi.Field) *TeamdrivesGetCall { 16862 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 16863 return c 16864} 16865 16866// IfNoneMatch sets the optional parameter which makes the operation 16867// fail if the object's ETag matches the given value. This is useful for 16868// getting updates only after the object has changed since the last 16869// request. Use googleapi.IsNotModified to check whether the response 16870// error from Do is the result of In-None-Match. 16871func (c *TeamdrivesGetCall) IfNoneMatch(entityTag string) *TeamdrivesGetCall { 16872 c.ifNoneMatch_ = entityTag 16873 return c 16874} 16875 16876// Context sets the context to be used in this call's Do method. Any 16877// pending HTTP request will be aborted if the provided context is 16878// canceled. 16879func (c *TeamdrivesGetCall) Context(ctx context.Context) *TeamdrivesGetCall { 16880 c.ctx_ = ctx 16881 return c 16882} 16883 16884// Header returns an http.Header that can be modified by the caller to 16885// add HTTP headers to the request. 16886func (c *TeamdrivesGetCall) Header() http.Header { 16887 if c.header_ == nil { 16888 c.header_ = make(http.Header) 16889 } 16890 return c.header_ 16891} 16892 16893func (c *TeamdrivesGetCall) doRequest(alt string) (*http.Response, error) { 16894 reqHeaders := make(http.Header) 16895 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 16896 for k, v := range c.header_ { 16897 reqHeaders[k] = v 16898 } 16899 reqHeaders.Set("User-Agent", c.s.userAgent()) 16900 if c.ifNoneMatch_ != "" { 16901 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 16902 } 16903 var body io.Reader = nil 16904 c.urlParams_.Set("alt", alt) 16905 c.urlParams_.Set("prettyPrint", "false") 16906 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") 16907 urls += "?" + c.urlParams_.Encode() 16908 req, err := http.NewRequest("GET", urls, body) 16909 if err != nil { 16910 return nil, err 16911 } 16912 req.Header = reqHeaders 16913 googleapi.Expand(req.URL, map[string]string{ 16914 "teamDriveId": c.teamDriveId, 16915 }) 16916 return gensupport.SendRequest(c.ctx_, c.s.client, req) 16917} 16918 16919// Do executes the "drive.teamdrives.get" call. 16920// Exactly one of *TeamDrive or error will be non-nil. Any non-2xx 16921// status code is an error. Response headers are in either 16922// *TeamDrive.ServerResponse.Header or (if a response was returned at 16923// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 16924// to check whether the returned error was because 16925// http.StatusNotModified was returned. 16926func (c *TeamdrivesGetCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) { 16927 gensupport.SetOptions(c.urlParams_, opts...) 16928 res, err := c.doRequest("json") 16929 if res != nil && res.StatusCode == http.StatusNotModified { 16930 if res.Body != nil { 16931 res.Body.Close() 16932 } 16933 return nil, &googleapi.Error{ 16934 Code: res.StatusCode, 16935 Header: res.Header, 16936 } 16937 } 16938 if err != nil { 16939 return nil, err 16940 } 16941 defer googleapi.CloseBody(res) 16942 if err := googleapi.CheckResponse(res); err != nil { 16943 return nil, err 16944 } 16945 ret := &TeamDrive{ 16946 ServerResponse: googleapi.ServerResponse{ 16947 Header: res.Header, 16948 HTTPStatusCode: res.StatusCode, 16949 }, 16950 } 16951 target := &ret 16952 if err := gensupport.DecodeResponse(target, res); err != nil { 16953 return nil, err 16954 } 16955 return ret, nil 16956 // { 16957 // "description": "Deprecated use drives.get instead.", 16958 // "httpMethod": "GET", 16959 // "id": "drive.teamdrives.get", 16960 // "parameterOrder": [ 16961 // "teamDriveId" 16962 // ], 16963 // "parameters": { 16964 // "teamDriveId": { 16965 // "description": "The ID of the Team Drive", 16966 // "location": "path", 16967 // "required": true, 16968 // "type": "string" 16969 // }, 16970 // "useDomainAdminAccess": { 16971 // "default": "false", 16972 // "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.", 16973 // "location": "query", 16974 // "type": "boolean" 16975 // } 16976 // }, 16977 // "path": "teamdrives/{teamDriveId}", 16978 // "response": { 16979 // "$ref": "TeamDrive" 16980 // }, 16981 // "scopes": [ 16982 // "https://www.googleapis.com/auth/drive", 16983 // "https://www.googleapis.com/auth/drive.readonly" 16984 // ] 16985 // } 16986 16987} 16988 16989// method id "drive.teamdrives.insert": 16990 16991type TeamdrivesInsertCall struct { 16992 s *Service 16993 teamdrive *TeamDrive 16994 urlParams_ gensupport.URLParams 16995 ctx_ context.Context 16996 header_ http.Header 16997} 16998 16999// Insert: Deprecated use drives.insert instead. 17000// 17001// - requestId: An ID, such as a random UUID, which uniquely identifies 17002// this user's request for idempotent creation of a Team Drive. A 17003// repeated request by the same user and with the same request ID will 17004// avoid creating duplicates by attempting to create the same Team 17005// Drive. If the Team Drive already exists a 409 error will be 17006// returned. 17007func (r *TeamdrivesService) Insert(requestId string, teamdrive *TeamDrive) *TeamdrivesInsertCall { 17008 c := &TeamdrivesInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17009 c.urlParams_.Set("requestId", requestId) 17010 c.teamdrive = teamdrive 17011 return c 17012} 17013 17014// Fields allows partial responses to be retrieved. See 17015// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17016// for more information. 17017func (c *TeamdrivesInsertCall) Fields(s ...googleapi.Field) *TeamdrivesInsertCall { 17018 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17019 return c 17020} 17021 17022// Context sets the context to be used in this call's Do method. Any 17023// pending HTTP request will be aborted if the provided context is 17024// canceled. 17025func (c *TeamdrivesInsertCall) Context(ctx context.Context) *TeamdrivesInsertCall { 17026 c.ctx_ = ctx 17027 return c 17028} 17029 17030// Header returns an http.Header that can be modified by the caller to 17031// add HTTP headers to the request. 17032func (c *TeamdrivesInsertCall) Header() http.Header { 17033 if c.header_ == nil { 17034 c.header_ = make(http.Header) 17035 } 17036 return c.header_ 17037} 17038 17039func (c *TeamdrivesInsertCall) doRequest(alt string) (*http.Response, error) { 17040 reqHeaders := make(http.Header) 17041 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 17042 for k, v := range c.header_ { 17043 reqHeaders[k] = v 17044 } 17045 reqHeaders.Set("User-Agent", c.s.userAgent()) 17046 var body io.Reader = nil 17047 body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive) 17048 if err != nil { 17049 return nil, err 17050 } 17051 reqHeaders.Set("Content-Type", "application/json") 17052 c.urlParams_.Set("alt", alt) 17053 c.urlParams_.Set("prettyPrint", "false") 17054 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives") 17055 urls += "?" + c.urlParams_.Encode() 17056 req, err := http.NewRequest("POST", urls, body) 17057 if err != nil { 17058 return nil, err 17059 } 17060 req.Header = reqHeaders 17061 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17062} 17063 17064// Do executes the "drive.teamdrives.insert" call. 17065// Exactly one of *TeamDrive or error will be non-nil. Any non-2xx 17066// status code is an error. Response headers are in either 17067// *TeamDrive.ServerResponse.Header or (if a response was returned at 17068// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 17069// to check whether the returned error was because 17070// http.StatusNotModified was returned. 17071func (c *TeamdrivesInsertCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) { 17072 gensupport.SetOptions(c.urlParams_, opts...) 17073 res, err := c.doRequest("json") 17074 if res != nil && res.StatusCode == http.StatusNotModified { 17075 if res.Body != nil { 17076 res.Body.Close() 17077 } 17078 return nil, &googleapi.Error{ 17079 Code: res.StatusCode, 17080 Header: res.Header, 17081 } 17082 } 17083 if err != nil { 17084 return nil, err 17085 } 17086 defer googleapi.CloseBody(res) 17087 if err := googleapi.CheckResponse(res); err != nil { 17088 return nil, err 17089 } 17090 ret := &TeamDrive{ 17091 ServerResponse: googleapi.ServerResponse{ 17092 Header: res.Header, 17093 HTTPStatusCode: res.StatusCode, 17094 }, 17095 } 17096 target := &ret 17097 if err := gensupport.DecodeResponse(target, res); err != nil { 17098 return nil, err 17099 } 17100 return ret, nil 17101 // { 17102 // "description": "Deprecated use drives.insert instead.", 17103 // "httpMethod": "POST", 17104 // "id": "drive.teamdrives.insert", 17105 // "parameterOrder": [ 17106 // "requestId" 17107 // ], 17108 // "parameters": { 17109 // "requestId": { 17110 // "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.", 17111 // "location": "query", 17112 // "required": true, 17113 // "type": "string" 17114 // } 17115 // }, 17116 // "path": "teamdrives", 17117 // "request": { 17118 // "$ref": "TeamDrive" 17119 // }, 17120 // "response": { 17121 // "$ref": "TeamDrive" 17122 // }, 17123 // "scopes": [ 17124 // "https://www.googleapis.com/auth/drive" 17125 // ] 17126 // } 17127 17128} 17129 17130// method id "drive.teamdrives.list": 17131 17132type TeamdrivesListCall struct { 17133 s *Service 17134 urlParams_ gensupport.URLParams 17135 ifNoneMatch_ string 17136 ctx_ context.Context 17137 header_ http.Header 17138} 17139 17140// List: Deprecated use drives.list instead. 17141func (r *TeamdrivesService) List() *TeamdrivesListCall { 17142 c := &TeamdrivesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17143 return c 17144} 17145 17146// MaxResults sets the optional parameter "maxResults": Maximum number 17147// of Team Drives to return. 17148func (c *TeamdrivesListCall) MaxResults(maxResults int64) *TeamdrivesListCall { 17149 c.urlParams_.Set("maxResults", fmt.Sprint(maxResults)) 17150 return c 17151} 17152 17153// PageToken sets the optional parameter "pageToken": Page token for 17154// Team Drives. 17155func (c *TeamdrivesListCall) PageToken(pageToken string) *TeamdrivesListCall { 17156 c.urlParams_.Set("pageToken", pageToken) 17157 return c 17158} 17159 17160// Q sets the optional parameter "q": Query string for searching Team 17161// Drives. 17162func (c *TeamdrivesListCall) Q(q string) *TeamdrivesListCall { 17163 c.urlParams_.Set("q", q) 17164 return c 17165} 17166 17167// UseDomainAdminAccess sets the optional parameter 17168// "useDomainAdminAccess": Issue the request as a domain administrator; 17169// if set to true, then all Team Drives of the domain in which the 17170// requester is an administrator are returned. 17171func (c *TeamdrivesListCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesListCall { 17172 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 17173 return c 17174} 17175 17176// Fields allows partial responses to be retrieved. See 17177// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17178// for more information. 17179func (c *TeamdrivesListCall) Fields(s ...googleapi.Field) *TeamdrivesListCall { 17180 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17181 return c 17182} 17183 17184// IfNoneMatch sets the optional parameter which makes the operation 17185// fail if the object's ETag matches the given value. This is useful for 17186// getting updates only after the object has changed since the last 17187// request. Use googleapi.IsNotModified to check whether the response 17188// error from Do is the result of In-None-Match. 17189func (c *TeamdrivesListCall) IfNoneMatch(entityTag string) *TeamdrivesListCall { 17190 c.ifNoneMatch_ = entityTag 17191 return c 17192} 17193 17194// Context sets the context to be used in this call's Do method. Any 17195// pending HTTP request will be aborted if the provided context is 17196// canceled. 17197func (c *TeamdrivesListCall) Context(ctx context.Context) *TeamdrivesListCall { 17198 c.ctx_ = ctx 17199 return c 17200} 17201 17202// Header returns an http.Header that can be modified by the caller to 17203// add HTTP headers to the request. 17204func (c *TeamdrivesListCall) Header() http.Header { 17205 if c.header_ == nil { 17206 c.header_ = make(http.Header) 17207 } 17208 return c.header_ 17209} 17210 17211func (c *TeamdrivesListCall) doRequest(alt string) (*http.Response, error) { 17212 reqHeaders := make(http.Header) 17213 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 17214 for k, v := range c.header_ { 17215 reqHeaders[k] = v 17216 } 17217 reqHeaders.Set("User-Agent", c.s.userAgent()) 17218 if c.ifNoneMatch_ != "" { 17219 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 17220 } 17221 var body io.Reader = nil 17222 c.urlParams_.Set("alt", alt) 17223 c.urlParams_.Set("prettyPrint", "false") 17224 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives") 17225 urls += "?" + c.urlParams_.Encode() 17226 req, err := http.NewRequest("GET", urls, body) 17227 if err != nil { 17228 return nil, err 17229 } 17230 req.Header = reqHeaders 17231 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17232} 17233 17234// Do executes the "drive.teamdrives.list" call. 17235// Exactly one of *TeamDriveList or error will be non-nil. Any non-2xx 17236// status code is an error. Response headers are in either 17237// *TeamDriveList.ServerResponse.Header or (if a response was returned 17238// at all) in error.(*googleapi.Error).Header. Use 17239// googleapi.IsNotModified to check whether the returned error was 17240// because http.StatusNotModified was returned. 17241func (c *TeamdrivesListCall) Do(opts ...googleapi.CallOption) (*TeamDriveList, error) { 17242 gensupport.SetOptions(c.urlParams_, opts...) 17243 res, err := c.doRequest("json") 17244 if res != nil && res.StatusCode == http.StatusNotModified { 17245 if res.Body != nil { 17246 res.Body.Close() 17247 } 17248 return nil, &googleapi.Error{ 17249 Code: res.StatusCode, 17250 Header: res.Header, 17251 } 17252 } 17253 if err != nil { 17254 return nil, err 17255 } 17256 defer googleapi.CloseBody(res) 17257 if err := googleapi.CheckResponse(res); err != nil { 17258 return nil, err 17259 } 17260 ret := &TeamDriveList{ 17261 ServerResponse: googleapi.ServerResponse{ 17262 Header: res.Header, 17263 HTTPStatusCode: res.StatusCode, 17264 }, 17265 } 17266 target := &ret 17267 if err := gensupport.DecodeResponse(target, res); err != nil { 17268 return nil, err 17269 } 17270 return ret, nil 17271 // { 17272 // "description": "Deprecated use drives.list instead.", 17273 // "httpMethod": "GET", 17274 // "id": "drive.teamdrives.list", 17275 // "parameters": { 17276 // "maxResults": { 17277 // "default": "10", 17278 // "description": "Maximum number of Team Drives to return.", 17279 // "format": "int32", 17280 // "location": "query", 17281 // "maximum": "100", 17282 // "minimum": "1", 17283 // "type": "integer" 17284 // }, 17285 // "pageToken": { 17286 // "description": "Page token for Team Drives.", 17287 // "location": "query", 17288 // "type": "string" 17289 // }, 17290 // "q": { 17291 // "description": "Query string for searching Team Drives.", 17292 // "location": "query", 17293 // "type": "string" 17294 // }, 17295 // "useDomainAdminAccess": { 17296 // "default": "false", 17297 // "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.", 17298 // "location": "query", 17299 // "type": "boolean" 17300 // } 17301 // }, 17302 // "path": "teamdrives", 17303 // "response": { 17304 // "$ref": "TeamDriveList" 17305 // }, 17306 // "scopes": [ 17307 // "https://www.googleapis.com/auth/drive", 17308 // "https://www.googleapis.com/auth/drive.readonly" 17309 // ] 17310 // } 17311 17312} 17313 17314// Pages invokes f for each page of results. 17315// A non-nil error returned from f will halt the iteration. 17316// The provided context supersedes any context provided to the Context method. 17317func (c *TeamdrivesListCall) Pages(ctx context.Context, f func(*TeamDriveList) error) error { 17318 c.ctx_ = ctx 17319 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 17320 for { 17321 x, err := c.Do() 17322 if err != nil { 17323 return err 17324 } 17325 if err := f(x); err != nil { 17326 return err 17327 } 17328 if x.NextPageToken == "" { 17329 return nil 17330 } 17331 c.PageToken(x.NextPageToken) 17332 } 17333} 17334 17335// method id "drive.teamdrives.update": 17336 17337type TeamdrivesUpdateCall struct { 17338 s *Service 17339 teamDriveId string 17340 teamdrive *TeamDrive 17341 urlParams_ gensupport.URLParams 17342 ctx_ context.Context 17343 header_ http.Header 17344} 17345 17346// Update: Deprecated use drives.update instead. 17347// 17348// - teamDriveId: The ID of the Team Drive. 17349func (r *TeamdrivesService) Update(teamDriveId string, teamdrive *TeamDrive) *TeamdrivesUpdateCall { 17350 c := &TeamdrivesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 17351 c.teamDriveId = teamDriveId 17352 c.teamdrive = teamdrive 17353 return c 17354} 17355 17356// UseDomainAdminAccess sets the optional parameter 17357// "useDomainAdminAccess": Issue the request as a domain administrator; 17358// if set to true, then the requester will be granted access if they are 17359// an administrator of the domain to which the Team Drive belongs. 17360func (c *TeamdrivesUpdateCall) UseDomainAdminAccess(useDomainAdminAccess bool) *TeamdrivesUpdateCall { 17361 c.urlParams_.Set("useDomainAdminAccess", fmt.Sprint(useDomainAdminAccess)) 17362 return c 17363} 17364 17365// Fields allows partial responses to be retrieved. See 17366// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 17367// for more information. 17368func (c *TeamdrivesUpdateCall) Fields(s ...googleapi.Field) *TeamdrivesUpdateCall { 17369 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 17370 return c 17371} 17372 17373// Context sets the context to be used in this call's Do method. Any 17374// pending HTTP request will be aborted if the provided context is 17375// canceled. 17376func (c *TeamdrivesUpdateCall) Context(ctx context.Context) *TeamdrivesUpdateCall { 17377 c.ctx_ = ctx 17378 return c 17379} 17380 17381// Header returns an http.Header that can be modified by the caller to 17382// add HTTP headers to the request. 17383func (c *TeamdrivesUpdateCall) Header() http.Header { 17384 if c.header_ == nil { 17385 c.header_ = make(http.Header) 17386 } 17387 return c.header_ 17388} 17389 17390func (c *TeamdrivesUpdateCall) doRequest(alt string) (*http.Response, error) { 17391 reqHeaders := make(http.Header) 17392 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210410") 17393 for k, v := range c.header_ { 17394 reqHeaders[k] = v 17395 } 17396 reqHeaders.Set("User-Agent", c.s.userAgent()) 17397 var body io.Reader = nil 17398 body, err := googleapi.WithoutDataWrapper.JSONReader(c.teamdrive) 17399 if err != nil { 17400 return nil, err 17401 } 17402 reqHeaders.Set("Content-Type", "application/json") 17403 c.urlParams_.Set("alt", alt) 17404 c.urlParams_.Set("prettyPrint", "false") 17405 urls := googleapi.ResolveRelative(c.s.BasePath, "teamdrives/{teamDriveId}") 17406 urls += "?" + c.urlParams_.Encode() 17407 req, err := http.NewRequest("PUT", urls, body) 17408 if err != nil { 17409 return nil, err 17410 } 17411 req.Header = reqHeaders 17412 googleapi.Expand(req.URL, map[string]string{ 17413 "teamDriveId": c.teamDriveId, 17414 }) 17415 return gensupport.SendRequest(c.ctx_, c.s.client, req) 17416} 17417 17418// Do executes the "drive.teamdrives.update" call. 17419// Exactly one of *TeamDrive or error will be non-nil. Any non-2xx 17420// status code is an error. Response headers are in either 17421// *TeamDrive.ServerResponse.Header or (if a response was returned at 17422// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 17423// to check whether the returned error was because 17424// http.StatusNotModified was returned. 17425func (c *TeamdrivesUpdateCall) Do(opts ...googleapi.CallOption) (*TeamDrive, error) { 17426 gensupport.SetOptions(c.urlParams_, opts...) 17427 res, err := c.doRequest("json") 17428 if res != nil && res.StatusCode == http.StatusNotModified { 17429 if res.Body != nil { 17430 res.Body.Close() 17431 } 17432 return nil, &googleapi.Error{ 17433 Code: res.StatusCode, 17434 Header: res.Header, 17435 } 17436 } 17437 if err != nil { 17438 return nil, err 17439 } 17440 defer googleapi.CloseBody(res) 17441 if err := googleapi.CheckResponse(res); err != nil { 17442 return nil, err 17443 } 17444 ret := &TeamDrive{ 17445 ServerResponse: googleapi.ServerResponse{ 17446 Header: res.Header, 17447 HTTPStatusCode: res.StatusCode, 17448 }, 17449 } 17450 target := &ret 17451 if err := gensupport.DecodeResponse(target, res); err != nil { 17452 return nil, err 17453 } 17454 return ret, nil 17455 // { 17456 // "description": "Deprecated use drives.update instead.", 17457 // "httpMethod": "PUT", 17458 // "id": "drive.teamdrives.update", 17459 // "parameterOrder": [ 17460 // "teamDriveId" 17461 // ], 17462 // "parameters": { 17463 // "teamDriveId": { 17464 // "description": "The ID of the Team Drive", 17465 // "location": "path", 17466 // "required": true, 17467 // "type": "string" 17468 // }, 17469 // "useDomainAdminAccess": { 17470 // "default": "false", 17471 // "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.", 17472 // "location": "query", 17473 // "type": "boolean" 17474 // } 17475 // }, 17476 // "path": "teamdrives/{teamDriveId}", 17477 // "request": { 17478 // "$ref": "TeamDrive" 17479 // }, 17480 // "response": { 17481 // "$ref": "TeamDrive" 17482 // }, 17483 // "scopes": [ 17484 // "https://www.googleapis.com/auth/drive" 17485 // ] 17486 // } 17487 17488} 17489