1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-06 10:33:34 +00:00

vendor: update all dependencies

This commit is contained in:
Nick Craig-Wood
2019-04-13 13:47:57 +01:00
parent 8190a81201
commit 613a9bb86b
448 changed files with 62205 additions and 13395 deletions

View File

@@ -38,7 +38,7 @@
"description": "Manages files in Drive including uploading, downloading, searching, detecting changes, and updating sharing permissions.",
"discoveryVersion": "v1",
"documentationLink": "https://developers.google.com/drive/",
"etag": "\"J3WqvAcMk4eQjJXvfSI4Yr8VouA/ht6QYJxjG-GWKiHV7jWIX4PB5aE\"",
"etag": "\"J3WqvAcMk4eQjJXvfSI4Yr8VouA/XBo3v2wypoRQ0OatiSPR_63Htp4\"",
"icons": {
"x16": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_16.png",
"x32": "https://ssl.gstatic.com/docs/doclist/images/drive_icon_32.png"
@@ -2748,7 +2748,7 @@
"revisions": {
"methods": {
"delete": {
"description": "Removes a revision.",
"description": "Permanently deletes a file version. You can only delete revisions for files with binary content, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.",
"httpMethod": "DELETE",
"id": "drive.revisions.delete",
"parameterOrder": [
@@ -3080,7 +3080,7 @@
}
}
},
"revision": "20181025",
"revision": "20190311",
"rootUrl": "https://www.googleapis.com/",
"schemas": {
"About": {

View File

@@ -1,4 +1,4 @@
// Copyright 2018 Google Inc. All rights reserved.
// Copyright 2019 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
@@ -6,13 +6,39 @@
// Package drive provides access to the Drive API.
//
// See https://developers.google.com/drive/
// For product documentation, see: https://developers.google.com/drive/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/drive/v2"
// ...
// driveService, err := drive.New(oauthHttpClient)
// ctx := context.Background()
// driveService, err := drive.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// By default, all available scopes (see "Constants") are used to authenticate. To restrict scopes, use option.WithScopes:
//
// driveService, err := drive.NewService(ctx, option.WithScopes(drive.DriveScriptsScope))
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// driveService, err := drive.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// driveService, err := drive.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package drive // import "google.golang.org/api/drive/v2"
import (
@@ -29,6 +55,8 @@ import (
gensupport "google.golang.org/api/gensupport"
googleapi "google.golang.org/api/googleapi"
option "google.golang.org/api/option"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
@@ -81,6 +109,40 @@ const (
DriveScriptsScope = "https://www.googleapis.com/auth/drive.scripts"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/drive",
"https://www.googleapis.com/auth/drive.appdata",
"https://www.googleapis.com/auth/drive.apps.readonly",
"https://www.googleapis.com/auth/drive.file",
"https://www.googleapis.com/auth/drive.metadata",
"https://www.googleapis.com/auth/drive.metadata.readonly",
"https://www.googleapis.com/auth/drive.photos.readonly",
"https://www.googleapis.com/auth/drive.readonly",
"https://www.googleapis.com/auth/drive.scripts",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
@@ -7563,7 +7625,7 @@ func (c *FilesInsertCall) doRequest(alt string) (*http.Response, error) {
return nil, err
}
req.Header = reqHeaders
gensupport.SetGetBody(req, getBody)
req.GetBody = getBody
return gensupport.SendRequest(c.ctx_, c.s.client, req)
}
@@ -9079,7 +9141,7 @@ func (c *FilesUpdateCall) doRequest(alt string) (*http.Response, error) {
return nil, err
}
req.Header = reqHeaders
gensupport.SetGetBody(req, getBody)
req.GetBody = getBody
googleapi.Expand(req.URL, map[string]string{
"fileId": c.fileId,
})
@@ -12566,7 +12628,7 @@ func (c *RealtimeUpdateCall) doRequest(alt string) (*http.Response, error) {
return nil, err
}
req.Header = reqHeaders
gensupport.SetGetBody(req, getBody)
req.GetBody = getBody
googleapi.Expand(req.URL, map[string]string{
"fileId": c.fileId,
})
@@ -13638,7 +13700,10 @@ type RevisionsDeleteCall struct {
header_ http.Header
}
// Delete: Removes a revision.
// Delete: Permanently deletes a file version. You can only delete
// revisions for files with binary content, like images or videos.
// Revisions for other files, like Google Docs or Sheets, and the last
// remaining file version can't be deleted.
func (r *RevisionsService) Delete(fileId string, revisionId string) *RevisionsDeleteCall {
c := &RevisionsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
c.fileId = fileId
@@ -13707,7 +13772,7 @@ func (c *RevisionsDeleteCall) Do(opts ...googleapi.CallOption) error {
}
return nil
// {
// "description": "Removes a revision.",
// "description": "Permanently deletes a file version. You can only delete revisions for files with binary content, like images or videos. Revisions for other files, like Google Docs or Sheets, and the last remaining file version can't be deleted.",
// "httpMethod": "DELETE",
// "id": "drive.revisions.delete",
// "parameterOrder": [