From 921818bca208f0c70e85ec670074cb3905cbbc82 Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Sat, 27 Aug 2016 01:32:30 +0100 Subject: Update dependencies --- .../google.golang.org/api/gensupport/resumable.go | 5 +- vendor/google.golang.org/api/gensupport/send.go | 55 +++++ vendor/google.golang.org/api/internal/pool.go | 59 +++++ .../google.golang.org/api/oauth2/v2/oauth2-gen.go | 20 +- vendor/google.golang.org/api/option/option.go | 14 ++ .../api/storage/v1/storage-api.json | 42 +++- .../api/storage/v1/storage-gen.go | 265 +++++++++------------ 7 files changed, 289 insertions(+), 171 deletions(-) create mode 100644 vendor/google.golang.org/api/gensupport/send.go create mode 100644 vendor/google.golang.org/api/internal/pool.go (limited to 'vendor/google.golang.org/api') diff --git a/vendor/google.golang.org/api/gensupport/resumable.go b/vendor/google.golang.org/api/gensupport/resumable.go index ad16943..695e365 100644 --- a/vendor/google.golang.org/api/gensupport/resumable.go +++ b/vendor/google.golang.org/api/gensupport/resumable.go @@ -12,7 +12,6 @@ import ( "time" "golang.org/x/net/context" - "golang.org/x/net/context/ctxhttp" ) const ( @@ -80,7 +79,7 @@ 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) - return ctxhttp.Do(ctx, rx.Client, req) + return SendRequest(ctx, rx.Client, req) } @@ -135,6 +134,8 @@ func contextDone(ctx context.Context) bool { // It retries using the provided back off strategy until cancelled or the // strategy indicates to stop retrying. // It is called from the auto-generated API code and is not visible to the user. +// Before sending an HTTP request, Upload calls any registered hook functions, +// and calls the returned functions after the request returns (see send.go). // rx is private to the auto-generated API code. // Exactly one of resp or err will be nil. If resp is non-nil, the caller must call resp.Body.Close. func (rx *ResumableUpload) Upload(ctx context.Context) (resp *http.Response, err error) { diff --git a/vendor/google.golang.org/api/gensupport/send.go b/vendor/google.golang.org/api/gensupport/send.go new file mode 100644 index 0000000..3d22f63 --- /dev/null +++ b/vendor/google.golang.org/api/gensupport/send.go @@ -0,0 +1,55 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gensupport + +import ( + "net/http" + + "golang.org/x/net/context" + "golang.org/x/net/context/ctxhttp" +) + +// Hook is the type of a function that is called once before each HTTP request +// that is sent by a generated API. It returns a function that is called after +// the request returns. +// Hooks are not called if the context is nil. +type Hook func(ctx context.Context, req *http.Request) func(resp *http.Response) + +var hooks []Hook + +// RegisterHook registers a Hook to be called before each HTTP request by a +// generated API. Hooks are called in the order they are registered. Each +// hook can return a function; if it is non-nil, it is called after the HTTP +// request returns. These functions are called in the reverse order. +// RegisterHook should not be called concurrently with itself or SendRequest. +func RegisterHook(h Hook) { + hooks = append(hooks, h) +} + +// SendRequest sends a single HTTP request using the given client. +// If ctx is non-nil, it calls all hooks, then sends the request with +// ctxhttp.Do, then calls any functions returned by the hooks in reverse order. +func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*http.Response, error) { + if ctx == nil { + return client.Do(req) + } + // Call hooks in order of registration, store returned funcs. + post := make([]func(resp *http.Response), len(hooks)) + for i, h := range hooks { + fn := h(ctx, req) + post[i] = fn + } + + // Send request. + resp, err := ctxhttp.Do(ctx, client, req) + + // Call returned funcs in reverse order. + for i := len(post) - 1; i >= 0; i-- { + if fn := post[i]; fn != nil { + fn(resp) + } + } + return resp, err +} diff --git a/vendor/google.golang.org/api/internal/pool.go b/vendor/google.golang.org/api/internal/pool.go new file mode 100644 index 0000000..4150feb --- /dev/null +++ b/vendor/google.golang.org/api/internal/pool.go @@ -0,0 +1,59 @@ +// Copyright 2016 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package internal + +import ( + "errors" + "google.golang.org/grpc/naming" +) + +// PoolResolver provides a fixed list of addresses to load balance between +// and does not provide further updates. +type PoolResolver struct { + poolSize int + dialOpt *DialSettings + ch chan []*naming.Update +} + +// NewPoolResolver returns a PoolResolver +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func NewPoolResolver(size int, o *DialSettings) *PoolResolver { + return &PoolResolver{poolSize: size, dialOpt: o} +} + +// Resolve returns a Watcher for the endpoint defined by the DialSettings +// provided to NewPoolResolver. +func (r *PoolResolver) Resolve(target string) (naming.Watcher, error) { + if r.dialOpt.Endpoint == "" { + return nil, errors.New("No endpoint configured") + } + addrs := make([]*naming.Update, 0, r.poolSize) + for i := 0; i < r.poolSize; i++ { + addrs = append(addrs, &naming.Update{Op: naming.Add, Addr: r.dialOpt.Endpoint, Metadata: i}) + } + r.ch = make(chan []*naming.Update, 1) + r.ch <- addrs + return r, nil +} + +// Next returns a static list of updates on the first call, +// and blocks indefinitely until Close is called on subsequent calls. +func (r *PoolResolver) Next() ([]*naming.Update, error) { + return <-r.ch, nil +} + +func (r *PoolResolver) Close() { + close(r.ch) +} 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 268592b..dd23316 100644 --- a/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go +++ b/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go @@ -332,10 +332,7 @@ func (c *GetCertForOpenIdConnectCall) doRequest(alt string) (*http.Response, err req, _ := http.NewRequest("GET", urls, body) req.Header = reqHeaders googleapi.SetOpaque(req.URL) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "oauth2.getCertForOpenIdConnect" call. @@ -444,10 +441,7 @@ func (c *TokeninfoCall) doRequest(alt string) (*http.Response, error) { req, _ := http.NewRequest("POST", urls, body) req.Header = reqHeaders googleapi.SetOpaque(req.URL) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "oauth2.tokeninfo" call. @@ -566,10 +560,7 @@ func (c *UserinfoGetCall) doRequest(alt string) (*http.Response, error) { req, _ := http.NewRequest("GET", urls, body) req.Header = reqHeaders googleapi.SetOpaque(req.URL) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "oauth2.userinfo.get" call. @@ -680,10 +671,7 @@ func (c *UserinfoV2MeGetCall) doRequest(alt string) (*http.Response, error) { req, _ := http.NewRequest("GET", urls, body) req.Header = reqHeaders googleapi.SetOpaque(req.URL) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "oauth2.userinfo.v2.me.get" call. diff --git a/vendor/google.golang.org/api/option/option.go b/vendor/google.golang.org/api/option/option.go index 0be53c1..556a6df 100644 --- a/vendor/google.golang.org/api/option/option.go +++ b/vendor/google.golang.org/api/option/option.go @@ -101,3 +101,17 @@ type withGRPCDialOption struct{ opt grpc.DialOption } func (w withGRPCDialOption) Apply(o *internal.DialSettings) { o.GRPCDialOpts = append(o.GRPCDialOpts, w.opt) } + +// WithGRPCConnectionPool returns a ClientOption that creates a pool of gRPC +// connections that requests will be balanced between. +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func WithGRPCConnectionPool(size int) ClientOption { + return withGRPCConnectionPool(size) +} + +type withGRPCConnectionPool int + +func (w withGRPCConnectionPool) Apply(o *internal.DialSettings) { + balancer := grpc.RoundRobin(internal.NewPoolResolver(int(w), o)) + o.GRPCDialOpts = append(o.GRPCDialOpts, grpc.WithBalancer(balancer)) +} 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 52811fd..8d9118b 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/cPnwg2U9hg8m8Y6wHWcvqIF8qSM\"", + "etag": "\"C5oy1hgQsABtYOYIOXWcR3BgYqU/gtcWNCypj7VTDxrk1rvvuniNHZo\"", "discoveryVersion": "v1", "id": "storage:v1", "name": "storage", "version": "v1", - "revision": "20160609", + "revision": "20160802", "title": "Cloud Storage JSON API", "description": "Stores and retrieves potentially large, immutable data objects.", "ownerDomain": "google.com", @@ -150,6 +150,15 @@ "$ref": "ObjectAccessControl" } }, + "encryption": { + "type": "object", + "description": "Encryption configuration used by default for newly inserted objects, when no encryption config is specified.", + "properties": { + "default_kms_key_name": { + "type": "string" + } + } + }, "etag": { "type": "string", "description": "HTTP 1.1 Entity tag for the bucket." @@ -361,13 +370,13 @@ }, "team": { "type": "string", - "description": "The team. Can be owners, editors, or viewers." + "description": "The team." } } }, "role": { "type": "string", - "description": "The access permission for the entity. Can be READER, WRITER, or OWNER.", + "description": "The access permission for the entity.", "annotations": { "required": [ "storage.bucketAccessControls.insert" @@ -553,7 +562,7 @@ }, "cacheControl": { "type": "string", - "description": "Cache-Control directive for the object data." + "description": "Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600." }, "componentCount": { "type": "integer", @@ -612,6 +621,10 @@ "description": "The kind of item this is. For objects, this is always storage#object.", "default": "storage#object" }, + "kmsKeyName": { + "type": "string", + "description": "Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key." + }, "md5Hash": { "type": "string", "description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices." @@ -738,13 +751,13 @@ }, "team": { "type": "string", - "description": "The team. Can be owners, editors, or viewers." + "description": "The team." } } }, "role": { "type": "string", - "description": "The access permission for the entity. Can be READER or OWNER." + "description": "The access permission for the entity." }, "selfLink": { "type": "string", @@ -1958,6 +1971,11 @@ "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", "format": "int64", "location": "query" + }, + "kmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" } }, "parameterOrder": [ @@ -2296,6 +2314,11 @@ "format": "int64", "location": "query" }, + "kmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" + }, "name": { "type": "string", "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", @@ -2547,6 +2570,11 @@ "required": true, "location": "path" }, + "destinationKmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" + }, "destinationObject": { "type": "string", "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", 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 f7e422c..346751b 100644 --- a/vendor/google.golang.org/api/storage/v1/storage-gen.go +++ b/vendor/google.golang.org/api/storage/v1/storage-gen.go @@ -169,6 +169,10 @@ type Bucket struct { // when no ACL is provided. DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"` + // Encryption: Encryption configuration used by default for newly + // inserted objects, when no encryption config is specified. + Encryption *BucketEncryption `json:"encryption,omitempty"` + // Etag: HTTP 1.1 Entity tag for the bucket. Etag string `json:"etag,omitempty"` @@ -284,6 +288,26 @@ func (s *BucketCors) MarshalJSON() ([]byte, error) { return gensupport.MarshalJSON(raw, s.ForceSendFields) } +// BucketEncryption: Encryption configuration used by default for newly +// inserted objects, when no encryption config is specified. +type BucketEncryption struct { + DefaultKmsKeyName string `json:"default_kms_key_name,omitempty"` + + // ForceSendFields is a list of field names (e.g. "DefaultKmsKeyName") + // to unconditionally include in API requests. By default, fields with + // empty values are omitted from API requests. However, any non-pointer, + // non-interface field appearing in ForceSendFields will be sent to the + // server regardless of whether the field is empty or not. This may be + // used to include empty fields in Patch requests. + ForceSendFields []string `json:"-"` +} + +func (s *BucketEncryption) MarshalJSON() ([]byte, error) { + type noMethod BucketEncryption + raw := noMethod(*s) + return gensupport.MarshalJSON(raw, s.ForceSendFields) +} + // BucketLifecycle: The bucket's lifecycle configuration. See lifecycle // management for more information. type BucketLifecycle struct { @@ -531,8 +555,7 @@ type BucketAccessControl struct { // ProjectTeam: The project team associated with the entity, if any. ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"` - // Role: The access permission for the entity. Can be READER, WRITER, or - // OWNER. + // Role: The access permission for the entity. Role string `json:"role,omitempty"` // SelfLink: The link to this access-control entry. @@ -563,7 +586,7 @@ type BucketAccessControlProjectTeam struct { // ProjectNumber: The project number. ProjectNumber string `json:"projectNumber,omitempty"` - // Team: The team. Can be owners, editors, or viewers. + // Team: The team. Team string `json:"team,omitempty"` // ForceSendFields is a list of field names (e.g. "ProjectNumber") to @@ -786,7 +809,9 @@ type Object struct { // Bucket: The name of the bucket containing this object. Bucket string `json:"bucket,omitempty"` - // CacheControl: Cache-Control directive for the object data. + // CacheControl: Cache-Control directive for the object data. If + // omitted, and the object is accessible to all anonymous users, the + // default will be public, max-age=3600. CacheControl string `json:"cacheControl,omitempty"` // ComponentCount: Number of underlying components that make up this @@ -831,6 +856,10 @@ type Object struct { // storage#object. Kind string `json:"kind,omitempty"` + // KmsKeyName: Cloud KMS Key used to encrypt this object, if the object + // is encrypted by such a key. + KmsKeyName string `json:"kmsKeyName,omitempty"` + // Md5Hash: MD5 hash of the data; encoded using base64. For more // information about using the MD5 hash, see Hashes and ETags: Best // Practices. @@ -994,7 +1023,7 @@ type ObjectAccessControl struct { // ProjectTeam: The project team associated with the entity, if any. ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"` - // Role: The access permission for the entity. Can be READER or OWNER. + // Role: The access permission for the entity. Role string `json:"role,omitempty"` // SelfLink: The link to this access-control entry. @@ -1025,7 +1054,7 @@ type ObjectAccessControlProjectTeam struct { // ProjectNumber: The project number. ProjectNumber string `json:"projectNumber,omitempty"` - // Team: The team. Can be owners, editors, or viewers. + // Team: The team. Team string `json:"team,omitempty"` // ForceSendFields is a list of field names (e.g. "ProjectNumber") to @@ -1203,10 +1232,7 @@ func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, "bucket": c.bucket, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.bucketAccessControls.delete" call. @@ -1314,10 +1340,7 @@ func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, err "bucket": c.bucket, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.bucketAccessControls.get" call. @@ -1442,10 +1465,7 @@ func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, googleapi.Expand(req.URL, map[string]string{ "bucket": c.bucket, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.bucketAccessControls.insert" call. @@ -1573,10 +1593,7 @@ func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, er googleapi.Expand(req.URL, map[string]string{ "bucket": c.bucket, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.bucketAccessControls.list" call. @@ -1698,10 +1715,7 @@ func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, e "bucket": c.bucket, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.bucketAccessControls.patch" call. @@ -1832,10 +1846,7 @@ func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, "bucket": c.bucket, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.bucketAccessControls.update" call. @@ -1972,10 +1983,7 @@ func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "bucket": c.bucket, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.buckets.delete" call. @@ -2114,10 +2122,7 @@ func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "bucket": c.bucket, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.buckets.get" call. @@ -2312,10 +2317,7 @@ func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) { req, _ := http.NewRequest("POST", urls, body) req.Header = reqHeaders googleapi.SetOpaque(req.URL) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.buckets.insert" call. @@ -2527,10 +2529,7 @@ func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { req, _ := http.NewRequest("GET", urls, body) req.Header = reqHeaders googleapi.SetOpaque(req.URL) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.buckets.list" call. @@ -2770,10 +2769,7 @@ func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "bucket": c.bucket, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.buckets.patch" call. @@ -3027,10 +3023,7 @@ func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "bucket": c.bucket, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.buckets.update" call. @@ -3212,10 +3205,7 @@ func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { req, _ := http.NewRequest("POST", urls, body) req.Header = reqHeaders googleapi.SetOpaque(req.URL) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.channels.stop" call. @@ -3298,10 +3288,7 @@ func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Res "bucket": c.bucket, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.defaultObjectAccessControls.delete" call. @@ -3409,10 +3396,7 @@ func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Respon "bucket": c.bucket, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.defaultObjectAccessControls.get" call. @@ -3538,10 +3522,7 @@ func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Res googleapi.Expand(req.URL, map[string]string{ "bucket": c.bucket, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.defaultObjectAccessControls.insert" call. @@ -3686,10 +3667,7 @@ func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Respo googleapi.Expand(req.URL, map[string]string{ "bucket": c.bucket, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.defaultObjectAccessControls.list" call. @@ -3823,10 +3801,7 @@ func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Resp "bucket": c.bucket, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.defaultObjectAccessControls.patch" call. @@ -3957,10 +3932,7 @@ func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Res "bucket": c.bucket, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.defaultObjectAccessControls.update" call. @@ -4096,10 +4068,7 @@ func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, "object": c.object, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objectAccessControls.delete" call. @@ -4231,10 +4200,7 @@ func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, err "object": c.object, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objectAccessControls.get" call. @@ -4383,10 +4349,7 @@ func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, "bucket": c.bucket, "object": c.object, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objectAccessControls.insert" call. @@ -4538,10 +4501,7 @@ func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, er "bucket": c.bucket, "object": c.object, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objectAccessControls.list" call. @@ -4687,10 +4647,7 @@ func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, e "object": c.object, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objectAccessControls.patch" call. @@ -4845,10 +4802,7 @@ func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, "object": c.object, "entity": c.entity, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objectAccessControls.update" call. @@ -4996,6 +4950,16 @@ func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) return c } +// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of +// the Cloud KMS key, of the form +// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, +// that will be used to encrypt the object. Overrides the object +// metadata's kms_key_name value, if any. +func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall { + c.urlParams_.Set("kmsKeyName", kmsKeyName) + return c +} + // Fields allows partial responses to be retrieved. See // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse // for more information. @@ -5030,10 +4994,7 @@ func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) { "destinationBucket": c.destinationBucket, "destinationObject": c.destinationObject, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Download fetches the API endpoint's "media" value, instead of the normal @@ -5142,6 +5103,11 @@ func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) { // "format": "int64", // "location": "query", // "type": "string" + // }, + // "kmsKeyName": { + // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + // "location": "query", + // "type": "string" // } // }, // "path": "b/{destinationBucket}/o/{destinationObject}/compose", @@ -5334,10 +5300,7 @@ func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) { "destinationBucket": c.destinationBucket, "destinationObject": c.destinationObject, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Download fetches the API endpoint's "media" value, instead of the normal @@ -5625,10 +5588,7 @@ func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) { "bucket": c.bucket, "object": c.object, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objects.delete" call. @@ -5818,10 +5778,7 @@ func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) { "bucket": c.bucket, "object": c.object, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Download fetches the API endpoint's "media" value, instead of the normal @@ -6026,6 +5983,16 @@ func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch in return c } +// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of +// the Cloud KMS key, of the form +// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, +// that will be used to encrypt the object. Overrides the object +// metadata's kms_key_name value, if any. +func (c *ObjectsInsertCall) KmsKeyName(kmsKeyName string) *ObjectsInsertCall { + c.urlParams_.Set("kmsKeyName", kmsKeyName) + return c +} + // Name sets the optional parameter "name": Name of the object. Required // when the object metadata is not otherwise provided. Overrides the // object metadata's name value, if any. For information about how to @@ -6076,6 +6043,9 @@ func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall { // supplied. // At most one of Media and ResumableMedia may be set. func (c *ObjectsInsertCall) Media(r io.Reader, options ...googleapi.MediaOption) *ObjectsInsertCall { + if ct := c.object.ContentType; ct != "" { + options = append([]googleapi.MediaOption{googleapi.ContentType(ct)}, options...) + } opts := googleapi.ProcessMediaOptions(options) chunkSize := opts.ChunkSize if !opts.ForceEmptyContentType { @@ -6169,10 +6139,7 @@ func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "bucket": c.bucket, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objects.insert" call. @@ -6297,6 +6264,11 @@ func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) { // "location": "query", // "type": "string" // }, + // "kmsKeyName": { + // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + // "location": "query", + // "type": "string" + // }, // "name": { // "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", // "location": "query", @@ -6468,10 +6440,7 @@ func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "bucket": c.bucket, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objects.list" call. @@ -6730,10 +6699,7 @@ func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) { "bucket": c.bucket, "object": c.object, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objects.patch" call. @@ -6899,6 +6865,17 @@ func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, desti return c } +// DestinationKmsKeyName sets the optional parameter +// "destinationKmsKeyName": Resource name of the Cloud KMS key, of the +// form +// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, +// that will be used to encrypt the object. Overrides the object +// metadata's kms_key_name value, if any. +func (c *ObjectsRewriteCall) DestinationKmsKeyName(destinationKmsKeyName string) *ObjectsRewriteCall { + c.urlParams_.Set("destinationKmsKeyName", destinationKmsKeyName) + return c +} + // DestinationPredefinedAcl sets the optional parameter // "destinationPredefinedAcl": Apply a predefined set of access controls // to the destination object. @@ -7071,10 +7048,7 @@ func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) { "destinationBucket": c.destinationBucket, "destinationObject": c.destinationObject, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objects.rewrite" call. @@ -7131,6 +7105,11 @@ func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse, // "required": true, // "type": "string" // }, + // "destinationKmsKeyName": { + // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + // "location": "query", + // "type": "string" + // }, // "destinationObject": { // "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", // "location": "path", @@ -7391,10 +7370,7 @@ func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) { "bucket": c.bucket, "object": c.object, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Download fetches the API endpoint's "media" value, instead of the normal @@ -7658,10 +7634,7 @@ func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) { googleapi.Expand(req.URL, map[string]string{ "bucket": c.bucket, }) - if c.ctx_ != nil { - return ctxhttp.Do(c.ctx_, c.s.client, req) - } - return c.s.client.Do(req) + return gensupport.SendRequest(c.ctx_, c.s.client, req) } // Do executes the "storage.objects.watchAll" call. -- cgit v1.2.3