github.com/olivere/camlistore@v0.0.0-20140121221811-1b7ac2da0199/third_party/code.google.com/p/google-api-go-client/drive/v2/drive-gen.go (about) 1 // Package drive provides access to the Drive API. 2 // 3 // See https://developers.google.com/drive/ 4 // 5 // Usage example: 6 // 7 // import "camlistore.org/third_party/code.google.com/p/google-api-go-client/drive/v2" 8 // ... 9 // driveService, err := drive.New(oauthHttpClient) 10 package driveclient 11 12 import ( 13 "bytes" 14 "camlistore.org/third_party/code.google.com/p/google-api-go-client/googleapi" 15 "encoding/json" 16 "errors" 17 "fmt" 18 "io" 19 "net/http" 20 "net/url" 21 "strconv" 22 "strings" 23 ) 24 25 // Always reference these packages, just in case the auto-generated code 26 // below doesn't. 27 var _ = bytes.NewBuffer 28 var _ = strconv.Itoa 29 var _ = fmt.Sprintf 30 var _ = json.NewDecoder 31 var _ = io.Copy 32 var _ = url.Parse 33 var _ = googleapi.Version 34 var _ = errors.New 35 var _ = strings.Replace 36 37 const apiId = "drive:v2" 38 const apiName = "drive" 39 const apiVersion = "v2" 40 const basePath = "https://www.googleapis.com/drive/v2/" 41 42 // OAuth2 scopes used by this API. 43 const ( 44 // View and manage the files and documents in your Google Drive 45 DriveScope = "https://www.googleapis.com/auth/drive" 46 47 // View and manage its own configuration data in your Google Drive 48 DriveAppdataScope = "https://www.googleapis.com/auth/drive.appdata" 49 50 // View your Google Drive apps 51 DriveAppsReadonlyScope = "https://www.googleapis.com/auth/drive.apps.readonly" 52 53 // View and manage Google Drive files that you have opened or created 54 // with this app 55 DriveFileScope = "https://www.googleapis.com/auth/drive.file" 56 57 // View metadata for files and documents in your Google Drive 58 DriveMetadataReadonlyScope = "https://www.googleapis.com/auth/drive.metadata.readonly" 59 60 // View the files and documents in your Google Drive 61 DriveReadonlyScope = "https://www.googleapis.com/auth/drive.readonly" 62 63 // Modify your Google Apps Script scripts' behavior 64 DriveScriptsScope = "https://www.googleapis.com/auth/drive.scripts" 65 ) 66 67 func New(client *http.Client) (*Service, error) { 68 if client == nil { 69 return nil, errors.New("client is nil") 70 } 71 s := &Service{client: client} 72 s.About = NewAboutService(s) 73 s.Apps = NewAppsService(s) 74 s.Changes = NewChangesService(s) 75 s.Channels = NewChannelsService(s) 76 s.Children = NewChildrenService(s) 77 s.Comments = NewCommentsService(s) 78 s.Files = NewFilesService(s) 79 s.Parents = NewParentsService(s) 80 s.Permissions = NewPermissionsService(s) 81 s.Properties = NewPropertiesService(s) 82 s.Realtime = NewRealtimeService(s) 83 s.Replies = NewRepliesService(s) 84 s.Revisions = NewRevisionsService(s) 85 return s, nil 86 } 87 88 type Service struct { 89 client *http.Client 90 91 About *AboutService 92 93 Apps *AppsService 94 95 Changes *ChangesService 96 97 Channels *ChannelsService 98 99 Children *ChildrenService 100 101 Comments *CommentsService 102 103 Files *FilesService 104 105 Parents *ParentsService 106 107 Permissions *PermissionsService 108 109 Properties *PropertiesService 110 111 Realtime *RealtimeService 112 113 Replies *RepliesService 114 115 Revisions *RevisionsService 116 } 117 118 func NewAboutService(s *Service) *AboutService { 119 rs := &AboutService{s: s} 120 return rs 121 } 122 123 type AboutService struct { 124 s *Service 125 } 126 127 func NewAppsService(s *Service) *AppsService { 128 rs := &AppsService{s: s} 129 return rs 130 } 131 132 type AppsService struct { 133 s *Service 134 } 135 136 func NewChangesService(s *Service) *ChangesService { 137 rs := &ChangesService{s: s} 138 return rs 139 } 140 141 type ChangesService struct { 142 s *Service 143 } 144 145 func NewChannelsService(s *Service) *ChannelsService { 146 rs := &ChannelsService{s: s} 147 return rs 148 } 149 150 type ChannelsService struct { 151 s *Service 152 } 153 154 func NewChildrenService(s *Service) *ChildrenService { 155 rs := &ChildrenService{s: s} 156 return rs 157 } 158 159 type ChildrenService struct { 160 s *Service 161 } 162 163 func NewCommentsService(s *Service) *CommentsService { 164 rs := &CommentsService{s: s} 165 return rs 166 } 167 168 type CommentsService struct { 169 s *Service 170 } 171 172 func NewFilesService(s *Service) *FilesService { 173 rs := &FilesService{s: s} 174 return rs 175 } 176 177 type FilesService struct { 178 s *Service 179 } 180 181 func NewParentsService(s *Service) *ParentsService { 182 rs := &ParentsService{s: s} 183 return rs 184 } 185 186 type ParentsService struct { 187 s *Service 188 } 189 190 func NewPermissionsService(s *Service) *PermissionsService { 191 rs := &PermissionsService{s: s} 192 return rs 193 } 194 195 type PermissionsService struct { 196 s *Service 197 } 198 199 func NewPropertiesService(s *Service) *PropertiesService { 200 rs := &PropertiesService{s: s} 201 return rs 202 } 203 204 type PropertiesService struct { 205 s *Service 206 } 207 208 func NewRealtimeService(s *Service) *RealtimeService { 209 rs := &RealtimeService{s: s} 210 return rs 211 } 212 213 type RealtimeService struct { 214 s *Service 215 } 216 217 func NewRepliesService(s *Service) *RepliesService { 218 rs := &RepliesService{s: s} 219 return rs 220 } 221 222 type RepliesService struct { 223 s *Service 224 } 225 226 func NewRevisionsService(s *Service) *RevisionsService { 227 rs := &RevisionsService{s: s} 228 return rs 229 } 230 231 type RevisionsService struct { 232 s *Service 233 } 234 235 type About struct { 236 // AdditionalRoleInfo: Information about supported additional roles per 237 // file type. The most specific type takes precedence. 238 AdditionalRoleInfo []*AboutAdditionalRoleInfo `json:"additionalRoleInfo,omitempty"` 239 240 // DomainSharingPolicy: The domain sharing policy for the current user. 241 DomainSharingPolicy string `json:"domainSharingPolicy,omitempty"` 242 243 // Etag: The ETag of the item. 244 Etag string `json:"etag,omitempty"` 245 246 // ExportFormats: The allowable export formats. 247 ExportFormats []*AboutExportFormats `json:"exportFormats,omitempty"` 248 249 // Features: List of additional features enabled on this account. 250 Features []*AboutFeatures `json:"features,omitempty"` 251 252 // ImportFormats: The allowable import formats. 253 ImportFormats []*AboutImportFormats `json:"importFormats,omitempty"` 254 255 // IsCurrentAppInstalled: A boolean indicating whether the authenticated 256 // app is installed by the authenticated user. 257 IsCurrentAppInstalled bool `json:"isCurrentAppInstalled,omitempty"` 258 259 // Kind: This is always drive#about. 260 Kind string `json:"kind,omitempty"` 261 262 // LargestChangeId: The largest change id. 263 LargestChangeId int64 `json:"largestChangeId,omitempty,string"` 264 265 // MaxUploadSizes: List of max upload sizes for each file type. The most 266 // specific type takes precedence. 267 MaxUploadSizes []*AboutMaxUploadSizes `json:"maxUploadSizes,omitempty"` 268 269 // Name: The name of the current user. 270 Name string `json:"name,omitempty"` 271 272 // PermissionId: The current user's ID as visible in the permissions 273 // collection. 274 PermissionId string `json:"permissionId,omitempty"` 275 276 // QuotaBytesTotal: The total number of quota bytes. 277 QuotaBytesTotal int64 `json:"quotaBytesTotal,omitempty,string"` 278 279 // QuotaBytesUsed: The number of quota bytes used by Google Drive. 280 QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"` 281 282 // QuotaBytesUsedAggregate: The number of quota bytes used by all Google 283 // apps (Drive, Picasa, etc.). 284 QuotaBytesUsedAggregate int64 `json:"quotaBytesUsedAggregate,omitempty,string"` 285 286 // QuotaBytesUsedInTrash: The number of quota bytes used by trashed 287 // items. 288 QuotaBytesUsedInTrash int64 `json:"quotaBytesUsedInTrash,omitempty,string"` 289 290 // RemainingChangeIds: The number of remaining change ids. 291 RemainingChangeIds int64 `json:"remainingChangeIds,omitempty,string"` 292 293 // RootFolderId: The id of the root folder. 294 RootFolderId string `json:"rootFolderId,omitempty"` 295 296 // SelfLink: A link back to this item. 297 SelfLink string `json:"selfLink,omitempty"` 298 299 // User: The authenticated user. 300 User *User `json:"user,omitempty"` 301 } 302 303 type AboutAdditionalRoleInfo struct { 304 // RoleSets: The supported additional roles per primary role. 305 RoleSets []*AboutAdditionalRoleInfoRoleSets `json:"roleSets,omitempty"` 306 307 // Type: The content type that this additional role info applies to. 308 Type string `json:"type,omitempty"` 309 } 310 311 type AboutAdditionalRoleInfoRoleSets struct { 312 // AdditionalRoles: The supported additional roles with the primary 313 // role. 314 AdditionalRoles []string `json:"additionalRoles,omitempty"` 315 316 // PrimaryRole: A primary permission role. 317 PrimaryRole string `json:"primaryRole,omitempty"` 318 } 319 320 type AboutExportFormats struct { 321 // Source: The content type to convert from. 322 Source string `json:"source,omitempty"` 323 324 // Targets: The possible content types to convert to. 325 Targets []string `json:"targets,omitempty"` 326 } 327 328 type AboutFeatures struct { 329 // FeatureName: The name of the feature. 330 FeatureName string `json:"featureName,omitempty"` 331 332 // FeatureRate: The request limit rate for this feature, in queries per 333 // second. 334 FeatureRate float64 `json:"featureRate,omitempty"` 335 } 336 337 type AboutImportFormats struct { 338 // Source: The imported file's content type to convert from. 339 Source string `json:"source,omitempty"` 340 341 // Targets: The possible content types to convert to. 342 Targets []string `json:"targets,omitempty"` 343 } 344 345 type AboutMaxUploadSizes struct { 346 // Size: The max upload size for this type. 347 Size int64 `json:"size,omitempty,string"` 348 349 // Type: The file type. 350 Type string `json:"type,omitempty"` 351 } 352 353 type App struct { 354 // Authorized: Whether the app is authorized to access data on the 355 // user's Drive. 356 Authorized bool `json:"authorized,omitempty"` 357 358 // Icons: The various icons for the app. 359 Icons []*AppIcons `json:"icons,omitempty"` 360 361 // Id: The ID of the app. 362 Id string `json:"id,omitempty"` 363 364 // Installed: Whether the app is installed. 365 Installed bool `json:"installed,omitempty"` 366 367 // Kind: This is always drive#app. 368 Kind string `json:"kind,omitempty"` 369 370 // LongDescription: A long description of the app. 371 LongDescription string `json:"longDescription,omitempty"` 372 373 // Name: The name of the app. 374 Name string `json:"name,omitempty"` 375 376 // ObjectType: The type of object this app creates (e.g. Chart). If 377 // empty, the app name should be used instead. 378 ObjectType string `json:"objectType,omitempty"` 379 380 // OpenUrlTemplate: The template url for opening files with this app. 381 // The template will contain {ids} and/or {exportIds} to be replaced by 382 // the actual file ids. 383 OpenUrlTemplate string `json:"openUrlTemplate,omitempty"` 384 385 // PrimaryFileExtensions: The list of primary file extensions. 386 PrimaryFileExtensions []string `json:"primaryFileExtensions,omitempty"` 387 388 // PrimaryMimeTypes: The list of primary mime types. 389 PrimaryMimeTypes []string `json:"primaryMimeTypes,omitempty"` 390 391 // ProductId: The ID of the product listing for this app. 392 ProductId string `json:"productId,omitempty"` 393 394 // ProductUrl: A link to the product listing for this app. 395 ProductUrl string `json:"productUrl,omitempty"` 396 397 // SecondaryFileExtensions: The list of secondary file extensions. 398 SecondaryFileExtensions []string `json:"secondaryFileExtensions,omitempty"` 399 400 // SecondaryMimeTypes: The list of secondary mime types. 401 SecondaryMimeTypes []string `json:"secondaryMimeTypes,omitempty"` 402 403 // ShortDescription: A short description of the app. 404 ShortDescription string `json:"shortDescription,omitempty"` 405 406 // SupportsCreate: Whether this app supports creating new objects. 407 SupportsCreate bool `json:"supportsCreate,omitempty"` 408 409 // SupportsImport: Whether this app supports importing Google Docs. 410 SupportsImport bool `json:"supportsImport,omitempty"` 411 412 // SupportsMultiOpen: Whether this app supports opening more than one 413 // file. 414 SupportsMultiOpen bool `json:"supportsMultiOpen,omitempty"` 415 416 // UseByDefault: Whether the app is selected as the default handler for 417 // the types it supports. 418 UseByDefault bool `json:"useByDefault,omitempty"` 419 } 420 421 type AppIcons struct { 422 // Category: Category of the icon. Allowed values are: 423 // - application - 424 // icon for the application 425 // - document - icon for a file associated 426 // with the app 427 // - documentShared - icon for a shared file associated 428 // with the app 429 Category string `json:"category,omitempty"` 430 431 // IconUrl: URL for the icon. 432 IconUrl string `json:"iconUrl,omitempty"` 433 434 // Size: Size of the icon. Represented as the maximum of the width and 435 // height. 436 Size int64 `json:"size,omitempty"` 437 } 438 439 type AppList struct { 440 // Etag: The ETag of the list. 441 Etag string `json:"etag,omitempty"` 442 443 // Items: The actual list of apps. 444 Items []*App `json:"items,omitempty"` 445 446 // Kind: This is always drive#appList. 447 Kind string `json:"kind,omitempty"` 448 449 // SelfLink: A link back to this list. 450 SelfLink string `json:"selfLink,omitempty"` 451 } 452 453 type Change struct { 454 // Deleted: Whether the file has been deleted. 455 Deleted bool `json:"deleted,omitempty"` 456 457 // File: The updated state of the file. Present if the file has not been 458 // deleted. 459 File *File `json:"file,omitempty"` 460 461 // FileId: The ID of the file associated with this change. 462 FileId string `json:"fileId,omitempty"` 463 464 // Id: The ID of the change. 465 Id int64 `json:"id,omitempty,string"` 466 467 // Kind: This is always drive#change. 468 Kind string `json:"kind,omitempty"` 469 470 // SelfLink: A link back to this change. 471 SelfLink string `json:"selfLink,omitempty"` 472 } 473 474 type ChangeList struct { 475 // Etag: The ETag of the list. 476 Etag string `json:"etag,omitempty"` 477 478 // Items: The actual list of changes. 479 Items []*Change `json:"items,omitempty"` 480 481 // Kind: This is always drive#changeList. 482 Kind string `json:"kind,omitempty"` 483 484 // LargestChangeId: The current largest change ID. 485 LargestChangeId int64 `json:"largestChangeId,omitempty,string"` 486 487 // NextLink: A link to the next page of changes. 488 NextLink string `json:"nextLink,omitempty"` 489 490 // NextPageToken: The page token for the next page of changes. 491 NextPageToken string `json:"nextPageToken,omitempty"` 492 493 // SelfLink: A link back to this list. 494 SelfLink string `json:"selfLink,omitempty"` 495 } 496 497 type Channel struct { 498 // Address: The address of the receiving entity where events are 499 // delivered. Specific to the channel type. 500 Address string `json:"address,omitempty"` 501 502 // Expiration: The expiration instant for this channel if it is defined. 503 Expiration int64 `json:"expiration,omitempty,string"` 504 505 // Id: A UUID for the channel 506 Id string `json:"id,omitempty"` 507 508 // Kind: A channel watching an API resource 509 Kind string `json:"kind,omitempty"` 510 511 // Params: Additional parameters controlling delivery channel behavior 512 Params *ChannelParams `json:"params,omitempty"` 513 514 // ResourceId: An opaque id that identifies the resource that is being 515 // watched. Stable across different API versions 516 ResourceId string `json:"resourceId,omitempty"` 517 518 // ResourceUri: The canonicalized ID of the watched resource. 519 ResourceUri string `json:"resourceUri,omitempty"` 520 521 // Token: An arbitrary string associated with the channel that is 522 // delivered to the target address with each event delivered over this 523 // channel. 524 Token string `json:"token,omitempty"` 525 526 // Type: The type of delivery mechanism used by this channel 527 Type string `json:"type,omitempty"` 528 } 529 530 type ChannelParams struct { 531 } 532 533 type ChildList struct { 534 // Etag: The ETag of the list. 535 Etag string `json:"etag,omitempty"` 536 537 // Items: The actual list of children. 538 Items []*ChildReference `json:"items,omitempty"` 539 540 // Kind: This is always drive#childList. 541 Kind string `json:"kind,omitempty"` 542 543 // NextLink: A link to the next page of children. 544 NextLink string `json:"nextLink,omitempty"` 545 546 // NextPageToken: The page token for the next page of children. 547 NextPageToken string `json:"nextPageToken,omitempty"` 548 549 // SelfLink: A link back to this list. 550 SelfLink string `json:"selfLink,omitempty"` 551 } 552 553 type ChildReference struct { 554 // ChildLink: A link to the child. 555 ChildLink string `json:"childLink,omitempty"` 556 557 // Id: The ID of the child. 558 Id string `json:"id,omitempty"` 559 560 // Kind: This is always drive#childReference. 561 Kind string `json:"kind,omitempty"` 562 563 // SelfLink: A link back to this reference. 564 SelfLink string `json:"selfLink,omitempty"` 565 } 566 567 type Comment struct { 568 // Anchor: A region of the document represented as a JSON string. See 569 // anchor documentation for details on how to define and interpret 570 // anchor properties. 571 Anchor string `json:"anchor,omitempty"` 572 573 // Author: The user who wrote this comment. 574 Author *User `json:"author,omitempty"` 575 576 // CommentId: The ID of the comment. 577 CommentId string `json:"commentId,omitempty"` 578 579 // Content: The plain text content used to create this comment. This is 580 // not HTML safe and should only be used as a starting point to make 581 // edits to a comment's content. 582 Content string `json:"content,omitempty"` 583 584 // Context: The context of the file which is being commented on. 585 Context *CommentContext `json:"context,omitempty"` 586 587 // CreatedDate: The date when this comment was first created. 588 CreatedDate string `json:"createdDate,omitempty"` 589 590 // Deleted: Whether this comment has been deleted. If a comment has been 591 // deleted the content will be cleared and this will only represent a 592 // comment that once existed. 593 Deleted bool `json:"deleted,omitempty"` 594 595 // FileId: The file which this comment is addressing. 596 FileId string `json:"fileId,omitempty"` 597 598 // FileTitle: The title of the file which this comment is addressing. 599 FileTitle string `json:"fileTitle,omitempty"` 600 601 // HtmlContent: HTML formatted content for this comment. 602 HtmlContent string `json:"htmlContent,omitempty"` 603 604 // Kind: This is always drive#comment. 605 Kind string `json:"kind,omitempty"` 606 607 // ModifiedDate: The date when this comment or any of its replies were 608 // last modified. 609 ModifiedDate string `json:"modifiedDate,omitempty"` 610 611 // Replies: Replies to this post. 612 Replies []*CommentReply `json:"replies,omitempty"` 613 614 // SelfLink: A link back to this comment. 615 SelfLink string `json:"selfLink,omitempty"` 616 617 // Status: The status of this comment. Status can be changed by posting 618 // a reply to a comment with the desired status. 619 // - "open" - The 620 // comment is still open. 621 // - "resolved" - The comment has been resolved 622 // by one of its replies. 623 Status string `json:"status,omitempty"` 624 } 625 626 type CommentContext struct { 627 // Type: The MIME type of the context snippet. 628 Type string `json:"type,omitempty"` 629 630 // Value: Data representation of the segment of the file being commented 631 // on. In the case of a text file for example, this would be the actual 632 // text that the comment is about. 633 Value string `json:"value,omitempty"` 634 } 635 636 type CommentList struct { 637 // Items: List of comments. 638 Items []*Comment `json:"items,omitempty"` 639 640 // Kind: This is always drive#commentList. 641 Kind string `json:"kind,omitempty"` 642 643 // NextLink: A link to the next page of comments. 644 NextLink string `json:"nextLink,omitempty"` 645 646 // NextPageToken: The token to use to request the next page of results. 647 NextPageToken string `json:"nextPageToken,omitempty"` 648 649 // SelfLink: A link back to this list. 650 SelfLink string `json:"selfLink,omitempty"` 651 } 652 653 type CommentReply struct { 654 // Author: The user who wrote this reply. 655 Author *User `json:"author,omitempty"` 656 657 // Content: The plain text content used to create this reply. This is 658 // not HTML safe and should only be used as a starting point to make 659 // edits to a reply's content. This field is required on inserts if no 660 // verb is specified (resolve/reopen). 661 Content string `json:"content,omitempty"` 662 663 // CreatedDate: The date when this reply was first created. 664 CreatedDate string `json:"createdDate,omitempty"` 665 666 // Deleted: Whether this reply has been deleted. If a reply has been 667 // deleted the content will be cleared and this will only represent a 668 // reply that once existed. 669 Deleted bool `json:"deleted,omitempty"` 670 671 // HtmlContent: HTML formatted content for this reply. 672 HtmlContent string `json:"htmlContent,omitempty"` 673 674 // Kind: This is always drive#commentReply. 675 Kind string `json:"kind,omitempty"` 676 677 // ModifiedDate: The date when this reply was last modified. 678 ModifiedDate string `json:"modifiedDate,omitempty"` 679 680 // ReplyId: The ID of the reply. 681 ReplyId string `json:"replyId,omitempty"` 682 683 // Verb: The action this reply performed to the parent comment. When 684 // creating a new reply this is the action to be perform to the parent 685 // comment. Possible values are: 686 // - "resolve" - To resolve a comment. 687 // 688 // - "reopen" - To reopen (un-resolve) a comment. 689 Verb string `json:"verb,omitempty"` 690 } 691 692 type CommentReplyList struct { 693 // Items: List of reply. 694 Items []*CommentReply `json:"items,omitempty"` 695 696 // Kind: This is always drive#commentReplyList. 697 Kind string `json:"kind,omitempty"` 698 699 // NextLink: A link to the next page of replies. 700 NextLink string `json:"nextLink,omitempty"` 701 702 // NextPageToken: The token to use to request the next page of results. 703 NextPageToken string `json:"nextPageToken,omitempty"` 704 705 // SelfLink: A link back to this list. 706 SelfLink string `json:"selfLink,omitempty"` 707 } 708 709 type File struct { 710 // AlternateLink: A link for opening the file in using a relevant Google 711 // editor or viewer. 712 AlternateLink string `json:"alternateLink,omitempty"` 713 714 // AppDataContents: Whether this file is in the appdata folder. 715 AppDataContents bool `json:"appDataContents,omitempty"` 716 717 // CreatedDate: Create time for this file (formatted ISO8601 timestamp). 718 CreatedDate string `json:"createdDate,omitempty"` 719 720 // DefaultOpenWithLink: A link to open this file with the user's default 721 // app for this file. Only populated when the drive.apps.readonly scope 722 // is used. 723 DefaultOpenWithLink string `json:"defaultOpenWithLink,omitempty"` 724 725 // Description: A short description of the file. 726 Description string `json:"description,omitempty"` 727 728 // DownloadUrl: Short lived download URL for the file. This is only 729 // populated for files with content stored in Drive. 730 DownloadUrl string `json:"downloadUrl,omitempty"` 731 732 // Editable: Whether the file can be edited by the current user. 733 Editable bool `json:"editable,omitempty"` 734 735 // EmbedLink: A link for embedding the file. 736 EmbedLink string `json:"embedLink,omitempty"` 737 738 // Etag: ETag of the file. 739 Etag string `json:"etag,omitempty"` 740 741 // ExplicitlyTrashed: Whether this file has been explicitly trashed, as 742 // opposed to recursively trashed. This will only be populated if the 743 // file is trashed. 744 ExplicitlyTrashed bool `json:"explicitlyTrashed,omitempty"` 745 746 // ExportLinks: Links for exporting Google Docs to specific formats. 747 ExportLinks *FileExportLinks `json:"exportLinks,omitempty"` 748 749 // FileExtension: The file extension used when downloading this file. 750 // This field is read only. To set the extension, include it in the 751 // title when creating the file. This is only populated for files with 752 // content stored in Drive. 753 FileExtension string `json:"fileExtension,omitempty"` 754 755 // FileSize: The size of the file in bytes. This is only populated for 756 // files with content stored in Drive. 757 FileSize int64 `json:"fileSize,omitempty,string"` 758 759 // HeadRevisionId: The ID of the file's head revision. This will only be 760 // populated for files with content stored in Drive. 761 HeadRevisionId string `json:"headRevisionId,omitempty"` 762 763 // IconLink: A link to the file's icon. 764 IconLink string `json:"iconLink,omitempty"` 765 766 // Id: The ID of the file. 767 Id string `json:"id,omitempty"` 768 769 // ImageMediaMetadata: Metadata about image media. This will only be 770 // present for image types, and its contents will depend on what can be 771 // parsed from the image content. 772 ImageMediaMetadata *FileImageMediaMetadata `json:"imageMediaMetadata,omitempty"` 773 774 // IndexableText: Indexable text attributes for the file (can only be 775 // written) 776 IndexableText *FileIndexableText `json:"indexableText,omitempty"` 777 778 // Kind: The type of file. This is always drive#file. 779 Kind string `json:"kind,omitempty"` 780 781 // Labels: A group of labels for the file. 782 Labels *FileLabels `json:"labels,omitempty"` 783 784 // LastModifyingUser: The last user to modify this file. 785 LastModifyingUser *User `json:"lastModifyingUser,omitempty"` 786 787 // LastModifyingUserName: Name of the last user to modify this file. 788 LastModifyingUserName string `json:"lastModifyingUserName,omitempty"` 789 790 // LastViewedByMeDate: Last time this file was viewed by the user 791 // (formatted RFC 3339 timestamp). 792 LastViewedByMeDate string `json:"lastViewedByMeDate,omitempty"` 793 794 // Md5Checksum: An MD5 checksum for the content of this file. This is 795 // populated only for files with content stored in Drive. 796 Md5Checksum string `json:"md5Checksum,omitempty"` 797 798 // MimeType: The MIME type of the file. This is only mutable on update 799 // when uploading new content. This field can be left blank, and the 800 // mimetype will be determined from the uploaded content's MIME type. 801 MimeType string `json:"mimeType,omitempty"` 802 803 // ModifiedByMeDate: Last time this file was modified by the user 804 // (formatted RFC 3339 timestamp). Note that setting modifiedDate will 805 // also update the modifiedByMe date for the user which set the date. 806 ModifiedByMeDate string `json:"modifiedByMeDate,omitempty"` 807 808 // ModifiedDate: Last time this file was modified by anyone (formatted 809 // RFC 3339 timestamp). This is only mutable on update when the 810 // setModifiedDate parameter is set. 811 ModifiedDate string `json:"modifiedDate,omitempty"` 812 813 // OpenWithLinks: A map of the id of each of the user's apps to a link 814 // to open this file with that app. Only populated when the 815 // drive.apps.readonly scope is used. 816 OpenWithLinks *FileOpenWithLinks `json:"openWithLinks,omitempty"` 817 818 // OriginalFilename: The original filename if the file was uploaded 819 // manually, or the original title if the file was inserted through the 820 // API. Note that renames of the title will not change the original 821 // filename. This will only be populated on files with content stored in 822 // Drive. 823 OriginalFilename string `json:"originalFilename,omitempty"` 824 825 // OwnerNames: Name(s) of the owner(s) of this file. 826 OwnerNames []string `json:"ownerNames,omitempty"` 827 828 // Owners: The owner(s) of this file. 829 Owners []*User `json:"owners,omitempty"` 830 831 // Parents: Collection of parent folders which contain this 832 // file. 833 // Setting this field will put the file in all of the provided 834 // folders. On insert, if no folders are provided, the file will be 835 // placed in the default root folder. 836 Parents []*ParentReference `json:"parents,omitempty"` 837 838 // QuotaBytesUsed: The number of quota bytes used by this file. 839 QuotaBytesUsed int64 `json:"quotaBytesUsed,omitempty,string"` 840 841 // SelfLink: A link back to this file. 842 SelfLink string `json:"selfLink,omitempty"` 843 844 // Shared: Whether the file has been shared. 845 Shared bool `json:"shared,omitempty"` 846 847 // SharedWithMeDate: Time at which this file was shared with the user 848 // (formatted RFC 3339 timestamp). 849 SharedWithMeDate string `json:"sharedWithMeDate,omitempty"` 850 851 // Thumbnail: Thumbnail for the file. Only accepted on upload and for 852 // files that are not already thumbnailed by Google. 853 Thumbnail *FileThumbnail `json:"thumbnail,omitempty"` 854 855 // ThumbnailLink: A link to the file's thumbnail. 856 ThumbnailLink string `json:"thumbnailLink,omitempty"` 857 858 // Title: The title of this file. 859 Title string `json:"title,omitempty"` 860 861 // UserPermission: The permissions for the authenticated user on this 862 // file. 863 UserPermission *Permission `json:"userPermission,omitempty"` 864 865 // WebContentLink: A link for downloading the content of the file in a 866 // browser using cookie based authentication. In cases where the content 867 // is shared publicly, the content can be downloaded without any 868 // credentials. 869 WebContentLink string `json:"webContentLink,omitempty"` 870 871 // WebViewLink: A link only available on public folders for viewing 872 // their static web assets (HTML, CSS, JS, etc) via Google Drive's 873 // Website Hosting. 874 WebViewLink string `json:"webViewLink,omitempty"` 875 876 // WritersCanShare: Whether writers can share the document with other 877 // users. 878 WritersCanShare bool `json:"writersCanShare,omitempty"` 879 } 880 881 type FileExportLinks struct { 882 } 883 884 type FileImageMediaMetadata struct { 885 // Aperture: The aperture used to create the photo (f-number). 886 Aperture float64 `json:"aperture,omitempty"` 887 888 // CameraMake: The make of the camera used to create the photo. 889 CameraMake string `json:"cameraMake,omitempty"` 890 891 // CameraModel: The model of the camera used to create the photo. 892 CameraModel string `json:"cameraModel,omitempty"` 893 894 // ColorSpace: The color space of the photo. 895 ColorSpace string `json:"colorSpace,omitempty"` 896 897 // Date: The date and time the photo was taken (EXIF format timestamp). 898 Date string `json:"date,omitempty"` 899 900 // ExposureBias: The exposure bias of the photo (APEX value). 901 ExposureBias float64 `json:"exposureBias,omitempty"` 902 903 // ExposureMode: The exposure mode used to create the photo. 904 ExposureMode string `json:"exposureMode,omitempty"` 905 906 // ExposureTime: The length of the exposure, in seconds. 907 ExposureTime float64 `json:"exposureTime,omitempty"` 908 909 // FlashUsed: Whether a flash was used to create the photo. 910 FlashUsed bool `json:"flashUsed,omitempty"` 911 912 // FocalLength: The focal length used to create the photo, in 913 // millimeters. 914 FocalLength float64 `json:"focalLength,omitempty"` 915 916 // Height: The height of the image in pixels. 917 Height int64 `json:"height,omitempty"` 918 919 // IsoSpeed: The ISO speed used to create the photo. 920 IsoSpeed int64 `json:"isoSpeed,omitempty"` 921 922 // Lens: The lens used to create the photo. 923 Lens string `json:"lens,omitempty"` 924 925 // Location: Geographic location information stored in the image. 926 Location *FileImageMediaMetadataLocation `json:"location,omitempty"` 927 928 // MaxApertureValue: The smallest f-number of the lens at the focal 929 // length used to create the photo (APEX value). 930 MaxApertureValue float64 `json:"maxApertureValue,omitempty"` 931 932 // MeteringMode: The metering mode used to create the photo. 933 MeteringMode string `json:"meteringMode,omitempty"` 934 935 // Rotation: The rotation in clockwise degrees from the image's original 936 // orientation. 937 Rotation int64 `json:"rotation,omitempty"` 938 939 // Sensor: The type of sensor used to create the photo. 940 Sensor string `json:"sensor,omitempty"` 941 942 // SubjectDistance: The distance to the subject of the photo, in meters. 943 SubjectDistance int64 `json:"subjectDistance,omitempty"` 944 945 // WhiteBalance: The white balance mode used to create the photo. 946 WhiteBalance string `json:"whiteBalance,omitempty"` 947 948 // Width: The width of the image in pixels. 949 Width int64 `json:"width,omitempty"` 950 } 951 952 type FileImageMediaMetadataLocation struct { 953 // Altitude: The altitude stored in the image. 954 Altitude float64 `json:"altitude,omitempty"` 955 956 // Latitude: The latitude stored in the image. 957 Latitude float64 `json:"latitude,omitempty"` 958 959 // Longitude: The longitude stored in the image. 960 Longitude float64 `json:"longitude,omitempty"` 961 } 962 963 type FileIndexableText struct { 964 // Text: The text to be indexed for this file. 965 Text string `json:"text,omitempty"` 966 } 967 968 type FileLabels struct { 969 // Hidden: Whether this file is hidden from the user. 970 Hidden bool `json:"hidden,omitempty"` 971 972 // Restricted: Whether viewers are prevented from downloading this file. 973 Restricted bool `json:"restricted,omitempty"` 974 975 // Starred: Whether this file is starred by the user. 976 Starred bool `json:"starred,omitempty"` 977 978 // Trashed: Whether this file has been trashed. 979 Trashed bool `json:"trashed,omitempty"` 980 981 // Viewed: Whether this file has been viewed by this user. 982 Viewed bool `json:"viewed,omitempty"` 983 } 984 985 type FileOpenWithLinks struct { 986 } 987 988 type FileThumbnail struct { 989 // Image: The URL-safe Base64 encoded bytes of the thumbnail image. 990 Image string `json:"image,omitempty"` 991 992 // MimeType: The MIME type of the thumbnail. 993 MimeType string `json:"mimeType,omitempty"` 994 } 995 996 type FileList struct { 997 // Etag: The ETag of the list. 998 Etag string `json:"etag,omitempty"` 999 1000 // Items: The actual list of files. 1001 Items []*File `json:"items,omitempty"` 1002 1003 // Kind: This is always drive#fileList. 1004 Kind string `json:"kind,omitempty"` 1005 1006 // NextLink: A link to the next page of files. 1007 NextLink string `json:"nextLink,omitempty"` 1008 1009 // NextPageToken: The page token for the next page of files. 1010 NextPageToken string `json:"nextPageToken,omitempty"` 1011 1012 // SelfLink: A link back to this list. 1013 SelfLink string `json:"selfLink,omitempty"` 1014 } 1015 1016 type ParentList struct { 1017 // Etag: The ETag of the list. 1018 Etag string `json:"etag,omitempty"` 1019 1020 // Items: The actual list of parents. 1021 Items []*ParentReference `json:"items,omitempty"` 1022 1023 // Kind: This is always drive#parentList. 1024 Kind string `json:"kind,omitempty"` 1025 1026 // SelfLink: A link back to this list. 1027 SelfLink string `json:"selfLink,omitempty"` 1028 } 1029 1030 type ParentReference struct { 1031 // Id: The ID of the parent. 1032 Id string `json:"id,omitempty"` 1033 1034 // IsRoot: Whether or not the parent is the root folder. 1035 IsRoot bool `json:"isRoot,omitempty"` 1036 1037 // Kind: This is always drive#parentReference. 1038 Kind string `json:"kind,omitempty"` 1039 1040 // ParentLink: A link to the parent. 1041 ParentLink string `json:"parentLink,omitempty"` 1042 1043 // SelfLink: A link back to this reference. 1044 SelfLink string `json:"selfLink,omitempty"` 1045 } 1046 1047 type Permission struct { 1048 // AdditionalRoles: Additional roles for this user. Only commenter is 1049 // currently allowed. 1050 AdditionalRoles []string `json:"additionalRoles,omitempty"` 1051 1052 // AuthKey: The authkey parameter required for this permission. 1053 AuthKey string `json:"authKey,omitempty"` 1054 1055 // Etag: The ETag of the permission. 1056 Etag string `json:"etag,omitempty"` 1057 1058 // Id: The ID of the permission. 1059 Id string `json:"id,omitempty"` 1060 1061 // Kind: This is always drive#permission. 1062 Kind string `json:"kind,omitempty"` 1063 1064 // Name: The name for this permission. 1065 Name string `json:"name,omitempty"` 1066 1067 // PhotoLink: A link to the profile photo, if available. 1068 PhotoLink string `json:"photoLink,omitempty"` 1069 1070 // Role: The primary role for this user. Allowed values are: 1071 // - owner 1072 // 1073 // - reader 1074 // - writer 1075 Role string `json:"role,omitempty"` 1076 1077 // SelfLink: A link back to this permission. 1078 SelfLink string `json:"selfLink,omitempty"` 1079 1080 // Type: The account type. Allowed values are: 1081 // - user 1082 // - group 1083 // - 1084 // domain 1085 // - anyone 1086 Type string `json:"type,omitempty"` 1087 1088 // Value: The email address or domain name for the entity. This is used 1089 // during inserts and is not populated in responses. 1090 Value string `json:"value,omitempty"` 1091 1092 // WithLink: Whether the link is required for this permission. 1093 WithLink bool `json:"withLink,omitempty"` 1094 } 1095 1096 type PermissionList struct { 1097 // Etag: The ETag of the list. 1098 Etag string `json:"etag,omitempty"` 1099 1100 // Items: The actual list of permissions. 1101 Items []*Permission `json:"items,omitempty"` 1102 1103 // Kind: This is always drive#permissionList. 1104 Kind string `json:"kind,omitempty"` 1105 1106 // SelfLink: A link back to this list. 1107 SelfLink string `json:"selfLink,omitempty"` 1108 } 1109 1110 type Property struct { 1111 // Etag: ETag of the property. 1112 Etag string `json:"etag,omitempty"` 1113 1114 // Key: The key of this property. 1115 Key string `json:"key,omitempty"` 1116 1117 // Kind: This is always drive#property. 1118 Kind string `json:"kind,omitempty"` 1119 1120 // SelfLink: The link back to this property. 1121 SelfLink string `json:"selfLink,omitempty"` 1122 1123 // Value: The value of this property. 1124 Value string `json:"value,omitempty"` 1125 1126 // Visibility: The visibility of this property. 1127 Visibility string `json:"visibility,omitempty"` 1128 } 1129 1130 type PropertyList struct { 1131 // Etag: The ETag of the list. 1132 Etag string `json:"etag,omitempty"` 1133 1134 // Items: The list of properties. 1135 Items []*Property `json:"items,omitempty"` 1136 1137 // Kind: This is always drive#propertyList. 1138 Kind string `json:"kind,omitempty"` 1139 1140 // SelfLink: The link back to this list. 1141 SelfLink string `json:"selfLink,omitempty"` 1142 } 1143 1144 type Revision struct { 1145 // DownloadUrl: Short term download URL for the file. This will only be 1146 // populated on files with content stored in Drive. 1147 DownloadUrl string `json:"downloadUrl,omitempty"` 1148 1149 // Etag: The ETag of the revision. 1150 Etag string `json:"etag,omitempty"` 1151 1152 // ExportLinks: Links for exporting Google Docs to specific formats. 1153 ExportLinks *RevisionExportLinks `json:"exportLinks,omitempty"` 1154 1155 // FileSize: The size of the revision in bytes. This will only be 1156 // populated on files with content stored in Drive. 1157 FileSize int64 `json:"fileSize,omitempty,string"` 1158 1159 // Id: The ID of the revision. 1160 Id string `json:"id,omitempty"` 1161 1162 // Kind: This is always drive#revision. 1163 Kind string `json:"kind,omitempty"` 1164 1165 // LastModifyingUser: The last user to modify this revision. 1166 LastModifyingUser *User `json:"lastModifyingUser,omitempty"` 1167 1168 // LastModifyingUserName: Name of the last user to modify this revision. 1169 LastModifyingUserName string `json:"lastModifyingUserName,omitempty"` 1170 1171 // Md5Checksum: An MD5 checksum for the content of this revision. This 1172 // will only be populated on files with content stored in Drive. 1173 Md5Checksum string `json:"md5Checksum,omitempty"` 1174 1175 // MimeType: The MIME type of the revision. 1176 MimeType string `json:"mimeType,omitempty"` 1177 1178 // ModifiedDate: Last time this revision was modified (formatted RFC 1179 // 3339 timestamp). 1180 ModifiedDate string `json:"modifiedDate,omitempty"` 1181 1182 // OriginalFilename: The original filename when this revision was 1183 // created. This will only be populated on files with content stored in 1184 // Drive. 1185 OriginalFilename string `json:"originalFilename,omitempty"` 1186 1187 // Pinned: Whether this revision is pinned to prevent automatic purging. 1188 // This will only be populated and can only be modified on files with 1189 // content stored in Drive which are not Google Docs. Revisions can also 1190 // be pinned when they are created through the 1191 // drive.files.insert/update/copy by using the pinned query parameter. 1192 Pinned bool `json:"pinned,omitempty"` 1193 1194 // PublishAuto: Whether subsequent revisions will be automatically 1195 // republished. This is only populated and can only be modified for 1196 // Google Docs. 1197 PublishAuto bool `json:"publishAuto,omitempty"` 1198 1199 // Published: Whether this revision is published. This is only populated 1200 // and can only be modified for Google Docs. 1201 Published bool `json:"published,omitempty"` 1202 1203 // PublishedLink: A link to the published revision. 1204 PublishedLink string `json:"publishedLink,omitempty"` 1205 1206 // PublishedOutsideDomain: Whether this revision is published outside 1207 // the domain. This is only populated and can only be modified for 1208 // Google Docs. 1209 PublishedOutsideDomain bool `json:"publishedOutsideDomain,omitempty"` 1210 1211 // SelfLink: A link back to this revision. 1212 SelfLink string `json:"selfLink,omitempty"` 1213 } 1214 1215 type RevisionExportLinks struct { 1216 } 1217 1218 type RevisionList struct { 1219 // Etag: The ETag of the list. 1220 Etag string `json:"etag,omitempty"` 1221 1222 // Items: The actual list of revisions. 1223 Items []*Revision `json:"items,omitempty"` 1224 1225 // Kind: This is always drive#revisionList. 1226 Kind string `json:"kind,omitempty"` 1227 1228 // SelfLink: A link back to this list. 1229 SelfLink string `json:"selfLink,omitempty"` 1230 } 1231 1232 type User struct { 1233 // DisplayName: A plain text displayable name for this user. 1234 DisplayName string `json:"displayName,omitempty"` 1235 1236 // IsAuthenticatedUser: Whether this user is the same as the 1237 // authenticated user for whom the request was made. 1238 IsAuthenticatedUser bool `json:"isAuthenticatedUser,omitempty"` 1239 1240 // Kind: This is always drive#user. 1241 Kind string `json:"kind,omitempty"` 1242 1243 // PermissionId: The user's ID as visible in the permissions collection. 1244 PermissionId string `json:"permissionId,omitempty"` 1245 1246 // Picture: The user's profile picture. 1247 Picture *UserPicture `json:"picture,omitempty"` 1248 } 1249 1250 type UserPicture struct { 1251 // Url: A URL that points to a profile picture of this user. 1252 Url string `json:"url,omitempty"` 1253 } 1254 1255 // method id "drive.about.get": 1256 1257 type AboutGetCall struct { 1258 s *Service 1259 opt_ map[string]interface{} 1260 } 1261 1262 // Get: Gets the information about the current user along with Drive API 1263 // settings 1264 func (r *AboutService) Get() *AboutGetCall { 1265 c := &AboutGetCall{s: r.s, opt_: make(map[string]interface{})} 1266 return c 1267 } 1268 1269 // IncludeSubscribed sets the optional parameter "includeSubscribed": 1270 // When calculating the number of remaining change IDs, whether to 1271 // include shared files and public files the user has opened. When set 1272 // to false, this counts only change IDs for owned files and any shared 1273 // or public files that the user has explictly added to a folder in 1274 // Drive. 1275 func (c *AboutGetCall) IncludeSubscribed(includeSubscribed bool) *AboutGetCall { 1276 c.opt_["includeSubscribed"] = includeSubscribed 1277 return c 1278 } 1279 1280 // MaxChangeIdCount sets the optional parameter "maxChangeIdCount": 1281 // Maximum number of remaining change IDs to count 1282 func (c *AboutGetCall) MaxChangeIdCount(maxChangeIdCount int64) *AboutGetCall { 1283 c.opt_["maxChangeIdCount"] = maxChangeIdCount 1284 return c 1285 } 1286 1287 // StartChangeId sets the optional parameter "startChangeId": Change ID 1288 // to start counting from when calculating number of remaining change 1289 // IDs 1290 func (c *AboutGetCall) StartChangeId(startChangeId int64) *AboutGetCall { 1291 c.opt_["startChangeId"] = startChangeId 1292 return c 1293 } 1294 1295 func (c *AboutGetCall) Do() (*About, error) { 1296 var body io.Reader = nil 1297 params := make(url.Values) 1298 params.Set("alt", "json") 1299 if v, ok := c.opt_["includeSubscribed"]; ok { 1300 params.Set("includeSubscribed", fmt.Sprintf("%v", v)) 1301 } 1302 if v, ok := c.opt_["maxChangeIdCount"]; ok { 1303 params.Set("maxChangeIdCount", fmt.Sprintf("%v", v)) 1304 } 1305 if v, ok := c.opt_["startChangeId"]; ok { 1306 params.Set("startChangeId", fmt.Sprintf("%v", v)) 1307 } 1308 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "about") 1309 urls += "?" + params.Encode() 1310 req, _ := http.NewRequest("GET", urls, body) 1311 googleapi.SetOpaque(req.URL) 1312 req.Header.Set("User-Agent", "google-api-go-client/0.5") 1313 res, err := c.s.client.Do(req) 1314 if err != nil { 1315 return nil, err 1316 } 1317 defer res.Body.Close() 1318 if err := googleapi.CheckResponse(res); err != nil { 1319 return nil, err 1320 } 1321 ret := new(About) 1322 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 1323 return nil, err 1324 } 1325 return ret, nil 1326 // { 1327 // "description": "Gets the information about the current user along with Drive API settings", 1328 // "httpMethod": "GET", 1329 // "id": "drive.about.get", 1330 // "parameters": { 1331 // "includeSubscribed": { 1332 // "default": "true", 1333 // "description": "When calculating the number of remaining change IDs, whether to include shared files and public files the user has opened. When set to false, this counts only change IDs for owned files and any shared or public files that the user has explictly added to a folder in Drive.", 1334 // "location": "query", 1335 // "type": "boolean" 1336 // }, 1337 // "maxChangeIdCount": { 1338 // "default": "1", 1339 // "description": "Maximum number of remaining change IDs to count", 1340 // "format": "int64", 1341 // "location": "query", 1342 // "type": "string" 1343 // }, 1344 // "startChangeId": { 1345 // "description": "Change ID to start counting from when calculating number of remaining change IDs", 1346 // "format": "int64", 1347 // "location": "query", 1348 // "type": "string" 1349 // } 1350 // }, 1351 // "path": "about", 1352 // "response": { 1353 // "$ref": "About" 1354 // }, 1355 // "scopes": [ 1356 // "https://www.googleapis.com/auth/drive", 1357 // "https://www.googleapis.com/auth/drive.appdata", 1358 // "https://www.googleapis.com/auth/drive.file", 1359 // "https://www.googleapis.com/auth/drive.metadata.readonly", 1360 // "https://www.googleapis.com/auth/drive.readonly" 1361 // ] 1362 // } 1363 1364 } 1365 1366 // method id "drive.apps.get": 1367 1368 type AppsGetCall struct { 1369 s *Service 1370 appId string 1371 opt_ map[string]interface{} 1372 } 1373 1374 // Get: Gets a specific app. 1375 func (r *AppsService) Get(appId string) *AppsGetCall { 1376 c := &AppsGetCall{s: r.s, opt_: make(map[string]interface{})} 1377 c.appId = appId 1378 return c 1379 } 1380 1381 func (c *AppsGetCall) Do() (*App, error) { 1382 var body io.Reader = nil 1383 params := make(url.Values) 1384 params.Set("alt", "json") 1385 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "apps/{appId}") 1386 urls += "?" + params.Encode() 1387 req, _ := http.NewRequest("GET", urls, body) 1388 req.URL.Path = strings.Replace(req.URL.Path, "{appId}", url.QueryEscape(c.appId), 1) 1389 googleapi.SetOpaque(req.URL) 1390 req.Header.Set("User-Agent", "google-api-go-client/0.5") 1391 res, err := c.s.client.Do(req) 1392 if err != nil { 1393 return nil, err 1394 } 1395 defer res.Body.Close() 1396 if err := googleapi.CheckResponse(res); err != nil { 1397 return nil, err 1398 } 1399 ret := new(App) 1400 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 1401 return nil, err 1402 } 1403 return ret, nil 1404 // { 1405 // "description": "Gets a specific app.", 1406 // "httpMethod": "GET", 1407 // "id": "drive.apps.get", 1408 // "parameterOrder": [ 1409 // "appId" 1410 // ], 1411 // "parameters": { 1412 // "appId": { 1413 // "description": "The ID of the app.", 1414 // "location": "path", 1415 // "required": true, 1416 // "type": "string" 1417 // } 1418 // }, 1419 // "path": "apps/{appId}", 1420 // "response": { 1421 // "$ref": "App" 1422 // }, 1423 // "scopes": [ 1424 // "https://www.googleapis.com/auth/drive.apps.readonly" 1425 // ] 1426 // } 1427 1428 } 1429 1430 // method id "drive.apps.list": 1431 1432 type AppsListCall struct { 1433 s *Service 1434 opt_ map[string]interface{} 1435 } 1436 1437 // List: Lists a user's installed apps. 1438 func (r *AppsService) List() *AppsListCall { 1439 c := &AppsListCall{s: r.s, opt_: make(map[string]interface{})} 1440 return c 1441 } 1442 1443 func (c *AppsListCall) Do() (*AppList, error) { 1444 var body io.Reader = nil 1445 params := make(url.Values) 1446 params.Set("alt", "json") 1447 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "apps") 1448 urls += "?" + params.Encode() 1449 req, _ := http.NewRequest("GET", urls, body) 1450 googleapi.SetOpaque(req.URL) 1451 req.Header.Set("User-Agent", "google-api-go-client/0.5") 1452 res, err := c.s.client.Do(req) 1453 if err != nil { 1454 return nil, err 1455 } 1456 defer res.Body.Close() 1457 if err := googleapi.CheckResponse(res); err != nil { 1458 return nil, err 1459 } 1460 ret := new(AppList) 1461 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 1462 return nil, err 1463 } 1464 return ret, nil 1465 // { 1466 // "description": "Lists a user's installed apps.", 1467 // "httpMethod": "GET", 1468 // "id": "drive.apps.list", 1469 // "path": "apps", 1470 // "response": { 1471 // "$ref": "AppList" 1472 // }, 1473 // "scopes": [ 1474 // "https://www.googleapis.com/auth/drive.apps.readonly" 1475 // ] 1476 // } 1477 1478 } 1479 1480 // method id "drive.changes.get": 1481 1482 type ChangesGetCall struct { 1483 s *Service 1484 changeId string 1485 opt_ map[string]interface{} 1486 } 1487 1488 // Get: Gets a specific change. 1489 func (r *ChangesService) Get(changeId string) *ChangesGetCall { 1490 c := &ChangesGetCall{s: r.s, opt_: make(map[string]interface{})} 1491 c.changeId = changeId 1492 return c 1493 } 1494 1495 func (c *ChangesGetCall) Do() (*Change, error) { 1496 var body io.Reader = nil 1497 params := make(url.Values) 1498 params.Set("alt", "json") 1499 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "changes/{changeId}") 1500 urls += "?" + params.Encode() 1501 req, _ := http.NewRequest("GET", urls, body) 1502 req.URL.Path = strings.Replace(req.URL.Path, "{changeId}", url.QueryEscape(c.changeId), 1) 1503 googleapi.SetOpaque(req.URL) 1504 req.Header.Set("User-Agent", "google-api-go-client/0.5") 1505 res, err := c.s.client.Do(req) 1506 if err != nil { 1507 return nil, err 1508 } 1509 defer res.Body.Close() 1510 if err := googleapi.CheckResponse(res); err != nil { 1511 return nil, err 1512 } 1513 ret := new(Change) 1514 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 1515 return nil, err 1516 } 1517 return ret, nil 1518 // { 1519 // "description": "Gets a specific change.", 1520 // "httpMethod": "GET", 1521 // "id": "drive.changes.get", 1522 // "parameterOrder": [ 1523 // "changeId" 1524 // ], 1525 // "parameters": { 1526 // "changeId": { 1527 // "description": "The ID of the change.", 1528 // "location": "path", 1529 // "required": true, 1530 // "type": "string" 1531 // } 1532 // }, 1533 // "path": "changes/{changeId}", 1534 // "response": { 1535 // "$ref": "Change" 1536 // }, 1537 // "scopes": [ 1538 // "https://www.googleapis.com/auth/drive", 1539 // "https://www.googleapis.com/auth/drive.appdata", 1540 // "https://www.googleapis.com/auth/drive.apps.readonly", 1541 // "https://www.googleapis.com/auth/drive.file", 1542 // "https://www.googleapis.com/auth/drive.metadata.readonly", 1543 // "https://www.googleapis.com/auth/drive.readonly" 1544 // ] 1545 // } 1546 1547 } 1548 1549 // method id "drive.changes.list": 1550 1551 type ChangesListCall struct { 1552 s *Service 1553 opt_ map[string]interface{} 1554 } 1555 1556 // List: Lists the changes for a user. 1557 func (r *ChangesService) List() *ChangesListCall { 1558 c := &ChangesListCall{s: r.s, opt_: make(map[string]interface{})} 1559 return c 1560 } 1561 1562 // IncludeDeleted sets the optional parameter "includeDeleted": Whether 1563 // to include deleted items. 1564 func (c *ChangesListCall) IncludeDeleted(includeDeleted bool) *ChangesListCall { 1565 c.opt_["includeDeleted"] = includeDeleted 1566 return c 1567 } 1568 1569 // IncludeSubscribed sets the optional parameter "includeSubscribed": 1570 // Whether to include shared files and public files the user has opened. 1571 // When set to false, the list will include owned files plus any shared 1572 // or public files the user has explictly added to a folder in Drive. 1573 func (c *ChangesListCall) IncludeSubscribed(includeSubscribed bool) *ChangesListCall { 1574 c.opt_["includeSubscribed"] = includeSubscribed 1575 return c 1576 } 1577 1578 // MaxResults sets the optional parameter "maxResults": Maximum number 1579 // of changes to return. 1580 func (c *ChangesListCall) MaxResults(maxResults int64) *ChangesListCall { 1581 c.opt_["maxResults"] = maxResults 1582 return c 1583 } 1584 1585 // PageToken sets the optional parameter "pageToken": Page token for 1586 // changes. 1587 func (c *ChangesListCall) PageToken(pageToken string) *ChangesListCall { 1588 c.opt_["pageToken"] = pageToken 1589 return c 1590 } 1591 1592 // StartChangeId sets the optional parameter "startChangeId": Change ID 1593 // to start listing changes from. 1594 func (c *ChangesListCall) StartChangeId(startChangeId int64) *ChangesListCall { 1595 c.opt_["startChangeId"] = startChangeId 1596 return c 1597 } 1598 1599 func (c *ChangesListCall) Do() (*ChangeList, error) { 1600 var body io.Reader = nil 1601 params := make(url.Values) 1602 params.Set("alt", "json") 1603 if v, ok := c.opt_["includeDeleted"]; ok { 1604 params.Set("includeDeleted", fmt.Sprintf("%v", v)) 1605 } 1606 if v, ok := c.opt_["includeSubscribed"]; ok { 1607 params.Set("includeSubscribed", fmt.Sprintf("%v", v)) 1608 } 1609 if v, ok := c.opt_["maxResults"]; ok { 1610 params.Set("maxResults", fmt.Sprintf("%v", v)) 1611 } 1612 if v, ok := c.opt_["pageToken"]; ok { 1613 params.Set("pageToken", fmt.Sprintf("%v", v)) 1614 } 1615 if v, ok := c.opt_["startChangeId"]; ok { 1616 params.Set("startChangeId", fmt.Sprintf("%v", v)) 1617 } 1618 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "changes") 1619 urls += "?" + params.Encode() 1620 req, _ := http.NewRequest("GET", urls, body) 1621 googleapi.SetOpaque(req.URL) 1622 req.Header.Set("User-Agent", "google-api-go-client/0.5") 1623 res, err := c.s.client.Do(req) 1624 if err != nil { 1625 return nil, err 1626 } 1627 defer res.Body.Close() 1628 if err := googleapi.CheckResponse(res); err != nil { 1629 return nil, err 1630 } 1631 ret := new(ChangeList) 1632 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 1633 return nil, err 1634 } 1635 return ret, nil 1636 // { 1637 // "description": "Lists the changes for a user.", 1638 // "httpMethod": "GET", 1639 // "id": "drive.changes.list", 1640 // "parameters": { 1641 // "includeDeleted": { 1642 // "default": "true", 1643 // "description": "Whether to include deleted items.", 1644 // "location": "query", 1645 // "type": "boolean" 1646 // }, 1647 // "includeSubscribed": { 1648 // "default": "true", 1649 // "description": "Whether to include shared files and public files the user has opened. When set to false, the list will include owned files plus any shared or public files the user has explictly added to a folder in Drive.", 1650 // "location": "query", 1651 // "type": "boolean" 1652 // }, 1653 // "maxResults": { 1654 // "default": "100", 1655 // "description": "Maximum number of changes to return.", 1656 // "format": "int32", 1657 // "location": "query", 1658 // "minimum": "0", 1659 // "type": "integer" 1660 // }, 1661 // "pageToken": { 1662 // "description": "Page token for changes.", 1663 // "location": "query", 1664 // "type": "string" 1665 // }, 1666 // "startChangeId": { 1667 // "description": "Change ID to start listing changes from.", 1668 // "format": "int64", 1669 // "location": "query", 1670 // "type": "string" 1671 // } 1672 // }, 1673 // "path": "changes", 1674 // "response": { 1675 // "$ref": "ChangeList" 1676 // }, 1677 // "scopes": [ 1678 // "https://www.googleapis.com/auth/drive", 1679 // "https://www.googleapis.com/auth/drive.appdata", 1680 // "https://www.googleapis.com/auth/drive.apps.readonly", 1681 // "https://www.googleapis.com/auth/drive.file", 1682 // "https://www.googleapis.com/auth/drive.metadata.readonly", 1683 // "https://www.googleapis.com/auth/drive.readonly" 1684 // ], 1685 // "supportsSubscription": true 1686 // } 1687 1688 } 1689 1690 // method id "drive.changes.watch": 1691 1692 type ChangesWatchCall struct { 1693 s *Service 1694 channel *Channel 1695 opt_ map[string]interface{} 1696 } 1697 1698 // Watch: Subscribe to changes for a user. 1699 func (r *ChangesService) Watch(channel *Channel) *ChangesWatchCall { 1700 c := &ChangesWatchCall{s: r.s, opt_: make(map[string]interface{})} 1701 c.channel = channel 1702 return c 1703 } 1704 1705 // IncludeDeleted sets the optional parameter "includeDeleted": Whether 1706 // to include deleted items. 1707 func (c *ChangesWatchCall) IncludeDeleted(includeDeleted bool) *ChangesWatchCall { 1708 c.opt_["includeDeleted"] = includeDeleted 1709 return c 1710 } 1711 1712 // IncludeSubscribed sets the optional parameter "includeSubscribed": 1713 // Whether to include shared files and public files the user has opened. 1714 // When set to false, the list will include owned files plus any shared 1715 // or public files the user has explictly added to a folder in Drive. 1716 func (c *ChangesWatchCall) IncludeSubscribed(includeSubscribed bool) *ChangesWatchCall { 1717 c.opt_["includeSubscribed"] = includeSubscribed 1718 return c 1719 } 1720 1721 // MaxResults sets the optional parameter "maxResults": Maximum number 1722 // of changes to return. 1723 func (c *ChangesWatchCall) MaxResults(maxResults int64) *ChangesWatchCall { 1724 c.opt_["maxResults"] = maxResults 1725 return c 1726 } 1727 1728 // PageToken sets the optional parameter "pageToken": Page token for 1729 // changes. 1730 func (c *ChangesWatchCall) PageToken(pageToken string) *ChangesWatchCall { 1731 c.opt_["pageToken"] = pageToken 1732 return c 1733 } 1734 1735 // StartChangeId sets the optional parameter "startChangeId": Change ID 1736 // to start listing changes from. 1737 func (c *ChangesWatchCall) StartChangeId(startChangeId int64) *ChangesWatchCall { 1738 c.opt_["startChangeId"] = startChangeId 1739 return c 1740 } 1741 1742 func (c *ChangesWatchCall) Do() (*Channel, error) { 1743 var body io.Reader = nil 1744 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 1745 if err != nil { 1746 return nil, err 1747 } 1748 ctype := "application/json" 1749 params := make(url.Values) 1750 params.Set("alt", "json") 1751 if v, ok := c.opt_["includeDeleted"]; ok { 1752 params.Set("includeDeleted", fmt.Sprintf("%v", v)) 1753 } 1754 if v, ok := c.opt_["includeSubscribed"]; ok { 1755 params.Set("includeSubscribed", fmt.Sprintf("%v", v)) 1756 } 1757 if v, ok := c.opt_["maxResults"]; ok { 1758 params.Set("maxResults", fmt.Sprintf("%v", v)) 1759 } 1760 if v, ok := c.opt_["pageToken"]; ok { 1761 params.Set("pageToken", fmt.Sprintf("%v", v)) 1762 } 1763 if v, ok := c.opt_["startChangeId"]; ok { 1764 params.Set("startChangeId", fmt.Sprintf("%v", v)) 1765 } 1766 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "changes/watch") 1767 urls += "?" + params.Encode() 1768 req, _ := http.NewRequest("POST", urls, body) 1769 googleapi.SetOpaque(req.URL) 1770 req.Header.Set("Content-Type", ctype) 1771 req.Header.Set("User-Agent", "google-api-go-client/0.5") 1772 res, err := c.s.client.Do(req) 1773 if err != nil { 1774 return nil, err 1775 } 1776 defer res.Body.Close() 1777 if err := googleapi.CheckResponse(res); err != nil { 1778 return nil, err 1779 } 1780 ret := new(Channel) 1781 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 1782 return nil, err 1783 } 1784 return ret, nil 1785 // { 1786 // "description": "Subscribe to changes for a user.", 1787 // "httpMethod": "POST", 1788 // "id": "drive.changes.watch", 1789 // "parameters": { 1790 // "includeDeleted": { 1791 // "default": "true", 1792 // "description": "Whether to include deleted items.", 1793 // "location": "query", 1794 // "type": "boolean" 1795 // }, 1796 // "includeSubscribed": { 1797 // "default": "true", 1798 // "description": "Whether to include shared files and public files the user has opened. When set to false, the list will include owned files plus any shared or public files the user has explictly added to a folder in Drive.", 1799 // "location": "query", 1800 // "type": "boolean" 1801 // }, 1802 // "maxResults": { 1803 // "default": "100", 1804 // "description": "Maximum number of changes to return.", 1805 // "format": "int32", 1806 // "location": "query", 1807 // "minimum": "0", 1808 // "type": "integer" 1809 // }, 1810 // "pageToken": { 1811 // "description": "Page token for changes.", 1812 // "location": "query", 1813 // "type": "string" 1814 // }, 1815 // "startChangeId": { 1816 // "description": "Change ID to start listing changes from.", 1817 // "format": "int64", 1818 // "location": "query", 1819 // "type": "string" 1820 // } 1821 // }, 1822 // "path": "changes/watch", 1823 // "request": { 1824 // "$ref": "Channel" 1825 // }, 1826 // "response": { 1827 // "$ref": "Channel" 1828 // }, 1829 // "scopes": [ 1830 // "https://www.googleapis.com/auth/drive", 1831 // "https://www.googleapis.com/auth/drive.appdata", 1832 // "https://www.googleapis.com/auth/drive.apps.readonly", 1833 // "https://www.googleapis.com/auth/drive.file", 1834 // "https://www.googleapis.com/auth/drive.metadata.readonly", 1835 // "https://www.googleapis.com/auth/drive.readonly" 1836 // ], 1837 // "supportsSubscription": true 1838 // } 1839 1840 } 1841 1842 // method id "drive.channels.stop": 1843 1844 type ChannelsStopCall struct { 1845 s *Service 1846 channel *Channel 1847 opt_ map[string]interface{} 1848 } 1849 1850 // Stop: 1851 func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall { 1852 c := &ChannelsStopCall{s: r.s, opt_: make(map[string]interface{})} 1853 c.channel = channel 1854 return c 1855 } 1856 1857 func (c *ChannelsStopCall) Do() error { 1858 var body io.Reader = nil 1859 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 1860 if err != nil { 1861 return err 1862 } 1863 ctype := "application/json" 1864 params := make(url.Values) 1865 params.Set("alt", "json") 1866 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "channels/stop") 1867 urls += "?" + params.Encode() 1868 req, _ := http.NewRequest("POST", urls, body) 1869 googleapi.SetOpaque(req.URL) 1870 req.Header.Set("Content-Type", ctype) 1871 req.Header.Set("User-Agent", "google-api-go-client/0.5") 1872 res, err := c.s.client.Do(req) 1873 if err != nil { 1874 return err 1875 } 1876 defer res.Body.Close() 1877 if err := googleapi.CheckResponse(res); err != nil { 1878 return err 1879 } 1880 return nil 1881 // { 1882 // "httpMethod": "POST", 1883 // "id": "drive.channels.stop", 1884 // "path": "channels/stop", 1885 // "request": { 1886 // "$ref": "Channel" 1887 // }, 1888 // "scopes": [ 1889 // "https://www.googleapis.com/auth/drive", 1890 // "https://www.googleapis.com/auth/drive.appdata", 1891 // "https://www.googleapis.com/auth/drive.apps.readonly", 1892 // "https://www.googleapis.com/auth/drive.file", 1893 // "https://www.googleapis.com/auth/drive.metadata.readonly", 1894 // "https://www.googleapis.com/auth/drive.readonly" 1895 // ] 1896 // } 1897 1898 } 1899 1900 // method id "drive.children.delete": 1901 1902 type ChildrenDeleteCall struct { 1903 s *Service 1904 folderId string 1905 childId string 1906 opt_ map[string]interface{} 1907 } 1908 1909 // Delete: Removes a child from a folder. 1910 func (r *ChildrenService) Delete(folderId string, childId string) *ChildrenDeleteCall { 1911 c := &ChildrenDeleteCall{s: r.s, opt_: make(map[string]interface{})} 1912 c.folderId = folderId 1913 c.childId = childId 1914 return c 1915 } 1916 1917 func (c *ChildrenDeleteCall) Do() error { 1918 var body io.Reader = nil 1919 params := make(url.Values) 1920 params.Set("alt", "json") 1921 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{folderId}/children/{childId}") 1922 urls += "?" + params.Encode() 1923 req, _ := http.NewRequest("DELETE", urls, body) 1924 req.URL.Path = strings.Replace(req.URL.Path, "{folderId}", url.QueryEscape(c.folderId), 1) 1925 req.URL.Path = strings.Replace(req.URL.Path, "{childId}", url.QueryEscape(c.childId), 1) 1926 googleapi.SetOpaque(req.URL) 1927 req.Header.Set("User-Agent", "google-api-go-client/0.5") 1928 res, err := c.s.client.Do(req) 1929 if err != nil { 1930 return err 1931 } 1932 defer res.Body.Close() 1933 if err := googleapi.CheckResponse(res); err != nil { 1934 return err 1935 } 1936 return nil 1937 // { 1938 // "description": "Removes a child from a folder.", 1939 // "httpMethod": "DELETE", 1940 // "id": "drive.children.delete", 1941 // "parameterOrder": [ 1942 // "folderId", 1943 // "childId" 1944 // ], 1945 // "parameters": { 1946 // "childId": { 1947 // "description": "The ID of the child.", 1948 // "location": "path", 1949 // "required": true, 1950 // "type": "string" 1951 // }, 1952 // "folderId": { 1953 // "description": "The ID of the folder.", 1954 // "location": "path", 1955 // "required": true, 1956 // "type": "string" 1957 // } 1958 // }, 1959 // "path": "files/{folderId}/children/{childId}", 1960 // "scopes": [ 1961 // "https://www.googleapis.com/auth/drive", 1962 // "https://www.googleapis.com/auth/drive.file" 1963 // ] 1964 // } 1965 1966 } 1967 1968 // method id "drive.children.get": 1969 1970 type ChildrenGetCall struct { 1971 s *Service 1972 folderId string 1973 childId string 1974 opt_ map[string]interface{} 1975 } 1976 1977 // Get: Gets a specific child reference. 1978 func (r *ChildrenService) Get(folderId string, childId string) *ChildrenGetCall { 1979 c := &ChildrenGetCall{s: r.s, opt_: make(map[string]interface{})} 1980 c.folderId = folderId 1981 c.childId = childId 1982 return c 1983 } 1984 1985 func (c *ChildrenGetCall) Do() (*ChildReference, error) { 1986 var body io.Reader = nil 1987 params := make(url.Values) 1988 params.Set("alt", "json") 1989 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{folderId}/children/{childId}") 1990 urls += "?" + params.Encode() 1991 req, _ := http.NewRequest("GET", urls, body) 1992 req.URL.Path = strings.Replace(req.URL.Path, "{folderId}", url.QueryEscape(c.folderId), 1) 1993 req.URL.Path = strings.Replace(req.URL.Path, "{childId}", url.QueryEscape(c.childId), 1) 1994 googleapi.SetOpaque(req.URL) 1995 req.Header.Set("User-Agent", "google-api-go-client/0.5") 1996 res, err := c.s.client.Do(req) 1997 if err != nil { 1998 return nil, err 1999 } 2000 defer res.Body.Close() 2001 if err := googleapi.CheckResponse(res); err != nil { 2002 return nil, err 2003 } 2004 ret := new(ChildReference) 2005 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 2006 return nil, err 2007 } 2008 return ret, nil 2009 // { 2010 // "description": "Gets a specific child reference.", 2011 // "httpMethod": "GET", 2012 // "id": "drive.children.get", 2013 // "parameterOrder": [ 2014 // "folderId", 2015 // "childId" 2016 // ], 2017 // "parameters": { 2018 // "childId": { 2019 // "description": "The ID of the child.", 2020 // "location": "path", 2021 // "required": true, 2022 // "type": "string" 2023 // }, 2024 // "folderId": { 2025 // "description": "The ID of the folder.", 2026 // "location": "path", 2027 // "required": true, 2028 // "type": "string" 2029 // } 2030 // }, 2031 // "path": "files/{folderId}/children/{childId}", 2032 // "response": { 2033 // "$ref": "ChildReference" 2034 // }, 2035 // "scopes": [ 2036 // "https://www.googleapis.com/auth/drive", 2037 // "https://www.googleapis.com/auth/drive.appdata", 2038 // "https://www.googleapis.com/auth/drive.file", 2039 // "https://www.googleapis.com/auth/drive.metadata.readonly", 2040 // "https://www.googleapis.com/auth/drive.readonly" 2041 // ] 2042 // } 2043 2044 } 2045 2046 // method id "drive.children.insert": 2047 2048 type ChildrenInsertCall struct { 2049 s *Service 2050 folderId string 2051 childreference *ChildReference 2052 opt_ map[string]interface{} 2053 } 2054 2055 // Insert: Inserts a file into a folder. 2056 func (r *ChildrenService) Insert(folderId string, childreference *ChildReference) *ChildrenInsertCall { 2057 c := &ChildrenInsertCall{s: r.s, opt_: make(map[string]interface{})} 2058 c.folderId = folderId 2059 c.childreference = childreference 2060 return c 2061 } 2062 2063 func (c *ChildrenInsertCall) Do() (*ChildReference, error) { 2064 var body io.Reader = nil 2065 body, err := googleapi.WithoutDataWrapper.JSONReader(c.childreference) 2066 if err != nil { 2067 return nil, err 2068 } 2069 ctype := "application/json" 2070 params := make(url.Values) 2071 params.Set("alt", "json") 2072 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{folderId}/children") 2073 urls += "?" + params.Encode() 2074 req, _ := http.NewRequest("POST", urls, body) 2075 req.URL.Path = strings.Replace(req.URL.Path, "{folderId}", url.QueryEscape(c.folderId), 1) 2076 googleapi.SetOpaque(req.URL) 2077 req.Header.Set("Content-Type", ctype) 2078 req.Header.Set("User-Agent", "google-api-go-client/0.5") 2079 res, err := c.s.client.Do(req) 2080 if err != nil { 2081 return nil, err 2082 } 2083 defer res.Body.Close() 2084 if err := googleapi.CheckResponse(res); err != nil { 2085 return nil, err 2086 } 2087 ret := new(ChildReference) 2088 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 2089 return nil, err 2090 } 2091 return ret, nil 2092 // { 2093 // "description": "Inserts a file into a folder.", 2094 // "httpMethod": "POST", 2095 // "id": "drive.children.insert", 2096 // "parameterOrder": [ 2097 // "folderId" 2098 // ], 2099 // "parameters": { 2100 // "folderId": { 2101 // "description": "The ID of the folder.", 2102 // "location": "path", 2103 // "required": true, 2104 // "type": "string" 2105 // } 2106 // }, 2107 // "path": "files/{folderId}/children", 2108 // "request": { 2109 // "$ref": "ChildReference" 2110 // }, 2111 // "response": { 2112 // "$ref": "ChildReference" 2113 // }, 2114 // "scopes": [ 2115 // "https://www.googleapis.com/auth/drive", 2116 // "https://www.googleapis.com/auth/drive.appdata", 2117 // "https://www.googleapis.com/auth/drive.file" 2118 // ] 2119 // } 2120 2121 } 2122 2123 // method id "drive.children.list": 2124 2125 type ChildrenListCall struct { 2126 s *Service 2127 folderId string 2128 opt_ map[string]interface{} 2129 } 2130 2131 // List: Lists a folder's children. 2132 func (r *ChildrenService) List(folderId string) *ChildrenListCall { 2133 c := &ChildrenListCall{s: r.s, opt_: make(map[string]interface{})} 2134 c.folderId = folderId 2135 return c 2136 } 2137 2138 // MaxResults sets the optional parameter "maxResults": Maximum number 2139 // of children to return. 2140 func (c *ChildrenListCall) MaxResults(maxResults int64) *ChildrenListCall { 2141 c.opt_["maxResults"] = maxResults 2142 return c 2143 } 2144 2145 // PageToken sets the optional parameter "pageToken": Page token for 2146 // children. 2147 func (c *ChildrenListCall) PageToken(pageToken string) *ChildrenListCall { 2148 c.opt_["pageToken"] = pageToken 2149 return c 2150 } 2151 2152 // Q sets the optional parameter "q": Query string for searching 2153 // children. 2154 func (c *ChildrenListCall) Q(q string) *ChildrenListCall { 2155 c.opt_["q"] = q 2156 return c 2157 } 2158 2159 func (c *ChildrenListCall) Do() (*ChildList, error) { 2160 var body io.Reader = nil 2161 params := make(url.Values) 2162 params.Set("alt", "json") 2163 if v, ok := c.opt_["maxResults"]; ok { 2164 params.Set("maxResults", fmt.Sprintf("%v", v)) 2165 } 2166 if v, ok := c.opt_["pageToken"]; ok { 2167 params.Set("pageToken", fmt.Sprintf("%v", v)) 2168 } 2169 if v, ok := c.opt_["q"]; ok { 2170 params.Set("q", fmt.Sprintf("%v", v)) 2171 } 2172 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{folderId}/children") 2173 urls += "?" + params.Encode() 2174 req, _ := http.NewRequest("GET", urls, body) 2175 req.URL.Path = strings.Replace(req.URL.Path, "{folderId}", url.QueryEscape(c.folderId), 1) 2176 googleapi.SetOpaque(req.URL) 2177 req.Header.Set("User-Agent", "google-api-go-client/0.5") 2178 res, err := c.s.client.Do(req) 2179 if err != nil { 2180 return nil, err 2181 } 2182 defer res.Body.Close() 2183 if err := googleapi.CheckResponse(res); err != nil { 2184 return nil, err 2185 } 2186 ret := new(ChildList) 2187 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 2188 return nil, err 2189 } 2190 return ret, nil 2191 // { 2192 // "description": "Lists a folder's children.", 2193 // "httpMethod": "GET", 2194 // "id": "drive.children.list", 2195 // "parameterOrder": [ 2196 // "folderId" 2197 // ], 2198 // "parameters": { 2199 // "folderId": { 2200 // "description": "The ID of the folder.", 2201 // "location": "path", 2202 // "required": true, 2203 // "type": "string" 2204 // }, 2205 // "maxResults": { 2206 // "default": "100", 2207 // "description": "Maximum number of children to return.", 2208 // "format": "int32", 2209 // "location": "query", 2210 // "minimum": "0", 2211 // "type": "integer" 2212 // }, 2213 // "pageToken": { 2214 // "description": "Page token for children.", 2215 // "location": "query", 2216 // "type": "string" 2217 // }, 2218 // "q": { 2219 // "description": "Query string for searching children.", 2220 // "location": "query", 2221 // "type": "string" 2222 // } 2223 // }, 2224 // "path": "files/{folderId}/children", 2225 // "response": { 2226 // "$ref": "ChildList" 2227 // }, 2228 // "scopes": [ 2229 // "https://www.googleapis.com/auth/drive", 2230 // "https://www.googleapis.com/auth/drive.appdata", 2231 // "https://www.googleapis.com/auth/drive.file", 2232 // "https://www.googleapis.com/auth/drive.metadata.readonly", 2233 // "https://www.googleapis.com/auth/drive.readonly" 2234 // ] 2235 // } 2236 2237 } 2238 2239 // method id "drive.comments.delete": 2240 2241 type CommentsDeleteCall struct { 2242 s *Service 2243 fileId string 2244 commentId string 2245 opt_ map[string]interface{} 2246 } 2247 2248 // Delete: Deletes a comment. 2249 func (r *CommentsService) Delete(fileId string, commentId string) *CommentsDeleteCall { 2250 c := &CommentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} 2251 c.fileId = fileId 2252 c.commentId = commentId 2253 return c 2254 } 2255 2256 func (c *CommentsDeleteCall) Do() error { 2257 var body io.Reader = nil 2258 params := make(url.Values) 2259 params.Set("alt", "json") 2260 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments/{commentId}") 2261 urls += "?" + params.Encode() 2262 req, _ := http.NewRequest("DELETE", urls, body) 2263 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 2264 req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) 2265 googleapi.SetOpaque(req.URL) 2266 req.Header.Set("User-Agent", "google-api-go-client/0.5") 2267 res, err := c.s.client.Do(req) 2268 if err != nil { 2269 return err 2270 } 2271 defer res.Body.Close() 2272 if err := googleapi.CheckResponse(res); err != nil { 2273 return err 2274 } 2275 return nil 2276 // { 2277 // "description": "Deletes a comment.", 2278 // "httpMethod": "DELETE", 2279 // "id": "drive.comments.delete", 2280 // "parameterOrder": [ 2281 // "fileId", 2282 // "commentId" 2283 // ], 2284 // "parameters": { 2285 // "commentId": { 2286 // "description": "The ID of the comment.", 2287 // "location": "path", 2288 // "required": true, 2289 // "type": "string" 2290 // }, 2291 // "fileId": { 2292 // "description": "The ID of the file.", 2293 // "location": "path", 2294 // "required": true, 2295 // "type": "string" 2296 // } 2297 // }, 2298 // "path": "files/{fileId}/comments/{commentId}", 2299 // "scopes": [ 2300 // "https://www.googleapis.com/auth/drive", 2301 // "https://www.googleapis.com/auth/drive.file", 2302 // "https://www.googleapis.com/auth/drive.readonly" 2303 // ] 2304 // } 2305 2306 } 2307 2308 // method id "drive.comments.get": 2309 2310 type CommentsGetCall struct { 2311 s *Service 2312 fileId string 2313 commentId string 2314 opt_ map[string]interface{} 2315 } 2316 2317 // Get: Gets a comment by ID. 2318 func (r *CommentsService) Get(fileId string, commentId string) *CommentsGetCall { 2319 c := &CommentsGetCall{s: r.s, opt_: make(map[string]interface{})} 2320 c.fileId = fileId 2321 c.commentId = commentId 2322 return c 2323 } 2324 2325 // IncludeDeleted sets the optional parameter "includeDeleted": If set, 2326 // this will succeed when retrieving a deleted comment, and will include 2327 // any deleted replies. 2328 func (c *CommentsGetCall) IncludeDeleted(includeDeleted bool) *CommentsGetCall { 2329 c.opt_["includeDeleted"] = includeDeleted 2330 return c 2331 } 2332 2333 func (c *CommentsGetCall) Do() (*Comment, error) { 2334 var body io.Reader = nil 2335 params := make(url.Values) 2336 params.Set("alt", "json") 2337 if v, ok := c.opt_["includeDeleted"]; ok { 2338 params.Set("includeDeleted", fmt.Sprintf("%v", v)) 2339 } 2340 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments/{commentId}") 2341 urls += "?" + params.Encode() 2342 req, _ := http.NewRequest("GET", urls, body) 2343 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 2344 req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) 2345 googleapi.SetOpaque(req.URL) 2346 req.Header.Set("User-Agent", "google-api-go-client/0.5") 2347 res, err := c.s.client.Do(req) 2348 if err != nil { 2349 return nil, err 2350 } 2351 defer res.Body.Close() 2352 if err := googleapi.CheckResponse(res); err != nil { 2353 return nil, err 2354 } 2355 ret := new(Comment) 2356 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 2357 return nil, err 2358 } 2359 return ret, nil 2360 // { 2361 // "description": "Gets a comment by ID.", 2362 // "httpMethod": "GET", 2363 // "id": "drive.comments.get", 2364 // "parameterOrder": [ 2365 // "fileId", 2366 // "commentId" 2367 // ], 2368 // "parameters": { 2369 // "commentId": { 2370 // "description": "The ID of the comment.", 2371 // "location": "path", 2372 // "required": true, 2373 // "type": "string" 2374 // }, 2375 // "fileId": { 2376 // "description": "The ID of the file.", 2377 // "location": "path", 2378 // "required": true, 2379 // "type": "string" 2380 // }, 2381 // "includeDeleted": { 2382 // "default": "false", 2383 // "description": "If set, this will succeed when retrieving a deleted comment, and will include any deleted replies.", 2384 // "location": "query", 2385 // "type": "boolean" 2386 // } 2387 // }, 2388 // "path": "files/{fileId}/comments/{commentId}", 2389 // "response": { 2390 // "$ref": "Comment" 2391 // }, 2392 // "scopes": [ 2393 // "https://www.googleapis.com/auth/drive", 2394 // "https://www.googleapis.com/auth/drive.file", 2395 // "https://www.googleapis.com/auth/drive.readonly" 2396 // ] 2397 // } 2398 2399 } 2400 2401 // method id "drive.comments.insert": 2402 2403 type CommentsInsertCall struct { 2404 s *Service 2405 fileId string 2406 comment *Comment 2407 opt_ map[string]interface{} 2408 } 2409 2410 // Insert: Creates a new comment on the given file. 2411 func (r *CommentsService) Insert(fileId string, comment *Comment) *CommentsInsertCall { 2412 c := &CommentsInsertCall{s: r.s, opt_: make(map[string]interface{})} 2413 c.fileId = fileId 2414 c.comment = comment 2415 return c 2416 } 2417 2418 func (c *CommentsInsertCall) Do() (*Comment, error) { 2419 var body io.Reader = nil 2420 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) 2421 if err != nil { 2422 return nil, err 2423 } 2424 ctype := "application/json" 2425 params := make(url.Values) 2426 params.Set("alt", "json") 2427 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments") 2428 urls += "?" + params.Encode() 2429 req, _ := http.NewRequest("POST", urls, body) 2430 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 2431 googleapi.SetOpaque(req.URL) 2432 req.Header.Set("Content-Type", ctype) 2433 req.Header.Set("User-Agent", "google-api-go-client/0.5") 2434 res, err := c.s.client.Do(req) 2435 if err != nil { 2436 return nil, err 2437 } 2438 defer res.Body.Close() 2439 if err := googleapi.CheckResponse(res); err != nil { 2440 return nil, err 2441 } 2442 ret := new(Comment) 2443 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 2444 return nil, err 2445 } 2446 return ret, nil 2447 // { 2448 // "description": "Creates a new comment on the given file.", 2449 // "httpMethod": "POST", 2450 // "id": "drive.comments.insert", 2451 // "parameterOrder": [ 2452 // "fileId" 2453 // ], 2454 // "parameters": { 2455 // "fileId": { 2456 // "description": "The ID of the file.", 2457 // "location": "path", 2458 // "required": true, 2459 // "type": "string" 2460 // } 2461 // }, 2462 // "path": "files/{fileId}/comments", 2463 // "request": { 2464 // "$ref": "Comment" 2465 // }, 2466 // "response": { 2467 // "$ref": "Comment" 2468 // }, 2469 // "scopes": [ 2470 // "https://www.googleapis.com/auth/drive", 2471 // "https://www.googleapis.com/auth/drive.file", 2472 // "https://www.googleapis.com/auth/drive.readonly" 2473 // ] 2474 // } 2475 2476 } 2477 2478 // method id "drive.comments.list": 2479 2480 type CommentsListCall struct { 2481 s *Service 2482 fileId string 2483 opt_ map[string]interface{} 2484 } 2485 2486 // List: Lists a file's comments. 2487 func (r *CommentsService) List(fileId string) *CommentsListCall { 2488 c := &CommentsListCall{s: r.s, opt_: make(map[string]interface{})} 2489 c.fileId = fileId 2490 return c 2491 } 2492 2493 // IncludeDeleted sets the optional parameter "includeDeleted": If set, 2494 // all comments and replies, including deleted comments and replies 2495 // (with content stripped) will be returned. 2496 func (c *CommentsListCall) IncludeDeleted(includeDeleted bool) *CommentsListCall { 2497 c.opt_["includeDeleted"] = includeDeleted 2498 return c 2499 } 2500 2501 // MaxResults sets the optional parameter "maxResults": The maximum 2502 // number of discussions to include in the response, used for paging. 2503 func (c *CommentsListCall) MaxResults(maxResults int64) *CommentsListCall { 2504 c.opt_["maxResults"] = maxResults 2505 return c 2506 } 2507 2508 // PageToken sets the optional parameter "pageToken": The continuation 2509 // token, used to page through large result sets. To get the next page 2510 // of results, set this parameter to the value of "nextPageToken" from 2511 // the previous response. 2512 func (c *CommentsListCall) PageToken(pageToken string) *CommentsListCall { 2513 c.opt_["pageToken"] = pageToken 2514 return c 2515 } 2516 2517 // UpdatedMin sets the optional parameter "updatedMin": Only discussions 2518 // that were updated after this timestamp will be returned. Formatted as 2519 // an RFC 3339 timestamp. 2520 func (c *CommentsListCall) UpdatedMin(updatedMin string) *CommentsListCall { 2521 c.opt_["updatedMin"] = updatedMin 2522 return c 2523 } 2524 2525 func (c *CommentsListCall) Do() (*CommentList, error) { 2526 var body io.Reader = nil 2527 params := make(url.Values) 2528 params.Set("alt", "json") 2529 if v, ok := c.opt_["includeDeleted"]; ok { 2530 params.Set("includeDeleted", fmt.Sprintf("%v", v)) 2531 } 2532 if v, ok := c.opt_["maxResults"]; ok { 2533 params.Set("maxResults", fmt.Sprintf("%v", v)) 2534 } 2535 if v, ok := c.opt_["pageToken"]; ok { 2536 params.Set("pageToken", fmt.Sprintf("%v", v)) 2537 } 2538 if v, ok := c.opt_["updatedMin"]; ok { 2539 params.Set("updatedMin", fmt.Sprintf("%v", v)) 2540 } 2541 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments") 2542 urls += "?" + params.Encode() 2543 req, _ := http.NewRequest("GET", urls, body) 2544 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 2545 googleapi.SetOpaque(req.URL) 2546 req.Header.Set("User-Agent", "google-api-go-client/0.5") 2547 res, err := c.s.client.Do(req) 2548 if err != nil { 2549 return nil, err 2550 } 2551 defer res.Body.Close() 2552 if err := googleapi.CheckResponse(res); err != nil { 2553 return nil, err 2554 } 2555 ret := new(CommentList) 2556 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 2557 return nil, err 2558 } 2559 return ret, nil 2560 // { 2561 // "description": "Lists a file's comments.", 2562 // "httpMethod": "GET", 2563 // "id": "drive.comments.list", 2564 // "parameterOrder": [ 2565 // "fileId" 2566 // ], 2567 // "parameters": { 2568 // "fileId": { 2569 // "description": "The ID of the file.", 2570 // "location": "path", 2571 // "required": true, 2572 // "type": "string" 2573 // }, 2574 // "includeDeleted": { 2575 // "default": "false", 2576 // "description": "If set, all comments and replies, including deleted comments and replies (with content stripped) will be returned.", 2577 // "location": "query", 2578 // "type": "boolean" 2579 // }, 2580 // "maxResults": { 2581 // "default": "20", 2582 // "description": "The maximum number of discussions to include in the response, used for paging.", 2583 // "format": "int32", 2584 // "location": "query", 2585 // "maximum": "100", 2586 // "minimum": "0", 2587 // "type": "integer" 2588 // }, 2589 // "pageToken": { 2590 // "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.", 2591 // "location": "query", 2592 // "type": "string" 2593 // }, 2594 // "updatedMin": { 2595 // "description": "Only discussions that were updated after this timestamp will be returned. Formatted as an RFC 3339 timestamp.", 2596 // "location": "query", 2597 // "type": "string" 2598 // } 2599 // }, 2600 // "path": "files/{fileId}/comments", 2601 // "response": { 2602 // "$ref": "CommentList" 2603 // }, 2604 // "scopes": [ 2605 // "https://www.googleapis.com/auth/drive", 2606 // "https://www.googleapis.com/auth/drive.file", 2607 // "https://www.googleapis.com/auth/drive.readonly" 2608 // ] 2609 // } 2610 2611 } 2612 2613 // method id "drive.comments.patch": 2614 2615 type CommentsPatchCall struct { 2616 s *Service 2617 fileId string 2618 commentId string 2619 comment *Comment 2620 opt_ map[string]interface{} 2621 } 2622 2623 // Patch: Updates an existing comment. This method supports patch 2624 // semantics. 2625 func (r *CommentsService) Patch(fileId string, commentId string, comment *Comment) *CommentsPatchCall { 2626 c := &CommentsPatchCall{s: r.s, opt_: make(map[string]interface{})} 2627 c.fileId = fileId 2628 c.commentId = commentId 2629 c.comment = comment 2630 return c 2631 } 2632 2633 func (c *CommentsPatchCall) Do() (*Comment, error) { 2634 var body io.Reader = nil 2635 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) 2636 if err != nil { 2637 return nil, err 2638 } 2639 ctype := "application/json" 2640 params := make(url.Values) 2641 params.Set("alt", "json") 2642 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments/{commentId}") 2643 urls += "?" + params.Encode() 2644 req, _ := http.NewRequest("PATCH", urls, body) 2645 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 2646 req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) 2647 googleapi.SetOpaque(req.URL) 2648 req.Header.Set("Content-Type", ctype) 2649 req.Header.Set("User-Agent", "google-api-go-client/0.5") 2650 res, err := c.s.client.Do(req) 2651 if err != nil { 2652 return nil, err 2653 } 2654 defer res.Body.Close() 2655 if err := googleapi.CheckResponse(res); err != nil { 2656 return nil, err 2657 } 2658 ret := new(Comment) 2659 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 2660 return nil, err 2661 } 2662 return ret, nil 2663 // { 2664 // "description": "Updates an existing comment. This method supports patch semantics.", 2665 // "httpMethod": "PATCH", 2666 // "id": "drive.comments.patch", 2667 // "parameterOrder": [ 2668 // "fileId", 2669 // "commentId" 2670 // ], 2671 // "parameters": { 2672 // "commentId": { 2673 // "description": "The ID of the comment.", 2674 // "location": "path", 2675 // "required": true, 2676 // "type": "string" 2677 // }, 2678 // "fileId": { 2679 // "description": "The ID of the file.", 2680 // "location": "path", 2681 // "required": true, 2682 // "type": "string" 2683 // } 2684 // }, 2685 // "path": "files/{fileId}/comments/{commentId}", 2686 // "request": { 2687 // "$ref": "Comment" 2688 // }, 2689 // "response": { 2690 // "$ref": "Comment" 2691 // }, 2692 // "scopes": [ 2693 // "https://www.googleapis.com/auth/drive", 2694 // "https://www.googleapis.com/auth/drive.file" 2695 // ] 2696 // } 2697 2698 } 2699 2700 // method id "drive.comments.update": 2701 2702 type CommentsUpdateCall struct { 2703 s *Service 2704 fileId string 2705 commentId string 2706 comment *Comment 2707 opt_ map[string]interface{} 2708 } 2709 2710 // Update: Updates an existing comment. 2711 func (r *CommentsService) Update(fileId string, commentId string, comment *Comment) *CommentsUpdateCall { 2712 c := &CommentsUpdateCall{s: r.s, opt_: make(map[string]interface{})} 2713 c.fileId = fileId 2714 c.commentId = commentId 2715 c.comment = comment 2716 return c 2717 } 2718 2719 func (c *CommentsUpdateCall) Do() (*Comment, error) { 2720 var body io.Reader = nil 2721 body, err := googleapi.WithoutDataWrapper.JSONReader(c.comment) 2722 if err != nil { 2723 return nil, err 2724 } 2725 ctype := "application/json" 2726 params := make(url.Values) 2727 params.Set("alt", "json") 2728 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments/{commentId}") 2729 urls += "?" + params.Encode() 2730 req, _ := http.NewRequest("PUT", urls, body) 2731 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 2732 req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) 2733 googleapi.SetOpaque(req.URL) 2734 req.Header.Set("Content-Type", ctype) 2735 req.Header.Set("User-Agent", "google-api-go-client/0.5") 2736 res, err := c.s.client.Do(req) 2737 if err != nil { 2738 return nil, err 2739 } 2740 defer res.Body.Close() 2741 if err := googleapi.CheckResponse(res); err != nil { 2742 return nil, err 2743 } 2744 ret := new(Comment) 2745 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 2746 return nil, err 2747 } 2748 return ret, nil 2749 // { 2750 // "description": "Updates an existing comment.", 2751 // "httpMethod": "PUT", 2752 // "id": "drive.comments.update", 2753 // "parameterOrder": [ 2754 // "fileId", 2755 // "commentId" 2756 // ], 2757 // "parameters": { 2758 // "commentId": { 2759 // "description": "The ID of the comment.", 2760 // "location": "path", 2761 // "required": true, 2762 // "type": "string" 2763 // }, 2764 // "fileId": { 2765 // "description": "The ID of the file.", 2766 // "location": "path", 2767 // "required": true, 2768 // "type": "string" 2769 // } 2770 // }, 2771 // "path": "files/{fileId}/comments/{commentId}", 2772 // "request": { 2773 // "$ref": "Comment" 2774 // }, 2775 // "response": { 2776 // "$ref": "Comment" 2777 // }, 2778 // "scopes": [ 2779 // "https://www.googleapis.com/auth/drive", 2780 // "https://www.googleapis.com/auth/drive.file" 2781 // ] 2782 // } 2783 2784 } 2785 2786 // method id "drive.files.copy": 2787 2788 type FilesCopyCall struct { 2789 s *Service 2790 fileId string 2791 file *File 2792 opt_ map[string]interface{} 2793 } 2794 2795 // Copy: Creates a copy of the specified file. 2796 func (r *FilesService) Copy(fileId string, file *File) *FilesCopyCall { 2797 c := &FilesCopyCall{s: r.s, opt_: make(map[string]interface{})} 2798 c.fileId = fileId 2799 c.file = file 2800 return c 2801 } 2802 2803 // Convert sets the optional parameter "convert": Whether to convert 2804 // this file to the corresponding Google Docs format. 2805 func (c *FilesCopyCall) Convert(convert bool) *FilesCopyCall { 2806 c.opt_["convert"] = convert 2807 return c 2808 } 2809 2810 // Ocr sets the optional parameter "ocr": Whether to attempt OCR on 2811 // .jpg, .png, .gif, or .pdf uploads. 2812 func (c *FilesCopyCall) Ocr(ocr bool) *FilesCopyCall { 2813 c.opt_["ocr"] = ocr 2814 return c 2815 } 2816 2817 // OcrLanguage sets the optional parameter "ocrLanguage": If ocr is 2818 // true, hints at the language to use. Valid values are ISO 639-1 codes. 2819 func (c *FilesCopyCall) OcrLanguage(ocrLanguage string) *FilesCopyCall { 2820 c.opt_["ocrLanguage"] = ocrLanguage 2821 return c 2822 } 2823 2824 // Pinned sets the optional parameter "pinned": Whether to pin the head 2825 // revision of the new copy. 2826 func (c *FilesCopyCall) Pinned(pinned bool) *FilesCopyCall { 2827 c.opt_["pinned"] = pinned 2828 return c 2829 } 2830 2831 // TimedTextLanguage sets the optional parameter "timedTextLanguage": 2832 // The language of the timed text. 2833 func (c *FilesCopyCall) TimedTextLanguage(timedTextLanguage string) *FilesCopyCall { 2834 c.opt_["timedTextLanguage"] = timedTextLanguage 2835 return c 2836 } 2837 2838 // TimedTextTrackName sets the optional parameter "timedTextTrackName": 2839 // The timed text track name. 2840 func (c *FilesCopyCall) TimedTextTrackName(timedTextTrackName string) *FilesCopyCall { 2841 c.opt_["timedTextTrackName"] = timedTextTrackName 2842 return c 2843 } 2844 2845 // Visibility sets the optional parameter "visibility": The visibility 2846 // of the new file. This parameter is only relevant when the source is 2847 // not a native Google Doc and convert=false. 2848 func (c *FilesCopyCall) Visibility(visibility string) *FilesCopyCall { 2849 c.opt_["visibility"] = visibility 2850 return c 2851 } 2852 2853 func (c *FilesCopyCall) Do() (*File, error) { 2854 var body io.Reader = nil 2855 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 2856 if err != nil { 2857 return nil, err 2858 } 2859 ctype := "application/json" 2860 params := make(url.Values) 2861 params.Set("alt", "json") 2862 if v, ok := c.opt_["convert"]; ok { 2863 params.Set("convert", fmt.Sprintf("%v", v)) 2864 } 2865 if v, ok := c.opt_["ocr"]; ok { 2866 params.Set("ocr", fmt.Sprintf("%v", v)) 2867 } 2868 if v, ok := c.opt_["ocrLanguage"]; ok { 2869 params.Set("ocrLanguage", fmt.Sprintf("%v", v)) 2870 } 2871 if v, ok := c.opt_["pinned"]; ok { 2872 params.Set("pinned", fmt.Sprintf("%v", v)) 2873 } 2874 if v, ok := c.opt_["timedTextLanguage"]; ok { 2875 params.Set("timedTextLanguage", fmt.Sprintf("%v", v)) 2876 } 2877 if v, ok := c.opt_["timedTextTrackName"]; ok { 2878 params.Set("timedTextTrackName", fmt.Sprintf("%v", v)) 2879 } 2880 if v, ok := c.opt_["visibility"]; ok { 2881 params.Set("visibility", fmt.Sprintf("%v", v)) 2882 } 2883 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/copy") 2884 urls += "?" + params.Encode() 2885 req, _ := http.NewRequest("POST", urls, body) 2886 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 2887 googleapi.SetOpaque(req.URL) 2888 req.Header.Set("Content-Type", ctype) 2889 req.Header.Set("User-Agent", "google-api-go-client/0.5") 2890 res, err := c.s.client.Do(req) 2891 if err != nil { 2892 return nil, err 2893 } 2894 defer res.Body.Close() 2895 if err := googleapi.CheckResponse(res); err != nil { 2896 return nil, err 2897 } 2898 ret := new(File) 2899 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 2900 return nil, err 2901 } 2902 return ret, nil 2903 // { 2904 // "description": "Creates a copy of the specified file.", 2905 // "httpMethod": "POST", 2906 // "id": "drive.files.copy", 2907 // "parameterOrder": [ 2908 // "fileId" 2909 // ], 2910 // "parameters": { 2911 // "convert": { 2912 // "default": "false", 2913 // "description": "Whether to convert this file to the corresponding Google Docs format.", 2914 // "location": "query", 2915 // "type": "boolean" 2916 // }, 2917 // "fileId": { 2918 // "description": "The ID of the file to copy.", 2919 // "location": "path", 2920 // "required": true, 2921 // "type": "string" 2922 // }, 2923 // "ocr": { 2924 // "default": "false", 2925 // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", 2926 // "location": "query", 2927 // "type": "boolean" 2928 // }, 2929 // "ocrLanguage": { 2930 // "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", 2931 // "location": "query", 2932 // "type": "string" 2933 // }, 2934 // "pinned": { 2935 // "default": "false", 2936 // "description": "Whether to pin the head revision of the new copy.", 2937 // "location": "query", 2938 // "type": "boolean" 2939 // }, 2940 // "timedTextLanguage": { 2941 // "description": "The language of the timed text.", 2942 // "location": "query", 2943 // "type": "string" 2944 // }, 2945 // "timedTextTrackName": { 2946 // "description": "The timed text track name.", 2947 // "location": "query", 2948 // "type": "string" 2949 // }, 2950 // "visibility": { 2951 // "default": "DEFAULT", 2952 // "description": "The visibility of the new file. This parameter is only relevant when the source is not a native Google Doc and convert=false.", 2953 // "enum": [ 2954 // "DEFAULT", 2955 // "PRIVATE" 2956 // ], 2957 // "enumDescriptions": [ 2958 // "The visibility of the new file is determined by the user's default visibility/sharing policies.", 2959 // "The new file will be visible to only the owner." 2960 // ], 2961 // "location": "query", 2962 // "type": "string" 2963 // } 2964 // }, 2965 // "path": "files/{fileId}/copy", 2966 // "request": { 2967 // "$ref": "File" 2968 // }, 2969 // "response": { 2970 // "$ref": "File" 2971 // }, 2972 // "scopes": [ 2973 // "https://www.googleapis.com/auth/drive", 2974 // "https://www.googleapis.com/auth/drive.appdata", 2975 // "https://www.googleapis.com/auth/drive.apps.readonly", 2976 // "https://www.googleapis.com/auth/drive.file" 2977 // ] 2978 // } 2979 2980 } 2981 2982 // method id "drive.files.delete": 2983 2984 type FilesDeleteCall struct { 2985 s *Service 2986 fileId string 2987 opt_ map[string]interface{} 2988 } 2989 2990 // Delete: Permanently deletes a file by ID. Skips the trash. 2991 func (r *FilesService) Delete(fileId string) *FilesDeleteCall { 2992 c := &FilesDeleteCall{s: r.s, opt_: make(map[string]interface{})} 2993 c.fileId = fileId 2994 return c 2995 } 2996 2997 func (c *FilesDeleteCall) Do() error { 2998 var body io.Reader = nil 2999 params := make(url.Values) 3000 params.Set("alt", "json") 3001 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}") 3002 urls += "?" + params.Encode() 3003 req, _ := http.NewRequest("DELETE", urls, body) 3004 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 3005 googleapi.SetOpaque(req.URL) 3006 req.Header.Set("User-Agent", "google-api-go-client/0.5") 3007 res, err := c.s.client.Do(req) 3008 if err != nil { 3009 return err 3010 } 3011 defer res.Body.Close() 3012 if err := googleapi.CheckResponse(res); err != nil { 3013 return err 3014 } 3015 return nil 3016 // { 3017 // "description": "Permanently deletes a file by ID. Skips the trash.", 3018 // "httpMethod": "DELETE", 3019 // "id": "drive.files.delete", 3020 // "parameterOrder": [ 3021 // "fileId" 3022 // ], 3023 // "parameters": { 3024 // "fileId": { 3025 // "description": "The ID of the file to delete.", 3026 // "location": "path", 3027 // "required": true, 3028 // "type": "string" 3029 // } 3030 // }, 3031 // "path": "files/{fileId}", 3032 // "scopes": [ 3033 // "https://www.googleapis.com/auth/drive", 3034 // "https://www.googleapis.com/auth/drive.appdata", 3035 // "https://www.googleapis.com/auth/drive.file" 3036 // ] 3037 // } 3038 3039 } 3040 3041 // method id "drive.files.get": 3042 3043 type FilesGetCall struct { 3044 s *Service 3045 fileId string 3046 opt_ map[string]interface{} 3047 } 3048 3049 // Get: Gets a file's metadata by ID. 3050 func (r *FilesService) Get(fileId string) *FilesGetCall { 3051 c := &FilesGetCall{s: r.s, opt_: make(map[string]interface{})} 3052 c.fileId = fileId 3053 return c 3054 } 3055 3056 // Projection sets the optional parameter "projection": This parameter 3057 // is deprecated and has no function. 3058 func (c *FilesGetCall) Projection(projection string) *FilesGetCall { 3059 c.opt_["projection"] = projection 3060 return c 3061 } 3062 3063 // UpdateViewedDate sets the optional parameter "updateViewedDate": 3064 // Whether to update the view date after successfully retrieving the 3065 // file. 3066 func (c *FilesGetCall) UpdateViewedDate(updateViewedDate bool) *FilesGetCall { 3067 c.opt_["updateViewedDate"] = updateViewedDate 3068 return c 3069 } 3070 3071 func (c *FilesGetCall) Do() (*File, error) { 3072 var body io.Reader = nil 3073 params := make(url.Values) 3074 params.Set("alt", "json") 3075 if v, ok := c.opt_["projection"]; ok { 3076 params.Set("projection", fmt.Sprintf("%v", v)) 3077 } 3078 if v, ok := c.opt_["updateViewedDate"]; ok { 3079 params.Set("updateViewedDate", fmt.Sprintf("%v", v)) 3080 } 3081 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}") 3082 urls += "?" + params.Encode() 3083 req, _ := http.NewRequest("GET", urls, body) 3084 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 3085 googleapi.SetOpaque(req.URL) 3086 req.Header.Set("User-Agent", "google-api-go-client/0.5") 3087 res, err := c.s.client.Do(req) 3088 if err != nil { 3089 return nil, err 3090 } 3091 defer res.Body.Close() 3092 if err := googleapi.CheckResponse(res); err != nil { 3093 return nil, err 3094 } 3095 ret := new(File) 3096 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 3097 return nil, err 3098 } 3099 return ret, nil 3100 // { 3101 // "description": "Gets a file's metadata by ID.", 3102 // "httpMethod": "GET", 3103 // "id": "drive.files.get", 3104 // "parameterOrder": [ 3105 // "fileId" 3106 // ], 3107 // "parameters": { 3108 // "fileId": { 3109 // "description": "The ID for the file in question.", 3110 // "location": "path", 3111 // "required": true, 3112 // "type": "string" 3113 // }, 3114 // "projection": { 3115 // "description": "This parameter is deprecated and has no function.", 3116 // "enum": [ 3117 // "BASIC", 3118 // "FULL" 3119 // ], 3120 // "enumDescriptions": [ 3121 // "Deprecated", 3122 // "Deprecated" 3123 // ], 3124 // "location": "query", 3125 // "type": "string" 3126 // }, 3127 // "updateViewedDate": { 3128 // "default": "false", 3129 // "description": "Whether to update the view date after successfully retrieving the file.", 3130 // "location": "query", 3131 // "type": "boolean" 3132 // } 3133 // }, 3134 // "path": "files/{fileId}", 3135 // "response": { 3136 // "$ref": "File" 3137 // }, 3138 // "scopes": [ 3139 // "https://www.googleapis.com/auth/drive", 3140 // "https://www.googleapis.com/auth/drive.appdata", 3141 // "https://www.googleapis.com/auth/drive.apps.readonly", 3142 // "https://www.googleapis.com/auth/drive.file", 3143 // "https://www.googleapis.com/auth/drive.metadata.readonly", 3144 // "https://www.googleapis.com/auth/drive.readonly" 3145 // ], 3146 // "supportsSubscription": true 3147 // } 3148 3149 } 3150 3151 // method id "drive.files.insert": 3152 3153 type FilesInsertCall struct { 3154 s *Service 3155 file *File 3156 opt_ map[string]interface{} 3157 media_ io.Reader 3158 } 3159 3160 // Insert: Insert a new file. 3161 func (r *FilesService) Insert(file *File) *FilesInsertCall { 3162 c := &FilesInsertCall{s: r.s, opt_: make(map[string]interface{})} 3163 c.file = file 3164 return c 3165 } 3166 3167 // Convert sets the optional parameter "convert": Whether to convert 3168 // this file to the corresponding Google Docs format. 3169 func (c *FilesInsertCall) Convert(convert bool) *FilesInsertCall { 3170 c.opt_["convert"] = convert 3171 return c 3172 } 3173 3174 // Ocr sets the optional parameter "ocr": Whether to attempt OCR on 3175 // .jpg, .png, .gif, or .pdf uploads. 3176 func (c *FilesInsertCall) Ocr(ocr bool) *FilesInsertCall { 3177 c.opt_["ocr"] = ocr 3178 return c 3179 } 3180 3181 // OcrLanguage sets the optional parameter "ocrLanguage": If ocr is 3182 // true, hints at the language to use. Valid values are ISO 639-1 codes. 3183 func (c *FilesInsertCall) OcrLanguage(ocrLanguage string) *FilesInsertCall { 3184 c.opt_["ocrLanguage"] = ocrLanguage 3185 return c 3186 } 3187 3188 // Pinned sets the optional parameter "pinned": Whether to pin the head 3189 // revision of the uploaded file. 3190 func (c *FilesInsertCall) Pinned(pinned bool) *FilesInsertCall { 3191 c.opt_["pinned"] = pinned 3192 return c 3193 } 3194 3195 // TimedTextLanguage sets the optional parameter "timedTextLanguage": 3196 // The language of the timed text. 3197 func (c *FilesInsertCall) TimedTextLanguage(timedTextLanguage string) *FilesInsertCall { 3198 c.opt_["timedTextLanguage"] = timedTextLanguage 3199 return c 3200 } 3201 3202 // TimedTextTrackName sets the optional parameter "timedTextTrackName": 3203 // The timed text track name. 3204 func (c *FilesInsertCall) TimedTextTrackName(timedTextTrackName string) *FilesInsertCall { 3205 c.opt_["timedTextTrackName"] = timedTextTrackName 3206 return c 3207 } 3208 3209 // UseContentAsIndexableText sets the optional parameter 3210 // "useContentAsIndexableText": Whether to use the content as indexable 3211 // text. 3212 func (c *FilesInsertCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesInsertCall { 3213 c.opt_["useContentAsIndexableText"] = useContentAsIndexableText 3214 return c 3215 } 3216 3217 // Visibility sets the optional parameter "visibility": The visibility 3218 // of the new file. This parameter is only relevant when convert=false. 3219 func (c *FilesInsertCall) Visibility(visibility string) *FilesInsertCall { 3220 c.opt_["visibility"] = visibility 3221 return c 3222 } 3223 func (c *FilesInsertCall) Media(r io.Reader) *FilesInsertCall { 3224 c.media_ = r 3225 return c 3226 } 3227 3228 func (c *FilesInsertCall) Do() (*File, error) { 3229 var body io.Reader = nil 3230 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 3231 if err != nil { 3232 return nil, err 3233 } 3234 ctype := "application/json" 3235 params := make(url.Values) 3236 params.Set("alt", "json") 3237 if v, ok := c.opt_["convert"]; ok { 3238 params.Set("convert", fmt.Sprintf("%v", v)) 3239 } 3240 if v, ok := c.opt_["ocr"]; ok { 3241 params.Set("ocr", fmt.Sprintf("%v", v)) 3242 } 3243 if v, ok := c.opt_["ocrLanguage"]; ok { 3244 params.Set("ocrLanguage", fmt.Sprintf("%v", v)) 3245 } 3246 if v, ok := c.opt_["pinned"]; ok { 3247 params.Set("pinned", fmt.Sprintf("%v", v)) 3248 } 3249 if v, ok := c.opt_["timedTextLanguage"]; ok { 3250 params.Set("timedTextLanguage", fmt.Sprintf("%v", v)) 3251 } 3252 if v, ok := c.opt_["timedTextTrackName"]; ok { 3253 params.Set("timedTextTrackName", fmt.Sprintf("%v", v)) 3254 } 3255 if v, ok := c.opt_["useContentAsIndexableText"]; ok { 3256 params.Set("useContentAsIndexableText", fmt.Sprintf("%v", v)) 3257 } 3258 if v, ok := c.opt_["visibility"]; ok { 3259 params.Set("visibility", fmt.Sprintf("%v", v)) 3260 } 3261 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files") 3262 if c.media_ != nil { 3263 urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) 3264 params.Set("uploadType", "multipart") 3265 } 3266 urls += "?" + params.Encode() 3267 contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) 3268 req, _ := http.NewRequest("POST", urls, body) 3269 googleapi.SetOpaque(req.URL) 3270 if hasMedia_ { 3271 req.ContentLength = contentLength_ 3272 } 3273 req.Header.Set("Content-Type", ctype) 3274 req.Header.Set("User-Agent", "google-api-go-client/0.5") 3275 res, err := c.s.client.Do(req) 3276 if err != nil { 3277 return nil, err 3278 } 3279 defer res.Body.Close() 3280 if err := googleapi.CheckResponse(res); err != nil { 3281 return nil, err 3282 } 3283 ret := new(File) 3284 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 3285 return nil, err 3286 } 3287 return ret, nil 3288 // { 3289 // "description": "Insert a new file.", 3290 // "httpMethod": "POST", 3291 // "id": "drive.files.insert", 3292 // "mediaUpload": { 3293 // "accept": [ 3294 // "*/*" 3295 // ], 3296 // "maxSize": "10GB", 3297 // "protocols": { 3298 // "resumable": { 3299 // "multipart": true, 3300 // "path": "/resumable/upload/drive/v2/files" 3301 // }, 3302 // "simple": { 3303 // "multipart": true, 3304 // "path": "/upload/drive/v2/files" 3305 // } 3306 // } 3307 // }, 3308 // "parameters": { 3309 // "convert": { 3310 // "default": "false", 3311 // "description": "Whether to convert this file to the corresponding Google Docs format.", 3312 // "location": "query", 3313 // "type": "boolean" 3314 // }, 3315 // "ocr": { 3316 // "default": "false", 3317 // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", 3318 // "location": "query", 3319 // "type": "boolean" 3320 // }, 3321 // "ocrLanguage": { 3322 // "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", 3323 // "location": "query", 3324 // "type": "string" 3325 // }, 3326 // "pinned": { 3327 // "default": "false", 3328 // "description": "Whether to pin the head revision of the uploaded file.", 3329 // "location": "query", 3330 // "type": "boolean" 3331 // }, 3332 // "timedTextLanguage": { 3333 // "description": "The language of the timed text.", 3334 // "location": "query", 3335 // "type": "string" 3336 // }, 3337 // "timedTextTrackName": { 3338 // "description": "The timed text track name.", 3339 // "location": "query", 3340 // "type": "string" 3341 // }, 3342 // "useContentAsIndexableText": { 3343 // "default": "false", 3344 // "description": "Whether to use the content as indexable text.", 3345 // "location": "query", 3346 // "type": "boolean" 3347 // }, 3348 // "visibility": { 3349 // "default": "DEFAULT", 3350 // "description": "The visibility of the new file. This parameter is only relevant when convert=false.", 3351 // "enum": [ 3352 // "DEFAULT", 3353 // "PRIVATE" 3354 // ], 3355 // "enumDescriptions": [ 3356 // "The visibility of the new file is determined by the user's default visibility/sharing policies.", 3357 // "The new file will be visible to only the owner." 3358 // ], 3359 // "location": "query", 3360 // "type": "string" 3361 // } 3362 // }, 3363 // "path": "files", 3364 // "request": { 3365 // "$ref": "File" 3366 // }, 3367 // "response": { 3368 // "$ref": "File" 3369 // }, 3370 // "scopes": [ 3371 // "https://www.googleapis.com/auth/drive", 3372 // "https://www.googleapis.com/auth/drive.appdata", 3373 // "https://www.googleapis.com/auth/drive.apps.readonly", 3374 // "https://www.googleapis.com/auth/drive.file" 3375 // ], 3376 // "supportsMediaUpload": true, 3377 // "supportsSubscription": true 3378 // } 3379 3380 } 3381 3382 // method id "drive.files.list": 3383 3384 type FilesListCall struct { 3385 s *Service 3386 opt_ map[string]interface{} 3387 } 3388 3389 // List: Lists the user's files. 3390 func (r *FilesService) List() *FilesListCall { 3391 c := &FilesListCall{s: r.s, opt_: make(map[string]interface{})} 3392 return c 3393 } 3394 3395 // MaxResults sets the optional parameter "maxResults": Maximum number 3396 // of files to return. 3397 func (c *FilesListCall) MaxResults(maxResults int64) *FilesListCall { 3398 c.opt_["maxResults"] = maxResults 3399 return c 3400 } 3401 3402 // PageToken sets the optional parameter "pageToken": Page token for 3403 // files. 3404 func (c *FilesListCall) PageToken(pageToken string) *FilesListCall { 3405 c.opt_["pageToken"] = pageToken 3406 return c 3407 } 3408 3409 // Projection sets the optional parameter "projection": This parameter 3410 // is deprecated and has no function. 3411 func (c *FilesListCall) Projection(projection string) *FilesListCall { 3412 c.opt_["projection"] = projection 3413 return c 3414 } 3415 3416 // Q sets the optional parameter "q": Query string for searching files. 3417 func (c *FilesListCall) Q(q string) *FilesListCall { 3418 c.opt_["q"] = q 3419 return c 3420 } 3421 3422 func (c *FilesListCall) Do() (*FileList, error) { 3423 var body io.Reader = nil 3424 params := make(url.Values) 3425 params.Set("alt", "json") 3426 if v, ok := c.opt_["maxResults"]; ok { 3427 params.Set("maxResults", fmt.Sprintf("%v", v)) 3428 } 3429 if v, ok := c.opt_["pageToken"]; ok { 3430 params.Set("pageToken", fmt.Sprintf("%v", v)) 3431 } 3432 if v, ok := c.opt_["projection"]; ok { 3433 params.Set("projection", fmt.Sprintf("%v", v)) 3434 } 3435 if v, ok := c.opt_["q"]; ok { 3436 params.Set("q", fmt.Sprintf("%v", v)) 3437 } 3438 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files") 3439 urls += "?" + params.Encode() 3440 req, _ := http.NewRequest("GET", urls, body) 3441 googleapi.SetOpaque(req.URL) 3442 req.Header.Set("User-Agent", "google-api-go-client/0.5") 3443 res, err := c.s.client.Do(req) 3444 if err != nil { 3445 return nil, err 3446 } 3447 defer res.Body.Close() 3448 if err := googleapi.CheckResponse(res); err != nil { 3449 return nil, err 3450 } 3451 ret := new(FileList) 3452 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 3453 return nil, err 3454 } 3455 return ret, nil 3456 // { 3457 // "description": "Lists the user's files.", 3458 // "httpMethod": "GET", 3459 // "id": "drive.files.list", 3460 // "parameters": { 3461 // "maxResults": { 3462 // "default": "100", 3463 // "description": "Maximum number of files to return.", 3464 // "format": "int32", 3465 // "location": "query", 3466 // "minimum": "0", 3467 // "type": "integer" 3468 // }, 3469 // "pageToken": { 3470 // "description": "Page token for files.", 3471 // "location": "query", 3472 // "type": "string" 3473 // }, 3474 // "projection": { 3475 // "description": "This parameter is deprecated and has no function.", 3476 // "enum": [ 3477 // "BASIC", 3478 // "FULL" 3479 // ], 3480 // "enumDescriptions": [ 3481 // "Deprecated", 3482 // "Deprecated" 3483 // ], 3484 // "location": "query", 3485 // "type": "string" 3486 // }, 3487 // "q": { 3488 // "description": "Query string for searching files.", 3489 // "location": "query", 3490 // "type": "string" 3491 // } 3492 // }, 3493 // "path": "files", 3494 // "response": { 3495 // "$ref": "FileList" 3496 // }, 3497 // "scopes": [ 3498 // "https://www.googleapis.com/auth/drive", 3499 // "https://www.googleapis.com/auth/drive.appdata", 3500 // "https://www.googleapis.com/auth/drive.apps.readonly", 3501 // "https://www.googleapis.com/auth/drive.file", 3502 // "https://www.googleapis.com/auth/drive.metadata.readonly", 3503 // "https://www.googleapis.com/auth/drive.readonly" 3504 // ] 3505 // } 3506 3507 } 3508 3509 // method id "drive.files.patch": 3510 3511 type FilesPatchCall struct { 3512 s *Service 3513 fileId string 3514 file *File 3515 opt_ map[string]interface{} 3516 } 3517 3518 // Patch: Updates file metadata and/or content. This method supports 3519 // patch semantics. 3520 func (r *FilesService) Patch(fileId string, file *File) *FilesPatchCall { 3521 c := &FilesPatchCall{s: r.s, opt_: make(map[string]interface{})} 3522 c.fileId = fileId 3523 c.file = file 3524 return c 3525 } 3526 3527 // Convert sets the optional parameter "convert": Whether to convert 3528 // this file to the corresponding Google Docs format. 3529 func (c *FilesPatchCall) Convert(convert bool) *FilesPatchCall { 3530 c.opt_["convert"] = convert 3531 return c 3532 } 3533 3534 // NewRevision sets the optional parameter "newRevision": Whether a blob 3535 // upload should create a new revision. If not set or false, the blob 3536 // data in the current head revision is replaced. If true, a new blob is 3537 // created as head revision, and previous revisions are preserved 3538 // (causing increased use of the user's data storage quota). 3539 func (c *FilesPatchCall) NewRevision(newRevision bool) *FilesPatchCall { 3540 c.opt_["newRevision"] = newRevision 3541 return c 3542 } 3543 3544 // Ocr sets the optional parameter "ocr": Whether to attempt OCR on 3545 // .jpg, .png, .gif, or .pdf uploads. 3546 func (c *FilesPatchCall) Ocr(ocr bool) *FilesPatchCall { 3547 c.opt_["ocr"] = ocr 3548 return c 3549 } 3550 3551 // OcrLanguage sets the optional parameter "ocrLanguage": If ocr is 3552 // true, hints at the language to use. Valid values are ISO 639-1 codes. 3553 func (c *FilesPatchCall) OcrLanguage(ocrLanguage string) *FilesPatchCall { 3554 c.opt_["ocrLanguage"] = ocrLanguage 3555 return c 3556 } 3557 3558 // Pinned sets the optional parameter "pinned": Whether to pin the new 3559 // revision. 3560 func (c *FilesPatchCall) Pinned(pinned bool) *FilesPatchCall { 3561 c.opt_["pinned"] = pinned 3562 return c 3563 } 3564 3565 // SetModifiedDate sets the optional parameter "setModifiedDate": 3566 // Whether to set the modified date with the supplied modified date. 3567 func (c *FilesPatchCall) SetModifiedDate(setModifiedDate bool) *FilesPatchCall { 3568 c.opt_["setModifiedDate"] = setModifiedDate 3569 return c 3570 } 3571 3572 // TimedTextLanguage sets the optional parameter "timedTextLanguage": 3573 // The language of the timed text. 3574 func (c *FilesPatchCall) TimedTextLanguage(timedTextLanguage string) *FilesPatchCall { 3575 c.opt_["timedTextLanguage"] = timedTextLanguage 3576 return c 3577 } 3578 3579 // TimedTextTrackName sets the optional parameter "timedTextTrackName": 3580 // The timed text track name. 3581 func (c *FilesPatchCall) TimedTextTrackName(timedTextTrackName string) *FilesPatchCall { 3582 c.opt_["timedTextTrackName"] = timedTextTrackName 3583 return c 3584 } 3585 3586 // UpdateViewedDate sets the optional parameter "updateViewedDate": 3587 // Whether to update the view date after successfully updating the file. 3588 func (c *FilesPatchCall) UpdateViewedDate(updateViewedDate bool) *FilesPatchCall { 3589 c.opt_["updateViewedDate"] = updateViewedDate 3590 return c 3591 } 3592 3593 // UseContentAsIndexableText sets the optional parameter 3594 // "useContentAsIndexableText": Whether to use the content as indexable 3595 // text. 3596 func (c *FilesPatchCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesPatchCall { 3597 c.opt_["useContentAsIndexableText"] = useContentAsIndexableText 3598 return c 3599 } 3600 3601 func (c *FilesPatchCall) Do() (*File, error) { 3602 var body io.Reader = nil 3603 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 3604 if err != nil { 3605 return nil, err 3606 } 3607 ctype := "application/json" 3608 params := make(url.Values) 3609 params.Set("alt", "json") 3610 if v, ok := c.opt_["convert"]; ok { 3611 params.Set("convert", fmt.Sprintf("%v", v)) 3612 } 3613 if v, ok := c.opt_["newRevision"]; ok { 3614 params.Set("newRevision", fmt.Sprintf("%v", v)) 3615 } 3616 if v, ok := c.opt_["ocr"]; ok { 3617 params.Set("ocr", fmt.Sprintf("%v", v)) 3618 } 3619 if v, ok := c.opt_["ocrLanguage"]; ok { 3620 params.Set("ocrLanguage", fmt.Sprintf("%v", v)) 3621 } 3622 if v, ok := c.opt_["pinned"]; ok { 3623 params.Set("pinned", fmt.Sprintf("%v", v)) 3624 } 3625 if v, ok := c.opt_["setModifiedDate"]; ok { 3626 params.Set("setModifiedDate", fmt.Sprintf("%v", v)) 3627 } 3628 if v, ok := c.opt_["timedTextLanguage"]; ok { 3629 params.Set("timedTextLanguage", fmt.Sprintf("%v", v)) 3630 } 3631 if v, ok := c.opt_["timedTextTrackName"]; ok { 3632 params.Set("timedTextTrackName", fmt.Sprintf("%v", v)) 3633 } 3634 if v, ok := c.opt_["updateViewedDate"]; ok { 3635 params.Set("updateViewedDate", fmt.Sprintf("%v", v)) 3636 } 3637 if v, ok := c.opt_["useContentAsIndexableText"]; ok { 3638 params.Set("useContentAsIndexableText", fmt.Sprintf("%v", v)) 3639 } 3640 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}") 3641 urls += "?" + params.Encode() 3642 req, _ := http.NewRequest("PATCH", urls, body) 3643 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 3644 googleapi.SetOpaque(req.URL) 3645 req.Header.Set("Content-Type", ctype) 3646 req.Header.Set("User-Agent", "google-api-go-client/0.5") 3647 res, err := c.s.client.Do(req) 3648 if err != nil { 3649 return nil, err 3650 } 3651 defer res.Body.Close() 3652 if err := googleapi.CheckResponse(res); err != nil { 3653 return nil, err 3654 } 3655 ret := new(File) 3656 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 3657 return nil, err 3658 } 3659 return ret, nil 3660 // { 3661 // "description": "Updates file metadata and/or content. This method supports patch semantics.", 3662 // "httpMethod": "PATCH", 3663 // "id": "drive.files.patch", 3664 // "parameterOrder": [ 3665 // "fileId" 3666 // ], 3667 // "parameters": { 3668 // "convert": { 3669 // "default": "false", 3670 // "description": "Whether to convert this file to the corresponding Google Docs format.", 3671 // "location": "query", 3672 // "type": "boolean" 3673 // }, 3674 // "fileId": { 3675 // "description": "The ID of the file to update.", 3676 // "location": "path", 3677 // "required": true, 3678 // "type": "string" 3679 // }, 3680 // "newRevision": { 3681 // "default": "true", 3682 // "description": "Whether a blob upload should create a new revision. If not set or false, the blob data in the current head revision is replaced. If true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).", 3683 // "location": "query", 3684 // "type": "boolean" 3685 // }, 3686 // "ocr": { 3687 // "default": "false", 3688 // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", 3689 // "location": "query", 3690 // "type": "boolean" 3691 // }, 3692 // "ocrLanguage": { 3693 // "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", 3694 // "location": "query", 3695 // "type": "string" 3696 // }, 3697 // "pinned": { 3698 // "default": "false", 3699 // "description": "Whether to pin the new revision.", 3700 // "location": "query", 3701 // "type": "boolean" 3702 // }, 3703 // "setModifiedDate": { 3704 // "default": "false", 3705 // "description": "Whether to set the modified date with the supplied modified date.", 3706 // "location": "query", 3707 // "type": "boolean" 3708 // }, 3709 // "timedTextLanguage": { 3710 // "description": "The language of the timed text.", 3711 // "location": "query", 3712 // "type": "string" 3713 // }, 3714 // "timedTextTrackName": { 3715 // "description": "The timed text track name.", 3716 // "location": "query", 3717 // "type": "string" 3718 // }, 3719 // "updateViewedDate": { 3720 // "default": "true", 3721 // "description": "Whether to update the view date after successfully updating the file.", 3722 // "location": "query", 3723 // "type": "boolean" 3724 // }, 3725 // "useContentAsIndexableText": { 3726 // "default": "false", 3727 // "description": "Whether to use the content as indexable text.", 3728 // "location": "query", 3729 // "type": "boolean" 3730 // } 3731 // }, 3732 // "path": "files/{fileId}", 3733 // "request": { 3734 // "$ref": "File" 3735 // }, 3736 // "response": { 3737 // "$ref": "File" 3738 // }, 3739 // "scopes": [ 3740 // "https://www.googleapis.com/auth/drive", 3741 // "https://www.googleapis.com/auth/drive.appdata", 3742 // "https://www.googleapis.com/auth/drive.apps.readonly", 3743 // "https://www.googleapis.com/auth/drive.file", 3744 // "https://www.googleapis.com/auth/drive.scripts" 3745 // ] 3746 // } 3747 3748 } 3749 3750 // method id "drive.files.touch": 3751 3752 type FilesTouchCall struct { 3753 s *Service 3754 fileId string 3755 opt_ map[string]interface{} 3756 } 3757 3758 // Touch: Set the file's updated time to the current server time. 3759 func (r *FilesService) Touch(fileId string) *FilesTouchCall { 3760 c := &FilesTouchCall{s: r.s, opt_: make(map[string]interface{})} 3761 c.fileId = fileId 3762 return c 3763 } 3764 3765 func (c *FilesTouchCall) Do() (*File, error) { 3766 var body io.Reader = nil 3767 params := make(url.Values) 3768 params.Set("alt", "json") 3769 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/touch") 3770 urls += "?" + params.Encode() 3771 req, _ := http.NewRequest("POST", urls, body) 3772 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 3773 googleapi.SetOpaque(req.URL) 3774 req.Header.Set("User-Agent", "google-api-go-client/0.5") 3775 res, err := c.s.client.Do(req) 3776 if err != nil { 3777 return nil, err 3778 } 3779 defer res.Body.Close() 3780 if err := googleapi.CheckResponse(res); err != nil { 3781 return nil, err 3782 } 3783 ret := new(File) 3784 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 3785 return nil, err 3786 } 3787 return ret, nil 3788 // { 3789 // "description": "Set the file's updated time to the current server time.", 3790 // "httpMethod": "POST", 3791 // "id": "drive.files.touch", 3792 // "parameterOrder": [ 3793 // "fileId" 3794 // ], 3795 // "parameters": { 3796 // "fileId": { 3797 // "description": "The ID of the file to update.", 3798 // "location": "path", 3799 // "required": true, 3800 // "type": "string" 3801 // } 3802 // }, 3803 // "path": "files/{fileId}/touch", 3804 // "response": { 3805 // "$ref": "File" 3806 // }, 3807 // "scopes": [ 3808 // "https://www.googleapis.com/auth/drive", 3809 // "https://www.googleapis.com/auth/drive.appdata", 3810 // "https://www.googleapis.com/auth/drive.apps.readonly", 3811 // "https://www.googleapis.com/auth/drive.file" 3812 // ] 3813 // } 3814 3815 } 3816 3817 // method id "drive.files.trash": 3818 3819 type FilesTrashCall struct { 3820 s *Service 3821 fileId string 3822 opt_ map[string]interface{} 3823 } 3824 3825 // Trash: Moves a file to the trash. 3826 func (r *FilesService) Trash(fileId string) *FilesTrashCall { 3827 c := &FilesTrashCall{s: r.s, opt_: make(map[string]interface{})} 3828 c.fileId = fileId 3829 return c 3830 } 3831 3832 func (c *FilesTrashCall) Do() (*File, error) { 3833 var body io.Reader = nil 3834 params := make(url.Values) 3835 params.Set("alt", "json") 3836 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/trash") 3837 urls += "?" + params.Encode() 3838 req, _ := http.NewRequest("POST", urls, body) 3839 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 3840 googleapi.SetOpaque(req.URL) 3841 req.Header.Set("User-Agent", "google-api-go-client/0.5") 3842 res, err := c.s.client.Do(req) 3843 if err != nil { 3844 return nil, err 3845 } 3846 defer res.Body.Close() 3847 if err := googleapi.CheckResponse(res); err != nil { 3848 return nil, err 3849 } 3850 ret := new(File) 3851 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 3852 return nil, err 3853 } 3854 return ret, nil 3855 // { 3856 // "description": "Moves a file to the trash.", 3857 // "httpMethod": "POST", 3858 // "id": "drive.files.trash", 3859 // "parameterOrder": [ 3860 // "fileId" 3861 // ], 3862 // "parameters": { 3863 // "fileId": { 3864 // "description": "The ID of the file to trash.", 3865 // "location": "path", 3866 // "required": true, 3867 // "type": "string" 3868 // } 3869 // }, 3870 // "path": "files/{fileId}/trash", 3871 // "response": { 3872 // "$ref": "File" 3873 // }, 3874 // "scopes": [ 3875 // "https://www.googleapis.com/auth/drive", 3876 // "https://www.googleapis.com/auth/drive.apps.readonly", 3877 // "https://www.googleapis.com/auth/drive.file" 3878 // ] 3879 // } 3880 3881 } 3882 3883 // method id "drive.files.untrash": 3884 3885 type FilesUntrashCall struct { 3886 s *Service 3887 fileId string 3888 opt_ map[string]interface{} 3889 } 3890 3891 // Untrash: Restores a file from the trash. 3892 func (r *FilesService) Untrash(fileId string) *FilesUntrashCall { 3893 c := &FilesUntrashCall{s: r.s, opt_: make(map[string]interface{})} 3894 c.fileId = fileId 3895 return c 3896 } 3897 3898 func (c *FilesUntrashCall) Do() (*File, error) { 3899 var body io.Reader = nil 3900 params := make(url.Values) 3901 params.Set("alt", "json") 3902 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/untrash") 3903 urls += "?" + params.Encode() 3904 req, _ := http.NewRequest("POST", urls, body) 3905 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 3906 googleapi.SetOpaque(req.URL) 3907 req.Header.Set("User-Agent", "google-api-go-client/0.5") 3908 res, err := c.s.client.Do(req) 3909 if err != nil { 3910 return nil, err 3911 } 3912 defer res.Body.Close() 3913 if err := googleapi.CheckResponse(res); err != nil { 3914 return nil, err 3915 } 3916 ret := new(File) 3917 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 3918 return nil, err 3919 } 3920 return ret, nil 3921 // { 3922 // "description": "Restores a file from the trash.", 3923 // "httpMethod": "POST", 3924 // "id": "drive.files.untrash", 3925 // "parameterOrder": [ 3926 // "fileId" 3927 // ], 3928 // "parameters": { 3929 // "fileId": { 3930 // "description": "The ID of the file to untrash.", 3931 // "location": "path", 3932 // "required": true, 3933 // "type": "string" 3934 // } 3935 // }, 3936 // "path": "files/{fileId}/untrash", 3937 // "response": { 3938 // "$ref": "File" 3939 // }, 3940 // "scopes": [ 3941 // "https://www.googleapis.com/auth/drive", 3942 // "https://www.googleapis.com/auth/drive.apps.readonly", 3943 // "https://www.googleapis.com/auth/drive.file" 3944 // ] 3945 // } 3946 3947 } 3948 3949 // method id "drive.files.update": 3950 3951 type FilesUpdateCall struct { 3952 s *Service 3953 fileId string 3954 file *File 3955 opt_ map[string]interface{} 3956 media_ io.Reader 3957 } 3958 3959 // Update: Updates file metadata and/or content. 3960 func (r *FilesService) Update(fileId string, file *File) *FilesUpdateCall { 3961 c := &FilesUpdateCall{s: r.s, opt_: make(map[string]interface{})} 3962 c.fileId = fileId 3963 c.file = file 3964 return c 3965 } 3966 3967 // Convert sets the optional parameter "convert": Whether to convert 3968 // this file to the corresponding Google Docs format. 3969 func (c *FilesUpdateCall) Convert(convert bool) *FilesUpdateCall { 3970 c.opt_["convert"] = convert 3971 return c 3972 } 3973 3974 // NewRevision sets the optional parameter "newRevision": Whether a blob 3975 // upload should create a new revision. If not set or false, the blob 3976 // data in the current head revision is replaced. If true, a new blob is 3977 // created as head revision, and previous revisions are preserved 3978 // (causing increased use of the user's data storage quota). 3979 func (c *FilesUpdateCall) NewRevision(newRevision bool) *FilesUpdateCall { 3980 c.opt_["newRevision"] = newRevision 3981 return c 3982 } 3983 3984 // Ocr sets the optional parameter "ocr": Whether to attempt OCR on 3985 // .jpg, .png, .gif, or .pdf uploads. 3986 func (c *FilesUpdateCall) Ocr(ocr bool) *FilesUpdateCall { 3987 c.opt_["ocr"] = ocr 3988 return c 3989 } 3990 3991 // OcrLanguage sets the optional parameter "ocrLanguage": If ocr is 3992 // true, hints at the language to use. Valid values are ISO 639-1 codes. 3993 func (c *FilesUpdateCall) OcrLanguage(ocrLanguage string) *FilesUpdateCall { 3994 c.opt_["ocrLanguage"] = ocrLanguage 3995 return c 3996 } 3997 3998 // Pinned sets the optional parameter "pinned": Whether to pin the new 3999 // revision. 4000 func (c *FilesUpdateCall) Pinned(pinned bool) *FilesUpdateCall { 4001 c.opt_["pinned"] = pinned 4002 return c 4003 } 4004 4005 // SetModifiedDate sets the optional parameter "setModifiedDate": 4006 // Whether to set the modified date with the supplied modified date. 4007 func (c *FilesUpdateCall) SetModifiedDate(setModifiedDate bool) *FilesUpdateCall { 4008 c.opt_["setModifiedDate"] = setModifiedDate 4009 return c 4010 } 4011 4012 // TimedTextLanguage sets the optional parameter "timedTextLanguage": 4013 // The language of the timed text. 4014 func (c *FilesUpdateCall) TimedTextLanguage(timedTextLanguage string) *FilesUpdateCall { 4015 c.opt_["timedTextLanguage"] = timedTextLanguage 4016 return c 4017 } 4018 4019 // TimedTextTrackName sets the optional parameter "timedTextTrackName": 4020 // The timed text track name. 4021 func (c *FilesUpdateCall) TimedTextTrackName(timedTextTrackName string) *FilesUpdateCall { 4022 c.opt_["timedTextTrackName"] = timedTextTrackName 4023 return c 4024 } 4025 4026 // UpdateViewedDate sets the optional parameter "updateViewedDate": 4027 // Whether to update the view date after successfully updating the file. 4028 func (c *FilesUpdateCall) UpdateViewedDate(updateViewedDate bool) *FilesUpdateCall { 4029 c.opt_["updateViewedDate"] = updateViewedDate 4030 return c 4031 } 4032 4033 // UseContentAsIndexableText sets the optional parameter 4034 // "useContentAsIndexableText": Whether to use the content as indexable 4035 // text. 4036 func (c *FilesUpdateCall) UseContentAsIndexableText(useContentAsIndexableText bool) *FilesUpdateCall { 4037 c.opt_["useContentAsIndexableText"] = useContentAsIndexableText 4038 return c 4039 } 4040 func (c *FilesUpdateCall) Media(r io.Reader) *FilesUpdateCall { 4041 c.media_ = r 4042 return c 4043 } 4044 4045 func (c *FilesUpdateCall) Do() (*File, error) { 4046 var body io.Reader = nil 4047 body, err := googleapi.WithoutDataWrapper.JSONReader(c.file) 4048 if err != nil { 4049 return nil, err 4050 } 4051 ctype := "application/json" 4052 params := make(url.Values) 4053 params.Set("alt", "json") 4054 if v, ok := c.opt_["convert"]; ok { 4055 params.Set("convert", fmt.Sprintf("%v", v)) 4056 } 4057 if v, ok := c.opt_["newRevision"]; ok { 4058 params.Set("newRevision", fmt.Sprintf("%v", v)) 4059 } 4060 if v, ok := c.opt_["ocr"]; ok { 4061 params.Set("ocr", fmt.Sprintf("%v", v)) 4062 } 4063 if v, ok := c.opt_["ocrLanguage"]; ok { 4064 params.Set("ocrLanguage", fmt.Sprintf("%v", v)) 4065 } 4066 if v, ok := c.opt_["pinned"]; ok { 4067 params.Set("pinned", fmt.Sprintf("%v", v)) 4068 } 4069 if v, ok := c.opt_["setModifiedDate"]; ok { 4070 params.Set("setModifiedDate", fmt.Sprintf("%v", v)) 4071 } 4072 if v, ok := c.opt_["timedTextLanguage"]; ok { 4073 params.Set("timedTextLanguage", fmt.Sprintf("%v", v)) 4074 } 4075 if v, ok := c.opt_["timedTextTrackName"]; ok { 4076 params.Set("timedTextTrackName", fmt.Sprintf("%v", v)) 4077 } 4078 if v, ok := c.opt_["updateViewedDate"]; ok { 4079 params.Set("updateViewedDate", fmt.Sprintf("%v", v)) 4080 } 4081 if v, ok := c.opt_["useContentAsIndexableText"]; ok { 4082 params.Set("useContentAsIndexableText", fmt.Sprintf("%v", v)) 4083 } 4084 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}") 4085 if c.media_ != nil { 4086 urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1) 4087 params.Set("uploadType", "multipart") 4088 } 4089 urls += "?" + params.Encode() 4090 contentLength_, hasMedia_ := googleapi.ConditionallyIncludeMedia(c.media_, &body, &ctype) 4091 req, _ := http.NewRequest("PUT", urls, body) 4092 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 4093 googleapi.SetOpaque(req.URL) 4094 if hasMedia_ { 4095 req.ContentLength = contentLength_ 4096 } 4097 req.Header.Set("Content-Type", ctype) 4098 req.Header.Set("User-Agent", "google-api-go-client/0.5") 4099 res, err := c.s.client.Do(req) 4100 if err != nil { 4101 return nil, err 4102 } 4103 defer res.Body.Close() 4104 if err := googleapi.CheckResponse(res); err != nil { 4105 return nil, err 4106 } 4107 ret := new(File) 4108 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 4109 return nil, err 4110 } 4111 return ret, nil 4112 // { 4113 // "description": "Updates file metadata and/or content.", 4114 // "httpMethod": "PUT", 4115 // "id": "drive.files.update", 4116 // "mediaUpload": { 4117 // "accept": [ 4118 // "*/*" 4119 // ], 4120 // "maxSize": "10GB", 4121 // "protocols": { 4122 // "resumable": { 4123 // "multipart": true, 4124 // "path": "/resumable/upload/drive/v2/files/{fileId}" 4125 // }, 4126 // "simple": { 4127 // "multipart": true, 4128 // "path": "/upload/drive/v2/files/{fileId}" 4129 // } 4130 // } 4131 // }, 4132 // "parameterOrder": [ 4133 // "fileId" 4134 // ], 4135 // "parameters": { 4136 // "convert": { 4137 // "default": "false", 4138 // "description": "Whether to convert this file to the corresponding Google Docs format.", 4139 // "location": "query", 4140 // "type": "boolean" 4141 // }, 4142 // "fileId": { 4143 // "description": "The ID of the file to update.", 4144 // "location": "path", 4145 // "required": true, 4146 // "type": "string" 4147 // }, 4148 // "newRevision": { 4149 // "default": "true", 4150 // "description": "Whether a blob upload should create a new revision. If not set or false, the blob data in the current head revision is replaced. If true, a new blob is created as head revision, and previous revisions are preserved (causing increased use of the user's data storage quota).", 4151 // "location": "query", 4152 // "type": "boolean" 4153 // }, 4154 // "ocr": { 4155 // "default": "false", 4156 // "description": "Whether to attempt OCR on .jpg, .png, .gif, or .pdf uploads.", 4157 // "location": "query", 4158 // "type": "boolean" 4159 // }, 4160 // "ocrLanguage": { 4161 // "description": "If ocr is true, hints at the language to use. Valid values are ISO 639-1 codes.", 4162 // "location": "query", 4163 // "type": "string" 4164 // }, 4165 // "pinned": { 4166 // "default": "false", 4167 // "description": "Whether to pin the new revision.", 4168 // "location": "query", 4169 // "type": "boolean" 4170 // }, 4171 // "setModifiedDate": { 4172 // "default": "false", 4173 // "description": "Whether to set the modified date with the supplied modified date.", 4174 // "location": "query", 4175 // "type": "boolean" 4176 // }, 4177 // "timedTextLanguage": { 4178 // "description": "The language of the timed text.", 4179 // "location": "query", 4180 // "type": "string" 4181 // }, 4182 // "timedTextTrackName": { 4183 // "description": "The timed text track name.", 4184 // "location": "query", 4185 // "type": "string" 4186 // }, 4187 // "updateViewedDate": { 4188 // "default": "true", 4189 // "description": "Whether to update the view date after successfully updating the file.", 4190 // "location": "query", 4191 // "type": "boolean" 4192 // }, 4193 // "useContentAsIndexableText": { 4194 // "default": "false", 4195 // "description": "Whether to use the content as indexable text.", 4196 // "location": "query", 4197 // "type": "boolean" 4198 // } 4199 // }, 4200 // "path": "files/{fileId}", 4201 // "request": { 4202 // "$ref": "File" 4203 // }, 4204 // "response": { 4205 // "$ref": "File" 4206 // }, 4207 // "scopes": [ 4208 // "https://www.googleapis.com/auth/drive", 4209 // "https://www.googleapis.com/auth/drive.appdata", 4210 // "https://www.googleapis.com/auth/drive.apps.readonly", 4211 // "https://www.googleapis.com/auth/drive.file", 4212 // "https://www.googleapis.com/auth/drive.scripts" 4213 // ], 4214 // "supportsMediaUpload": true 4215 // } 4216 4217 } 4218 4219 // method id "drive.files.watch": 4220 4221 type FilesWatchCall struct { 4222 s *Service 4223 fileId string 4224 channel *Channel 4225 opt_ map[string]interface{} 4226 } 4227 4228 // Watch: Subscribe to changes on a file 4229 func (r *FilesService) Watch(fileId string, channel *Channel) *FilesWatchCall { 4230 c := &FilesWatchCall{s: r.s, opt_: make(map[string]interface{})} 4231 c.fileId = fileId 4232 c.channel = channel 4233 return c 4234 } 4235 4236 // Projection sets the optional parameter "projection": This parameter 4237 // is deprecated and has no function. 4238 func (c *FilesWatchCall) Projection(projection string) *FilesWatchCall { 4239 c.opt_["projection"] = projection 4240 return c 4241 } 4242 4243 // UpdateViewedDate sets the optional parameter "updateViewedDate": 4244 // Whether to update the view date after successfully retrieving the 4245 // file. 4246 func (c *FilesWatchCall) UpdateViewedDate(updateViewedDate bool) *FilesWatchCall { 4247 c.opt_["updateViewedDate"] = updateViewedDate 4248 return c 4249 } 4250 4251 func (c *FilesWatchCall) Do() (*Channel, error) { 4252 var body io.Reader = nil 4253 body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel) 4254 if err != nil { 4255 return nil, err 4256 } 4257 ctype := "application/json" 4258 params := make(url.Values) 4259 params.Set("alt", "json") 4260 if v, ok := c.opt_["projection"]; ok { 4261 params.Set("projection", fmt.Sprintf("%v", v)) 4262 } 4263 if v, ok := c.opt_["updateViewedDate"]; ok { 4264 params.Set("updateViewedDate", fmt.Sprintf("%v", v)) 4265 } 4266 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/watch") 4267 urls += "?" + params.Encode() 4268 req, _ := http.NewRequest("POST", urls, body) 4269 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 4270 googleapi.SetOpaque(req.URL) 4271 req.Header.Set("Content-Type", ctype) 4272 req.Header.Set("User-Agent", "google-api-go-client/0.5") 4273 res, err := c.s.client.Do(req) 4274 if err != nil { 4275 return nil, err 4276 } 4277 defer res.Body.Close() 4278 if err := googleapi.CheckResponse(res); err != nil { 4279 return nil, err 4280 } 4281 ret := new(Channel) 4282 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 4283 return nil, err 4284 } 4285 return ret, nil 4286 // { 4287 // "description": "Subscribe to changes on a file", 4288 // "httpMethod": "POST", 4289 // "id": "drive.files.watch", 4290 // "parameterOrder": [ 4291 // "fileId" 4292 // ], 4293 // "parameters": { 4294 // "fileId": { 4295 // "description": "The ID for the file in question.", 4296 // "location": "path", 4297 // "required": true, 4298 // "type": "string" 4299 // }, 4300 // "projection": { 4301 // "description": "This parameter is deprecated and has no function.", 4302 // "enum": [ 4303 // "BASIC", 4304 // "FULL" 4305 // ], 4306 // "enumDescriptions": [ 4307 // "Deprecated", 4308 // "Deprecated" 4309 // ], 4310 // "location": "query", 4311 // "type": "string" 4312 // }, 4313 // "updateViewedDate": { 4314 // "default": "false", 4315 // "description": "Whether to update the view date after successfully retrieving the file.", 4316 // "location": "query", 4317 // "type": "boolean" 4318 // } 4319 // }, 4320 // "path": "files/{fileId}/watch", 4321 // "request": { 4322 // "$ref": "Channel" 4323 // }, 4324 // "response": { 4325 // "$ref": "Channel" 4326 // }, 4327 // "scopes": [ 4328 // "https://www.googleapis.com/auth/drive", 4329 // "https://www.googleapis.com/auth/drive.appdata", 4330 // "https://www.googleapis.com/auth/drive.apps.readonly", 4331 // "https://www.googleapis.com/auth/drive.file", 4332 // "https://www.googleapis.com/auth/drive.metadata.readonly", 4333 // "https://www.googleapis.com/auth/drive.readonly" 4334 // ], 4335 // "supportsSubscription": true 4336 // } 4337 4338 } 4339 4340 // method id "drive.parents.delete": 4341 4342 type ParentsDeleteCall struct { 4343 s *Service 4344 fileId string 4345 parentId string 4346 opt_ map[string]interface{} 4347 } 4348 4349 // Delete: Removes a parent from a file. 4350 func (r *ParentsService) Delete(fileId string, parentId string) *ParentsDeleteCall { 4351 c := &ParentsDeleteCall{s: r.s, opt_: make(map[string]interface{})} 4352 c.fileId = fileId 4353 c.parentId = parentId 4354 return c 4355 } 4356 4357 func (c *ParentsDeleteCall) Do() error { 4358 var body io.Reader = nil 4359 params := make(url.Values) 4360 params.Set("alt", "json") 4361 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/parents/{parentId}") 4362 urls += "?" + params.Encode() 4363 req, _ := http.NewRequest("DELETE", urls, body) 4364 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 4365 req.URL.Path = strings.Replace(req.URL.Path, "{parentId}", url.QueryEscape(c.parentId), 1) 4366 googleapi.SetOpaque(req.URL) 4367 req.Header.Set("User-Agent", "google-api-go-client/0.5") 4368 res, err := c.s.client.Do(req) 4369 if err != nil { 4370 return err 4371 } 4372 defer res.Body.Close() 4373 if err := googleapi.CheckResponse(res); err != nil { 4374 return err 4375 } 4376 return nil 4377 // { 4378 // "description": "Removes a parent from a file.", 4379 // "httpMethod": "DELETE", 4380 // "id": "drive.parents.delete", 4381 // "parameterOrder": [ 4382 // "fileId", 4383 // "parentId" 4384 // ], 4385 // "parameters": { 4386 // "fileId": { 4387 // "description": "The ID of the file.", 4388 // "location": "path", 4389 // "required": true, 4390 // "type": "string" 4391 // }, 4392 // "parentId": { 4393 // "description": "The ID of the parent.", 4394 // "location": "path", 4395 // "required": true, 4396 // "type": "string" 4397 // } 4398 // }, 4399 // "path": "files/{fileId}/parents/{parentId}", 4400 // "scopes": [ 4401 // "https://www.googleapis.com/auth/drive", 4402 // "https://www.googleapis.com/auth/drive.file" 4403 // ] 4404 // } 4405 4406 } 4407 4408 // method id "drive.parents.get": 4409 4410 type ParentsGetCall struct { 4411 s *Service 4412 fileId string 4413 parentId string 4414 opt_ map[string]interface{} 4415 } 4416 4417 // Get: Gets a specific parent reference. 4418 func (r *ParentsService) Get(fileId string, parentId string) *ParentsGetCall { 4419 c := &ParentsGetCall{s: r.s, opt_: make(map[string]interface{})} 4420 c.fileId = fileId 4421 c.parentId = parentId 4422 return c 4423 } 4424 4425 func (c *ParentsGetCall) Do() (*ParentReference, error) { 4426 var body io.Reader = nil 4427 params := make(url.Values) 4428 params.Set("alt", "json") 4429 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/parents/{parentId}") 4430 urls += "?" + params.Encode() 4431 req, _ := http.NewRequest("GET", urls, body) 4432 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 4433 req.URL.Path = strings.Replace(req.URL.Path, "{parentId}", url.QueryEscape(c.parentId), 1) 4434 googleapi.SetOpaque(req.URL) 4435 req.Header.Set("User-Agent", "google-api-go-client/0.5") 4436 res, err := c.s.client.Do(req) 4437 if err != nil { 4438 return nil, err 4439 } 4440 defer res.Body.Close() 4441 if err := googleapi.CheckResponse(res); err != nil { 4442 return nil, err 4443 } 4444 ret := new(ParentReference) 4445 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 4446 return nil, err 4447 } 4448 return ret, nil 4449 // { 4450 // "description": "Gets a specific parent reference.", 4451 // "httpMethod": "GET", 4452 // "id": "drive.parents.get", 4453 // "parameterOrder": [ 4454 // "fileId", 4455 // "parentId" 4456 // ], 4457 // "parameters": { 4458 // "fileId": { 4459 // "description": "The ID of the file.", 4460 // "location": "path", 4461 // "required": true, 4462 // "type": "string" 4463 // }, 4464 // "parentId": { 4465 // "description": "The ID of the parent.", 4466 // "location": "path", 4467 // "required": true, 4468 // "type": "string" 4469 // } 4470 // }, 4471 // "path": "files/{fileId}/parents/{parentId}", 4472 // "response": { 4473 // "$ref": "ParentReference" 4474 // }, 4475 // "scopes": [ 4476 // "https://www.googleapis.com/auth/drive", 4477 // "https://www.googleapis.com/auth/drive.appdata", 4478 // "https://www.googleapis.com/auth/drive.file", 4479 // "https://www.googleapis.com/auth/drive.metadata.readonly", 4480 // "https://www.googleapis.com/auth/drive.readonly" 4481 // ] 4482 // } 4483 4484 } 4485 4486 // method id "drive.parents.insert": 4487 4488 type ParentsInsertCall struct { 4489 s *Service 4490 fileId string 4491 parentreference *ParentReference 4492 opt_ map[string]interface{} 4493 } 4494 4495 // Insert: Adds a parent folder for a file. 4496 func (r *ParentsService) Insert(fileId string, parentreference *ParentReference) *ParentsInsertCall { 4497 c := &ParentsInsertCall{s: r.s, opt_: make(map[string]interface{})} 4498 c.fileId = fileId 4499 c.parentreference = parentreference 4500 return c 4501 } 4502 4503 func (c *ParentsInsertCall) Do() (*ParentReference, error) { 4504 var body io.Reader = nil 4505 body, err := googleapi.WithoutDataWrapper.JSONReader(c.parentreference) 4506 if err != nil { 4507 return nil, err 4508 } 4509 ctype := "application/json" 4510 params := make(url.Values) 4511 params.Set("alt", "json") 4512 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/parents") 4513 urls += "?" + params.Encode() 4514 req, _ := http.NewRequest("POST", urls, body) 4515 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 4516 googleapi.SetOpaque(req.URL) 4517 req.Header.Set("Content-Type", ctype) 4518 req.Header.Set("User-Agent", "google-api-go-client/0.5") 4519 res, err := c.s.client.Do(req) 4520 if err != nil { 4521 return nil, err 4522 } 4523 defer res.Body.Close() 4524 if err := googleapi.CheckResponse(res); err != nil { 4525 return nil, err 4526 } 4527 ret := new(ParentReference) 4528 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 4529 return nil, err 4530 } 4531 return ret, nil 4532 // { 4533 // "description": "Adds a parent folder for a file.", 4534 // "httpMethod": "POST", 4535 // "id": "drive.parents.insert", 4536 // "parameterOrder": [ 4537 // "fileId" 4538 // ], 4539 // "parameters": { 4540 // "fileId": { 4541 // "description": "The ID of the file.", 4542 // "location": "path", 4543 // "required": true, 4544 // "type": "string" 4545 // } 4546 // }, 4547 // "path": "files/{fileId}/parents", 4548 // "request": { 4549 // "$ref": "ParentReference" 4550 // }, 4551 // "response": { 4552 // "$ref": "ParentReference" 4553 // }, 4554 // "scopes": [ 4555 // "https://www.googleapis.com/auth/drive", 4556 // "https://www.googleapis.com/auth/drive.appdata", 4557 // "https://www.googleapis.com/auth/drive.file" 4558 // ] 4559 // } 4560 4561 } 4562 4563 // method id "drive.parents.list": 4564 4565 type ParentsListCall struct { 4566 s *Service 4567 fileId string 4568 opt_ map[string]interface{} 4569 } 4570 4571 // List: Lists a file's parents. 4572 func (r *ParentsService) List(fileId string) *ParentsListCall { 4573 c := &ParentsListCall{s: r.s, opt_: make(map[string]interface{})} 4574 c.fileId = fileId 4575 return c 4576 } 4577 4578 func (c *ParentsListCall) Do() (*ParentList, error) { 4579 var body io.Reader = nil 4580 params := make(url.Values) 4581 params.Set("alt", "json") 4582 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/parents") 4583 urls += "?" + params.Encode() 4584 req, _ := http.NewRequest("GET", urls, body) 4585 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 4586 googleapi.SetOpaque(req.URL) 4587 req.Header.Set("User-Agent", "google-api-go-client/0.5") 4588 res, err := c.s.client.Do(req) 4589 if err != nil { 4590 return nil, err 4591 } 4592 defer res.Body.Close() 4593 if err := googleapi.CheckResponse(res); err != nil { 4594 return nil, err 4595 } 4596 ret := new(ParentList) 4597 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 4598 return nil, err 4599 } 4600 return ret, nil 4601 // { 4602 // "description": "Lists a file's parents.", 4603 // "httpMethod": "GET", 4604 // "id": "drive.parents.list", 4605 // "parameterOrder": [ 4606 // "fileId" 4607 // ], 4608 // "parameters": { 4609 // "fileId": { 4610 // "description": "The ID of the file.", 4611 // "location": "path", 4612 // "required": true, 4613 // "type": "string" 4614 // } 4615 // }, 4616 // "path": "files/{fileId}/parents", 4617 // "response": { 4618 // "$ref": "ParentList" 4619 // }, 4620 // "scopes": [ 4621 // "https://www.googleapis.com/auth/drive", 4622 // "https://www.googleapis.com/auth/drive.appdata", 4623 // "https://www.googleapis.com/auth/drive.file", 4624 // "https://www.googleapis.com/auth/drive.metadata.readonly", 4625 // "https://www.googleapis.com/auth/drive.readonly" 4626 // ] 4627 // } 4628 4629 } 4630 4631 // method id "drive.permissions.delete": 4632 4633 type PermissionsDeleteCall struct { 4634 s *Service 4635 fileId string 4636 permissionId string 4637 opt_ map[string]interface{} 4638 } 4639 4640 // Delete: Deletes a permission from a file. 4641 func (r *PermissionsService) Delete(fileId string, permissionId string) *PermissionsDeleteCall { 4642 c := &PermissionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} 4643 c.fileId = fileId 4644 c.permissionId = permissionId 4645 return c 4646 } 4647 4648 func (c *PermissionsDeleteCall) Do() error { 4649 var body io.Reader = nil 4650 params := make(url.Values) 4651 params.Set("alt", "json") 4652 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/permissions/{permissionId}") 4653 urls += "?" + params.Encode() 4654 req, _ := http.NewRequest("DELETE", urls, body) 4655 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 4656 req.URL.Path = strings.Replace(req.URL.Path, "{permissionId}", url.QueryEscape(c.permissionId), 1) 4657 googleapi.SetOpaque(req.URL) 4658 req.Header.Set("User-Agent", "google-api-go-client/0.5") 4659 res, err := c.s.client.Do(req) 4660 if err != nil { 4661 return err 4662 } 4663 defer res.Body.Close() 4664 if err := googleapi.CheckResponse(res); err != nil { 4665 return err 4666 } 4667 return nil 4668 // { 4669 // "description": "Deletes a permission from a file.", 4670 // "httpMethod": "DELETE", 4671 // "id": "drive.permissions.delete", 4672 // "parameterOrder": [ 4673 // "fileId", 4674 // "permissionId" 4675 // ], 4676 // "parameters": { 4677 // "fileId": { 4678 // "description": "The ID for the file.", 4679 // "location": "path", 4680 // "required": true, 4681 // "type": "string" 4682 // }, 4683 // "permissionId": { 4684 // "description": "The ID for the permission.", 4685 // "location": "path", 4686 // "required": true, 4687 // "type": "string" 4688 // } 4689 // }, 4690 // "path": "files/{fileId}/permissions/{permissionId}", 4691 // "scopes": [ 4692 // "https://www.googleapis.com/auth/drive", 4693 // "https://www.googleapis.com/auth/drive.file" 4694 // ] 4695 // } 4696 4697 } 4698 4699 // method id "drive.permissions.get": 4700 4701 type PermissionsGetCall struct { 4702 s *Service 4703 fileId string 4704 permissionId string 4705 opt_ map[string]interface{} 4706 } 4707 4708 // Get: Gets a permission by ID. 4709 func (r *PermissionsService) Get(fileId string, permissionId string) *PermissionsGetCall { 4710 c := &PermissionsGetCall{s: r.s, opt_: make(map[string]interface{})} 4711 c.fileId = fileId 4712 c.permissionId = permissionId 4713 return c 4714 } 4715 4716 func (c *PermissionsGetCall) Do() (*Permission, error) { 4717 var body io.Reader = nil 4718 params := make(url.Values) 4719 params.Set("alt", "json") 4720 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/permissions/{permissionId}") 4721 urls += "?" + params.Encode() 4722 req, _ := http.NewRequest("GET", urls, body) 4723 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 4724 req.URL.Path = strings.Replace(req.URL.Path, "{permissionId}", url.QueryEscape(c.permissionId), 1) 4725 googleapi.SetOpaque(req.URL) 4726 req.Header.Set("User-Agent", "google-api-go-client/0.5") 4727 res, err := c.s.client.Do(req) 4728 if err != nil { 4729 return nil, err 4730 } 4731 defer res.Body.Close() 4732 if err := googleapi.CheckResponse(res); err != nil { 4733 return nil, err 4734 } 4735 ret := new(Permission) 4736 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 4737 return nil, err 4738 } 4739 return ret, nil 4740 // { 4741 // "description": "Gets a permission by ID.", 4742 // "httpMethod": "GET", 4743 // "id": "drive.permissions.get", 4744 // "parameterOrder": [ 4745 // "fileId", 4746 // "permissionId" 4747 // ], 4748 // "parameters": { 4749 // "fileId": { 4750 // "description": "The ID for the file.", 4751 // "location": "path", 4752 // "required": true, 4753 // "type": "string" 4754 // }, 4755 // "permissionId": { 4756 // "description": "The ID for the permission.", 4757 // "location": "path", 4758 // "required": true, 4759 // "type": "string" 4760 // } 4761 // }, 4762 // "path": "files/{fileId}/permissions/{permissionId}", 4763 // "response": { 4764 // "$ref": "Permission" 4765 // }, 4766 // "scopes": [ 4767 // "https://www.googleapis.com/auth/drive", 4768 // "https://www.googleapis.com/auth/drive.file", 4769 // "https://www.googleapis.com/auth/drive.metadata.readonly", 4770 // "https://www.googleapis.com/auth/drive.readonly" 4771 // ] 4772 // } 4773 4774 } 4775 4776 // method id "drive.permissions.insert": 4777 4778 type PermissionsInsertCall struct { 4779 s *Service 4780 fileId string 4781 permission *Permission 4782 opt_ map[string]interface{} 4783 } 4784 4785 // Insert: Inserts a permission for a file. 4786 func (r *PermissionsService) Insert(fileId string, permission *Permission) *PermissionsInsertCall { 4787 c := &PermissionsInsertCall{s: r.s, opt_: make(map[string]interface{})} 4788 c.fileId = fileId 4789 c.permission = permission 4790 return c 4791 } 4792 4793 // EmailMessage sets the optional parameter "emailMessage": A custom 4794 // message to include in notification emails. 4795 func (c *PermissionsInsertCall) EmailMessage(emailMessage string) *PermissionsInsertCall { 4796 c.opt_["emailMessage"] = emailMessage 4797 return c 4798 } 4799 4800 // SendNotificationEmails sets the optional parameter 4801 // "sendNotificationEmails": Whether to send notification emails when 4802 // sharing to users or groups. 4803 func (c *PermissionsInsertCall) SendNotificationEmails(sendNotificationEmails bool) *PermissionsInsertCall { 4804 c.opt_["sendNotificationEmails"] = sendNotificationEmails 4805 return c 4806 } 4807 4808 func (c *PermissionsInsertCall) Do() (*Permission, error) { 4809 var body io.Reader = nil 4810 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) 4811 if err != nil { 4812 return nil, err 4813 } 4814 ctype := "application/json" 4815 params := make(url.Values) 4816 params.Set("alt", "json") 4817 if v, ok := c.opt_["emailMessage"]; ok { 4818 params.Set("emailMessage", fmt.Sprintf("%v", v)) 4819 } 4820 if v, ok := c.opt_["sendNotificationEmails"]; ok { 4821 params.Set("sendNotificationEmails", fmt.Sprintf("%v", v)) 4822 } 4823 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/permissions") 4824 urls += "?" + params.Encode() 4825 req, _ := http.NewRequest("POST", urls, body) 4826 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 4827 googleapi.SetOpaque(req.URL) 4828 req.Header.Set("Content-Type", ctype) 4829 req.Header.Set("User-Agent", "google-api-go-client/0.5") 4830 res, err := c.s.client.Do(req) 4831 if err != nil { 4832 return nil, err 4833 } 4834 defer res.Body.Close() 4835 if err := googleapi.CheckResponse(res); err != nil { 4836 return nil, err 4837 } 4838 ret := new(Permission) 4839 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 4840 return nil, err 4841 } 4842 return ret, nil 4843 // { 4844 // "description": "Inserts a permission for a file.", 4845 // "httpMethod": "POST", 4846 // "id": "drive.permissions.insert", 4847 // "parameterOrder": [ 4848 // "fileId" 4849 // ], 4850 // "parameters": { 4851 // "emailMessage": { 4852 // "description": "A custom message to include in notification emails.", 4853 // "location": "query", 4854 // "type": "string" 4855 // }, 4856 // "fileId": { 4857 // "description": "The ID for the file.", 4858 // "location": "path", 4859 // "required": true, 4860 // "type": "string" 4861 // }, 4862 // "sendNotificationEmails": { 4863 // "default": "true", 4864 // "description": "Whether to send notification emails when sharing to users or groups.", 4865 // "location": "query", 4866 // "type": "boolean" 4867 // } 4868 // }, 4869 // "path": "files/{fileId}/permissions", 4870 // "request": { 4871 // "$ref": "Permission" 4872 // }, 4873 // "response": { 4874 // "$ref": "Permission" 4875 // }, 4876 // "scopes": [ 4877 // "https://www.googleapis.com/auth/drive", 4878 // "https://www.googleapis.com/auth/drive.file" 4879 // ] 4880 // } 4881 4882 } 4883 4884 // method id "drive.permissions.list": 4885 4886 type PermissionsListCall struct { 4887 s *Service 4888 fileId string 4889 opt_ map[string]interface{} 4890 } 4891 4892 // List: Lists a file's permissions. 4893 func (r *PermissionsService) List(fileId string) *PermissionsListCall { 4894 c := &PermissionsListCall{s: r.s, opt_: make(map[string]interface{})} 4895 c.fileId = fileId 4896 return c 4897 } 4898 4899 func (c *PermissionsListCall) Do() (*PermissionList, error) { 4900 var body io.Reader = nil 4901 params := make(url.Values) 4902 params.Set("alt", "json") 4903 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/permissions") 4904 urls += "?" + params.Encode() 4905 req, _ := http.NewRequest("GET", urls, body) 4906 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 4907 googleapi.SetOpaque(req.URL) 4908 req.Header.Set("User-Agent", "google-api-go-client/0.5") 4909 res, err := c.s.client.Do(req) 4910 if err != nil { 4911 return nil, err 4912 } 4913 defer res.Body.Close() 4914 if err := googleapi.CheckResponse(res); err != nil { 4915 return nil, err 4916 } 4917 ret := new(PermissionList) 4918 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 4919 return nil, err 4920 } 4921 return ret, nil 4922 // { 4923 // "description": "Lists a file's permissions.", 4924 // "httpMethod": "GET", 4925 // "id": "drive.permissions.list", 4926 // "parameterOrder": [ 4927 // "fileId" 4928 // ], 4929 // "parameters": { 4930 // "fileId": { 4931 // "description": "The ID for the file.", 4932 // "location": "path", 4933 // "required": true, 4934 // "type": "string" 4935 // } 4936 // }, 4937 // "path": "files/{fileId}/permissions", 4938 // "response": { 4939 // "$ref": "PermissionList" 4940 // }, 4941 // "scopes": [ 4942 // "https://www.googleapis.com/auth/drive", 4943 // "https://www.googleapis.com/auth/drive.file", 4944 // "https://www.googleapis.com/auth/drive.metadata.readonly", 4945 // "https://www.googleapis.com/auth/drive.readonly" 4946 // ] 4947 // } 4948 4949 } 4950 4951 // method id "drive.permissions.patch": 4952 4953 type PermissionsPatchCall struct { 4954 s *Service 4955 fileId string 4956 permissionId string 4957 permission *Permission 4958 opt_ map[string]interface{} 4959 } 4960 4961 // Patch: Updates a permission. This method supports patch semantics. 4962 func (r *PermissionsService) Patch(fileId string, permissionId string, permission *Permission) *PermissionsPatchCall { 4963 c := &PermissionsPatchCall{s: r.s, opt_: make(map[string]interface{})} 4964 c.fileId = fileId 4965 c.permissionId = permissionId 4966 c.permission = permission 4967 return c 4968 } 4969 4970 // TransferOwnership sets the optional parameter "transferOwnership": 4971 // Whether changing a role to 'owner' should also downgrade the current 4972 // owners to writers. 4973 func (c *PermissionsPatchCall) TransferOwnership(transferOwnership bool) *PermissionsPatchCall { 4974 c.opt_["transferOwnership"] = transferOwnership 4975 return c 4976 } 4977 4978 func (c *PermissionsPatchCall) Do() (*Permission, error) { 4979 var body io.Reader = nil 4980 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) 4981 if err != nil { 4982 return nil, err 4983 } 4984 ctype := "application/json" 4985 params := make(url.Values) 4986 params.Set("alt", "json") 4987 if v, ok := c.opt_["transferOwnership"]; ok { 4988 params.Set("transferOwnership", fmt.Sprintf("%v", v)) 4989 } 4990 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/permissions/{permissionId}") 4991 urls += "?" + params.Encode() 4992 req, _ := http.NewRequest("PATCH", urls, body) 4993 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 4994 req.URL.Path = strings.Replace(req.URL.Path, "{permissionId}", url.QueryEscape(c.permissionId), 1) 4995 googleapi.SetOpaque(req.URL) 4996 req.Header.Set("Content-Type", ctype) 4997 req.Header.Set("User-Agent", "google-api-go-client/0.5") 4998 res, err := c.s.client.Do(req) 4999 if err != nil { 5000 return nil, err 5001 } 5002 defer res.Body.Close() 5003 if err := googleapi.CheckResponse(res); err != nil { 5004 return nil, err 5005 } 5006 ret := new(Permission) 5007 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 5008 return nil, err 5009 } 5010 return ret, nil 5011 // { 5012 // "description": "Updates a permission. This method supports patch semantics.", 5013 // "httpMethod": "PATCH", 5014 // "id": "drive.permissions.patch", 5015 // "parameterOrder": [ 5016 // "fileId", 5017 // "permissionId" 5018 // ], 5019 // "parameters": { 5020 // "fileId": { 5021 // "description": "The ID for the file.", 5022 // "location": "path", 5023 // "required": true, 5024 // "type": "string" 5025 // }, 5026 // "permissionId": { 5027 // "description": "The ID for the permission.", 5028 // "location": "path", 5029 // "required": true, 5030 // "type": "string" 5031 // }, 5032 // "transferOwnership": { 5033 // "default": "false", 5034 // "description": "Whether changing a role to 'owner' should also downgrade the current owners to writers.", 5035 // "location": "query", 5036 // "type": "boolean" 5037 // } 5038 // }, 5039 // "path": "files/{fileId}/permissions/{permissionId}", 5040 // "request": { 5041 // "$ref": "Permission" 5042 // }, 5043 // "response": { 5044 // "$ref": "Permission" 5045 // }, 5046 // "scopes": [ 5047 // "https://www.googleapis.com/auth/drive", 5048 // "https://www.googleapis.com/auth/drive.file" 5049 // ] 5050 // } 5051 5052 } 5053 5054 // method id "drive.permissions.update": 5055 5056 type PermissionsUpdateCall struct { 5057 s *Service 5058 fileId string 5059 permissionId string 5060 permission *Permission 5061 opt_ map[string]interface{} 5062 } 5063 5064 // Update: Updates a permission. 5065 func (r *PermissionsService) Update(fileId string, permissionId string, permission *Permission) *PermissionsUpdateCall { 5066 c := &PermissionsUpdateCall{s: r.s, opt_: make(map[string]interface{})} 5067 c.fileId = fileId 5068 c.permissionId = permissionId 5069 c.permission = permission 5070 return c 5071 } 5072 5073 // TransferOwnership sets the optional parameter "transferOwnership": 5074 // Whether changing a role to 'owner' should also downgrade the current 5075 // owners to writers. 5076 func (c *PermissionsUpdateCall) TransferOwnership(transferOwnership bool) *PermissionsUpdateCall { 5077 c.opt_["transferOwnership"] = transferOwnership 5078 return c 5079 } 5080 5081 func (c *PermissionsUpdateCall) Do() (*Permission, error) { 5082 var body io.Reader = nil 5083 body, err := googleapi.WithoutDataWrapper.JSONReader(c.permission) 5084 if err != nil { 5085 return nil, err 5086 } 5087 ctype := "application/json" 5088 params := make(url.Values) 5089 params.Set("alt", "json") 5090 if v, ok := c.opt_["transferOwnership"]; ok { 5091 params.Set("transferOwnership", fmt.Sprintf("%v", v)) 5092 } 5093 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/permissions/{permissionId}") 5094 urls += "?" + params.Encode() 5095 req, _ := http.NewRequest("PUT", urls, body) 5096 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 5097 req.URL.Path = strings.Replace(req.URL.Path, "{permissionId}", url.QueryEscape(c.permissionId), 1) 5098 googleapi.SetOpaque(req.URL) 5099 req.Header.Set("Content-Type", ctype) 5100 req.Header.Set("User-Agent", "google-api-go-client/0.5") 5101 res, err := c.s.client.Do(req) 5102 if err != nil { 5103 return nil, err 5104 } 5105 defer res.Body.Close() 5106 if err := googleapi.CheckResponse(res); err != nil { 5107 return nil, err 5108 } 5109 ret := new(Permission) 5110 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 5111 return nil, err 5112 } 5113 return ret, nil 5114 // { 5115 // "description": "Updates a permission.", 5116 // "httpMethod": "PUT", 5117 // "id": "drive.permissions.update", 5118 // "parameterOrder": [ 5119 // "fileId", 5120 // "permissionId" 5121 // ], 5122 // "parameters": { 5123 // "fileId": { 5124 // "description": "The ID for the file.", 5125 // "location": "path", 5126 // "required": true, 5127 // "type": "string" 5128 // }, 5129 // "permissionId": { 5130 // "description": "The ID for the permission.", 5131 // "location": "path", 5132 // "required": true, 5133 // "type": "string" 5134 // }, 5135 // "transferOwnership": { 5136 // "default": "false", 5137 // "description": "Whether changing a role to 'owner' should also downgrade the current owners to writers.", 5138 // "location": "query", 5139 // "type": "boolean" 5140 // } 5141 // }, 5142 // "path": "files/{fileId}/permissions/{permissionId}", 5143 // "request": { 5144 // "$ref": "Permission" 5145 // }, 5146 // "response": { 5147 // "$ref": "Permission" 5148 // }, 5149 // "scopes": [ 5150 // "https://www.googleapis.com/auth/drive", 5151 // "https://www.googleapis.com/auth/drive.file" 5152 // ] 5153 // } 5154 5155 } 5156 5157 // method id "drive.properties.delete": 5158 5159 type PropertiesDeleteCall struct { 5160 s *Service 5161 fileId string 5162 propertyKey string 5163 opt_ map[string]interface{} 5164 } 5165 5166 // Delete: Deletes a property. 5167 func (r *PropertiesService) Delete(fileId string, propertyKey string) *PropertiesDeleteCall { 5168 c := &PropertiesDeleteCall{s: r.s, opt_: make(map[string]interface{})} 5169 c.fileId = fileId 5170 c.propertyKey = propertyKey 5171 return c 5172 } 5173 5174 // Visibility sets the optional parameter "visibility": The visibility 5175 // of the property. 5176 func (c *PropertiesDeleteCall) Visibility(visibility string) *PropertiesDeleteCall { 5177 c.opt_["visibility"] = visibility 5178 return c 5179 } 5180 5181 func (c *PropertiesDeleteCall) Do() error { 5182 var body io.Reader = nil 5183 params := make(url.Values) 5184 params.Set("alt", "json") 5185 if v, ok := c.opt_["visibility"]; ok { 5186 params.Set("visibility", fmt.Sprintf("%v", v)) 5187 } 5188 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/properties/{propertyKey}") 5189 urls += "?" + params.Encode() 5190 req, _ := http.NewRequest("DELETE", urls, body) 5191 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 5192 req.URL.Path = strings.Replace(req.URL.Path, "{propertyKey}", url.QueryEscape(c.propertyKey), 1) 5193 googleapi.SetOpaque(req.URL) 5194 req.Header.Set("User-Agent", "google-api-go-client/0.5") 5195 res, err := c.s.client.Do(req) 5196 if err != nil { 5197 return err 5198 } 5199 defer res.Body.Close() 5200 if err := googleapi.CheckResponse(res); err != nil { 5201 return err 5202 } 5203 return nil 5204 // { 5205 // "description": "Deletes a property.", 5206 // "httpMethod": "DELETE", 5207 // "id": "drive.properties.delete", 5208 // "parameterOrder": [ 5209 // "fileId", 5210 // "propertyKey" 5211 // ], 5212 // "parameters": { 5213 // "fileId": { 5214 // "description": "The ID of the file.", 5215 // "location": "path", 5216 // "required": true, 5217 // "type": "string" 5218 // }, 5219 // "propertyKey": { 5220 // "description": "The key of the property.", 5221 // "location": "path", 5222 // "required": true, 5223 // "type": "string" 5224 // }, 5225 // "visibility": { 5226 // "default": "private", 5227 // "description": "The visibility of the property.", 5228 // "location": "query", 5229 // "type": "string" 5230 // } 5231 // }, 5232 // "path": "files/{fileId}/properties/{propertyKey}", 5233 // "scopes": [ 5234 // "https://www.googleapis.com/auth/drive", 5235 // "https://www.googleapis.com/auth/drive.appdata", 5236 // "https://www.googleapis.com/auth/drive.file" 5237 // ] 5238 // } 5239 5240 } 5241 5242 // method id "drive.properties.get": 5243 5244 type PropertiesGetCall struct { 5245 s *Service 5246 fileId string 5247 propertyKey string 5248 opt_ map[string]interface{} 5249 } 5250 5251 // Get: Gets a property by its key. 5252 func (r *PropertiesService) Get(fileId string, propertyKey string) *PropertiesGetCall { 5253 c := &PropertiesGetCall{s: r.s, opt_: make(map[string]interface{})} 5254 c.fileId = fileId 5255 c.propertyKey = propertyKey 5256 return c 5257 } 5258 5259 // Visibility sets the optional parameter "visibility": The visibility 5260 // of the property. 5261 func (c *PropertiesGetCall) Visibility(visibility string) *PropertiesGetCall { 5262 c.opt_["visibility"] = visibility 5263 return c 5264 } 5265 5266 func (c *PropertiesGetCall) Do() (*Property, error) { 5267 var body io.Reader = nil 5268 params := make(url.Values) 5269 params.Set("alt", "json") 5270 if v, ok := c.opt_["visibility"]; ok { 5271 params.Set("visibility", fmt.Sprintf("%v", v)) 5272 } 5273 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/properties/{propertyKey}") 5274 urls += "?" + params.Encode() 5275 req, _ := http.NewRequest("GET", urls, body) 5276 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 5277 req.URL.Path = strings.Replace(req.URL.Path, "{propertyKey}", url.QueryEscape(c.propertyKey), 1) 5278 googleapi.SetOpaque(req.URL) 5279 req.Header.Set("User-Agent", "google-api-go-client/0.5") 5280 res, err := c.s.client.Do(req) 5281 if err != nil { 5282 return nil, err 5283 } 5284 defer res.Body.Close() 5285 if err := googleapi.CheckResponse(res); err != nil { 5286 return nil, err 5287 } 5288 ret := new(Property) 5289 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 5290 return nil, err 5291 } 5292 return ret, nil 5293 // { 5294 // "description": "Gets a property by its key.", 5295 // "httpMethod": "GET", 5296 // "id": "drive.properties.get", 5297 // "parameterOrder": [ 5298 // "fileId", 5299 // "propertyKey" 5300 // ], 5301 // "parameters": { 5302 // "fileId": { 5303 // "description": "The ID of the file.", 5304 // "location": "path", 5305 // "required": true, 5306 // "type": "string" 5307 // }, 5308 // "propertyKey": { 5309 // "description": "The key of the property.", 5310 // "location": "path", 5311 // "required": true, 5312 // "type": "string" 5313 // }, 5314 // "visibility": { 5315 // "default": "private", 5316 // "description": "The visibility of the property.", 5317 // "location": "query", 5318 // "type": "string" 5319 // } 5320 // }, 5321 // "path": "files/{fileId}/properties/{propertyKey}", 5322 // "response": { 5323 // "$ref": "Property" 5324 // }, 5325 // "scopes": [ 5326 // "https://www.googleapis.com/auth/drive", 5327 // "https://www.googleapis.com/auth/drive.appdata", 5328 // "https://www.googleapis.com/auth/drive.file", 5329 // "https://www.googleapis.com/auth/drive.metadata.readonly", 5330 // "https://www.googleapis.com/auth/drive.readonly" 5331 // ] 5332 // } 5333 5334 } 5335 5336 // method id "drive.properties.insert": 5337 5338 type PropertiesInsertCall struct { 5339 s *Service 5340 fileId string 5341 property *Property 5342 opt_ map[string]interface{} 5343 } 5344 5345 // Insert: Adds a property to a file. 5346 func (r *PropertiesService) Insert(fileId string, property *Property) *PropertiesInsertCall { 5347 c := &PropertiesInsertCall{s: r.s, opt_: make(map[string]interface{})} 5348 c.fileId = fileId 5349 c.property = property 5350 return c 5351 } 5352 5353 func (c *PropertiesInsertCall) Do() (*Property, error) { 5354 var body io.Reader = nil 5355 body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) 5356 if err != nil { 5357 return nil, err 5358 } 5359 ctype := "application/json" 5360 params := make(url.Values) 5361 params.Set("alt", "json") 5362 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/properties") 5363 urls += "?" + params.Encode() 5364 req, _ := http.NewRequest("POST", urls, body) 5365 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 5366 googleapi.SetOpaque(req.URL) 5367 req.Header.Set("Content-Type", ctype) 5368 req.Header.Set("User-Agent", "google-api-go-client/0.5") 5369 res, err := c.s.client.Do(req) 5370 if err != nil { 5371 return nil, err 5372 } 5373 defer res.Body.Close() 5374 if err := googleapi.CheckResponse(res); err != nil { 5375 return nil, err 5376 } 5377 ret := new(Property) 5378 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 5379 return nil, err 5380 } 5381 return ret, nil 5382 // { 5383 // "description": "Adds a property to a file.", 5384 // "httpMethod": "POST", 5385 // "id": "drive.properties.insert", 5386 // "parameterOrder": [ 5387 // "fileId" 5388 // ], 5389 // "parameters": { 5390 // "fileId": { 5391 // "description": "The ID of the file.", 5392 // "location": "path", 5393 // "required": true, 5394 // "type": "string" 5395 // } 5396 // }, 5397 // "path": "files/{fileId}/properties", 5398 // "request": { 5399 // "$ref": "Property" 5400 // }, 5401 // "response": { 5402 // "$ref": "Property" 5403 // }, 5404 // "scopes": [ 5405 // "https://www.googleapis.com/auth/drive", 5406 // "https://www.googleapis.com/auth/drive.appdata", 5407 // "https://www.googleapis.com/auth/drive.file" 5408 // ] 5409 // } 5410 5411 } 5412 5413 // method id "drive.properties.list": 5414 5415 type PropertiesListCall struct { 5416 s *Service 5417 fileId string 5418 opt_ map[string]interface{} 5419 } 5420 5421 // List: Lists a file's properties. 5422 func (r *PropertiesService) List(fileId string) *PropertiesListCall { 5423 c := &PropertiesListCall{s: r.s, opt_: make(map[string]interface{})} 5424 c.fileId = fileId 5425 return c 5426 } 5427 5428 func (c *PropertiesListCall) Do() (*PropertyList, error) { 5429 var body io.Reader = nil 5430 params := make(url.Values) 5431 params.Set("alt", "json") 5432 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/properties") 5433 urls += "?" + params.Encode() 5434 req, _ := http.NewRequest("GET", urls, body) 5435 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 5436 googleapi.SetOpaque(req.URL) 5437 req.Header.Set("User-Agent", "google-api-go-client/0.5") 5438 res, err := c.s.client.Do(req) 5439 if err != nil { 5440 return nil, err 5441 } 5442 defer res.Body.Close() 5443 if err := googleapi.CheckResponse(res); err != nil { 5444 return nil, err 5445 } 5446 ret := new(PropertyList) 5447 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 5448 return nil, err 5449 } 5450 return ret, nil 5451 // { 5452 // "description": "Lists a file's properties.", 5453 // "httpMethod": "GET", 5454 // "id": "drive.properties.list", 5455 // "parameterOrder": [ 5456 // "fileId" 5457 // ], 5458 // "parameters": { 5459 // "fileId": { 5460 // "description": "The ID of the file.", 5461 // "location": "path", 5462 // "required": true, 5463 // "type": "string" 5464 // } 5465 // }, 5466 // "path": "files/{fileId}/properties", 5467 // "response": { 5468 // "$ref": "PropertyList" 5469 // }, 5470 // "scopes": [ 5471 // "https://www.googleapis.com/auth/drive", 5472 // "https://www.googleapis.com/auth/drive.appdata", 5473 // "https://www.googleapis.com/auth/drive.file", 5474 // "https://www.googleapis.com/auth/drive.metadata.readonly", 5475 // "https://www.googleapis.com/auth/drive.readonly" 5476 // ] 5477 // } 5478 5479 } 5480 5481 // method id "drive.properties.patch": 5482 5483 type PropertiesPatchCall struct { 5484 s *Service 5485 fileId string 5486 propertyKey string 5487 property *Property 5488 opt_ map[string]interface{} 5489 } 5490 5491 // Patch: Updates a property. This method supports patch semantics. 5492 func (r *PropertiesService) Patch(fileId string, propertyKey string, property *Property) *PropertiesPatchCall { 5493 c := &PropertiesPatchCall{s: r.s, opt_: make(map[string]interface{})} 5494 c.fileId = fileId 5495 c.propertyKey = propertyKey 5496 c.property = property 5497 return c 5498 } 5499 5500 // Visibility sets the optional parameter "visibility": The visibility 5501 // of the property. 5502 func (c *PropertiesPatchCall) Visibility(visibility string) *PropertiesPatchCall { 5503 c.opt_["visibility"] = visibility 5504 return c 5505 } 5506 5507 func (c *PropertiesPatchCall) Do() (*Property, error) { 5508 var body io.Reader = nil 5509 body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) 5510 if err != nil { 5511 return nil, err 5512 } 5513 ctype := "application/json" 5514 params := make(url.Values) 5515 params.Set("alt", "json") 5516 if v, ok := c.opt_["visibility"]; ok { 5517 params.Set("visibility", fmt.Sprintf("%v", v)) 5518 } 5519 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/properties/{propertyKey}") 5520 urls += "?" + params.Encode() 5521 req, _ := http.NewRequest("PATCH", urls, body) 5522 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 5523 req.URL.Path = strings.Replace(req.URL.Path, "{propertyKey}", url.QueryEscape(c.propertyKey), 1) 5524 googleapi.SetOpaque(req.URL) 5525 req.Header.Set("Content-Type", ctype) 5526 req.Header.Set("User-Agent", "google-api-go-client/0.5") 5527 res, err := c.s.client.Do(req) 5528 if err != nil { 5529 return nil, err 5530 } 5531 defer res.Body.Close() 5532 if err := googleapi.CheckResponse(res); err != nil { 5533 return nil, err 5534 } 5535 ret := new(Property) 5536 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 5537 return nil, err 5538 } 5539 return ret, nil 5540 // { 5541 // "description": "Updates a property. This method supports patch semantics.", 5542 // "httpMethod": "PATCH", 5543 // "id": "drive.properties.patch", 5544 // "parameterOrder": [ 5545 // "fileId", 5546 // "propertyKey" 5547 // ], 5548 // "parameters": { 5549 // "fileId": { 5550 // "description": "The ID of the file.", 5551 // "location": "path", 5552 // "required": true, 5553 // "type": "string" 5554 // }, 5555 // "propertyKey": { 5556 // "description": "The key of the property.", 5557 // "location": "path", 5558 // "required": true, 5559 // "type": "string" 5560 // }, 5561 // "visibility": { 5562 // "default": "private", 5563 // "description": "The visibility of the property.", 5564 // "location": "query", 5565 // "type": "string" 5566 // } 5567 // }, 5568 // "path": "files/{fileId}/properties/{propertyKey}", 5569 // "request": { 5570 // "$ref": "Property" 5571 // }, 5572 // "response": { 5573 // "$ref": "Property" 5574 // }, 5575 // "scopes": [ 5576 // "https://www.googleapis.com/auth/drive", 5577 // "https://www.googleapis.com/auth/drive.appdata", 5578 // "https://www.googleapis.com/auth/drive.file" 5579 // ] 5580 // } 5581 5582 } 5583 5584 // method id "drive.properties.update": 5585 5586 type PropertiesUpdateCall struct { 5587 s *Service 5588 fileId string 5589 propertyKey string 5590 property *Property 5591 opt_ map[string]interface{} 5592 } 5593 5594 // Update: Updates a property. 5595 func (r *PropertiesService) Update(fileId string, propertyKey string, property *Property) *PropertiesUpdateCall { 5596 c := &PropertiesUpdateCall{s: r.s, opt_: make(map[string]interface{})} 5597 c.fileId = fileId 5598 c.propertyKey = propertyKey 5599 c.property = property 5600 return c 5601 } 5602 5603 // Visibility sets the optional parameter "visibility": The visibility 5604 // of the property. 5605 func (c *PropertiesUpdateCall) Visibility(visibility string) *PropertiesUpdateCall { 5606 c.opt_["visibility"] = visibility 5607 return c 5608 } 5609 5610 func (c *PropertiesUpdateCall) Do() (*Property, error) { 5611 var body io.Reader = nil 5612 body, err := googleapi.WithoutDataWrapper.JSONReader(c.property) 5613 if err != nil { 5614 return nil, err 5615 } 5616 ctype := "application/json" 5617 params := make(url.Values) 5618 params.Set("alt", "json") 5619 if v, ok := c.opt_["visibility"]; ok { 5620 params.Set("visibility", fmt.Sprintf("%v", v)) 5621 } 5622 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/properties/{propertyKey}") 5623 urls += "?" + params.Encode() 5624 req, _ := http.NewRequest("PUT", urls, body) 5625 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 5626 req.URL.Path = strings.Replace(req.URL.Path, "{propertyKey}", url.QueryEscape(c.propertyKey), 1) 5627 googleapi.SetOpaque(req.URL) 5628 req.Header.Set("Content-Type", ctype) 5629 req.Header.Set("User-Agent", "google-api-go-client/0.5") 5630 res, err := c.s.client.Do(req) 5631 if err != nil { 5632 return nil, err 5633 } 5634 defer res.Body.Close() 5635 if err := googleapi.CheckResponse(res); err != nil { 5636 return nil, err 5637 } 5638 ret := new(Property) 5639 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 5640 return nil, err 5641 } 5642 return ret, nil 5643 // { 5644 // "description": "Updates a property.", 5645 // "httpMethod": "PUT", 5646 // "id": "drive.properties.update", 5647 // "parameterOrder": [ 5648 // "fileId", 5649 // "propertyKey" 5650 // ], 5651 // "parameters": { 5652 // "fileId": { 5653 // "description": "The ID of the file.", 5654 // "location": "path", 5655 // "required": true, 5656 // "type": "string" 5657 // }, 5658 // "propertyKey": { 5659 // "description": "The key of the property.", 5660 // "location": "path", 5661 // "required": true, 5662 // "type": "string" 5663 // }, 5664 // "visibility": { 5665 // "default": "private", 5666 // "description": "The visibility of the property.", 5667 // "location": "query", 5668 // "type": "string" 5669 // } 5670 // }, 5671 // "path": "files/{fileId}/properties/{propertyKey}", 5672 // "request": { 5673 // "$ref": "Property" 5674 // }, 5675 // "response": { 5676 // "$ref": "Property" 5677 // }, 5678 // "scopes": [ 5679 // "https://www.googleapis.com/auth/drive", 5680 // "https://www.googleapis.com/auth/drive.appdata", 5681 // "https://www.googleapis.com/auth/drive.file" 5682 // ] 5683 // } 5684 5685 } 5686 5687 // method id "drive.realtime.get": 5688 5689 type RealtimeGetCall struct { 5690 s *Service 5691 fileId string 5692 opt_ map[string]interface{} 5693 } 5694 5695 // Get: Exports the contents of the Realtime API data model associated 5696 // with this file as JSON. 5697 func (r *RealtimeService) Get(fileId string) *RealtimeGetCall { 5698 c := &RealtimeGetCall{s: r.s, opt_: make(map[string]interface{})} 5699 c.fileId = fileId 5700 return c 5701 } 5702 5703 func (c *RealtimeGetCall) Do() error { 5704 var body io.Reader = nil 5705 params := make(url.Values) 5706 params.Set("alt", "json") 5707 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/realtime") 5708 urls += "?" + params.Encode() 5709 req, _ := http.NewRequest("GET", urls, body) 5710 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 5711 googleapi.SetOpaque(req.URL) 5712 req.Header.Set("User-Agent", "google-api-go-client/0.5") 5713 res, err := c.s.client.Do(req) 5714 if err != nil { 5715 return err 5716 } 5717 defer res.Body.Close() 5718 if err := googleapi.CheckResponse(res); err != nil { 5719 return err 5720 } 5721 return nil 5722 // { 5723 // "description": "Exports the contents of the Realtime API data model associated with this file as JSON.", 5724 // "httpMethod": "GET", 5725 // "id": "drive.realtime.get", 5726 // "parameterOrder": [ 5727 // "fileId" 5728 // ], 5729 // "parameters": { 5730 // "fileId": { 5731 // "description": "The ID of the file that the Realtime API data model is associated with.", 5732 // "location": "path", 5733 // "required": true, 5734 // "type": "string" 5735 // } 5736 // }, 5737 // "path": "files/{fileId}/realtime", 5738 // "scopes": [ 5739 // "https://www.googleapis.com/auth/drive", 5740 // "https://www.googleapis.com/auth/drive.file", 5741 // "https://www.googleapis.com/auth/drive.readonly" 5742 // ], 5743 // "supportsMediaDownload": true 5744 // } 5745 5746 } 5747 5748 // method id "drive.replies.delete": 5749 5750 type RepliesDeleteCall struct { 5751 s *Service 5752 fileId string 5753 commentId string 5754 replyId string 5755 opt_ map[string]interface{} 5756 } 5757 5758 // Delete: Deletes a reply. 5759 func (r *RepliesService) Delete(fileId string, commentId string, replyId string) *RepliesDeleteCall { 5760 c := &RepliesDeleteCall{s: r.s, opt_: make(map[string]interface{})} 5761 c.fileId = fileId 5762 c.commentId = commentId 5763 c.replyId = replyId 5764 return c 5765 } 5766 5767 func (c *RepliesDeleteCall) Do() error { 5768 var body io.Reader = nil 5769 params := make(url.Values) 5770 params.Set("alt", "json") 5771 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments/{commentId}/replies/{replyId}") 5772 urls += "?" + params.Encode() 5773 req, _ := http.NewRequest("DELETE", urls, body) 5774 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 5775 req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) 5776 req.URL.Path = strings.Replace(req.URL.Path, "{replyId}", url.QueryEscape(c.replyId), 1) 5777 googleapi.SetOpaque(req.URL) 5778 req.Header.Set("User-Agent", "google-api-go-client/0.5") 5779 res, err := c.s.client.Do(req) 5780 if err != nil { 5781 return err 5782 } 5783 defer res.Body.Close() 5784 if err := googleapi.CheckResponse(res); err != nil { 5785 return err 5786 } 5787 return nil 5788 // { 5789 // "description": "Deletes a reply.", 5790 // "httpMethod": "DELETE", 5791 // "id": "drive.replies.delete", 5792 // "parameterOrder": [ 5793 // "fileId", 5794 // "commentId", 5795 // "replyId" 5796 // ], 5797 // "parameters": { 5798 // "commentId": { 5799 // "description": "The ID of the comment.", 5800 // "location": "path", 5801 // "required": true, 5802 // "type": "string" 5803 // }, 5804 // "fileId": { 5805 // "description": "The ID of the file.", 5806 // "location": "path", 5807 // "required": true, 5808 // "type": "string" 5809 // }, 5810 // "replyId": { 5811 // "description": "The ID of the reply.", 5812 // "location": "path", 5813 // "required": true, 5814 // "type": "string" 5815 // } 5816 // }, 5817 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 5818 // "scopes": [ 5819 // "https://www.googleapis.com/auth/drive", 5820 // "https://www.googleapis.com/auth/drive.file" 5821 // ] 5822 // } 5823 5824 } 5825 5826 // method id "drive.replies.get": 5827 5828 type RepliesGetCall struct { 5829 s *Service 5830 fileId string 5831 commentId string 5832 replyId string 5833 opt_ map[string]interface{} 5834 } 5835 5836 // Get: Gets a reply. 5837 func (r *RepliesService) Get(fileId string, commentId string, replyId string) *RepliesGetCall { 5838 c := &RepliesGetCall{s: r.s, opt_: make(map[string]interface{})} 5839 c.fileId = fileId 5840 c.commentId = commentId 5841 c.replyId = replyId 5842 return c 5843 } 5844 5845 // IncludeDeleted sets the optional parameter "includeDeleted": If set, 5846 // this will succeed when retrieving a deleted reply. 5847 func (c *RepliesGetCall) IncludeDeleted(includeDeleted bool) *RepliesGetCall { 5848 c.opt_["includeDeleted"] = includeDeleted 5849 return c 5850 } 5851 5852 func (c *RepliesGetCall) Do() (*CommentReply, error) { 5853 var body io.Reader = nil 5854 params := make(url.Values) 5855 params.Set("alt", "json") 5856 if v, ok := c.opt_["includeDeleted"]; ok { 5857 params.Set("includeDeleted", fmt.Sprintf("%v", v)) 5858 } 5859 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments/{commentId}/replies/{replyId}") 5860 urls += "?" + params.Encode() 5861 req, _ := http.NewRequest("GET", urls, body) 5862 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 5863 req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) 5864 req.URL.Path = strings.Replace(req.URL.Path, "{replyId}", url.QueryEscape(c.replyId), 1) 5865 googleapi.SetOpaque(req.URL) 5866 req.Header.Set("User-Agent", "google-api-go-client/0.5") 5867 res, err := c.s.client.Do(req) 5868 if err != nil { 5869 return nil, err 5870 } 5871 defer res.Body.Close() 5872 if err := googleapi.CheckResponse(res); err != nil { 5873 return nil, err 5874 } 5875 ret := new(CommentReply) 5876 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 5877 return nil, err 5878 } 5879 return ret, nil 5880 // { 5881 // "description": "Gets a reply.", 5882 // "httpMethod": "GET", 5883 // "id": "drive.replies.get", 5884 // "parameterOrder": [ 5885 // "fileId", 5886 // "commentId", 5887 // "replyId" 5888 // ], 5889 // "parameters": { 5890 // "commentId": { 5891 // "description": "The ID of the comment.", 5892 // "location": "path", 5893 // "required": true, 5894 // "type": "string" 5895 // }, 5896 // "fileId": { 5897 // "description": "The ID of the file.", 5898 // "location": "path", 5899 // "required": true, 5900 // "type": "string" 5901 // }, 5902 // "includeDeleted": { 5903 // "default": "false", 5904 // "description": "If set, this will succeed when retrieving a deleted reply.", 5905 // "location": "query", 5906 // "type": "boolean" 5907 // }, 5908 // "replyId": { 5909 // "description": "The ID of the reply.", 5910 // "location": "path", 5911 // "required": true, 5912 // "type": "string" 5913 // } 5914 // }, 5915 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 5916 // "response": { 5917 // "$ref": "CommentReply" 5918 // }, 5919 // "scopes": [ 5920 // "https://www.googleapis.com/auth/drive", 5921 // "https://www.googleapis.com/auth/drive.file", 5922 // "https://www.googleapis.com/auth/drive.readonly" 5923 // ] 5924 // } 5925 5926 } 5927 5928 // method id "drive.replies.insert": 5929 5930 type RepliesInsertCall struct { 5931 s *Service 5932 fileId string 5933 commentId string 5934 commentreply *CommentReply 5935 opt_ map[string]interface{} 5936 } 5937 5938 // Insert: Creates a new reply to the given comment. 5939 func (r *RepliesService) Insert(fileId string, commentId string, commentreply *CommentReply) *RepliesInsertCall { 5940 c := &RepliesInsertCall{s: r.s, opt_: make(map[string]interface{})} 5941 c.fileId = fileId 5942 c.commentId = commentId 5943 c.commentreply = commentreply 5944 return c 5945 } 5946 5947 func (c *RepliesInsertCall) Do() (*CommentReply, error) { 5948 var body io.Reader = nil 5949 body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) 5950 if err != nil { 5951 return nil, err 5952 } 5953 ctype := "application/json" 5954 params := make(url.Values) 5955 params.Set("alt", "json") 5956 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments/{commentId}/replies") 5957 urls += "?" + params.Encode() 5958 req, _ := http.NewRequest("POST", urls, body) 5959 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 5960 req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) 5961 googleapi.SetOpaque(req.URL) 5962 req.Header.Set("Content-Type", ctype) 5963 req.Header.Set("User-Agent", "google-api-go-client/0.5") 5964 res, err := c.s.client.Do(req) 5965 if err != nil { 5966 return nil, err 5967 } 5968 defer res.Body.Close() 5969 if err := googleapi.CheckResponse(res); err != nil { 5970 return nil, err 5971 } 5972 ret := new(CommentReply) 5973 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 5974 return nil, err 5975 } 5976 return ret, nil 5977 // { 5978 // "description": "Creates a new reply to the given comment.", 5979 // "httpMethod": "POST", 5980 // "id": "drive.replies.insert", 5981 // "parameterOrder": [ 5982 // "fileId", 5983 // "commentId" 5984 // ], 5985 // "parameters": { 5986 // "commentId": { 5987 // "description": "The ID of the comment.", 5988 // "location": "path", 5989 // "required": true, 5990 // "type": "string" 5991 // }, 5992 // "fileId": { 5993 // "description": "The ID of the file.", 5994 // "location": "path", 5995 // "required": true, 5996 // "type": "string" 5997 // } 5998 // }, 5999 // "path": "files/{fileId}/comments/{commentId}/replies", 6000 // "request": { 6001 // "$ref": "CommentReply" 6002 // }, 6003 // "response": { 6004 // "$ref": "CommentReply" 6005 // }, 6006 // "scopes": [ 6007 // "https://www.googleapis.com/auth/drive", 6008 // "https://www.googleapis.com/auth/drive.file" 6009 // ] 6010 // } 6011 6012 } 6013 6014 // method id "drive.replies.list": 6015 6016 type RepliesListCall struct { 6017 s *Service 6018 fileId string 6019 commentId string 6020 opt_ map[string]interface{} 6021 } 6022 6023 // List: Lists all of the replies to a comment. 6024 func (r *RepliesService) List(fileId string, commentId string) *RepliesListCall { 6025 c := &RepliesListCall{s: r.s, opt_: make(map[string]interface{})} 6026 c.fileId = fileId 6027 c.commentId = commentId 6028 return c 6029 } 6030 6031 // IncludeDeleted sets the optional parameter "includeDeleted": If set, 6032 // all replies, including deleted replies (with content stripped) will 6033 // be returned. 6034 func (c *RepliesListCall) IncludeDeleted(includeDeleted bool) *RepliesListCall { 6035 c.opt_["includeDeleted"] = includeDeleted 6036 return c 6037 } 6038 6039 // MaxResults sets the optional parameter "maxResults": The maximum 6040 // number of replies to include in the response, used for paging. 6041 func (c *RepliesListCall) MaxResults(maxResults int64) *RepliesListCall { 6042 c.opt_["maxResults"] = maxResults 6043 return c 6044 } 6045 6046 // PageToken sets the optional parameter "pageToken": The continuation 6047 // token, used to page through large result sets. To get the next page 6048 // of results, set this parameter to the value of "nextPageToken" from 6049 // the previous response. 6050 func (c *RepliesListCall) PageToken(pageToken string) *RepliesListCall { 6051 c.opt_["pageToken"] = pageToken 6052 return c 6053 } 6054 6055 func (c *RepliesListCall) Do() (*CommentReplyList, error) { 6056 var body io.Reader = nil 6057 params := make(url.Values) 6058 params.Set("alt", "json") 6059 if v, ok := c.opt_["includeDeleted"]; ok { 6060 params.Set("includeDeleted", fmt.Sprintf("%v", v)) 6061 } 6062 if v, ok := c.opt_["maxResults"]; ok { 6063 params.Set("maxResults", fmt.Sprintf("%v", v)) 6064 } 6065 if v, ok := c.opt_["pageToken"]; ok { 6066 params.Set("pageToken", fmt.Sprintf("%v", v)) 6067 } 6068 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments/{commentId}/replies") 6069 urls += "?" + params.Encode() 6070 req, _ := http.NewRequest("GET", urls, body) 6071 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 6072 req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) 6073 googleapi.SetOpaque(req.URL) 6074 req.Header.Set("User-Agent", "google-api-go-client/0.5") 6075 res, err := c.s.client.Do(req) 6076 if err != nil { 6077 return nil, err 6078 } 6079 defer res.Body.Close() 6080 if err := googleapi.CheckResponse(res); err != nil { 6081 return nil, err 6082 } 6083 ret := new(CommentReplyList) 6084 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 6085 return nil, err 6086 } 6087 return ret, nil 6088 // { 6089 // "description": "Lists all of the replies to a comment.", 6090 // "httpMethod": "GET", 6091 // "id": "drive.replies.list", 6092 // "parameterOrder": [ 6093 // "fileId", 6094 // "commentId" 6095 // ], 6096 // "parameters": { 6097 // "commentId": { 6098 // "description": "The ID of the comment.", 6099 // "location": "path", 6100 // "required": true, 6101 // "type": "string" 6102 // }, 6103 // "fileId": { 6104 // "description": "The ID of the file.", 6105 // "location": "path", 6106 // "required": true, 6107 // "type": "string" 6108 // }, 6109 // "includeDeleted": { 6110 // "default": "false", 6111 // "description": "If set, all replies, including deleted replies (with content stripped) will be returned.", 6112 // "location": "query", 6113 // "type": "boolean" 6114 // }, 6115 // "maxResults": { 6116 // "default": "20", 6117 // "description": "The maximum number of replies to include in the response, used for paging.", 6118 // "format": "int32", 6119 // "location": "query", 6120 // "maximum": "100", 6121 // "minimum": "0", 6122 // "type": "integer" 6123 // }, 6124 // "pageToken": { 6125 // "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.", 6126 // "location": "query", 6127 // "type": "string" 6128 // } 6129 // }, 6130 // "path": "files/{fileId}/comments/{commentId}/replies", 6131 // "response": { 6132 // "$ref": "CommentReplyList" 6133 // }, 6134 // "scopes": [ 6135 // "https://www.googleapis.com/auth/drive", 6136 // "https://www.googleapis.com/auth/drive.file", 6137 // "https://www.googleapis.com/auth/drive.readonly" 6138 // ] 6139 // } 6140 6141 } 6142 6143 // method id "drive.replies.patch": 6144 6145 type RepliesPatchCall struct { 6146 s *Service 6147 fileId string 6148 commentId string 6149 replyId string 6150 commentreply *CommentReply 6151 opt_ map[string]interface{} 6152 } 6153 6154 // Patch: Updates an existing reply. This method supports patch 6155 // semantics. 6156 func (r *RepliesService) Patch(fileId string, commentId string, replyId string, commentreply *CommentReply) *RepliesPatchCall { 6157 c := &RepliesPatchCall{s: r.s, opt_: make(map[string]interface{})} 6158 c.fileId = fileId 6159 c.commentId = commentId 6160 c.replyId = replyId 6161 c.commentreply = commentreply 6162 return c 6163 } 6164 6165 func (c *RepliesPatchCall) Do() (*CommentReply, error) { 6166 var body io.Reader = nil 6167 body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) 6168 if err != nil { 6169 return nil, err 6170 } 6171 ctype := "application/json" 6172 params := make(url.Values) 6173 params.Set("alt", "json") 6174 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments/{commentId}/replies/{replyId}") 6175 urls += "?" + params.Encode() 6176 req, _ := http.NewRequest("PATCH", urls, body) 6177 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 6178 req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) 6179 req.URL.Path = strings.Replace(req.URL.Path, "{replyId}", url.QueryEscape(c.replyId), 1) 6180 googleapi.SetOpaque(req.URL) 6181 req.Header.Set("Content-Type", ctype) 6182 req.Header.Set("User-Agent", "google-api-go-client/0.5") 6183 res, err := c.s.client.Do(req) 6184 if err != nil { 6185 return nil, err 6186 } 6187 defer res.Body.Close() 6188 if err := googleapi.CheckResponse(res); err != nil { 6189 return nil, err 6190 } 6191 ret := new(CommentReply) 6192 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 6193 return nil, err 6194 } 6195 return ret, nil 6196 // { 6197 // "description": "Updates an existing reply. This method supports patch semantics.", 6198 // "httpMethod": "PATCH", 6199 // "id": "drive.replies.patch", 6200 // "parameterOrder": [ 6201 // "fileId", 6202 // "commentId", 6203 // "replyId" 6204 // ], 6205 // "parameters": { 6206 // "commentId": { 6207 // "description": "The ID of the comment.", 6208 // "location": "path", 6209 // "required": true, 6210 // "type": "string" 6211 // }, 6212 // "fileId": { 6213 // "description": "The ID of the file.", 6214 // "location": "path", 6215 // "required": true, 6216 // "type": "string" 6217 // }, 6218 // "replyId": { 6219 // "description": "The ID of the reply.", 6220 // "location": "path", 6221 // "required": true, 6222 // "type": "string" 6223 // } 6224 // }, 6225 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 6226 // "request": { 6227 // "$ref": "CommentReply" 6228 // }, 6229 // "response": { 6230 // "$ref": "CommentReply" 6231 // }, 6232 // "scopes": [ 6233 // "https://www.googleapis.com/auth/drive", 6234 // "https://www.googleapis.com/auth/drive.file" 6235 // ] 6236 // } 6237 6238 } 6239 6240 // method id "drive.replies.update": 6241 6242 type RepliesUpdateCall struct { 6243 s *Service 6244 fileId string 6245 commentId string 6246 replyId string 6247 commentreply *CommentReply 6248 opt_ map[string]interface{} 6249 } 6250 6251 // Update: Updates an existing reply. 6252 func (r *RepliesService) Update(fileId string, commentId string, replyId string, commentreply *CommentReply) *RepliesUpdateCall { 6253 c := &RepliesUpdateCall{s: r.s, opt_: make(map[string]interface{})} 6254 c.fileId = fileId 6255 c.commentId = commentId 6256 c.replyId = replyId 6257 c.commentreply = commentreply 6258 return c 6259 } 6260 6261 func (c *RepliesUpdateCall) Do() (*CommentReply, error) { 6262 var body io.Reader = nil 6263 body, err := googleapi.WithoutDataWrapper.JSONReader(c.commentreply) 6264 if err != nil { 6265 return nil, err 6266 } 6267 ctype := "application/json" 6268 params := make(url.Values) 6269 params.Set("alt", "json") 6270 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/comments/{commentId}/replies/{replyId}") 6271 urls += "?" + params.Encode() 6272 req, _ := http.NewRequest("PUT", urls, body) 6273 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 6274 req.URL.Path = strings.Replace(req.URL.Path, "{commentId}", url.QueryEscape(c.commentId), 1) 6275 req.URL.Path = strings.Replace(req.URL.Path, "{replyId}", url.QueryEscape(c.replyId), 1) 6276 googleapi.SetOpaque(req.URL) 6277 req.Header.Set("Content-Type", ctype) 6278 req.Header.Set("User-Agent", "google-api-go-client/0.5") 6279 res, err := c.s.client.Do(req) 6280 if err != nil { 6281 return nil, err 6282 } 6283 defer res.Body.Close() 6284 if err := googleapi.CheckResponse(res); err != nil { 6285 return nil, err 6286 } 6287 ret := new(CommentReply) 6288 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 6289 return nil, err 6290 } 6291 return ret, nil 6292 // { 6293 // "description": "Updates an existing reply.", 6294 // "httpMethod": "PUT", 6295 // "id": "drive.replies.update", 6296 // "parameterOrder": [ 6297 // "fileId", 6298 // "commentId", 6299 // "replyId" 6300 // ], 6301 // "parameters": { 6302 // "commentId": { 6303 // "description": "The ID of the comment.", 6304 // "location": "path", 6305 // "required": true, 6306 // "type": "string" 6307 // }, 6308 // "fileId": { 6309 // "description": "The ID of the file.", 6310 // "location": "path", 6311 // "required": true, 6312 // "type": "string" 6313 // }, 6314 // "replyId": { 6315 // "description": "The ID of the reply.", 6316 // "location": "path", 6317 // "required": true, 6318 // "type": "string" 6319 // } 6320 // }, 6321 // "path": "files/{fileId}/comments/{commentId}/replies/{replyId}", 6322 // "request": { 6323 // "$ref": "CommentReply" 6324 // }, 6325 // "response": { 6326 // "$ref": "CommentReply" 6327 // }, 6328 // "scopes": [ 6329 // "https://www.googleapis.com/auth/drive", 6330 // "https://www.googleapis.com/auth/drive.file" 6331 // ] 6332 // } 6333 6334 } 6335 6336 // method id "drive.revisions.delete": 6337 6338 type RevisionsDeleteCall struct { 6339 s *Service 6340 fileId string 6341 revisionId string 6342 opt_ map[string]interface{} 6343 } 6344 6345 // Delete: Removes a revision. 6346 func (r *RevisionsService) Delete(fileId string, revisionId string) *RevisionsDeleteCall { 6347 c := &RevisionsDeleteCall{s: r.s, opt_: make(map[string]interface{})} 6348 c.fileId = fileId 6349 c.revisionId = revisionId 6350 return c 6351 } 6352 6353 func (c *RevisionsDeleteCall) Do() error { 6354 var body io.Reader = nil 6355 params := make(url.Values) 6356 params.Set("alt", "json") 6357 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/revisions/{revisionId}") 6358 urls += "?" + params.Encode() 6359 req, _ := http.NewRequest("DELETE", urls, body) 6360 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 6361 req.URL.Path = strings.Replace(req.URL.Path, "{revisionId}", url.QueryEscape(c.revisionId), 1) 6362 googleapi.SetOpaque(req.URL) 6363 req.Header.Set("User-Agent", "google-api-go-client/0.5") 6364 res, err := c.s.client.Do(req) 6365 if err != nil { 6366 return err 6367 } 6368 defer res.Body.Close() 6369 if err := googleapi.CheckResponse(res); err != nil { 6370 return err 6371 } 6372 return nil 6373 // { 6374 // "description": "Removes a revision.", 6375 // "httpMethod": "DELETE", 6376 // "id": "drive.revisions.delete", 6377 // "parameterOrder": [ 6378 // "fileId", 6379 // "revisionId" 6380 // ], 6381 // "parameters": { 6382 // "fileId": { 6383 // "description": "The ID of the file.", 6384 // "location": "path", 6385 // "required": true, 6386 // "type": "string" 6387 // }, 6388 // "revisionId": { 6389 // "description": "The ID of the revision.", 6390 // "location": "path", 6391 // "required": true, 6392 // "type": "string" 6393 // } 6394 // }, 6395 // "path": "files/{fileId}/revisions/{revisionId}", 6396 // "scopes": [ 6397 // "https://www.googleapis.com/auth/drive", 6398 // "https://www.googleapis.com/auth/drive.appdata", 6399 // "https://www.googleapis.com/auth/drive.file" 6400 // ] 6401 // } 6402 6403 } 6404 6405 // method id "drive.revisions.get": 6406 6407 type RevisionsGetCall struct { 6408 s *Service 6409 fileId string 6410 revisionId string 6411 opt_ map[string]interface{} 6412 } 6413 6414 // Get: Gets a specific revision. 6415 func (r *RevisionsService) Get(fileId string, revisionId string) *RevisionsGetCall { 6416 c := &RevisionsGetCall{s: r.s, opt_: make(map[string]interface{})} 6417 c.fileId = fileId 6418 c.revisionId = revisionId 6419 return c 6420 } 6421 6422 func (c *RevisionsGetCall) Do() (*Revision, error) { 6423 var body io.Reader = nil 6424 params := make(url.Values) 6425 params.Set("alt", "json") 6426 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/revisions/{revisionId}") 6427 urls += "?" + params.Encode() 6428 req, _ := http.NewRequest("GET", urls, body) 6429 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 6430 req.URL.Path = strings.Replace(req.URL.Path, "{revisionId}", url.QueryEscape(c.revisionId), 1) 6431 googleapi.SetOpaque(req.URL) 6432 req.Header.Set("User-Agent", "google-api-go-client/0.5") 6433 res, err := c.s.client.Do(req) 6434 if err != nil { 6435 return nil, err 6436 } 6437 defer res.Body.Close() 6438 if err := googleapi.CheckResponse(res); err != nil { 6439 return nil, err 6440 } 6441 ret := new(Revision) 6442 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 6443 return nil, err 6444 } 6445 return ret, nil 6446 // { 6447 // "description": "Gets a specific revision.", 6448 // "httpMethod": "GET", 6449 // "id": "drive.revisions.get", 6450 // "parameterOrder": [ 6451 // "fileId", 6452 // "revisionId" 6453 // ], 6454 // "parameters": { 6455 // "fileId": { 6456 // "description": "The ID of the file.", 6457 // "location": "path", 6458 // "required": true, 6459 // "type": "string" 6460 // }, 6461 // "revisionId": { 6462 // "description": "The ID of the revision.", 6463 // "location": "path", 6464 // "required": true, 6465 // "type": "string" 6466 // } 6467 // }, 6468 // "path": "files/{fileId}/revisions/{revisionId}", 6469 // "response": { 6470 // "$ref": "Revision" 6471 // }, 6472 // "scopes": [ 6473 // "https://www.googleapis.com/auth/drive", 6474 // "https://www.googleapis.com/auth/drive.appdata", 6475 // "https://www.googleapis.com/auth/drive.file", 6476 // "https://www.googleapis.com/auth/drive.metadata.readonly", 6477 // "https://www.googleapis.com/auth/drive.readonly" 6478 // ] 6479 // } 6480 6481 } 6482 6483 // method id "drive.revisions.list": 6484 6485 type RevisionsListCall struct { 6486 s *Service 6487 fileId string 6488 opt_ map[string]interface{} 6489 } 6490 6491 // List: Lists a file's revisions. 6492 func (r *RevisionsService) List(fileId string) *RevisionsListCall { 6493 c := &RevisionsListCall{s: r.s, opt_: make(map[string]interface{})} 6494 c.fileId = fileId 6495 return c 6496 } 6497 6498 func (c *RevisionsListCall) Do() (*RevisionList, error) { 6499 var body io.Reader = nil 6500 params := make(url.Values) 6501 params.Set("alt", "json") 6502 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/revisions") 6503 urls += "?" + params.Encode() 6504 req, _ := http.NewRequest("GET", urls, body) 6505 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 6506 googleapi.SetOpaque(req.URL) 6507 req.Header.Set("User-Agent", "google-api-go-client/0.5") 6508 res, err := c.s.client.Do(req) 6509 if err != nil { 6510 return nil, err 6511 } 6512 defer res.Body.Close() 6513 if err := googleapi.CheckResponse(res); err != nil { 6514 return nil, err 6515 } 6516 ret := new(RevisionList) 6517 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 6518 return nil, err 6519 } 6520 return ret, nil 6521 // { 6522 // "description": "Lists a file's revisions.", 6523 // "httpMethod": "GET", 6524 // "id": "drive.revisions.list", 6525 // "parameterOrder": [ 6526 // "fileId" 6527 // ], 6528 // "parameters": { 6529 // "fileId": { 6530 // "description": "The ID of the file.", 6531 // "location": "path", 6532 // "required": true, 6533 // "type": "string" 6534 // } 6535 // }, 6536 // "path": "files/{fileId}/revisions", 6537 // "response": { 6538 // "$ref": "RevisionList" 6539 // }, 6540 // "scopes": [ 6541 // "https://www.googleapis.com/auth/drive", 6542 // "https://www.googleapis.com/auth/drive.appdata", 6543 // "https://www.googleapis.com/auth/drive.file", 6544 // "https://www.googleapis.com/auth/drive.metadata.readonly", 6545 // "https://www.googleapis.com/auth/drive.readonly" 6546 // ] 6547 // } 6548 6549 } 6550 6551 // method id "drive.revisions.patch": 6552 6553 type RevisionsPatchCall struct { 6554 s *Service 6555 fileId string 6556 revisionId string 6557 revision *Revision 6558 opt_ map[string]interface{} 6559 } 6560 6561 // Patch: Updates a revision. This method supports patch semantics. 6562 func (r *RevisionsService) Patch(fileId string, revisionId string, revision *Revision) *RevisionsPatchCall { 6563 c := &RevisionsPatchCall{s: r.s, opt_: make(map[string]interface{})} 6564 c.fileId = fileId 6565 c.revisionId = revisionId 6566 c.revision = revision 6567 return c 6568 } 6569 6570 func (c *RevisionsPatchCall) Do() (*Revision, error) { 6571 var body io.Reader = nil 6572 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision) 6573 if err != nil { 6574 return nil, err 6575 } 6576 ctype := "application/json" 6577 params := make(url.Values) 6578 params.Set("alt", "json") 6579 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/revisions/{revisionId}") 6580 urls += "?" + params.Encode() 6581 req, _ := http.NewRequest("PATCH", urls, body) 6582 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 6583 req.URL.Path = strings.Replace(req.URL.Path, "{revisionId}", url.QueryEscape(c.revisionId), 1) 6584 googleapi.SetOpaque(req.URL) 6585 req.Header.Set("Content-Type", ctype) 6586 req.Header.Set("User-Agent", "google-api-go-client/0.5") 6587 res, err := c.s.client.Do(req) 6588 if err != nil { 6589 return nil, err 6590 } 6591 defer res.Body.Close() 6592 if err := googleapi.CheckResponse(res); err != nil { 6593 return nil, err 6594 } 6595 ret := new(Revision) 6596 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 6597 return nil, err 6598 } 6599 return ret, nil 6600 // { 6601 // "description": "Updates a revision. This method supports patch semantics.", 6602 // "httpMethod": "PATCH", 6603 // "id": "drive.revisions.patch", 6604 // "parameterOrder": [ 6605 // "fileId", 6606 // "revisionId" 6607 // ], 6608 // "parameters": { 6609 // "fileId": { 6610 // "description": "The ID for the file.", 6611 // "location": "path", 6612 // "required": true, 6613 // "type": "string" 6614 // }, 6615 // "revisionId": { 6616 // "description": "The ID for the revision.", 6617 // "location": "path", 6618 // "required": true, 6619 // "type": "string" 6620 // } 6621 // }, 6622 // "path": "files/{fileId}/revisions/{revisionId}", 6623 // "request": { 6624 // "$ref": "Revision" 6625 // }, 6626 // "response": { 6627 // "$ref": "Revision" 6628 // }, 6629 // "scopes": [ 6630 // "https://www.googleapis.com/auth/drive", 6631 // "https://www.googleapis.com/auth/drive.appdata", 6632 // "https://www.googleapis.com/auth/drive.file" 6633 // ] 6634 // } 6635 6636 } 6637 6638 // method id "drive.revisions.update": 6639 6640 type RevisionsUpdateCall struct { 6641 s *Service 6642 fileId string 6643 revisionId string 6644 revision *Revision 6645 opt_ map[string]interface{} 6646 } 6647 6648 // Update: Updates a revision. 6649 func (r *RevisionsService) Update(fileId string, revisionId string, revision *Revision) *RevisionsUpdateCall { 6650 c := &RevisionsUpdateCall{s: r.s, opt_: make(map[string]interface{})} 6651 c.fileId = fileId 6652 c.revisionId = revisionId 6653 c.revision = revision 6654 return c 6655 } 6656 6657 func (c *RevisionsUpdateCall) Do() (*Revision, error) { 6658 var body io.Reader = nil 6659 body, err := googleapi.WithoutDataWrapper.JSONReader(c.revision) 6660 if err != nil { 6661 return nil, err 6662 } 6663 ctype := "application/json" 6664 params := make(url.Values) 6665 params.Set("alt", "json") 6666 urls := googleapi.ResolveRelative("https://www.googleapis.com/drive/v2/", "files/{fileId}/revisions/{revisionId}") 6667 urls += "?" + params.Encode() 6668 req, _ := http.NewRequest("PUT", urls, body) 6669 req.URL.Path = strings.Replace(req.URL.Path, "{fileId}", url.QueryEscape(c.fileId), 1) 6670 req.URL.Path = strings.Replace(req.URL.Path, "{revisionId}", url.QueryEscape(c.revisionId), 1) 6671 googleapi.SetOpaque(req.URL) 6672 req.Header.Set("Content-Type", ctype) 6673 req.Header.Set("User-Agent", "google-api-go-client/0.5") 6674 res, err := c.s.client.Do(req) 6675 if err != nil { 6676 return nil, err 6677 } 6678 defer res.Body.Close() 6679 if err := googleapi.CheckResponse(res); err != nil { 6680 return nil, err 6681 } 6682 ret := new(Revision) 6683 if err := json.NewDecoder(res.Body).Decode(ret); err != nil { 6684 return nil, err 6685 } 6686 return ret, nil 6687 // { 6688 // "description": "Updates a revision.", 6689 // "httpMethod": "PUT", 6690 // "id": "drive.revisions.update", 6691 // "parameterOrder": [ 6692 // "fileId", 6693 // "revisionId" 6694 // ], 6695 // "parameters": { 6696 // "fileId": { 6697 // "description": "The ID for the file.", 6698 // "location": "path", 6699 // "required": true, 6700 // "type": "string" 6701 // }, 6702 // "revisionId": { 6703 // "description": "The ID for the revision.", 6704 // "location": "path", 6705 // "required": true, 6706 // "type": "string" 6707 // } 6708 // }, 6709 // "path": "files/{fileId}/revisions/{revisionId}", 6710 // "request": { 6711 // "$ref": "Revision" 6712 // }, 6713 // "response": { 6714 // "$ref": "Revision" 6715 // }, 6716 // "scopes": [ 6717 // "https://www.googleapis.com/auth/drive", 6718 // "https://www.googleapis.com/auth/drive.appdata", 6719 // "https://www.googleapis.com/auth/drive.file" 6720 // ] 6721 // } 6722 6723 }