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/json.go28
-rw-r--r--vendor/google.golang.org/api/internal/settings.go15
-rw-r--r--vendor/google.golang.org/api/iterator/iterator.go231
-rw-r--r--vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go40
-rw-r--r--vendor/google.golang.org/api/option/option.go15
-rw-r--r--vendor/google.golang.org/api/storage/v1/storage-api.json54
-rw-r--r--vendor/google.golang.org/api/storage/v1/storage-gen.go344
-rw-r--r--vendor/google.golang.org/api/transport/dial.go27
8 files changed, 597 insertions, 157 deletions
diff --git a/vendor/google.golang.org/api/gensupport/json.go b/vendor/google.golang.org/api/gensupport/json.go
index dd7bcd2..53331b7 100644
--- a/vendor/google.golang.org/api/gensupport/json.go
+++ b/vendor/google.golang.org/api/gensupport/json.go
@@ -12,13 +12,13 @@ import (
)
// MarshalJSON returns a JSON encoding of schema containing only selected fields.
-// A field is selected if:
-// * it has a non-empty value, or
-// * its field name is present in forceSendFields, and
-// * it is not a nil pointer or nil interface.
+// A field is selected if any of the following is true:
+// * it has a non-empty value
+// * its field name is present in forceSendFields and it is not a nil pointer or nil interface
+// * its field name is present in nullFields.
// The JSON key for each selected field is taken from the field's json: struct tag.
-func MarshalJSON(schema interface{}, forceSendFields []string) ([]byte, error) {
- if len(forceSendFields) == 0 {
+func MarshalJSON(schema interface{}, forceSendFields, nullFields []string) ([]byte, error) {
+ if len(forceSendFields) == 0 && len(nullFields) == 0 {
return json.Marshal(schema)
}
@@ -26,15 +26,19 @@ func MarshalJSON(schema interface{}, forceSendFields []string) ([]byte, error) {
for _, f := range forceSendFields {
mustInclude[f] = struct{}{}
}
+ useNull := make(map[string]struct{})
+ for _, f := range nullFields {
+ useNull[f] = struct{}{}
+ }
- dataMap, err := schemaToMap(schema, mustInclude)
+ dataMap, err := schemaToMap(schema, mustInclude, useNull)
if err != nil {
return nil, err
}
return json.Marshal(dataMap)
}
-func schemaToMap(schema interface{}, mustInclude map[string]struct{}) (map[string]interface{}, error) {
+func schemaToMap(schema interface{}, mustInclude, useNull map[string]struct{}) (map[string]interface{}, error) {
m := make(map[string]interface{})
s := reflect.ValueOf(schema)
st := s.Type()
@@ -54,6 +58,14 @@ func schemaToMap(schema interface{}, mustInclude map[string]struct{}) (map[strin
v := s.Field(i)
f := st.Field(i)
+
+ if _, ok := useNull[f.Name]; ok {
+ if !isEmptyValue(v) {
+ return nil, fmt.Errorf("field %q in NullFields has non-empty value", f.Name)
+ }
+ m[tag.apiName] = nil
+ continue
+ }
if !includeField(v, f, mustInclude) {
continue
}
diff --git a/vendor/google.golang.org/api/internal/settings.go b/vendor/google.golang.org/api/internal/settings.go
index eb9300c..976280b 100644
--- a/vendor/google.golang.org/api/internal/settings.go
+++ b/vendor/google.golang.org/api/internal/settings.go
@@ -11,11 +11,12 @@ import (
// DialSettings holds information needed to establish a connection with a
// Google API service.
type DialSettings struct {
- Endpoint string
- Scopes []string
- TokenSource oauth2.TokenSource
- UserAgent string
- HTTPClient *http.Client
- GRPCDialOpts []grpc.DialOption
- GRPCConn *grpc.ClientConn
+ Endpoint string
+ Scopes []string
+ ServiceAccountJSONFilename string // if set, TokenSource is ignored.
+ TokenSource oauth2.TokenSource
+ UserAgent string
+ HTTPClient *http.Client
+ GRPCDialOpts []grpc.DialOption
+ GRPCConn *grpc.ClientConn
}
diff --git a/vendor/google.golang.org/api/iterator/iterator.go b/vendor/google.golang.org/api/iterator/iterator.go
new file mode 100644
index 0000000..0640c82
--- /dev/null
+++ b/vendor/google.golang.org/api/iterator/iterator.go
@@ -0,0 +1,231 @@
+// 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 iterator provides support for standard Google API iterators.
+// See https://github.com/GoogleCloudPlatform/gcloud-golang/wiki/Iterator-Guidelines.
+package iterator
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+)
+
+// Done is returned by an iterator's Next method when the iteration is
+// complete; when there are no more items to return.
+var Done = errors.New("no more items in iterator")
+
+// We don't support mixed calls to Next and NextPage because they play
+// with the paging state in incompatible ways.
+var errMixed = errors.New("iterator: Next and NextPage called on same iterator")
+
+// PageInfo contains information about an iterator's paging state.
+type PageInfo struct {
+ // Token is the token used to retrieve the next page of items from the
+ // API. You may set Token immediately after creating an iterator to
+ // begin iteration at a particular point. If Token is the empty string,
+ // the iterator will begin with the first eligible item.
+ //
+ // The result of setting Token after the first call to Next is undefined.
+ //
+ // After the underlying API method is called to retrieve a page of items,
+ // Token is set to the next-page token in the response.
+ Token string
+
+ // MaxSize is the maximum number of items returned by a call to the API.
+ // Set MaxSize as a hint to optimize the buffering behavior of the iterator.
+ // If zero, the page size is determined by the underlying service.
+ //
+ // Use Pager to retrieve a page of a specific, exact size.
+ MaxSize int
+
+ // The error state of the iterator. Manipulated by PageInfo.next and Pager.
+ // This is a latch: it starts as nil, and once set should never change.
+ err error
+
+ // If true, no more calls to fetch should be made. Set to true when fetch
+ // returns an empty page token. The iterator is Done when this is true AND
+ // the buffer is empty.
+ atEnd bool
+
+ // Function that fetches a page from the underlying service. It should pass
+ // the pageSize and pageToken arguments to the service, fill the buffer
+ // with the results from the call, and return the next-page token returned
+ // by the service. The function must not remove any existing items from the
+ // buffer. If the underlying RPC takes an int32 page size, pageSize should
+ // be silently truncated.
+ fetch func(pageSize int, pageToken string) (nextPageToken string, err error)
+
+ // Function that clears the iterator's buffer, returning any currently buffered items.
+ bufLen func() int
+
+ // Function that returns the buffer, after setting the buffer variable to nil.
+ takeBuf func() interface{}
+
+ // Set to true on first call to PageInfo.next or Pager.NextPage. Used to check
+ // for calls to both Next and NextPage with the same iterator.
+ nextCalled, nextPageCalled bool
+}
+
+// NewPageInfo exposes internals for iterator implementations.
+// It is not a stable interface.
+var NewPageInfo = newPageInfo
+
+// If an iterator can support paging, its iterator-creating method should call
+// this (via the NewPageInfo variable above).
+//
+// The fetch, bufLen and takeBuf arguments provide access to the
+// iterator's internal slice of buffered items. They behave as described in
+// PageInfo, above.
+//
+// The return value is the PageInfo.next method bound to the returned PageInfo value.
+// (Returning it avoids exporting PageInfo.next.)
+func newPageInfo(fetch func(int, string) (string, error), bufLen func() int, takeBuf func() interface{}) (*PageInfo, func() error) {
+ pi := &PageInfo{
+ fetch: fetch,
+ bufLen: bufLen,
+ takeBuf: takeBuf,
+ }
+ return pi, pi.next
+}
+
+// Remaining returns the number of items available before the iterator makes another API call.
+func (pi *PageInfo) Remaining() int { return pi.bufLen() }
+
+// next provides support for an iterator's Next function. An iterator's Next
+// should return the error returned by next if non-nil; else it can assume
+// there is at least one item in its buffer, and it should return that item and
+// remove it from the buffer.
+func (pi *PageInfo) next() error {
+ pi.nextCalled = true
+ if pi.err != nil { // Once we get an error, always return it.
+ // TODO(jba): fix so users can retry on transient errors? Probably not worth it.
+ return pi.err
+ }
+ if pi.nextPageCalled {
+ pi.err = errMixed
+ return pi.err
+ }
+ // Loop until we get some items or reach the end.
+ for pi.bufLen() == 0 && !pi.atEnd {
+ if err := pi.fill(pi.MaxSize); err != nil {
+ pi.err = err
+ return pi.err
+ }
+ if pi.Token == "" {
+ pi.atEnd = true
+ }
+ }
+ // Either the buffer is non-empty or pi.atEnd is true (or both).
+ if pi.bufLen() == 0 {
+ // The buffer is empty and pi.atEnd is true, i.e. the service has no
+ // more items.
+ pi.err = Done
+ }
+ return pi.err
+}
+
+// Call the service to fill the buffer, using size and pi.Token. Set pi.Token to the
+// next-page token returned by the call.
+// If fill returns a non-nil error, the buffer will be empty.
+func (pi *PageInfo) fill(size int) error {
+ tok, err := pi.fetch(size, pi.Token)
+ if err != nil {
+ pi.takeBuf() // clear the buffer
+ return err
+ }
+ pi.Token = tok
+ return nil
+}
+
+// Pageable is implemented by iterators that support paging.
+type Pageable interface {
+ // PageInfo returns paging information associated with the iterator.
+ PageInfo() *PageInfo
+}
+
+// Pager supports retrieving iterator items a page at a time.
+type Pager struct {
+ pageInfo *PageInfo
+ pageSize int
+}
+
+// NewPager returns a pager that uses iter. Calls to its NextPage method will
+// obtain exactly pageSize items, unless fewer remain. The pageToken argument
+// indicates where to start the iteration. Pass the empty string to start at
+// the beginning, or pass a token retrieved from a call to Pager.NextPage.
+//
+// If you use an iterator with a Pager, you must not call Next on the iterator.
+func NewPager(iter Pageable, pageSize int, pageToken string) *Pager {
+ p := &Pager{
+ pageInfo: iter.PageInfo(),
+ pageSize: pageSize,
+ }
+ p.pageInfo.Token = pageToken
+ if pageSize <= 0 {
+ p.pageInfo.err = errors.New("iterator: page size must be positive")
+ }
+ return p
+}
+
+// NextPage retrieves a sequence of items from the iterator and appends them
+// to slicep, which must be a pointer to a slice of the iterator's item type.
+// Exactly p.pageSize items will be appended, unless fewer remain.
+//
+// The first return value is the page token to use for the next page of items.
+// If empty, there are no more pages. Aside from checking for the end of the
+// iteration, the returned page token is only needed if the iteration is to be
+// resumed a later time, in another context (possibly another process).
+//
+// The second return value is non-nil if an error occurred. It will never be
+// the special iterator sentinel value Done. To recognize the end of the
+// iteration, compare nextPageToken to the empty string.
+//
+// It is possible for NextPage to return a single zero-length page along with
+// an empty page token when there are no more items in the iteration.
+func (p *Pager) NextPage(slicep interface{}) (nextPageToken string, err error) {
+ p.pageInfo.nextPageCalled = true
+ if p.pageInfo.err != nil {
+ return "", p.pageInfo.err
+ }
+ if p.pageInfo.nextCalled {
+ p.pageInfo.err = errMixed
+ return "", p.pageInfo.err
+ }
+ if p.pageInfo.bufLen() > 0 {
+ return "", errors.New("must call NextPage with an empty buffer")
+ }
+ // The buffer must be empty here, so takeBuf is a no-op. We call it just to get
+ // the buffer's type.
+ wantSliceType := reflect.PtrTo(reflect.ValueOf(p.pageInfo.takeBuf()).Type())
+ if slicep == nil {
+ return "", errors.New("nil passed to Pager.NextPage")
+ }
+ vslicep := reflect.ValueOf(slicep)
+ if vslicep.Type() != wantSliceType {
+ return "", fmt.Errorf("slicep should be of type %s, got %T", wantSliceType, slicep)
+ }
+ for p.pageInfo.bufLen() < p.pageSize {
+ if err := p.pageInfo.fill(p.pageSize - p.pageInfo.bufLen()); err != nil {
+ p.pageInfo.err = err
+ return "", p.pageInfo.err
+ }
+ if p.pageInfo.Token == "" {
+ break
+ }
+ }
+ e := vslicep.Elem()
+ e.Set(reflect.AppendSlice(e, reflect.ValueOf(p.pageInfo.takeBuf())))
+ return p.pageInfo.Token, nil
+}
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 6b18fad..b1a7694 100644
--- a/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go
+++ b/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go
@@ -131,12 +131,20 @@ type Jwk struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Keys") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *Jwk) MarshalJSON() ([]byte, error) {
type noMethod Jwk
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type JwkKeys struct {
@@ -159,12 +167,20 @@ type JwkKeys struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Alg") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *JwkKeys) MarshalJSON() ([]byte, error) {
type noMethod JwkKeys
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type Tokeninfo struct {
@@ -212,12 +228,20 @@ type Tokeninfo struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "AccessType") to include in
+ // API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *Tokeninfo) MarshalJSON() ([]byte, error) {
type noMethod Tokeninfo
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type Userinfoplus struct {
@@ -270,12 +294,20 @@ type Userinfoplus struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Email") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *Userinfoplus) MarshalJSON() ([]byte, error) {
type noMethod Userinfoplus
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "oauth2.getCertForOpenIdConnect":
diff --git a/vendor/google.golang.org/api/option/option.go b/vendor/google.golang.org/api/option/option.go
index 556a6df..b935e6d 100644
--- a/vendor/google.golang.org/api/option/option.go
+++ b/vendor/google.golang.org/api/option/option.go
@@ -26,6 +26,21 @@ func (w withTokenSource) Apply(o *internal.DialSettings) {
o.TokenSource = w.ts
}
+// WithServiceAccountFile returns a ClientOption that uses a Google service
+// account credentials file to authenticate.
+// Use WithTokenSource with a token source created from
+// golang.org/x/oauth2/google.JWTConfigFromJSON
+// if reading the file from disk is not an option.
+func WithServiceAccountFile(filename string) ClientOption {
+ return withServiceAccountFile(filename)
+}
+
+type withServiceAccountFile string
+
+func (w withServiceAccountFile) Apply(o *internal.DialSettings) {
+ o.ServiceAccountJSONFilename = string(w)
+}
+
// WithEndpoint returns a ClientOption that overrides the default endpoint
// to be used for a service.
func WithEndpoint(url string) ClientOption {
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 8d9118b..69bdf27 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/gtcWNCypj7VTDxrk1rvvuniNHZo\"",
+ "etag": "\"C5oy1hgQsABtYOYIOXWcR3BgYqU/HhsBn9wwz5D-d92BzzyinZOo-SY\"",
"discoveryVersion": "v1",
"id": "storage:v1",
"name": "storage",
"version": "v1",
- "revision": "20160802",
+ "revision": "20160923",
"title": "Cloud Storage JSON API",
"description": "Stores and retrieves potentially large, immutable data objects.",
"ownerDomain": "google.com",
@@ -150,15 +150,6 @@
"$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."
@@ -621,10 +612,6 @@
"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."
@@ -713,7 +700,13 @@
},
"entity": {
"type": "string",
- "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com."
+ "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.",
+ "annotations": {
+ "required": [
+ "storage.defaultObjectAccessControls.insert",
+ "storage.objectAccessControls.insert"
+ ]
+ }
},
"entityId": {
"type": "string",
@@ -725,7 +718,7 @@
},
"generation": {
"type": "string",
- "description": "The content generation of the object.",
+ "description": "The content generation of the object, if applied to an object.",
"format": "int64"
},
"id": {
@@ -739,7 +732,7 @@
},
"object": {
"type": "string",
- "description": "The name of the object."
+ "description": "The name of the object, if applied to an object."
},
"projectTeam": {
"type": "object",
@@ -757,7 +750,13 @@
},
"role": {
"type": "string",
- "description": "The access permission for the entity."
+ "description": "The access permission for the entity.",
+ "annotations": {
+ "required": [
+ "storage.defaultObjectAccessControls.insert",
+ "storage.objectAccessControls.insert"
+ ]
+ }
},
"selfLink": {
"type": "string",
@@ -774,7 +773,7 @@
"type": "array",
"description": "The list of items.",
"items": {
- "type": "any"
+ "$ref": "ObjectAccessControl"
}
},
"kind": {
@@ -1971,11 +1970,6 @@
"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": [
@@ -2314,11 +2308,6 @@
"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.",
@@ -2570,11 +2559,6 @@
"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 a74cad2..a7b6982 100644
--- a/vendor/google.golang.org/api/storage/v1/storage-gen.go
+++ b/vendor/google.golang.org/api/storage/v1/storage-gen.go
@@ -169,10 +169,6 @@ 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"`
@@ -245,12 +241,20 @@ type Bucket struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Acl") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *Bucket) MarshalJSON() ([]byte, error) {
type noMethod Bucket
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type BucketCors struct {
@@ -280,32 +284,20 @@ type BucketCors struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "MaxAgeSeconds") to include
+ // in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. However, any field with
+ // an empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *BucketCors) MarshalJSON() ([]byte, error) {
type noMethod BucketCors
raw := noMethod(*s)
- 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)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BucketLifecycle: The bucket's lifecycle configuration. See lifecycle
@@ -322,12 +314,20 @@ type BucketLifecycle struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Rule") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *BucketLifecycle) MarshalJSON() ([]byte, error) {
type noMethod BucketLifecycle
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type BucketLifecycleRule struct {
@@ -344,12 +344,20 @@ type BucketLifecycleRule struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Action") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *BucketLifecycleRule) MarshalJSON() ([]byte, error) {
type noMethod BucketLifecycleRule
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BucketLifecycleRuleAction: The action to take.
@@ -364,12 +372,20 @@ type BucketLifecycleRuleAction struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Type") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *BucketLifecycleRuleAction) MarshalJSON() ([]byte, error) {
type noMethod BucketLifecycleRuleAction
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BucketLifecycleRuleCondition: The condition(s) under which the action
@@ -401,12 +417,20 @@ type BucketLifecycleRuleCondition struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Age") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *BucketLifecycleRuleCondition) MarshalJSON() ([]byte, error) {
type noMethod BucketLifecycleRuleCondition
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BucketLogging: The bucket's logging configuration, which defines the
@@ -427,12 +451,20 @@ type BucketLogging struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "LogBucket") to include in
+ // API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *BucketLogging) MarshalJSON() ([]byte, error) {
type noMethod BucketLogging
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BucketOwner: The owner of the bucket. This is always the project
@@ -451,12 +483,20 @@ type BucketOwner struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Entity") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *BucketOwner) MarshalJSON() ([]byte, error) {
type noMethod BucketOwner
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BucketVersioning: The bucket's versioning configuration.
@@ -472,12 +512,20 @@ type BucketVersioning struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Enabled") to include in
+ // API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *BucketVersioning) MarshalJSON() ([]byte, error) {
type noMethod BucketVersioning
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BucketWebsite: The bucket's website configuration, controlling how
@@ -503,12 +551,21 @@ type BucketWebsite struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "MainPageSuffix") to
+ // include in API requests with the JSON null value. By default, fields
+ // with empty values are omitted from API requests. However, any field
+ // with an empty value appearing in NullFields will be sent to the
+ // server as null. It is an error if a field in this list has a
+ // non-empty value. This may be used to include null fields in Patch
+ // requests.
+ NullFields []string `json:"-"`
}
func (s *BucketWebsite) MarshalJSON() ([]byte, error) {
type noMethod BucketWebsite
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BucketAccessControl: An access-control entry.
@@ -572,12 +629,20 @@ type BucketAccessControl struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Bucket") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *BucketAccessControl) MarshalJSON() ([]byte, error) {
type noMethod BucketAccessControl
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BucketAccessControlProjectTeam: The project team associated with the
@@ -596,12 +661,20 @@ type BucketAccessControlProjectTeam struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "ProjectNumber") to include
+ // in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. However, any field with
+ // an empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *BucketAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
type noMethod BucketAccessControlProjectTeam
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BucketAccessControls: An access-control list.
@@ -624,12 +697,20 @@ type BucketAccessControls struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Items") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *BucketAccessControls) MarshalJSON() ([]byte, error) {
type noMethod BucketAccessControls
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Buckets: A list of buckets.
@@ -657,12 +738,20 @@ type Buckets struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Items") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *Buckets) MarshalJSON() ([]byte, error) {
type noMethod Buckets
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Channel: An notification channel used to watch for resource changes.
@@ -715,12 +804,20 @@ type Channel struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Address") to include in
+ // API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *Channel) MarshalJSON() ([]byte, error) {
type noMethod Channel
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ComposeRequest: A Compose request.
@@ -742,12 +839,20 @@ type ComposeRequest struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Destination") to include
+ // in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. However, any field with
+ // an empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *ComposeRequest) MarshalJSON() ([]byte, error) {
type noMethod ComposeRequest
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
type ComposeRequestSourceObjects struct {
@@ -769,12 +874,20 @@ type ComposeRequestSourceObjects struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Generation") to include in
+ // API requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *ComposeRequestSourceObjects) MarshalJSON() ([]byte, error) {
type noMethod ComposeRequestSourceObjects
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ComposeRequestSourceObjectsObjectPreconditions: Conditions that must
@@ -793,12 +906,21 @@ type ComposeRequestSourceObjectsObjectPreconditions struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "IfGenerationMatch") to
+ // include in API requests with the JSON null value. By default, fields
+ // with empty values are omitted from API requests. However, any field
+ // with an empty value appearing in NullFields will be sent to the
+ // server as null. It is an error if a field in this list has a
+ // non-empty value. This may be used to include null fields in Patch
+ // requests.
+ NullFields []string `json:"-"`
}
func (s *ComposeRequestSourceObjectsObjectPreconditions) MarshalJSON() ([]byte, error) {
type noMethod ComposeRequestSourceObjectsObjectPreconditions
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Object: An object.
@@ -856,10 +978,6 @@ 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.
@@ -917,12 +1035,20 @@ type Object struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Acl") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *Object) MarshalJSON() ([]byte, error) {
type noMethod Object
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ObjectCustomerEncryption: Metadata of customer-supplied encryption
@@ -941,12 +1067,21 @@ type ObjectCustomerEncryption struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "EncryptionAlgorithm") to
+ // include in API requests with the JSON null value. By default, fields
+ // with empty values are omitted from API requests. However, any field
+ // with an empty value appearing in NullFields will be sent to the
+ // server as null. It is an error if a field in this list has a
+ // non-empty value. This may be used to include null fields in Patch
+ // requests.
+ NullFields []string `json:"-"`
}
func (s *ObjectCustomerEncryption) MarshalJSON() ([]byte, error) {
type noMethod ObjectCustomerEncryption
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ObjectOwner: The owner of the object. This will always be the
@@ -965,12 +1100,20 @@ type ObjectOwner struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Entity") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *ObjectOwner) MarshalJSON() ([]byte, error) {
type noMethod ObjectOwner
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ObjectAccessControl: An access-control entry.
@@ -1007,7 +1150,8 @@ type ObjectAccessControl struct {
// Etag: HTTP 1.1 Entity tag for the access-control entry.
Etag string `json:"etag,omitempty"`
- // Generation: The content generation of the object.
+ // Generation: The content generation of the object, if applied to an
+ // object.
Generation int64 `json:"generation,omitempty,string"`
// Id: The ID of the access-control entry.
@@ -1017,7 +1161,7 @@ type ObjectAccessControl struct {
// this is always storage#objectAccessControl.
Kind string `json:"kind,omitempty"`
- // Object: The name of the object.
+ // Object: The name of the object, if applied to an object.
Object string `json:"object,omitempty"`
// ProjectTeam: The project team associated with the entity, if any.
@@ -1040,12 +1184,20 @@ type ObjectAccessControl struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Bucket") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *ObjectAccessControl) MarshalJSON() ([]byte, error) {
type noMethod ObjectAccessControl
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ObjectAccessControlProjectTeam: The project team associated with the
@@ -1064,18 +1216,26 @@ type ObjectAccessControlProjectTeam struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "ProjectNumber") to include
+ // in API requests with the JSON null value. By default, fields with
+ // empty values are omitted from API requests. However, any field with
+ // an empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *ObjectAccessControlProjectTeam) MarshalJSON() ([]byte, error) {
type noMethod ObjectAccessControlProjectTeam
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ObjectAccessControls: An access-control list.
type ObjectAccessControls struct {
// Items: The list of items.
- Items []interface{} `json:"items,omitempty"`
+ Items []*ObjectAccessControl `json:"items,omitempty"`
// Kind: The kind of item this is. For lists of object access control
// entries, this is always storage#objectAccessControls.
@@ -1092,12 +1252,20 @@ type ObjectAccessControls struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Items") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *ObjectAccessControls) MarshalJSON() ([]byte, error) {
type noMethod ObjectAccessControls
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Objects: A list of objects.
@@ -1129,12 +1297,20 @@ type Objects struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Items") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *Objects) MarshalJSON() ([]byte, error) {
type noMethod Objects
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// RewriteResponse: A rewrite response.
@@ -1176,12 +1352,20 @@ type RewriteResponse struct {
// server regardless of whether the field is empty or not. This may be
// used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
+
+ // NullFields is a list of field names (e.g. "Done") to include in API
+ // requests with the JSON null value. By default, fields with empty
+ // values are omitted from API requests. However, any field with an
+ // empty value appearing in NullFields will be sent to the server as
+ // null. It is an error if a field in this list has a non-empty value.
+ // This may be used to include null fields in Patch requests.
+ NullFields []string `json:"-"`
}
func (s *RewriteResponse) MarshalJSON() ([]byte, error) {
type noMethod RewriteResponse
raw := noMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields)
+ return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// method id "storage.bucketAccessControls.delete":
@@ -4947,16 +5131,6 @@ 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.
@@ -5100,11 +5274,6 @@ 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",
@@ -5980,16 +6149,6 @@ 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
@@ -6261,11 +6420,6 @@ 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",
@@ -6862,17 +7016,6 @@ 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.
@@ -7102,11 +7245,6 @@ 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",
diff --git a/vendor/google.golang.org/api/transport/dial.go b/vendor/google.golang.org/api/transport/dial.go
index a7d058b..c054460 100644
--- a/vendor/google.golang.org/api/transport/dial.go
+++ b/vendor/google.golang.org/api/transport/dial.go
@@ -20,6 +20,7 @@ package transport
import (
"errors"
"fmt"
+ "io/ioutil"
"net/http"
"golang.org/x/net/context"
@@ -48,6 +49,13 @@ func NewHTTPClient(ctx context.Context, opts ...option.ClientOption) (*http.Clie
if o.HTTPClient != nil {
return o.HTTPClient, o.Endpoint, nil
}
+ if o.ServiceAccountJSONFilename != "" {
+ ts, err := serviceAcctTokenSource(ctx, o.ServiceAccountJSONFilename, o.Scopes...)
+ if err != nil {
+ return nil, "", err
+ }
+ o.TokenSource = ts
+ }
if o.TokenSource == nil {
var err error
o.TokenSource, err = google.DefaultTokenSource(ctx, o.Scopes...)
@@ -74,6 +82,13 @@ func DialGRPC(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientCon
if o.GRPCConn != nil {
return o.GRPCConn, nil
}
+ if o.ServiceAccountJSONFilename != "" {
+ ts, err := serviceAcctTokenSource(ctx, o.ServiceAccountJSONFilename, o.Scopes...)
+ if err != nil {
+ return nil, err
+ }
+ o.TokenSource = ts
+ }
if o.TokenSource == nil {
var err error
o.TokenSource, err = google.DefaultTokenSource(ctx, o.Scopes...)
@@ -95,3 +110,15 @@ func DialGRPC(ctx context.Context, opts ...option.ClientOption) (*grpc.ClientCon
}
return grpc.DialContext(ctx, o.Endpoint, grpcOpts...)
}
+
+func serviceAcctTokenSource(ctx context.Context, filename string, scope ...string) (oauth2.TokenSource, error) {
+ data, err := ioutil.ReadFile(filename)
+ if err != nil {
+ return nil, fmt.Errorf("cannot read service account file: %v", err)
+ }
+ cfg, err := google.JWTConfigFromJSON(data, scope...)
+ if err != nil {
+ return nil, fmt.Errorf("google.JWTConfigFromJSON: %v", err)
+ }
+ return cfg.TokenSource(ctx), nil
+}