aboutsummaryrefslogtreecommitdiff
path: root/vendor/google.golang.org/api
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/google.golang.org/api')
-rw-r--r--vendor/google.golang.org/api/gensupport/resumable.go32
-rw-r--r--vendor/google.golang.org/api/gensupport/retry.go8
-rw-r--r--vendor/google.golang.org/api/googleapi/transport/apikey.go38
-rw-r--r--vendor/google.golang.org/api/googleapi/types.go20
-rw-r--r--vendor/google.golang.org/api/internal/settings.go1
-rw-r--r--vendor/google.golang.org/api/oauth2/v2/oauth2-api.json8
-rw-r--r--vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go52
-rw-r--r--vendor/google.golang.org/api/option/option.go10
-rw-r--r--vendor/google.golang.org/api/storage/v1/storage-api.json9
-rw-r--r--vendor/google.golang.org/api/storage/v1/storage-gen.go460
-rw-r--r--vendor/google.golang.org/api/transport/dial.go10
11 files changed, 628 insertions, 20 deletions
diff --git a/vendor/google.golang.org/api/gensupport/resumable.go b/vendor/google.golang.org/api/gensupport/resumable.go
index 695e365..dcd591f 100644
--- a/vendor/google.golang.org/api/gensupport/resumable.go
+++ b/vendor/google.golang.org/api/gensupport/resumable.go
@@ -5,6 +5,7 @@
package gensupport
import (
+ "errors"
"fmt"
"io"
"net/http"
@@ -15,10 +16,6 @@ import (
)
const (
- // statusResumeIncomplete is the code returned by the Google uploader
- // when the transfer is not yet complete.
- statusResumeIncomplete = 308
-
// statusTooManyRequests is returned by the storage API if the
// per-project limits have been temporarily exceeded. The request
// should be retried.
@@ -79,8 +76,23 @@ func (rx *ResumableUpload) doUploadRequest(ctx context.Context, data io.Reader,
req.Header.Set("Content-Range", contentRange)
req.Header.Set("Content-Type", rx.MediaType)
req.Header.Set("User-Agent", rx.UserAgent)
+
+ // Google's upload endpoint uses status code 308 for a
+ // different purpose than the "308 Permanent Redirect"
+ // since-standardized in RFC 7238. Because of the conflict in
+ // semantics, Google added this new request header which
+ // causes it to not use "308" and instead reply with 200 OK
+ // and sets the upload-specific "X-HTTP-Status-Code-Override:
+ // 308" response header.
+ req.Header.Set("X-GUploader-No-308", "yes")
+
return SendRequest(ctx, rx.Client, req)
+}
+func statusResumeIncomplete(resp *http.Response) bool {
+ // This is how the server signals "status resume incomplete"
+ // when X-GUploader-No-308 is set to "yes":
+ return resp != nil && resp.Header.Get("X-Http-Status-Code-Override") == "308"
}
// reportProgress calls a user-supplied callback to report upload progress.
@@ -111,11 +123,17 @@ func (rx *ResumableUpload) transferChunk(ctx context.Context) (*http.Response, e
return res, err
}
- if res.StatusCode == statusResumeIncomplete || res.StatusCode == http.StatusOK {
+ // We sent "X-GUploader-No-308: yes" (see comment elsewhere in
+ // this file), so we don't expect to get a 308.
+ if res.StatusCode == 308 {
+ return nil, errors.New("unexpected 308 response status code")
+ }
+
+ if res.StatusCode == http.StatusOK {
rx.reportProgress(off, off+int64(size))
}
- if res.StatusCode == statusResumeIncomplete {
+ if statusResumeIncomplete(res) {
rx.Media.Next()
}
return res, nil
@@ -177,7 +195,7 @@ func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err
// If the chunk was uploaded successfully, but there's still
// more to go, upload the next chunk without any delay.
- if status == statusResumeIncomplete {
+ if statusResumeIncomplete(resp) {
pause = 0
backoff.Reset()
resp.Body.Close()
diff --git a/vendor/google.golang.org/api/gensupport/retry.go b/vendor/google.golang.org/api/gensupport/retry.go
index 7f83d1d..9023368 100644
--- a/vendor/google.golang.org/api/gensupport/retry.go
+++ b/vendor/google.golang.org/api/gensupport/retry.go
@@ -55,23 +55,17 @@ func DefaultBackoffStrategy() BackoffStrategy {
// shouldRetry returns true if the HTTP response / error indicates that the
// request should be attempted again.
func shouldRetry(status int, err error) bool {
- // Retry for 5xx response codes.
- if 500 <= status && status < 600 {
+ if 500 <= status && status <= 599 {
return true
}
-
- // Retry on statusTooManyRequests{
if status == statusTooManyRequests {
return true
}
-
- // Retry on unexpected EOFs and temporary network errors.
if err == io.ErrUnexpectedEOF {
return true
}
if err, ok := err.(net.Error); ok {
return err.Temporary()
}
-
return false
}
diff --git a/vendor/google.golang.org/api/googleapi/transport/apikey.go b/vendor/google.golang.org/api/googleapi/transport/apikey.go
new file mode 100644
index 0000000..eca1ea2
--- /dev/null
+++ b/vendor/google.golang.org/api/googleapi/transport/apikey.go
@@ -0,0 +1,38 @@
+// Copyright 2012 Google Inc. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Package transport contains HTTP transports used to make
+// authenticated API requests.
+package transport
+
+import (
+ "errors"
+ "net/http"
+)
+
+// APIKey is an HTTP Transport which wraps an underlying transport and
+// appends an API Key "key" parameter to the URL of outgoing requests.
+type APIKey struct {
+ // Key is the API Key to set on requests.
+ Key string
+
+ // Transport is the underlying HTTP transport.
+ // If nil, http.DefaultTransport is used.
+ Transport http.RoundTripper
+}
+
+func (t *APIKey) RoundTrip(req *http.Request) (*http.Response, error) {
+ rt := t.Transport
+ if rt == nil {
+ rt = http.DefaultTransport
+ if rt == nil {
+ return nil, errors.New("googleapi/transport: no Transport specified or available")
+ }
+ }
+ newReq := *req
+ args := newReq.URL.Query()
+ args.Set("key", t.Key)
+ newReq.URL.RawQuery = args.Encode()
+ return rt.RoundTrip(&newReq)
+}
diff --git a/vendor/google.golang.org/api/googleapi/types.go b/vendor/google.golang.org/api/googleapi/types.go
index a02b4b0..c8fdd54 100644
--- a/vendor/google.golang.org/api/googleapi/types.go
+++ b/vendor/google.golang.org/api/googleapi/types.go
@@ -6,6 +6,7 @@ package googleapi
import (
"encoding/json"
+ "errors"
"strconv"
)
@@ -149,6 +150,25 @@ func (s Float64s) MarshalJSON() ([]byte, error) {
})
}
+// RawMessage is a raw encoded JSON value.
+// It is identical to json.RawMessage, except it does not suffer from
+// https://golang.org/issue/14493.
+type RawMessage []byte
+
+// MarshalJSON returns m.
+func (m RawMessage) MarshalJSON() ([]byte, error) {
+ return m, nil
+}
+
+// UnmarshalJSON sets *m to a copy of data.
+func (m *RawMessage) UnmarshalJSON(data []byte) error {
+ if m == nil {
+ return errors.New("googleapi.RawMessage: UnmarshalJSON on nil pointer")
+ }
+ *m = append((*m)[:0], data...)
+ return nil
+}
+
/*
* Helper routines for simplifying the creation of optional fields of basic type.
*/
diff --git a/vendor/google.golang.org/api/internal/settings.go b/vendor/google.golang.org/api/internal/settings.go
index 976280b..6e60e48 100644
--- a/vendor/google.golang.org/api/internal/settings.go
+++ b/vendor/google.golang.org/api/internal/settings.go
@@ -16,6 +16,7 @@ type DialSettings struct {
ServiceAccountJSONFilename string // if set, TokenSource is ignored.
TokenSource oauth2.TokenSource
UserAgent string
+ APIKey string
HTTPClient *http.Client
GRPCDialOpts []grpc.DialOption
GRPCConn *grpc.ClientConn
diff --git a/vendor/google.golang.org/api/oauth2/v2/oauth2-api.json b/vendor/google.golang.org/api/oauth2/v2/oauth2-api.json
index fb63f08..f1f8beb 100644
--- a/vendor/google.golang.org/api/oauth2/v2/oauth2-api.json
+++ b/vendor/google.golang.org/api/oauth2/v2/oauth2-api.json
@@ -1,18 +1,18 @@
{
"kind": "discovery#restDescription",
- "etag": "\"jQLIOHBVnDZie4rQHGH1WJF-INE/VY5CxwtmcPmH-ruiSL2amW9TN0Q\"",
+ "etag": "\"tbys6C40o18GZwyMen5GMkdK-3s/DLGEtypjIuIXh77Iqrmfcan50ew\"",
"discoveryVersion": "v1",
"id": "oauth2:v2",
"name": "oauth2",
"version": "v2",
- "revision": "20160330",
+ "revision": "20161103",
"title": "Google OAuth2 API",
"description": "Obtains end-user authorization grants for use with other Google APIs.",
"ownerDomain": "google.com",
"ownerName": "Google",
"icons": {
- "x16": "http://www.google.com/images/icons/product/search-16.gif",
- "x32": "http://www.google.com/images/icons/product/search-32.gif"
+ "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png",
+ "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png"
},
"documentationLink": "https://developers.google.com/accounts/docs/OAuth2",
"protocol": "rest",
diff --git a/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go b/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go
index b1a7694..7440468 100644
--- a/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go
+++ b/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go
@@ -317,6 +317,7 @@ type GetCertForOpenIdConnectCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// GetCertForOpenIdConnect:
@@ -351,8 +352,20 @@ func (c *GetCertForOpenIdConnectCall) Context(ctx context.Context) *GetCertForOp
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *GetCertForOpenIdConnectCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *GetCertForOpenIdConnectCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -420,6 +433,7 @@ type TokeninfoCall struct {
s *Service
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Tokeninfo:
@@ -462,8 +476,20 @@ func (c *TokeninfoCall) Context(ctx context.Context) *TokeninfoCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *TokeninfoCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *TokeninfoCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
@@ -543,6 +569,7 @@ type UserinfoGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// Get:
@@ -577,8 +604,20 @@ func (c *UserinfoGetCall) Context(ctx context.Context) *UserinfoGetCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *UserinfoGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *UserinfoGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -653,6 +692,7 @@ type UserinfoV2MeGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// Get:
@@ -687,8 +727,20 @@ func (c *UserinfoV2MeGetCall) Context(ctx context.Context) *UserinfoV2MeGetCall
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *UserinfoV2MeGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *UserinfoV2MeGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
diff --git a/vendor/google.golang.org/api/option/option.go b/vendor/google.golang.org/api/option/option.go
index b935e6d..f266919 100644
--- a/vendor/google.golang.org/api/option/option.go
+++ b/vendor/google.golang.org/api/option/option.go
@@ -130,3 +130,13 @@ func (w withGRPCConnectionPool) Apply(o *internal.DialSettings) {
balancer := grpc.RoundRobin(internal.NewPoolResolver(int(w), o))
o.GRPCDialOpts = append(o.GRPCDialOpts, grpc.WithBalancer(balancer))
}
+
+// WithAPIKey returns a ClientOption that specifies an API key to be used
+// as the basis for authentication.
+func WithAPIKey(apiKey string) ClientOption {
+ return withAPIKey(apiKey)
+}
+
+type withAPIKey string
+
+func (w withAPIKey) Apply(o *internal.DialSettings) { o.APIKey = string(w) }
diff --git a/vendor/google.golang.org/api/storage/v1/storage-api.json b/vendor/google.golang.org/api/storage/v1/storage-api.json
index 598d1a5..67fe1a2 100644
--- a/vendor/google.golang.org/api/storage/v1/storage-api.json
+++ b/vendor/google.golang.org/api/storage/v1/storage-api.json
@@ -1,11 +1,11 @@
{
"kind": "discovery#restDescription",
- "etag": "\"C5oy1hgQsABtYOYIOXWcR3BgYqU/G3kZz5Dv92Y-2NZwaNrcr5jwm4A\"",
+ "etag": "\"tbys6C40o18GZwyMen5GMkdK-3s/sMgjc4eoIFjgub4daTU-MGW0WMA\"",
"discoveryVersion": "v1",
"id": "storage:v1",
"name": "storage",
"version": "v1",
- "revision": "20161019",
+ "revision": "20161109",
"title": "Cloud Storage JSON API",
"description": "Stores and retrieves potentially large, immutable data objects.",
"ownerDomain": "google.com",
@@ -685,6 +685,11 @@
"description": "The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.",
"format": "date-time"
},
+ "timeStorageClassUpdated": {
+ "type": "string",
+ "description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.",
+ "format": "date-time"
+ },
"updated": {
"type": "string",
"description": "The modification time of the object metadata in RFC 3339 format.",
diff --git a/vendor/google.golang.org/api/storage/v1/storage-gen.go b/vendor/google.golang.org/api/storage/v1/storage-gen.go
index 4c458af..0f1d094 100644
--- a/vendor/google.golang.org/api/storage/v1/storage-gen.go
+++ b/vendor/google.golang.org/api/storage/v1/storage-gen.go
@@ -1034,6 +1034,11 @@ type Object struct {
// deleted.
TimeDeleted string `json:"timeDeleted,omitempty"`
+ // TimeStorageClassUpdated: The time at which the object's storage class
+ // was last changed. When the object is initially created, it will be
+ // set to timeCreated.
+ TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"`
+
// Updated: The modification time of the object metadata in RFC 3339
// format.
Updated string `json:"updated,omitempty"`
@@ -1390,6 +1395,7 @@ type BucketAccessControlsDeleteCall struct {
entity string
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Delete: Permanently deletes the ACL entry for the specified entity on
@@ -1417,8 +1423,20 @@ func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAcc
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketAccessControlsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
@@ -1485,6 +1503,7 @@ type BucketAccessControlsGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// Get: Returns the ACL entry for the specified entity on the specified
@@ -1522,8 +1541,20 @@ func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccess
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketAccessControlsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -1620,6 +1651,7 @@ type BucketAccessControlsInsertCall struct {
bucketaccesscontrol *BucketAccessControl
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Insert: Creates a new ACL entry on the specified bucket.
@@ -1646,8 +1678,20 @@ func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAcc
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketAccessControlsInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
@@ -1741,6 +1785,7 @@ type BucketAccessControlsListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// List: Retrieves ACL entries on the specified bucket.
@@ -1776,8 +1821,20 @@ func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAcces
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketAccessControlsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -1867,6 +1924,7 @@ type BucketAccessControlsPatchCall struct {
bucketaccesscontrol *BucketAccessControl
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Patch: Updates an ACL entry on the specified bucket. This method
@@ -1895,8 +1953,20 @@ func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAcce
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketAccessControlsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
@@ -1999,6 +2069,7 @@ type BucketAccessControlsUpdateCall struct {
bucketaccesscontrol *BucketAccessControl
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Update: Updates an ACL entry on the specified bucket.
@@ -2026,8 +2097,20 @@ func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAcc
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketAccessControlsUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
@@ -2128,6 +2211,7 @@ type BucketsDeleteCall struct {
bucket string
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Delete: Permanently deletes an empty bucket.
@@ -2169,8 +2253,20 @@ func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
@@ -2241,6 +2337,7 @@ type BucketsGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// Get: Returns metadata for the specified bucket.
@@ -2305,8 +2402,20 @@ func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -2422,6 +2531,7 @@ type BucketsInsertCall struct {
bucket *Bucket
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Insert: Creates a new bucket.
@@ -2500,8 +2610,20 @@ func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketsInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
@@ -2645,6 +2767,7 @@ type BucketsListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// List: Retrieves a list of buckets for a given project.
@@ -2713,8 +2836,20 @@ func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -2854,6 +2989,7 @@ type BucketsPatchCall struct {
bucket2 *Bucket
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Patch: Updates a bucket. Changes to the bucket will be readable
@@ -2950,8 +3086,20 @@ func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
@@ -3110,6 +3258,7 @@ type BucketsUpdateCall struct {
bucket2 *Bucket
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Update: Updates a bucket. Changes to the bucket will be readable
@@ -3206,8 +3355,20 @@ func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *BucketsUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
@@ -3365,6 +3526,7 @@ type ChannelsStopCall struct {
channel *Channel
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Stop: Stop watching resources through this channel
@@ -3390,8 +3552,20 @@ func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ChannelsStopCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
@@ -3447,6 +3621,7 @@ type DefaultObjectAccessControlsDeleteCall struct {
entity string
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Delete: Permanently deletes the default object ACL entry for the
@@ -3474,8 +3649,20 @@ func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *De
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
@@ -3542,6 +3729,7 @@ type DefaultObjectAccessControlsGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// Get: Returns the default object ACL entry for the specified entity on
@@ -3579,8 +3767,20 @@ func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *Defau
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -3677,6 +3877,7 @@ type DefaultObjectAccessControlsInsertCall struct {
objectaccesscontrol *ObjectAccessControl
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Insert: Creates a new default object ACL entry on the specified
@@ -3704,8 +3905,20 @@ func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *De
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
@@ -3799,6 +4012,7 @@ type DefaultObjectAccessControlsListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// List: Retrieves default object ACL entries on the specified bucket.
@@ -3851,8 +4065,20 @@ func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *Defa
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -3954,6 +4180,7 @@ type DefaultObjectAccessControlsPatchCall struct {
objectaccesscontrol *ObjectAccessControl
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Patch: Updates a default object ACL entry on the specified bucket.
@@ -3982,8 +4209,20 @@ func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *Def
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
@@ -4086,6 +4325,7 @@ type DefaultObjectAccessControlsUpdateCall struct {
objectaccesscontrol *ObjectAccessControl
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Update: Updates a default object ACL entry on the specified bucket.
@@ -4113,8 +4353,20 @@ func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *De
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
@@ -4217,6 +4469,7 @@ type ObjectAccessControlsDeleteCall struct {
entity string
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Delete: Permanently deletes the ACL entry for the specified entity on
@@ -4253,8 +4506,20 @@ func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAcc
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
@@ -4336,6 +4601,7 @@ type ObjectAccessControlsGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// Get: Returns the ACL entry for the specified entity on the specified
@@ -4382,8 +4648,20 @@ func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccess
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectAccessControlsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -4495,6 +4773,7 @@ type ObjectAccessControlsInsertCall struct {
objectaccesscontrol *ObjectAccessControl
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Insert: Creates a new ACL entry on the specified object.
@@ -4530,8 +4809,20 @@ func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAcc
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectAccessControlsInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
@@ -4640,6 +4931,7 @@ type ObjectAccessControlsListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// List: Retrieves ACL entries on the specified object.
@@ -4684,8 +4976,20 @@ func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAcces
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectAccessControlsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -4790,6 +5094,7 @@ type ObjectAccessControlsPatchCall struct {
objectaccesscontrol *ObjectAccessControl
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Patch: Updates an ACL entry on the specified object. This method
@@ -4827,8 +5132,20 @@ func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAcce
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectAccessControlsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
@@ -4946,6 +5263,7 @@ type ObjectAccessControlsUpdateCall struct {
objectaccesscontrol *ObjectAccessControl
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Update: Updates an ACL entry on the specified object.
@@ -4982,8 +5300,20 @@ func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAcc
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
@@ -5100,6 +5430,7 @@ type ObjectsComposeCall struct {
composerequest *ComposeRequest
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Compose: Concatenates a list of existing objects into a new object in
@@ -5165,8 +5496,20 @@ func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectsComposeCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
@@ -5323,6 +5666,7 @@ type ObjectsCopyCall struct {
object *Object
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Copy: Copies a source object to a destination object. Optionally
@@ -5464,8 +5808,20 @@ func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectsCopyCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
@@ -5690,6 +6046,7 @@ type ObjectsDeleteCall struct {
object string
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Delete: Deletes an object and its metadata. Deletions are permanent
@@ -5759,8 +6116,20 @@ func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectsDeleteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
c.urlParams_.Set("alt", alt)
@@ -5858,6 +6227,7 @@ type ObjectsGetCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// Get: Retrieves an object or its metadata.
@@ -5946,8 +6316,20 @@ func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectsGetCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -6113,6 +6495,7 @@ type ObjectsInsertCall struct {
mediaSize_ int64 // mediaSize, if known. Used only for calls to progressUpdater_.
progressUpdater_ googleapi.ProgressUpdater
ctx_ context.Context
+ header_ http.Header
}
// Insert: Stores a new object and metadata.
@@ -6275,8 +6658,20 @@ func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectsInsertCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
@@ -6505,6 +6900,7 @@ type ObjectsListCall struct {
urlParams_ gensupport.URLParams
ifNoneMatch_ string
ctx_ context.Context
+ header_ http.Header
}
// List: Retrieves a list of objects matching the criteria.
@@ -6594,8 +6990,20 @@ func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectsListCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
if c.ifNoneMatch_ != "" {
reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
@@ -6750,6 +7158,7 @@ type ObjectsPatchCall struct {
object2 *Object
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Patch: Updates an object's metadata. This method supports patch
@@ -6850,8 +7259,20 @@ func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectsPatchCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
@@ -7020,6 +7441,7 @@ type ObjectsRewriteCall struct {
object *Object
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Rewrite: Rewrites a source object to a destination object. Optionally
@@ -7186,8 +7608,20 @@ func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectsRewriteCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
@@ -7406,6 +7840,7 @@ type ObjectsUpdateCall struct {
object2 *Object
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// Update: Updates an object's metadata.
@@ -7505,8 +7940,20 @@ func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectsUpdateCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
@@ -7690,6 +8137,7 @@ type ObjectsWatchAllCall struct {
channel *Channel
urlParams_ gensupport.URLParams
ctx_ context.Context
+ header_ http.Header
}
// WatchAll: Watch for changes on all objects in a bucket.
@@ -7770,8 +8218,20 @@ func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall
return c
}
+// Header returns an http.Header that can be modified by the caller to
+// add HTTP headers to the request.
+func (c *ObjectsWatchAllCall) Header() http.Header {
+ if c.header_ == nil {
+ c.header_ = make(http.Header)
+ }
+ return c.header_
+}
+
func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
reqHeaders := make(http.Header)
+ for k, v := range c.header_ {
+ reqHeaders[k] = v
+ }
reqHeaders.Set("User-Agent", c.s.userAgent())
var body io.Reader = nil
body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
diff --git a/vendor/google.golang.org/api/transport/dial.go b/vendor/google.golang.org/api/transport/dial.go
index c054460..9971eb8 100644
--- a/vendor/google.golang.org/api/transport/dial.go
+++ b/vendor/google.golang.org/api/transport/dial.go
@@ -30,6 +30,7 @@ import (
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/credentials/oauth"
+ gtransport "google.golang.org/api/googleapi/transport"
"google.golang.org/api/internal"
"google.golang.org/api/option"
)
@@ -49,6 +50,15 @@ func NewHTTPClient(ctx context.Context, opts ...option.ClientOption) (*http.Clie
if o.HTTPClient != nil {
return o.HTTPClient, o.Endpoint, nil
}
+ if o.APIKey != "" {
+ hc := &http.Client{
+ Transport: &gtransport.APIKey{
+ Key: o.APIKey,
+ Transport: http.DefaultTransport,
+ },
+ }
+ return hc, o.Endpoint, nil
+ }
if o.ServiceAccountJSONFilename != "" {
ts, err := serviceAcctTokenSource(ctx, o.ServiceAccountJSONFilename, o.Scopes...)
if err != nil {