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/LICENSE27
-rw-r--r--vendor/google.golang.org/api/gensupport/backoff.go46
-rw-r--r--vendor/google.golang.org/api/gensupport/buffer.go77
-rw-r--r--vendor/google.golang.org/api/gensupport/doc.go10
-rw-r--r--vendor/google.golang.org/api/gensupport/go18.go17
-rw-r--r--vendor/google.golang.org/api/gensupport/header.go22
-rw-r--r--vendor/google.golang.org/api/gensupport/json.go211
-rw-r--r--vendor/google.golang.org/api/gensupport/jsonfloat.go57
-rw-r--r--vendor/google.golang.org/api/gensupport/media.go336
-rw-r--r--vendor/google.golang.org/api/gensupport/not_go18.go14
-rw-r--r--vendor/google.golang.org/api/gensupport/params.go50
-rw-r--r--vendor/google.golang.org/api/gensupport/resumable.go217
-rw-r--r--vendor/google.golang.org/api/gensupport/retry.go85
-rw-r--r--vendor/google.golang.org/api/gensupport/send.go71
-rw-r--r--vendor/google.golang.org/api/googleapi/googleapi.go415
-rw-r--r--vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE18
-rw-r--r--vendor/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go248
-rw-r--r--vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.go17
-rw-r--r--vendor/google.golang.org/api/googleapi/transport/apikey.go38
-rw-r--r--vendor/google.golang.org/api/googleapi/types.go202
-rw-r--r--vendor/google.golang.org/api/internal/creds.go42
-rw-r--r--vendor/google.golang.org/api/internal/pool.go59
-rw-r--r--vendor/google.golang.org/api/internal/service-account.json12
-rw-r--r--vendor/google.golang.org/api/internal/settings.go62
-rw-r--r--vendor/google.golang.org/api/iterator/iterator.go231
-rw-r--r--vendor/google.golang.org/api/oauth2/v2/oauth2-api.json294
-rw-r--r--vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go809
-rw-r--r--vendor/google.golang.org/api/option/credentials_go19.go32
-rw-r--r--vendor/google.golang.org/api/option/credentials_notgo19.go32
-rw-r--r--vendor/google.golang.org/api/option/option.go178
-rw-r--r--vendor/google.golang.org/api/storage/v1/storage-api.json3794
-rw-r--r--vendor/google.golang.org/api/storage/v1/storage-gen.go11207
-rw-r--r--vendor/google.golang.org/api/transport/http/dial.go138
-rw-r--r--vendor/google.golang.org/api/transport/http/go18.go31
-rw-r--r--vendor/google.golang.org/api/transport/http/not_go18.go21
35 files changed, 0 insertions, 19120 deletions
diff --git a/vendor/google.golang.org/api/LICENSE b/vendor/google.golang.org/api/LICENSE
deleted file mode 100644
index 263aa7a..0000000
--- a/vendor/google.golang.org/api/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) 2011 Google Inc. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/google.golang.org/api/gensupport/backoff.go b/vendor/google.golang.org/api/gensupport/backoff.go
deleted file mode 100644
index 1356140..0000000
--- a/vendor/google.golang.org/api/gensupport/backoff.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// 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 (
- "math/rand"
- "time"
-)
-
-type BackoffStrategy interface {
- // Pause returns the duration of the next pause and true if the operation should be
- // retried, or false if no further retries should be attempted.
- Pause() (time.Duration, bool)
-
- // Reset restores the strategy to its initial state.
- Reset()
-}
-
-// ExponentialBackoff performs exponential backoff as per https://en.wikipedia.org/wiki/Exponential_backoff.
-// The initial pause time is given by Base.
-// Once the total pause time exceeds Max, Pause will indicate no further retries.
-type ExponentialBackoff struct {
- Base time.Duration
- Max time.Duration
- total time.Duration
- n uint
-}
-
-func (eb *ExponentialBackoff) Pause() (time.Duration, bool) {
- if eb.total > eb.Max {
- return 0, false
- }
-
- // The next pause is selected from randomly from [0, 2^n * Base).
- d := time.Duration(rand.Int63n((1 << eb.n) * int64(eb.Base)))
- eb.total += d
- eb.n++
- return d, true
-}
-
-func (eb *ExponentialBackoff) Reset() {
- eb.n = 0
- eb.total = 0
-}
diff --git a/vendor/google.golang.org/api/gensupport/buffer.go b/vendor/google.golang.org/api/gensupport/buffer.go
deleted file mode 100644
index 9921049..0000000
--- a/vendor/google.golang.org/api/gensupport/buffer.go
+++ /dev/null
@@ -1,77 +0,0 @@
-// 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 (
- "bytes"
- "io"
-
- "google.golang.org/api/googleapi"
-)
-
-// MediaBuffer buffers data from an io.Reader to support uploading media in retryable chunks.
-type MediaBuffer struct {
- media io.Reader
-
- chunk []byte // The current chunk which is pending upload. The capacity is the chunk size.
- err error // Any error generated when populating chunk by reading media.
-
- // The absolute position of chunk in the underlying media.
- off int64
-}
-
-func NewMediaBuffer(media io.Reader, chunkSize int) *MediaBuffer {
- return &MediaBuffer{media: media, chunk: make([]byte, 0, chunkSize)}
-}
-
-// Chunk returns the current buffered chunk, the offset in the underlying media
-// from which the chunk is drawn, and the size of the chunk.
-// Successive calls to Chunk return the same chunk between calls to Next.
-func (mb *MediaBuffer) Chunk() (chunk io.Reader, off int64, size int, err error) {
- // There may already be data in chunk if Next has not been called since the previous call to Chunk.
- if mb.err == nil && len(mb.chunk) == 0 {
- mb.err = mb.loadChunk()
- }
- return bytes.NewReader(mb.chunk), mb.off, len(mb.chunk), mb.err
-}
-
-// loadChunk will read from media into chunk, up to the capacity of chunk.
-func (mb *MediaBuffer) loadChunk() error {
- bufSize := cap(mb.chunk)
- mb.chunk = mb.chunk[:bufSize]
-
- read := 0
- var err error
- for err == nil && read < bufSize {
- var n int
- n, err = mb.media.Read(mb.chunk[read:])
- read += n
- }
- mb.chunk = mb.chunk[:read]
- return err
-}
-
-// Next advances to the next chunk, which will be returned by the next call to Chunk.
-// Calls to Next without a corresponding prior call to Chunk will have no effect.
-func (mb *MediaBuffer) Next() {
- mb.off += int64(len(mb.chunk))
- mb.chunk = mb.chunk[0:0]
-}
-
-type readerTyper struct {
- io.Reader
- googleapi.ContentTyper
-}
-
-// ReaderAtToReader adapts a ReaderAt to be used as a Reader.
-// If ra implements googleapi.ContentTyper, then the returned reader
-// will also implement googleapi.ContentTyper, delegating to ra.
-func ReaderAtToReader(ra io.ReaderAt, size int64) io.Reader {
- r := io.NewSectionReader(ra, 0, size)
- if typer, ok := ra.(googleapi.ContentTyper); ok {
- return readerTyper{r, typer}
- }
- return r
-}
diff --git a/vendor/google.golang.org/api/gensupport/doc.go b/vendor/google.golang.org/api/gensupport/doc.go
deleted file mode 100644
index 752c4b4..0000000
--- a/vendor/google.golang.org/api/gensupport/doc.go
+++ /dev/null
@@ -1,10 +0,0 @@
-// 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 is an internal implementation detail used by code
-// generated by the google-api-go-generator tool.
-//
-// This package may be modified at any time without regard for backwards
-// compatibility. It should not be used directly by API users.
-package gensupport
diff --git a/vendor/google.golang.org/api/gensupport/go18.go b/vendor/google.golang.org/api/gensupport/go18.go
deleted file mode 100644
index c76cb8f..0000000
--- a/vendor/google.golang.org/api/gensupport/go18.go
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2018 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.
-
-// +build go1.8
-
-package gensupport
-
-import (
- "io"
- "net/http"
-)
-
-// SetGetBody sets the GetBody field of req to f.
-func SetGetBody(req *http.Request, f func() (io.ReadCloser, error)) {
- req.GetBody = f
-}
diff --git a/vendor/google.golang.org/api/gensupport/header.go b/vendor/google.golang.org/api/gensupport/header.go
deleted file mode 100644
index cb5e67c..0000000
--- a/vendor/google.golang.org/api/gensupport/header.go
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2017 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 (
- "fmt"
- "runtime"
- "strings"
-)
-
-// GoogleClientHeader returns the value to use for the x-goog-api-client
-// header, which is used internally by Google.
-func GoogleClientHeader(generatorVersion, clientElement string) string {
- elts := []string{"gl-go/" + strings.Replace(runtime.Version(), " ", "_", -1)}
- if clientElement != "" {
- elts = append(elts, clientElement)
- }
- elts = append(elts, fmt.Sprintf("gdcl/%s", generatorVersion))
- return strings.Join(elts, " ")
-}
diff --git a/vendor/google.golang.org/api/gensupport/json.go b/vendor/google.golang.org/api/gensupport/json.go
deleted file mode 100644
index c01e321..0000000
--- a/vendor/google.golang.org/api/gensupport/json.go
+++ /dev/null
@@ -1,211 +0,0 @@
-// Copyright 2015 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 (
- "encoding/json"
- "fmt"
- "reflect"
- "strings"
-)
-
-// MarshalJSON returns a JSON encoding of schema containing only selected fields.
-// 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, nullFields []string) ([]byte, error) {
- if len(forceSendFields) == 0 && len(nullFields) == 0 {
- return json.Marshal(schema)
- }
-
- mustInclude := make(map[string]bool)
- for _, f := range forceSendFields {
- mustInclude[f] = true
- }
- useNull := make(map[string]bool)
- useNullMaps := make(map[string]map[string]bool)
- for _, nf := range nullFields {
- parts := strings.SplitN(nf, ".", 2)
- field := parts[0]
- if len(parts) == 1 {
- useNull[field] = true
- } else {
- if useNullMaps[field] == nil {
- useNullMaps[field] = map[string]bool{}
- }
- useNullMaps[field][parts[1]] = true
- }
- }
-
- dataMap, err := schemaToMap(schema, mustInclude, useNull, useNullMaps)
- if err != nil {
- return nil, err
- }
- return json.Marshal(dataMap)
-}
-
-func schemaToMap(schema interface{}, mustInclude, useNull map[string]bool, useNullMaps map[string]map[string]bool) (map[string]interface{}, error) {
- m := make(map[string]interface{})
- s := reflect.ValueOf(schema)
- st := s.Type()
-
- for i := 0; i < s.NumField(); i++ {
- jsonTag := st.Field(i).Tag.Get("json")
- if jsonTag == "" {
- continue
- }
- tag, err := parseJSONTag(jsonTag)
- if err != nil {
- return nil, err
- }
- if tag.ignore {
- continue
- }
-
- v := s.Field(i)
- f := st.Field(i)
-
- if useNull[f.Name] {
- 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
- }
-
- // If map fields are explicitly set to null, use a map[string]interface{}.
- if f.Type.Kind() == reflect.Map && useNullMaps[f.Name] != nil {
- ms, ok := v.Interface().(map[string]string)
- if !ok {
- return nil, fmt.Errorf("field %q has keys in NullFields but is not a map[string]string", f.Name)
- }
- mi := map[string]interface{}{}
- for k, v := range ms {
- mi[k] = v
- }
- for k := range useNullMaps[f.Name] {
- mi[k] = nil
- }
- m[tag.apiName] = mi
- continue
- }
-
- // nil maps are treated as empty maps.
- if f.Type.Kind() == reflect.Map && v.IsNil() {
- m[tag.apiName] = map[string]string{}
- continue
- }
-
- // nil slices are treated as empty slices.
- if f.Type.Kind() == reflect.Slice && v.IsNil() {
- m[tag.apiName] = []bool{}
- continue
- }
-
- if tag.stringFormat {
- m[tag.apiName] = formatAsString(v, f.Type.Kind())
- } else {
- m[tag.apiName] = v.Interface()
- }
- }
- return m, nil
-}
-
-// formatAsString returns a string representation of v, dereferencing it first if possible.
-func formatAsString(v reflect.Value, kind reflect.Kind) string {
- if kind == reflect.Ptr && !v.IsNil() {
- v = v.Elem()
- }
-
- return fmt.Sprintf("%v", v.Interface())
-}
-
-// jsonTag represents a restricted version of the struct tag format used by encoding/json.
-// It is used to describe the JSON encoding of fields in a Schema struct.
-type jsonTag struct {
- apiName string
- stringFormat bool
- ignore bool
-}
-
-// parseJSONTag parses a restricted version of the struct tag format used by encoding/json.
-// The format of the tag must match that generated by the Schema.writeSchemaStruct method
-// in the api generator.
-func parseJSONTag(val string) (jsonTag, error) {
- if val == "-" {
- return jsonTag{ignore: true}, nil
- }
-
- var tag jsonTag
-
- i := strings.Index(val, ",")
- if i == -1 || val[:i] == "" {
- return tag, fmt.Errorf("malformed json tag: %s", val)
- }
-
- tag = jsonTag{
- apiName: val[:i],
- }
-
- switch val[i+1:] {
- case "omitempty":
- case "omitempty,string":
- tag.stringFormat = true
- default:
- return tag, fmt.Errorf("malformed json tag: %s", val)
- }
-
- return tag, nil
-}
-
-// Reports whether the struct field "f" with value "v" should be included in JSON output.
-func includeField(v reflect.Value, f reflect.StructField, mustInclude map[string]bool) bool {
- // The regular JSON encoding of a nil pointer is "null", which means "delete this field".
- // Therefore, we could enable field deletion by honoring pointer fields' presence in the mustInclude set.
- // However, many fields are not pointers, so there would be no way to delete these fields.
- // Rather than partially supporting field deletion, we ignore mustInclude for nil pointer fields.
- // Deletion will be handled by a separate mechanism.
- if f.Type.Kind() == reflect.Ptr && v.IsNil() {
- return false
- }
-
- // The "any" type is represented as an interface{}. If this interface
- // is nil, there is no reasonable representation to send. We ignore
- // these fields, for the same reasons as given above for pointers.
- if f.Type.Kind() == reflect.Interface && v.IsNil() {
- return false
- }
-
- return mustInclude[f.Name] || !isEmptyValue(v)
-}
-
-// isEmptyValue reports whether v is the empty value for its type. This
-// implementation is based on that of the encoding/json package, but its
-// correctness does not depend on it being identical. What's important is that
-// this function return false in situations where v should not be sent as part
-// of a PATCH operation.
-func isEmptyValue(v reflect.Value) bool {
- switch v.Kind() {
- case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
- return v.Len() == 0
- case reflect.Bool:
- return !v.Bool()
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- return v.Int() == 0
- case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
- return v.Uint() == 0
- case reflect.Float32, reflect.Float64:
- return v.Float() == 0
- case reflect.Interface, reflect.Ptr:
- return v.IsNil()
- }
- return false
-}
diff --git a/vendor/google.golang.org/api/gensupport/jsonfloat.go b/vendor/google.golang.org/api/gensupport/jsonfloat.go
deleted file mode 100644
index cb02335..0000000
--- a/vendor/google.golang.org/api/gensupport/jsonfloat.go
+++ /dev/null
@@ -1,57 +0,0 @@
-// 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 gensupport
-
-import (
- "encoding/json"
- "errors"
- "fmt"
- "math"
-)
-
-// JSONFloat64 is a float64 that supports proper unmarshaling of special float
-// values in JSON, according to
-// https://developers.google.com/protocol-buffers/docs/proto3#json. Although
-// that is a proto-to-JSON spec, it applies to all Google APIs.
-//
-// The jsonpb package
-// (https://github.com/golang/protobuf/blob/master/jsonpb/jsonpb.go) has
-// similar functionality, but only for direct translation from proto messages
-// to JSON.
-type JSONFloat64 float64
-
-func (f *JSONFloat64) UnmarshalJSON(data []byte) error {
- var ff float64
- if err := json.Unmarshal(data, &ff); err == nil {
- *f = JSONFloat64(ff)
- return nil
- }
- var s string
- if err := json.Unmarshal(data, &s); err == nil {
- switch s {
- case "NaN":
- ff = math.NaN()
- case "Infinity":
- ff = math.Inf(1)
- case "-Infinity":
- ff = math.Inf(-1)
- default:
- return fmt.Errorf("google.golang.org/api/internal: bad float string %q", s)
- }
- *f = JSONFloat64(ff)
- return nil
- }
- return errors.New("google.golang.org/api/internal: data not float or string")
-}
diff --git a/vendor/google.golang.org/api/gensupport/media.go b/vendor/google.golang.org/api/gensupport/media.go
deleted file mode 100644
index 5895fef..0000000
--- a/vendor/google.golang.org/api/gensupport/media.go
+++ /dev/null
@@ -1,336 +0,0 @@
-// 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 (
- "bytes"
- "fmt"
- "io"
- "io/ioutil"
- "mime/multipart"
- "net/http"
- "net/textproto"
- "strings"
- "sync"
-
- "google.golang.org/api/googleapi"
-)
-
-const sniffBuffSize = 512
-
-func newContentSniffer(r io.Reader) *contentSniffer {
- return &contentSniffer{r: r}
-}
-
-// contentSniffer wraps a Reader, and reports the content type determined by sniffing up to 512 bytes from the Reader.
-type contentSniffer struct {
- r io.Reader
- start []byte // buffer for the sniffed bytes.
- err error // set to any error encountered while reading bytes to be sniffed.
-
- ctype string // set on first sniff.
- sniffed bool // set to true on first sniff.
-}
-
-func (cs *contentSniffer) Read(p []byte) (n int, err error) {
- // Ensure that the content type is sniffed before any data is consumed from Reader.
- _, _ = cs.ContentType()
-
- if len(cs.start) > 0 {
- n := copy(p, cs.start)
- cs.start = cs.start[n:]
- return n, nil
- }
-
- // We may have read some bytes into start while sniffing, even if the read ended in an error.
- // We should first return those bytes, then the error.
- if cs.err != nil {
- return 0, cs.err
- }
-
- // Now we have handled all bytes that were buffered while sniffing. Now just delegate to the underlying reader.
- return cs.r.Read(p)
-}
-
-// ContentType returns the sniffed content type, and whether the content type was succesfully sniffed.
-func (cs *contentSniffer) ContentType() (string, bool) {
- if cs.sniffed {
- return cs.ctype, cs.ctype != ""
- }
- cs.sniffed = true
- // If ReadAll hits EOF, it returns err==nil.
- cs.start, cs.err = ioutil.ReadAll(io.LimitReader(cs.r, sniffBuffSize))
-
- // Don't try to detect the content type based on possibly incomplete data.
- if cs.err != nil {
- return "", false
- }
-
- cs.ctype = http.DetectContentType(cs.start)
- return cs.ctype, true
-}
-
-// DetermineContentType determines the content type of the supplied reader.
-// If the content type is already known, it can be specified via ctype.
-// Otherwise, the content of media will be sniffed to determine the content type.
-// If media implements googleapi.ContentTyper (deprecated), this will be used
-// instead of sniffing the content.
-// After calling DetectContentType the caller must not perform further reads on
-// media, but rather read from the Reader that is returned.
-func DetermineContentType(media io.Reader, ctype string) (io.Reader, string) {
- // Note: callers could avoid calling DetectContentType if ctype != "",
- // but doing the check inside this function reduces the amount of
- // generated code.
- if ctype != "" {
- return media, ctype
- }
-
- // For backwards compatability, allow clients to set content
- // type by providing a ContentTyper for media.
- if typer, ok := media.(googleapi.ContentTyper); ok {
- return media, typer.ContentType()
- }
-
- sniffer := newContentSniffer(media)
- if ctype, ok := sniffer.ContentType(); ok {
- return sniffer, ctype
- }
- // If content type could not be sniffed, reads from sniffer will eventually fail with an error.
- return sniffer, ""
-}
-
-type typeReader struct {
- io.Reader
- typ string
-}
-
-// multipartReader combines the contents of multiple readers to create a multipart/related HTTP body.
-// Close must be called if reads from the multipartReader are abandoned before reaching EOF.
-type multipartReader struct {
- pr *io.PipeReader
- ctype string
- mu sync.Mutex
- pipeOpen bool
-}
-
-func newMultipartReader(parts []typeReader) *multipartReader {
- mp := &multipartReader{pipeOpen: true}
- var pw *io.PipeWriter
- mp.pr, pw = io.Pipe()
- mpw := multipart.NewWriter(pw)
- mp.ctype = "multipart/related; boundary=" + mpw.Boundary()
- go func() {
- for _, part := range parts {
- w, err := mpw.CreatePart(typeHeader(part.typ))
- if err != nil {
- mpw.Close()
- pw.CloseWithError(fmt.Errorf("googleapi: CreatePart failed: %v", err))
- return
- }
- _, err = io.Copy(w, part.Reader)
- if err != nil {
- mpw.Close()
- pw.CloseWithError(fmt.Errorf("googleapi: Copy failed: %v", err))
- return
- }
- }
-
- mpw.Close()
- pw.Close()
- }()
- return mp
-}
-
-func (mp *multipartReader) Read(data []byte) (n int, err error) {
- return mp.pr.Read(data)
-}
-
-func (mp *multipartReader) Close() error {
- mp.mu.Lock()
- if !mp.pipeOpen {
- mp.mu.Unlock()
- return nil
- }
- mp.pipeOpen = false
- mp.mu.Unlock()
- return mp.pr.Close()
-}
-
-// CombineBodyMedia combines a json body with media content to create a multipart/related HTTP body.
-// It returns a ReadCloser containing the combined body, and the overall "multipart/related" content type, with random boundary.
-//
-// The caller must call Close on the returned ReadCloser if reads are abandoned before reaching EOF.
-func CombineBodyMedia(body io.Reader, bodyContentType string, media io.Reader, mediaContentType string) (io.ReadCloser, string) {
- mp := newMultipartReader([]typeReader{
- {body, bodyContentType},
- {media, mediaContentType},
- })
- return mp, mp.ctype
-}
-
-func typeHeader(contentType string) textproto.MIMEHeader {
- h := make(textproto.MIMEHeader)
- if contentType != "" {
- h.Set("Content-Type", contentType)
- }
- return h
-}
-
-// PrepareUpload determines whether the data in the supplied reader should be
-// uploaded in a single request, or in sequential chunks.
-// chunkSize is the size of the chunk that media should be split into.
-//
-// If chunkSize is zero, media is returned as the first value, and the other
-// two return values are nil, true.
-//
-// Otherwise, a MediaBuffer is returned, along with a bool indicating whether the
-// contents of media fit in a single chunk.
-//
-// After PrepareUpload has been called, media should no longer be used: the
-// media content should be accessed via one of the return values.
-func PrepareUpload(media io.Reader, chunkSize int) (r io.Reader, mb *MediaBuffer, singleChunk bool) {
- if chunkSize == 0 { // do not chunk
- return media, nil, true
- }
- mb = NewMediaBuffer(media, chunkSize)
- _, _, _, err := mb.Chunk()
- // If err is io.EOF, we can upload this in a single request. Otherwise, err is
- // either nil or a non-EOF error. If it is the latter, then the next call to
- // mb.Chunk will return the same error. Returning a MediaBuffer ensures that this
- // error will be handled at some point.
- return nil, mb, err == io.EOF
-}
-
-// MediaInfo holds information for media uploads. It is intended for use by generated
-// code only.
-type MediaInfo struct {
- // At most one of Media and MediaBuffer will be set.
- media io.Reader
- buffer *MediaBuffer
- singleChunk bool
- mType string
- size int64 // mediaSize, if known. Used only for calls to progressUpdater_.
- progressUpdater googleapi.ProgressUpdater
-}
-
-// NewInfoFromMedia should be invoked from the Media method of a call. It returns a
-// MediaInfo populated with chunk size and content type, and a reader or MediaBuffer
-// if needed.
-func NewInfoFromMedia(r io.Reader, options []googleapi.MediaOption) *MediaInfo {
- mi := &MediaInfo{}
- opts := googleapi.ProcessMediaOptions(options)
- if !opts.ForceEmptyContentType {
- r, mi.mType = DetermineContentType(r, opts.ContentType)
- }
- mi.media, mi.buffer, mi.singleChunk = PrepareUpload(r, opts.ChunkSize)
- return mi
-}
-
-// NewInfoFromResumableMedia should be invoked from the ResumableMedia method of a
-// call. It returns a MediaInfo using the given reader, size and media type.
-func NewInfoFromResumableMedia(r io.ReaderAt, size int64, mediaType string) *MediaInfo {
- rdr := ReaderAtToReader(r, size)
- rdr, mType := DetermineContentType(rdr, mediaType)
- return &MediaInfo{
- size: size,
- mType: mType,
- buffer: NewMediaBuffer(rdr, googleapi.DefaultUploadChunkSize),
- media: nil,
- singleChunk: false,
- }
-}
-
-func (mi *MediaInfo) SetProgressUpdater(pu googleapi.ProgressUpdater) {
- if mi != nil {
- mi.progressUpdater = pu
- }
-}
-
-// UploadType determines the type of upload: a single request, or a resumable
-// series of requests.
-func (mi *MediaInfo) UploadType() string {
- if mi.singleChunk {
- return "multipart"
- }
- return "resumable"
-}
-
-// UploadRequest sets up an HTTP request for media upload. It adds headers
-// as necessary, and returns a replacement for the body and a function for http.Request.GetBody.
-func (mi *MediaInfo) UploadRequest(reqHeaders http.Header, body io.Reader) (newBody io.Reader, getBody func() (io.ReadCloser, error), cleanup func()) {
- cleanup = func() {}
- if mi == nil {
- return body, nil, cleanup
- }
- var media io.Reader
- if mi.media != nil {
- // This only happens when the caller has turned off chunking. In that
- // case, we write all of media in a single non-retryable request.
- media = mi.media
- } else if mi.singleChunk {
- // The data fits in a single chunk, which has now been read into the MediaBuffer.
- // We obtain that chunk so we can write it in a single request. The request can
- // be retried because the data is stored in the MediaBuffer.
- media, _, _, _ = mi.buffer.Chunk()
- }
- if media != nil {
- fb := readerFunc(body)
- fm := readerFunc(media)
- combined, ctype := CombineBodyMedia(body, "application/json", media, mi.mType)
- if fb != nil && fm != nil {
- getBody = func() (io.ReadCloser, error) {
- rb := ioutil.NopCloser(fb())
- rm := ioutil.NopCloser(fm())
- r, _ := CombineBodyMedia(rb, "application/json", rm, mi.mType)
- return r, nil
- }
- }
- cleanup = func() { combined.Close() }
- reqHeaders.Set("Content-Type", ctype)
- body = combined
- }
- if mi.buffer != nil && mi.mType != "" && !mi.singleChunk {
- reqHeaders.Set("X-Upload-Content-Type", mi.mType)
- }
- return body, getBody, cleanup
-}
-
-// readerFunc returns a function that always returns an io.Reader that has the same
-// contents as r, provided that can be done without consuming r. Otherwise, it
-// returns nil.
-// See http.NewRequest (in net/http/request.go).
-func readerFunc(r io.Reader) func() io.Reader {
- switch r := r.(type) {
- case *bytes.Buffer:
- buf := r.Bytes()
- return func() io.Reader { return bytes.NewReader(buf) }
- case *bytes.Reader:
- snapshot := *r
- return func() io.Reader { r := snapshot; return &r }
- case *strings.Reader:
- snapshot := *r
- return func() io.Reader { r := snapshot; return &r }
- default:
- return nil
- }
-}
-
-// ResumableUpload returns an appropriately configured ResumableUpload value if the
-// upload is resumable, or nil otherwise.
-func (mi *MediaInfo) ResumableUpload(locURI string) *ResumableUpload {
- if mi == nil || mi.singleChunk {
- return nil
- }
- return &ResumableUpload{
- URI: locURI,
- Media: mi.buffer,
- MediaType: mi.mType,
- Callback: func(curr int64) {
- if mi.progressUpdater != nil {
- mi.progressUpdater(curr, mi.size)
- }
- },
- }
-}
diff --git a/vendor/google.golang.org/api/gensupport/not_go18.go b/vendor/google.golang.org/api/gensupport/not_go18.go
deleted file mode 100644
index 2536501..0000000
--- a/vendor/google.golang.org/api/gensupport/not_go18.go
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright 2018 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.
-
-// +build !go1.8
-
-package gensupport
-
-import (
- "io"
- "net/http"
-)
-
-func SetGetBody(req *http.Request, f func() (io.ReadCloser, error)) {}
diff --git a/vendor/google.golang.org/api/gensupport/params.go b/vendor/google.golang.org/api/gensupport/params.go
deleted file mode 100644
index 3b3c743..0000000
--- a/vendor/google.golang.org/api/gensupport/params.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015 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/url"
-
- "google.golang.org/api/googleapi"
-)
-
-// URLParams is a simplified replacement for url.Values
-// that safely builds up URL parameters for encoding.
-type URLParams map[string][]string
-
-// Get returns the first value for the given key, or "".
-func (u URLParams) Get(key string) string {
- vs := u[key]
- if len(vs) == 0 {
- return ""
- }
- return vs[0]
-}
-
-// Set sets the key to value.
-// It replaces any existing values.
-func (u URLParams) Set(key, value string) {
- u[key] = []string{value}
-}
-
-// SetMulti sets the key to an array of values.
-// It replaces any existing values.
-// Note that values must not be modified after calling SetMulti
-// so the caller is responsible for making a copy if necessary.
-func (u URLParams) SetMulti(key string, values []string) {
- u[key] = values
-}
-
-// Encode encodes the values into ``URL encoded'' form
-// ("bar=baz&foo=quux") sorted by key.
-func (u URLParams) Encode() string {
- return url.Values(u).Encode()
-}
-
-func SetOptions(u URLParams, opts ...googleapi.CallOption) {
- for _, o := range opts {
- u.Set(o.Get())
- }
-}
diff --git a/vendor/google.golang.org/api/gensupport/resumable.go b/vendor/google.golang.org/api/gensupport/resumable.go
deleted file mode 100644
index dcd591f..0000000
--- a/vendor/google.golang.org/api/gensupport/resumable.go
+++ /dev/null
@@ -1,217 +0,0 @@
-// 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 (
- "errors"
- "fmt"
- "io"
- "net/http"
- "sync"
- "time"
-
- "golang.org/x/net/context"
-)
-
-const (
- // statusTooManyRequests is returned by the storage API if the
- // per-project limits have been temporarily exceeded. The request
- // should be retried.
- // https://cloud.google.com/storage/docs/json_api/v1/status-codes#standardcodes
- statusTooManyRequests = 429
-)
-
-// ResumableUpload is used by the generated APIs to provide resumable uploads.
-// It is not used by developers directly.
-type ResumableUpload struct {
- Client *http.Client
- // URI is the resumable resource destination provided by the server after specifying "&uploadType=resumable".
- URI string
- UserAgent string // User-Agent for header of the request
- // Media is the object being uploaded.
- Media *MediaBuffer
- // MediaType defines the media type, e.g. "image/jpeg".
- MediaType string
-
- mu sync.Mutex // guards progress
- progress int64 // number of bytes uploaded so far
-
- // Callback is an optional function that will be periodically called with the cumulative number of bytes uploaded.
- Callback func(int64)
-
- // If not specified, a default exponential backoff strategy will be used.
- Backoff BackoffStrategy
-}
-
-// Progress returns the number of bytes uploaded at this point.
-func (rx *ResumableUpload) Progress() int64 {
- rx.mu.Lock()
- defer rx.mu.Unlock()
- return rx.progress
-}
-
-// doUploadRequest performs a single HTTP request to upload data.
-// off specifies the offset in rx.Media from which data is drawn.
-// size is the number of bytes in data.
-// final specifies whether data is the final chunk to be uploaded.
-func (rx *ResumableUpload) doUploadRequest(ctx context.Context, data io.Reader, off, size int64, final bool) (*http.Response, error) {
- req, err := http.NewRequest("POST", rx.URI, data)
- if err != nil {
- return nil, err
- }
-
- req.ContentLength = size
- var contentRange string
- if final {
- if size == 0 {
- contentRange = fmt.Sprintf("bytes */%v", off)
- } else {
- contentRange = fmt.Sprintf("bytes %v-%v/%v", off, off+size-1, off+size)
- }
- } else {
- contentRange = fmt.Sprintf("bytes %v-%v/*", off, off+size-1)
- }
- req.Header.Set("Content-Range", contentRange)
- req.Header.Set("Content-Type", rx.MediaType)
- req.Header.Set("User-Agent", rx.UserAgent)
-
- // Google's upload endpoint uses status code 308 for a
- // different purpose than the "308 Permanent Redirect"
- // since-standardized in RFC 7238. Because of the conflict in
- // semantics, Google added this new request header which
- // causes it to not use "308" and instead reply with 200 OK
- // and sets the upload-specific "X-HTTP-Status-Code-Override:
- // 308" response header.
- req.Header.Set("X-GUploader-No-308", "yes")
-
- return SendRequest(ctx, rx.Client, req)
-}
-
-func statusResumeIncomplete(resp *http.Response) bool {
- // This is how the server signals "status resume incomplete"
- // when X-GUploader-No-308 is set to "yes":
- return resp != nil && resp.Header.Get("X-Http-Status-Code-Override") == "308"
-}
-
-// reportProgress calls a user-supplied callback to report upload progress.
-// If old==updated, the callback is not called.
-func (rx *ResumableUpload) reportProgress(old, updated int64) {
- if updated-old == 0 {
- return
- }
- rx.mu.Lock()
- rx.progress = updated
- rx.mu.Unlock()
- if rx.Callback != nil {
- rx.Callback(updated)
- }
-}
-
-// transferChunk performs a single HTTP request to upload a single chunk from rx.Media.
-func (rx *ResumableUpload) transferChunk(ctx context.Context) (*http.Response, error) {
- chunk, off, size, err := rx.Media.Chunk()
-
- done := err == io.EOF
- if !done && err != nil {
- return nil, err
- }
-
- res, err := rx.doUploadRequest(ctx, chunk, off, int64(size), done)
- if err != nil {
- return res, err
- }
-
- // We sent "X-GUploader-No-308: yes" (see comment elsewhere in
- // this file), so we don't expect to get a 308.
- if res.StatusCode == 308 {
- return nil, errors.New("unexpected 308 response status code")
- }
-
- if res.StatusCode == http.StatusOK {
- rx.reportProgress(off, off+int64(size))
- }
-
- if statusResumeIncomplete(res) {
- rx.Media.Next()
- }
- return res, nil
-}
-
-func contextDone(ctx context.Context) bool {
- select {
- case <-ctx.Done():
- return true
- default:
- return false
- }
-}
-
-// Upload starts the process of a resumable upload with a cancellable context.
-// 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) {
- var pause time.Duration
- backoff := rx.Backoff
- if backoff == nil {
- backoff = DefaultBackoffStrategy()
- }
-
- for {
- // Ensure that we return in the case of cancelled context, even if pause is 0.
- if contextDone(ctx) {
- return nil, ctx.Err()
- }
- select {
- case <-ctx.Done():
- return nil, ctx.Err()
- case <-time.After(pause):
- }
-
- resp, err = rx.transferChunk(ctx)
-
- var status int
- if resp != nil {
- status = resp.StatusCode
- }
-
- // Check if we should retry the request.
- if shouldRetry(status, err) {
- var retry bool
- pause, retry = backoff.Pause()
- if retry {
- if resp != nil && resp.Body != nil {
- resp.Body.Close()
- }
- continue
- }
- }
-
- // If the chunk was uploaded successfully, but there's still
- // more to go, upload the next chunk without any delay.
- if statusResumeIncomplete(resp) {
- pause = 0
- backoff.Reset()
- resp.Body.Close()
- continue
- }
-
- // It's possible for err and resp to both be non-nil here, but we expose a simpler
- // contract to our callers: exactly one of resp and err will be non-nil. This means
- // that any response body must be closed here before returning a non-nil error.
- if err != nil {
- if resp != nil && resp.Body != nil {
- resp.Body.Close()
- }
- return nil, err
- }
-
- return resp, nil
- }
-}
diff --git a/vendor/google.golang.org/api/gensupport/retry.go b/vendor/google.golang.org/api/gensupport/retry.go
deleted file mode 100644
index c60b3c3..0000000
--- a/vendor/google.golang.org/api/gensupport/retry.go
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright 2017 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 gensupport
-
-import (
- "io"
- "net"
- "net/http"
- "time"
-
- "golang.org/x/net/context"
-)
-
-// Retry invokes the given function, retrying it multiple times if the connection failed or
-// the HTTP status response indicates the request should be attempted again. ctx may be nil.
-func Retry(ctx context.Context, f func() (*http.Response, error), backoff BackoffStrategy) (*http.Response, error) {
- for {
- resp, err := f()
-
- var status int
- if resp != nil {
- status = resp.StatusCode
- }
-
- // Return if we shouldn't retry.
- pause, retry := backoff.Pause()
- if !shouldRetry(status, err) || !retry {
- return resp, err
- }
-
- // Ensure the response body is closed, if any.
- if resp != nil && resp.Body != nil {
- resp.Body.Close()
- }
-
- // Pause, but still listen to ctx.Done if context is not nil.
- var done <-chan struct{}
- if ctx != nil {
- done = ctx.Done()
- }
- select {
- case <-done:
- return nil, ctx.Err()
- case <-time.After(pause):
- }
- }
-}
-
-// DefaultBackoffStrategy returns a default strategy to use for retrying failed upload requests.
-func DefaultBackoffStrategy() BackoffStrategy {
- return &ExponentialBackoff{
- Base: 250 * time.Millisecond,
- Max: 16 * time.Second,
- }
-}
-
-// shouldRetry returns true if the HTTP response / error indicates that the
-// request should be attempted again.
-func shouldRetry(status int, err error) bool {
- if 500 <= status && status <= 599 {
- return true
- }
- if status == statusTooManyRequests {
- return true
- }
- if err == io.ErrUnexpectedEOF {
- return true
- }
- if err, ok := err.(net.Error); ok {
- return err.Temporary()
- }
- return false
-}
diff --git a/vendor/google.golang.org/api/gensupport/send.go b/vendor/google.golang.org/api/gensupport/send.go
deleted file mode 100644
index 0f75aa8..0000000
--- a/vendor/google.golang.org/api/gensupport/send.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// 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 (
- "encoding/json"
- "errors"
- "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) {
- // Disallow Accept-Encoding because it interferes with the automatic gzip handling
- // done by the default http.Transport. See https://github.com/google/google-api-go-client/issues/219.
- if _, ok := req.Header["Accept-Encoding"]; ok {
- return nil, errors.New("google api: custom Accept-Encoding headers not allowed")
- }
- 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
-}
-
-// DecodeResponse decodes the body of res into target. If there is no body,
-// target is unchanged.
-func DecodeResponse(target interface{}, res *http.Response) error {
- if res.StatusCode == http.StatusNoContent {
- return nil
- }
- return json.NewDecoder(res.Body).Decode(target)
-}
diff --git a/vendor/google.golang.org/api/googleapi/googleapi.go b/vendor/google.golang.org/api/googleapi/googleapi.go
deleted file mode 100644
index c998445..0000000
--- a/vendor/google.golang.org/api/googleapi/googleapi.go
+++ /dev/null
@@ -1,415 +0,0 @@
-// Copyright 2011 Google Inc. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package googleapi contains the common code shared by all Google API
-// libraries.
-package googleapi // import "google.golang.org/api/googleapi"
-
-import (
- "bytes"
- "encoding/json"
- "fmt"
- "io"
- "io/ioutil"
- "net/http"
- "net/url"
- "strings"
-
- "google.golang.org/api/googleapi/internal/uritemplates"
-)
-
-// ContentTyper is an interface for Readers which know (or would like
-// to override) their Content-Type. If a media body doesn't implement
-// ContentTyper, the type is sniffed from the content using
-// http.DetectContentType.
-type ContentTyper interface {
- ContentType() string
-}
-
-// A SizeReaderAt is a ReaderAt with a Size method.
-// An io.SectionReader implements SizeReaderAt.
-type SizeReaderAt interface {
- io.ReaderAt
- Size() int64
-}
-
-// ServerResponse is embedded in each Do response and
-// provides the HTTP status code and header sent by the server.
-type ServerResponse struct {
- // HTTPStatusCode is the server's response status code.
- // When using a resource method's Do call, this will always be in the 2xx range.
- HTTPStatusCode int
- // Header contains the response header fields from the server.
- Header http.Header
-}
-
-const (
- Version = "0.5"
-
- // UserAgent is the header string used to identify this package.
- UserAgent = "google-api-go-client/" + Version
-
- // The default chunk size to use for resumable uploads if not specified by the user.
- DefaultUploadChunkSize = 8 * 1024 * 1024
-
- // The minimum chunk size that can be used for resumable uploads. All
- // user-specified chunk sizes must be multiple of this value.
- MinUploadChunkSize = 256 * 1024
-)
-
-// Error contains an error response from the server.
-type Error struct {
- // Code is the HTTP response status code and will always be populated.
- Code int `json:"code"`
- // Message is the server response message and is only populated when
- // explicitly referenced by the JSON server response.
- Message string `json:"message"`
- // Body is the raw response returned by the server.
- // It is often but not always JSON, depending on how the request fails.
- Body string
- // Header contains the response header fields from the server.
- Header http.Header
-
- Errors []ErrorItem
-}
-
-// ErrorItem is a detailed error code & message from the Google API frontend.
-type ErrorItem struct {
- // Reason is the typed error code. For example: "some_example".
- Reason string `json:"reason"`
- // Message is the human-readable description of the error.
- Message string `json:"message"`
-}
-
-func (e *Error) Error() string {
- if len(e.Errors) == 0 && e.Message == "" {
- return fmt.Sprintf("googleapi: got HTTP response code %d with body: %v", e.Code, e.Body)
- }
- var buf bytes.Buffer
- fmt.Fprintf(&buf, "googleapi: Error %d: ", e.Code)
- if e.Message != "" {
- fmt.Fprintf(&buf, "%s", e.Message)
- }
- if len(e.Errors) == 0 {
- return strings.TrimSpace(buf.String())
- }
- if len(e.Errors) == 1 && e.Errors[0].Message == e.Message {
- fmt.Fprintf(&buf, ", %s", e.Errors[0].Reason)
- return buf.String()
- }
- fmt.Fprintln(&buf, "\nMore details:")
- for _, v := range e.Errors {
- fmt.Fprintf(&buf, "Reason: %s, Message: %s\n", v.Reason, v.Message)
- }
- return buf.String()
-}
-
-type errorReply struct {
- Error *Error `json:"error"`
-}
-
-// CheckResponse returns an error (of type *Error) if the response
-// status code is not 2xx.
-func CheckResponse(res *http.Response) error {
- if res.StatusCode >= 200 && res.StatusCode <= 299 {
- return nil
- }
- slurp, err := ioutil.ReadAll(res.Body)
- if err == nil {
- jerr := new(errorReply)
- err = json.Unmarshal(slurp, jerr)
- if err == nil && jerr.Error != nil {
- if jerr.Error.Code == 0 {
- jerr.Error.Code = res.StatusCode
- }
- jerr.Error.Body = string(slurp)
- return jerr.Error
- }
- }
- return &Error{
- Code: res.StatusCode,
- Body: string(slurp),
- Header: res.Header,
- }
-}
-
-// IsNotModified reports whether err is the result of the
-// server replying with http.StatusNotModified.
-// Such error values are sometimes returned by "Do" methods
-// on calls when If-None-Match is used.
-func IsNotModified(err error) bool {
- if err == nil {
- return false
- }
- ae, ok := err.(*Error)
- return ok && ae.Code == http.StatusNotModified
-}
-
-// CheckMediaResponse returns an error (of type *Error) if the response
-// status code is not 2xx. Unlike CheckResponse it does not assume the
-// body is a JSON error document.
-// It is the caller's responsibility to close res.Body.
-func CheckMediaResponse(res *http.Response) error {
- if res.StatusCode >= 200 && res.StatusCode <= 299 {
- return nil
- }
- slurp, _ := ioutil.ReadAll(io.LimitReader(res.Body, 1<<20))
- return &Error{
- Code: res.StatusCode,
- Body: string(slurp),
- }
-}
-
-type MarshalStyle bool
-
-var WithDataWrapper = MarshalStyle(true)
-var WithoutDataWrapper = MarshalStyle(false)
-
-func (wrap MarshalStyle) JSONReader(v interface{}) (io.Reader, error) {
- buf := new(bytes.Buffer)
- if wrap {
- buf.Write([]byte(`{"data": `))
- }
- err := json.NewEncoder(buf).Encode(v)
- if err != nil {
- return nil, err
- }
- if wrap {
- buf.Write([]byte(`}`))
- }
- return buf, nil
-}
-
-// endingWithErrorReader from r until it returns an error. If the
-// final error from r is io.EOF and e is non-nil, e is used instead.
-type endingWithErrorReader struct {
- r io.Reader
- e error
-}
-
-func (er endingWithErrorReader) Read(p []byte) (n int, err error) {
- n, err = er.r.Read(p)
- if err == io.EOF && er.e != nil {
- err = er.e
- }
- return
-}
-
-// countingWriter counts the number of bytes it receives to write, but
-// discards them.
-type countingWriter struct {
- n *int64
-}
-
-func (w countingWriter) Write(p []byte) (int, error) {
- *w.n += int64(len(p))
- return len(p), nil
-}
-
-// ProgressUpdater is a function that is called upon every progress update of a resumable upload.
-// This is the only part of a resumable upload (from googleapi) that is usable by the developer.
-// The remaining usable pieces of resumable uploads is exposed in each auto-generated API.
-type ProgressUpdater func(current, total int64)
-
-type MediaOption interface {
- setOptions(o *MediaOptions)
-}
-
-type contentTypeOption string
-
-func (ct contentTypeOption) setOptions(o *MediaOptions) {
- o.ContentType = string(ct)
- if o.ContentType == "" {
- o.ForceEmptyContentType = true
- }
-}
-
-// ContentType returns a MediaOption which sets the Content-Type header for media uploads.
-// If ctype is empty, the Content-Type header will be omitted.
-func ContentType(ctype string) MediaOption {
- return contentTypeOption(ctype)
-}
-
-type chunkSizeOption int
-
-func (cs chunkSizeOption) setOptions(o *MediaOptions) {
- size := int(cs)
- if size%MinUploadChunkSize != 0 {
- size += MinUploadChunkSize - (size % MinUploadChunkSize)
- }
- o.ChunkSize = size
-}
-
-// ChunkSize returns a MediaOption which sets the chunk size for media uploads.
-// size will be rounded up to the nearest multiple of 256K.
-// Media which contains fewer than size bytes will be uploaded in a single request.
-// Media which contains size bytes or more will be uploaded in separate chunks.
-// If size is zero, media will be uploaded in a single request.
-func ChunkSize(size int) MediaOption {
- return chunkSizeOption(size)
-}
-
-// MediaOptions stores options for customizing media upload. It is not used by developers directly.
-type MediaOptions struct {
- ContentType string
- ForceEmptyContentType bool
-
- ChunkSize int
-}
-
-// ProcessMediaOptions stores options from opts in a MediaOptions.
-// It is not used by developers directly.
-func ProcessMediaOptions(opts []MediaOption) *MediaOptions {
- mo := &MediaOptions{ChunkSize: DefaultUploadChunkSize}
- for _, o := range opts {
- o.setOptions(mo)
- }
- return mo
-}
-
-func ResolveRelative(basestr, relstr string) string {
- u, _ := url.Parse(basestr)
- afterColonPath := ""
- if i := strings.IndexRune(relstr, ':'); i > 0 {
- afterColonPath = relstr[i+1:]
- relstr = relstr[:i]
- }
- rel, _ := url.Parse(relstr)
- u = u.ResolveReference(rel)
- us := u.String()
- if afterColonPath != "" {
- us = fmt.Sprintf("%s:%s", us, afterColonPath)
- }
- us = strings.Replace(us, "%7B", "{", -1)
- us = strings.Replace(us, "%7D", "}", -1)
- us = strings.Replace(us, "%2A", "*", -1)
- return us
-}
-
-// Expand subsitutes any {encoded} strings in the URL passed in using
-// the map supplied.
-//
-// This calls SetOpaque to avoid encoding of the parameters in the URL path.
-func Expand(u *url.URL, expansions map[string]string) {
- escaped, unescaped, err := uritemplates.Expand(u.Path, expansions)
- if err == nil {
- u.Path = unescaped
- u.RawPath = escaped
- }
-}
-
-// CloseBody is used to close res.Body.
-// Prior to calling Close, it also tries to Read a small amount to see an EOF.
-// Not seeing an EOF can prevent HTTP Transports from reusing connections.
-func CloseBody(res *http.Response) {
- if res == nil || res.Body == nil {
- return
- }
- // Justification for 3 byte reads: two for up to "\r\n" after
- // a JSON/XML document, and then 1 to see EOF if we haven't yet.
- // TODO(bradfitz): detect Go 1.3+ and skip these reads.
- // See https://codereview.appspot.com/58240043
- // and https://codereview.appspot.com/49570044
- buf := make([]byte, 1)
- for i := 0; i < 3; i++ {
- _, err := res.Body.Read(buf)
- if err != nil {
- break
- }
- }
- res.Body.Close()
-
-}
-
-// VariantType returns the type name of the given variant.
-// If the map doesn't contain the named key or the value is not a []interface{}, "" is returned.
-// This is used to support "variant" APIs that can return one of a number of different types.
-func VariantType(t map[string]interface{}) string {
- s, _ := t["type"].(string)
- return s
-}
-
-// ConvertVariant uses the JSON encoder/decoder to fill in the struct 'dst' with the fields found in variant 'v'.
-// This is used to support "variant" APIs that can return one of a number of different types.
-// It reports whether the conversion was successful.
-func ConvertVariant(v map[string]interface{}, dst interface{}) bool {
- var buf bytes.Buffer
- err := json.NewEncoder(&buf).Encode(v)
- if err != nil {
- return false
- }
- return json.Unmarshal(buf.Bytes(), dst) == nil
-}
-
-// A Field names a field to be retrieved with a partial response.
-// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-//
-// Partial responses can dramatically reduce the amount of data that must be sent to your application.
-// In order to request partial responses, you can specify the full list of fields
-// that your application needs by adding the Fields option to your request.
-//
-// Field strings use camelCase with leading lower-case characters to identify fields within the response.
-//
-// For example, if your response has a "NextPageToken" and a slice of "Items" with "Id" fields,
-// you could request just those fields like this:
-//
-// svc.Events.List().Fields("nextPageToken", "items/id").Do()
-//
-// or if you were also interested in each Item's "Updated" field, you can combine them like this:
-//
-// svc.Events.List().Fields("nextPageToken", "items(id,updated)").Do()
-//
-// More information about field formatting can be found here:
-// https://developers.google.com/+/api/#fields-syntax
-//
-// Another way to find field names is through the Google API explorer:
-// https://developers.google.com/apis-explorer/#p/
-type Field string
-
-// CombineFields combines fields into a single string.
-func CombineFields(s []Field) string {
- r := make([]string, len(s))
- for i, v := range s {
- r[i] = string(v)
- }
- return strings.Join(r, ",")
-}
-
-// A CallOption is an optional argument to an API call.
-// It should be treated as an opaque value by users of Google APIs.
-//
-// A CallOption is something that configures an API call in a way that is
-// not specific to that API; for instance, controlling the quota user for
-// an API call is common across many APIs, and is thus a CallOption.
-type CallOption interface {
- Get() (key, value string)
-}
-
-// QuotaUser returns a CallOption that will set the quota user for a call.
-// The quota user can be used by server-side applications to control accounting.
-// It can be an arbitrary string up to 40 characters, and will override UserIP
-// if both are provided.
-func QuotaUser(u string) CallOption { return quotaUser(u) }
-
-type quotaUser string
-
-func (q quotaUser) Get() (string, string) { return "quotaUser", string(q) }
-
-// UserIP returns a CallOption that will set the "userIp" parameter of a call.
-// This should be the IP address of the originating request.
-func UserIP(ip string) CallOption { return userIP(ip) }
-
-type userIP string
-
-func (i userIP) Get() (string, string) { return "userIp", string(i) }
-
-// Trace returns a CallOption that enables diagnostic tracing for a call.
-// traceToken is an ID supplied by Google support.
-func Trace(traceToken string) CallOption { return traceTok(traceToken) }
-
-type traceTok string
-
-func (t traceTok) Get() (string, string) { return "trace", "token:" + string(t) }
-
-// TODO: Fields too
diff --git a/vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE b/vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE
deleted file mode 100644
index de9c88c..0000000
--- a/vendor/google.golang.org/api/googleapi/internal/uritemplates/LICENSE
+++ /dev/null
@@ -1,18 +0,0 @@
-Copyright (c) 2013 Joshua Tacoma
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/vendor/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go b/vendor/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go
deleted file mode 100644
index 63bf053..0000000
--- a/vendor/google.golang.org/api/googleapi/internal/uritemplates/uritemplates.go
+++ /dev/null
@@ -1,248 +0,0 @@
-// Copyright 2013 Joshua Tacoma. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package uritemplates is a level 3 implementation of RFC 6570 (URI
-// Template, http://tools.ietf.org/html/rfc6570).
-// uritemplates does not support composite values (in Go: slices or maps)
-// and so does not qualify as a level 4 implementation.
-package uritemplates
-
-import (
- "bytes"
- "errors"
- "regexp"
- "strconv"
- "strings"
-)
-
-var (
- unreserved = regexp.MustCompile("[^A-Za-z0-9\\-._~]")
- reserved = regexp.MustCompile("[^A-Za-z0-9\\-._~:/?#[\\]@!$&'()*+,;=]")
- validname = regexp.MustCompile("^([A-Za-z0-9_\\.]|%[0-9A-Fa-f][0-9A-Fa-f])+$")
- hex = []byte("0123456789ABCDEF")
-)
-
-func pctEncode(src []byte) []byte {
- dst := make([]byte, len(src)*3)
- for i, b := range src {
- buf := dst[i*3 : i*3+3]
- buf[0] = 0x25
- buf[1] = hex[b/16]
- buf[2] = hex[b%16]
- }
- return dst
-}
-
-// pairWriter is a convenience struct which allows escaped and unescaped
-// versions of the template to be written in parallel.
-type pairWriter struct {
- escaped, unescaped bytes.Buffer
-}
-
-// Write writes the provided string directly without any escaping.
-func (w *pairWriter) Write(s string) {
- w.escaped.WriteString(s)
- w.unescaped.WriteString(s)
-}
-
-// Escape writes the provided string, escaping the string for the
-// escaped output.
-func (w *pairWriter) Escape(s string, allowReserved bool) {
- w.unescaped.WriteString(s)
- if allowReserved {
- w.escaped.Write(reserved.ReplaceAllFunc([]byte(s), pctEncode))
- } else {
- w.escaped.Write(unreserved.ReplaceAllFunc([]byte(s), pctEncode))
- }
-}
-
-// Escaped returns the escaped string.
-func (w *pairWriter) Escaped() string {
- return w.escaped.String()
-}
-
-// Unescaped returns the unescaped string.
-func (w *pairWriter) Unescaped() string {
- return w.unescaped.String()
-}
-
-// A uriTemplate is a parsed representation of a URI template.
-type uriTemplate struct {
- raw string
- parts []templatePart
-}
-
-// parse parses a URI template string into a uriTemplate object.
-func parse(rawTemplate string) (*uriTemplate, error) {
- split := strings.Split(rawTemplate, "{")
- parts := make([]templatePart, len(split)*2-1)
- for i, s := range split {
- if i == 0 {
- if strings.Contains(s, "}") {
- return nil, errors.New("unexpected }")
- }
- parts[i].raw = s
- continue
- }
- subsplit := strings.Split(s, "}")
- if len(subsplit) != 2 {
- return nil, errors.New("malformed template")
- }
- expression := subsplit[0]
- var err error
- parts[i*2-1], err = parseExpression(expression)
- if err != nil {
- return nil, err
- }
- parts[i*2].raw = subsplit[1]
- }
- return &uriTemplate{
- raw: rawTemplate,
- parts: parts,
- }, nil
-}
-
-type templatePart struct {
- raw string
- terms []templateTerm
- first string
- sep string
- named bool
- ifemp string
- allowReserved bool
-}
-
-type templateTerm struct {
- name string
- explode bool
- truncate int
-}
-
-func parseExpression(expression string) (result templatePart, err error) {
- switch expression[0] {
- case '+':
- result.sep = ","
- result.allowReserved = true
- expression = expression[1:]
- case '.':
- result.first = "."
- result.sep = "."
- expression = expression[1:]
- case '/':
- result.first = "/"
- result.sep = "/"
- expression = expression[1:]
- case ';':
- result.first = ";"
- result.sep = ";"
- result.named = true
- expression = expression[1:]
- case '?':
- result.first = "?"
- result.sep = "&"
- result.named = true
- result.ifemp = "="
- expression = expression[1:]
- case '&':
- result.first = "&"
- result.sep = "&"
- result.named = true
- result.ifemp = "="
- expression = expression[1:]
- case '#':
- result.first = "#"
- result.sep = ","
- result.allowReserved = true
- expression = expression[1:]
- default:
- result.sep = ","
- }
- rawterms := strings.Split(expression, ",")
- result.terms = make([]templateTerm, len(rawterms))
- for i, raw := range rawterms {
- result.terms[i], err = parseTerm(raw)
- if err != nil {
- break
- }
- }
- return result, err
-}
-
-func parseTerm(term string) (result templateTerm, err error) {
- // TODO(djd): Remove "*" suffix parsing once we check that no APIs have
- // mistakenly used that attribute.
- if strings.HasSuffix(term, "*") {
- result.explode = true
- term = term[:len(term)-1]
- }
- split := strings.Split(term, ":")
- if len(split) == 1 {
- result.name = term
- } else if len(split) == 2 {
- result.name = split[0]
- var parsed int64
- parsed, err = strconv.ParseInt(split[1], 10, 0)
- result.truncate = int(parsed)
- } else {
- err = errors.New("multiple colons in same term")
- }
- if !validname.MatchString(result.name) {
- err = errors.New("not a valid name: " + result.name)
- }
- if result.explode && result.truncate > 0 {
- err = errors.New("both explode and prefix modifers on same term")
- }
- return result, err
-}
-
-// Expand expands a URI template with a set of values to produce the
-// resultant URI. Two forms of the result are returned: one with all the
-// elements escaped, and one with the elements unescaped.
-func (t *uriTemplate) Expand(values map[string]string) (escaped, unescaped string) {
- var w pairWriter
- for _, p := range t.parts {
- p.expand(&w, values)
- }
- return w.Escaped(), w.Unescaped()
-}
-
-func (tp *templatePart) expand(w *pairWriter, values map[string]string) {
- if len(tp.raw) > 0 {
- w.Write(tp.raw)
- return
- }
- var first = true
- for _, term := range tp.terms {
- value, exists := values[term.name]
- if !exists {
- continue
- }
- if first {
- w.Write(tp.first)
- first = false
- } else {
- w.Write(tp.sep)
- }
- tp.expandString(w, term, value)
- }
-}
-
-func (tp *templatePart) expandName(w *pairWriter, name string, empty bool) {
- if tp.named {
- w.Write(name)
- if empty {
- w.Write(tp.ifemp)
- } else {
- w.Write("=")
- }
- }
-}
-
-func (tp *templatePart) expandString(w *pairWriter, t templateTerm, s string) {
- if len(s) > t.truncate && t.truncate > 0 {
- s = s[:t.truncate]
- }
- tp.expandName(w, t.name, len(s) == 0)
- w.Escape(s, tp.allowReserved)
-}
diff --git a/vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.go b/vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.go
deleted file mode 100644
index 2e70b81..0000000
--- a/vendor/google.golang.org/api/googleapi/internal/uritemplates/utils.go
+++ /dev/null
@@ -1,17 +0,0 @@
-// 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 uritemplates
-
-// Expand parses then expands a URI template with a set of values to produce
-// the resultant URI. Two forms of the result are returned: one with all the
-// elements escaped, and one with the elements unescaped.
-func Expand(path string, values map[string]string) (escaped, unescaped string, err error) {
- template, err := parse(path)
- if err != nil {
- return "", "", err
- }
- escaped, unescaped = template.Expand(values)
- return escaped, unescaped, nil
-}
diff --git a/vendor/google.golang.org/api/googleapi/transport/apikey.go b/vendor/google.golang.org/api/googleapi/transport/apikey.go
deleted file mode 100644
index eca1ea2..0000000
--- a/vendor/google.golang.org/api/googleapi/transport/apikey.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2012 Google Inc. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package transport contains HTTP transports used to make
-// authenticated API requests.
-package transport
-
-import (
- "errors"
- "net/http"
-)
-
-// APIKey is an HTTP Transport which wraps an underlying transport and
-// appends an API Key "key" parameter to the URL of outgoing requests.
-type APIKey struct {
- // Key is the API Key to set on requests.
- Key string
-
- // Transport is the underlying HTTP transport.
- // If nil, http.DefaultTransport is used.
- Transport http.RoundTripper
-}
-
-func (t *APIKey) RoundTrip(req *http.Request) (*http.Response, error) {
- rt := t.Transport
- if rt == nil {
- rt = http.DefaultTransport
- if rt == nil {
- return nil, errors.New("googleapi/transport: no Transport specified or available")
- }
- }
- newReq := *req
- args := newReq.URL.Query()
- args.Set("key", t.Key)
- newReq.URL.RawQuery = args.Encode()
- return rt.RoundTrip(&newReq)
-}
diff --git a/vendor/google.golang.org/api/googleapi/types.go b/vendor/google.golang.org/api/googleapi/types.go
deleted file mode 100644
index c8fdd54..0000000
--- a/vendor/google.golang.org/api/googleapi/types.go
+++ /dev/null
@@ -1,202 +0,0 @@
-// Copyright 2013 Google Inc. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package googleapi
-
-import (
- "encoding/json"
- "errors"
- "strconv"
-)
-
-// Int64s is a slice of int64s that marshal as quoted strings in JSON.
-type Int64s []int64
-
-func (q *Int64s) UnmarshalJSON(raw []byte) error {
- *q = (*q)[:0]
- var ss []string
- if err := json.Unmarshal(raw, &ss); err != nil {
- return err
- }
- for _, s := range ss {
- v, err := strconv.ParseInt(s, 10, 64)
- if err != nil {
- return err
- }
- *q = append(*q, int64(v))
- }
- return nil
-}
-
-// Int32s is a slice of int32s that marshal as quoted strings in JSON.
-type Int32s []int32
-
-func (q *Int32s) UnmarshalJSON(raw []byte) error {
- *q = (*q)[:0]
- var ss []string
- if err := json.Unmarshal(raw, &ss); err != nil {
- return err
- }
- for _, s := range ss {
- v, err := strconv.ParseInt(s, 10, 32)
- if err != nil {
- return err
- }
- *q = append(*q, int32(v))
- }
- return nil
-}
-
-// Uint64s is a slice of uint64s that marshal as quoted strings in JSON.
-type Uint64s []uint64
-
-func (q *Uint64s) UnmarshalJSON(raw []byte) error {
- *q = (*q)[:0]
- var ss []string
- if err := json.Unmarshal(raw, &ss); err != nil {
- return err
- }
- for _, s := range ss {
- v, err := strconv.ParseUint(s, 10, 64)
- if err != nil {
- return err
- }
- *q = append(*q, uint64(v))
- }
- return nil
-}
-
-// Uint32s is a slice of uint32s that marshal as quoted strings in JSON.
-type Uint32s []uint32
-
-func (q *Uint32s) UnmarshalJSON(raw []byte) error {
- *q = (*q)[:0]
- var ss []string
- if err := json.Unmarshal(raw, &ss); err != nil {
- return err
- }
- for _, s := range ss {
- v, err := strconv.ParseUint(s, 10, 32)
- if err != nil {
- return err
- }
- *q = append(*q, uint32(v))
- }
- return nil
-}
-
-// Float64s is a slice of float64s that marshal as quoted strings in JSON.
-type Float64s []float64
-
-func (q *Float64s) UnmarshalJSON(raw []byte) error {
- *q = (*q)[:0]
- var ss []string
- if err := json.Unmarshal(raw, &ss); err != nil {
- return err
- }
- for _, s := range ss {
- v, err := strconv.ParseFloat(s, 64)
- if err != nil {
- return err
- }
- *q = append(*q, float64(v))
- }
- return nil
-}
-
-func quotedList(n int, fn func(dst []byte, i int) []byte) ([]byte, error) {
- dst := make([]byte, 0, 2+n*10) // somewhat arbitrary
- dst = append(dst, '[')
- for i := 0; i < n; i++ {
- if i > 0 {
- dst = append(dst, ',')
- }
- dst = append(dst, '"')
- dst = fn(dst, i)
- dst = append(dst, '"')
- }
- dst = append(dst, ']')
- return dst, nil
-}
-
-func (s Int64s) MarshalJSON() ([]byte, error) {
- return quotedList(len(s), func(dst []byte, i int) []byte {
- return strconv.AppendInt(dst, s[i], 10)
- })
-}
-
-func (s Int32s) MarshalJSON() ([]byte, error) {
- return quotedList(len(s), func(dst []byte, i int) []byte {
- return strconv.AppendInt(dst, int64(s[i]), 10)
- })
-}
-
-func (s Uint64s) MarshalJSON() ([]byte, error) {
- return quotedList(len(s), func(dst []byte, i int) []byte {
- return strconv.AppendUint(dst, s[i], 10)
- })
-}
-
-func (s Uint32s) MarshalJSON() ([]byte, error) {
- return quotedList(len(s), func(dst []byte, i int) []byte {
- return strconv.AppendUint(dst, uint64(s[i]), 10)
- })
-}
-
-func (s Float64s) MarshalJSON() ([]byte, error) {
- return quotedList(len(s), func(dst []byte, i int) []byte {
- return strconv.AppendFloat(dst, s[i], 'g', -1, 64)
- })
-}
-
-// RawMessage is a raw encoded JSON value.
-// It is identical to json.RawMessage, except it does not suffer from
-// https://golang.org/issue/14493.
-type RawMessage []byte
-
-// MarshalJSON returns m.
-func (m RawMessage) MarshalJSON() ([]byte, error) {
- return m, nil
-}
-
-// UnmarshalJSON sets *m to a copy of data.
-func (m *RawMessage) UnmarshalJSON(data []byte) error {
- if m == nil {
- return errors.New("googleapi.RawMessage: UnmarshalJSON on nil pointer")
- }
- *m = append((*m)[:0], data...)
- return nil
-}
-
-/*
- * Helper routines for simplifying the creation of optional fields of basic type.
- */
-
-// Bool is a helper routine that allocates a new bool value
-// to store v and returns a pointer to it.
-func Bool(v bool) *bool { return &v }
-
-// Int32 is a helper routine that allocates a new int32 value
-// to store v and returns a pointer to it.
-func Int32(v int32) *int32 { return &v }
-
-// Int64 is a helper routine that allocates a new int64 value
-// to store v and returns a pointer to it.
-func Int64(v int64) *int64 { return &v }
-
-// Float64 is a helper routine that allocates a new float64 value
-// to store v and returns a pointer to it.
-func Float64(v float64) *float64 { return &v }
-
-// Uint32 is a helper routine that allocates a new uint32 value
-// to store v and returns a pointer to it.
-func Uint32(v uint32) *uint32 { return &v }
-
-// Uint64 is a helper routine that allocates a new uint64 value
-// to store v and returns a pointer to it.
-func Uint64(v uint64) *uint64 { return &v }
-
-// String is a helper routine that allocates a new string value
-// to store v and returns a pointer to it.
-func String(v string) *string { return &v }
diff --git a/vendor/google.golang.org/api/internal/creds.go b/vendor/google.golang.org/api/internal/creds.go
deleted file mode 100644
index c16b7b6..0000000
--- a/vendor/google.golang.org/api/internal/creds.go
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2017 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 (
- "fmt"
- "io/ioutil"
-
- "golang.org/x/net/context"
- "golang.org/x/oauth2/google"
-)
-
-// Creds returns credential information obtained from DialSettings, or if none, then
-// it returns default credential information.
-func Creds(ctx context.Context, ds *DialSettings) (*google.DefaultCredentials, error) {
- if ds.Credentials != nil {
- return ds.Credentials, nil
- }
- if ds.CredentialsFile != "" {
- data, err := ioutil.ReadFile(ds.CredentialsFile)
- if err != nil {
- return nil, fmt.Errorf("cannot read credentials file: %v", err)
- }
- return google.CredentialsFromJSON(ctx, data, ds.Scopes...)
- }
- if ds.TokenSource != nil {
- return &google.DefaultCredentials{TokenSource: ds.TokenSource}, nil
- }
- return google.FindDefaultCredentials(ctx, ds.Scopes...)
-}
diff --git a/vendor/google.golang.org/api/internal/pool.go b/vendor/google.golang.org/api/internal/pool.go
deleted file mode 100644
index 4150feb..0000000
--- a/vendor/google.golang.org/api/internal/pool.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// 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/internal/service-account.json b/vendor/google.golang.org/api/internal/service-account.json
deleted file mode 100644
index 2cb54c2..0000000
--- a/vendor/google.golang.org/api/internal/service-account.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "type": "service_account",
- "project_id": "project_id",
- "private_key_id": "private_key_id",
- "private_key": "private_key",
- "client_email": "xyz@developer.gserviceaccount.com",
- "client_id": "123",
- "auth_uri": "https://accounts.google.com/o/oauth2/auth",
- "token_uri": "https://accounts.google.com/o/oauth2/token",
- "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
- "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/xyz%40developer.gserviceaccount.com"
-}
diff --git a/vendor/google.golang.org/api/internal/settings.go b/vendor/google.golang.org/api/internal/settings.go
deleted file mode 100644
index 34dfa5a..0000000
--- a/vendor/google.golang.org/api/internal/settings.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2017 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 supports the options and transport packages.
-package internal
-
-import (
- "errors"
- "net/http"
-
- "golang.org/x/oauth2"
- "golang.org/x/oauth2/google"
- "google.golang.org/grpc"
-)
-
-// DialSettings holds information needed to establish a connection with a
-// Google API service.
-type DialSettings struct {
- Endpoint string
- Scopes []string
- TokenSource oauth2.TokenSource
- Credentials *google.DefaultCredentials
- CredentialsFile string // if set, Token Source is ignored.
- UserAgent string
- APIKey string
- HTTPClient *http.Client
- GRPCDialOpts []grpc.DialOption
- GRPCConn *grpc.ClientConn
- NoAuth bool
-}
-
-// Validate reports an error if ds is invalid.
-func (ds *DialSettings) Validate() error {
- hasCreds := ds.APIKey != "" || ds.TokenSource != nil || ds.CredentialsFile != "" || ds.Credentials != nil
- if ds.NoAuth && hasCreds {
- return errors.New("options.WithoutAuthentication is incompatible with any option that provides credentials")
- }
- // Credentials should not appear with other options.
- // We currently allow TokenSource and CredentialsFile to coexist.
- // TODO(jba): make TokenSource & CredentialsFile an error (breaking change).
- if ds.Credentials != nil && (ds.APIKey != "" || ds.TokenSource != nil || ds.CredentialsFile != "") {
- return errors.New("multiple credential options provided")
- }
- if ds.HTTPClient != nil && ds.GRPCConn != nil {
- return errors.New("WithHTTPClient is incompatible with WithGRPCConn")
- }
- if ds.HTTPClient != nil && ds.GRPCDialOpts != nil {
- return errors.New("WithHTTPClient is incompatible with gRPC dial options")
- }
- return nil
-}
diff --git a/vendor/google.golang.org/api/iterator/iterator.go b/vendor/google.golang.org/api/iterator/iterator.go
deleted file mode 100644
index e34e520..0000000
--- a/vendor/google.golang.org/api/iterator/iterator.go
+++ /dev/null
@@ -1,231 +0,0 @@
-// 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 returns the number of 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-api.json b/vendor/google.golang.org/api/oauth2/v2/oauth2-api.json
deleted file mode 100644
index 18204dc..0000000
--- a/vendor/google.golang.org/api/oauth2/v2/oauth2-api.json
+++ /dev/null
@@ -1,294 +0,0 @@
-{
- "auth": {
- "oauth2": {
- "scopes": {
- "https://www.googleapis.com/auth/plus.login": {
- "description": "Know the list of people in your circles, your age range, and language"
- },
- "https://www.googleapis.com/auth/plus.me": {
- "description": "Know who you are on Google"
- },
- "https://www.googleapis.com/auth/userinfo.email": {
- "description": "View your email address"
- },
- "https://www.googleapis.com/auth/userinfo.profile": {
- "description": "View your basic profile info"
- }
- }
- }
- },
- "basePath": "/",
- "baseUrl": "https://www.googleapis.com/",
- "batchPath": "batch/oauth2/v2",
- "description": "Obtains end-user authorization grants for use with other Google APIs.",
- "discoveryVersion": "v1",
- "documentationLink": "https://developers.google.com/accounts/docs/OAuth2",
- "etag": "\"Zkyw9ACJZUvcYmlFaKGChzhmtnE/aQYw8bQfY3xIJbtzdw5QvIFJYtI\"",
- "icons": {
- "x16": "https://www.gstatic.com/images/branding/product/1x/googleg_16dp.png",
- "x32": "https://www.gstatic.com/images/branding/product/1x/googleg_32dp.png"
- },
- "id": "oauth2:v2",
- "kind": "discovery#restDescription",
- "methods": {
- "getCertForOpenIdConnect": {
- "httpMethod": "GET",
- "id": "oauth2.getCertForOpenIdConnect",
- "path": "oauth2/v2/certs",
- "response": {
- "$ref": "Jwk"
- }
- },
- "tokeninfo": {
- "httpMethod": "POST",
- "id": "oauth2.tokeninfo",
- "parameters": {
- "access_token": {
- "location": "query",
- "type": "string"
- },
- "id_token": {
- "location": "query",
- "type": "string"
- },
- "token_handle": {
- "location": "query",
- "type": "string"
- }
- },
- "path": "oauth2/v2/tokeninfo",
- "response": {
- "$ref": "Tokeninfo"
- }
- }
- },
- "name": "oauth2",
- "ownerDomain": "google.com",
- "ownerName": "Google",
- "parameters": {
- "alt": {
- "default": "json",
- "description": "Data format for the response.",
- "enum": [
- "json"
- ],
- "enumDescriptions": [
- "Responses with Content-Type of application/json"
- ],
- "location": "query",
- "type": "string"
- },
- "fields": {
- "description": "Selector specifying which fields to include in a partial response.",
- "location": "query",
- "type": "string"
- },
- "key": {
- "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
- "location": "query",
- "type": "string"
- },
- "oauth_token": {
- "description": "OAuth 2.0 token for the current user.",
- "location": "query",
- "type": "string"
- },
- "prettyPrint": {
- "default": "true",
- "description": "Returns response with indentations and line breaks.",
- "location": "query",
- "type": "boolean"
- },
- "quotaUser": {
- "description": "An opaque string that represents a user for quota purposes. Must not exceed 40 characters.",
- "location": "query",
- "type": "string"
- },
- "userIp": {
- "description": "Deprecated. Please use quotaUser instead.",
- "location": "query",
- "type": "string"
- }
- },
- "protocol": "rest",
- "resources": {
- "userinfo": {
- "methods": {
- "get": {
- "httpMethod": "GET",
- "id": "oauth2.userinfo.get",
- "path": "oauth2/v2/userinfo",
- "response": {
- "$ref": "Userinfoplus"
- },
- "scopes": [
- "https://www.googleapis.com/auth/plus.login",
- "https://www.googleapis.com/auth/plus.me",
- "https://www.googleapis.com/auth/userinfo.email",
- "https://www.googleapis.com/auth/userinfo.profile"
- ]
- }
- },
- "resources": {
- "v2": {
- "resources": {
- "me": {
- "methods": {
- "get": {
- "httpMethod": "GET",
- "id": "oauth2.userinfo.v2.me.get",
- "path": "userinfo/v2/me",
- "response": {
- "$ref": "Userinfoplus"
- },
- "scopes": [
- "https://www.googleapis.com/auth/plus.login",
- "https://www.googleapis.com/auth/plus.me",
- "https://www.googleapis.com/auth/userinfo.email",
- "https://www.googleapis.com/auth/userinfo.profile"
- ]
- }
- }
- }
- }
- }
- }
- }
- },
- "revision": "20180208",
- "rootUrl": "https://www.googleapis.com/",
- "schemas": {
- "Jwk": {
- "id": "Jwk",
- "properties": {
- "keys": {
- "items": {
- "properties": {
- "alg": {
- "default": "RS256",
- "type": "string"
- },
- "e": {
- "type": "string"
- },
- "kid": {
- "type": "string"
- },
- "kty": {
- "default": "RSA",
- "type": "string"
- },
- "n": {
- "type": "string"
- },
- "use": {
- "default": "sig",
- "type": "string"
- }
- },
- "type": "object"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "Tokeninfo": {
- "id": "Tokeninfo",
- "properties": {
- "access_type": {
- "description": "The access type granted with this token. It can be offline or online.",
- "type": "string"
- },
- "audience": {
- "description": "Who is the intended audience for this token. In general the same as issued_to.",
- "type": "string"
- },
- "email": {
- "description": "The email address of the user. Present only if the email scope is present in the request.",
- "type": "string"
- },
- "expires_in": {
- "description": "The expiry time of the token, as number of seconds left until expiry.",
- "format": "int32",
- "type": "integer"
- },
- "issued_to": {
- "description": "To whom was the token issued to. In general the same as audience.",
- "type": "string"
- },
- "scope": {
- "description": "The space separated list of scopes granted to this token.",
- "type": "string"
- },
- "token_handle": {
- "description": "The token handle associated with this token.",
- "type": "string"
- },
- "user_id": {
- "description": "The obfuscated user id.",
- "type": "string"
- },
- "verified_email": {
- "description": "Boolean flag which is true if the email address is verified. Present only if the email scope is present in the request.",
- "type": "boolean"
- }
- },
- "type": "object"
- },
- "Userinfoplus": {
- "id": "Userinfoplus",
- "properties": {
- "email": {
- "description": "The user's email address.",
- "type": "string"
- },
- "family_name": {
- "description": "The user's last name.",
- "type": "string"
- },
- "gender": {
- "description": "The user's gender.",
- "type": "string"
- },
- "given_name": {
- "description": "The user's first name.",
- "type": "string"
- },
- "hd": {
- "description": "The hosted domain e.g. example.com if the user is Google apps user.",
- "type": "string"
- },
- "id": {
- "description": "The obfuscated ID of the user.",
- "type": "string"
- },
- "link": {
- "description": "URL of the profile page.",
- "type": "string"
- },
- "locale": {
- "description": "The user's preferred locale.",
- "type": "string"
- },
- "name": {
- "description": "The user's full name.",
- "type": "string"
- },
- "picture": {
- "description": "URL of the user's picture image.",
- "type": "string"
- },
- "verified_email": {
- "default": "true",
- "description": "Boolean flag which is true if the email address is verified. Always verified because we only return the user's primary email address.",
- "type": "boolean"
- }
- },
- "type": "object"
- }
- },
- "servicePath": "",
- "title": "Google OAuth2 API",
- "version": "v2"
-} \ No newline at end of file
diff --git a/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go b/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go
deleted file mode 100644
index 68c54ee..0000000
--- a/vendor/google.golang.org/api/oauth2/v2/oauth2-gen.go
+++ /dev/null
@@ -1,809 +0,0 @@
-// Package oauth2 provides access to the Google OAuth2 API.
-//
-// See https://developers.google.com/accounts/docs/OAuth2
-//
-// Usage example:
-//
-// import "google.golang.org/api/oauth2/v2"
-// ...
-// oauth2Service, err := oauth2.New(oauthHttpClient)
-package oauth2 // import "google.golang.org/api/oauth2/v2"
-
-import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- context "golang.org/x/net/context"
- ctxhttp "golang.org/x/net/context/ctxhttp"
- gensupport "google.golang.org/api/gensupport"
- googleapi "google.golang.org/api/googleapi"
- "io"
- "net/http"
- "net/url"
- "strconv"
- "strings"
-)
-
-// Always reference these packages, just in case the auto-generated code
-// below doesn't.
-var _ = bytes.NewBuffer
-var _ = strconv.Itoa
-var _ = fmt.Sprintf
-var _ = json.NewDecoder
-var _ = io.Copy
-var _ = url.Parse
-var _ = gensupport.MarshalJSON
-var _ = googleapi.Version
-var _ = errors.New
-var _ = strings.Replace
-var _ = context.Canceled
-var _ = ctxhttp.Do
-
-const apiId = "oauth2:v2"
-const apiName = "oauth2"
-const apiVersion = "v2"
-const basePath = "https://www.googleapis.com/"
-
-// OAuth2 scopes used by this API.
-const (
- // Know the list of people in your circles, your age range, and language
- PlusLoginScope = "https://www.googleapis.com/auth/plus.login"
-
- // Know who you are on Google
- PlusMeScope = "https://www.googleapis.com/auth/plus.me"
-
- // View your email address
- UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
-
- // View your basic profile info
- UserinfoProfileScope = "https://www.googleapis.com/auth/userinfo.profile"
-)
-
-func New(client *http.Client) (*Service, error) {
- if client == nil {
- return nil, errors.New("client is nil")
- }
- s := &Service{client: client, BasePath: basePath}
- s.Userinfo = NewUserinfoService(s)
- return s, nil
-}
-
-type Service struct {
- client *http.Client
- BasePath string // API endpoint base URL
- UserAgent string // optional additional User-Agent fragment
-
- Userinfo *UserinfoService
-}
-
-func (s *Service) userAgent() string {
- if s.UserAgent == "" {
- return googleapi.UserAgent
- }
- return googleapi.UserAgent + " " + s.UserAgent
-}
-
-func NewUserinfoService(s *Service) *UserinfoService {
- rs := &UserinfoService{s: s}
- rs.V2 = NewUserinfoV2Service(s)
- return rs
-}
-
-type UserinfoService struct {
- s *Service
-
- V2 *UserinfoV2Service
-}
-
-func NewUserinfoV2Service(s *Service) *UserinfoV2Service {
- rs := &UserinfoV2Service{s: s}
- rs.Me = NewUserinfoV2MeService(s)
- return rs
-}
-
-type UserinfoV2Service struct {
- s *Service
-
- Me *UserinfoV2MeService
-}
-
-func NewUserinfoV2MeService(s *Service) *UserinfoV2MeService {
- rs := &UserinfoV2MeService{s: s}
- return rs
-}
-
-type UserinfoV2MeService struct {
- s *Service
-}
-
-type Jwk struct {
- Keys []*JwkKeys `json:"keys,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Keys") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-type JwkKeys struct {
- Alg string `json:"alg,omitempty"`
-
- E string `json:"e,omitempty"`
-
- Kid string `json:"kid,omitempty"`
-
- Kty string `json:"kty,omitempty"`
-
- N string `json:"n,omitempty"`
-
- Use string `json:"use,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Alg") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-type Tokeninfo struct {
- // AccessType: The access type granted with this token. It can be
- // offline or online.
- AccessType string `json:"access_type,omitempty"`
-
- // Audience: Who is the intended audience for this token. In general the
- // same as issued_to.
- Audience string `json:"audience,omitempty"`
-
- // Email: The email address of the user. Present only if the email scope
- // is present in the request.
- Email string `json:"email,omitempty"`
-
- // ExpiresIn: The expiry time of the token, as number of seconds left
- // until expiry.
- ExpiresIn int64 `json:"expires_in,omitempty"`
-
- // IssuedTo: To whom was the token issued to. In general the same as
- // audience.
- IssuedTo string `json:"issued_to,omitempty"`
-
- // Scope: The space separated list of scopes granted to this token.
- Scope string `json:"scope,omitempty"`
-
- // TokenHandle: The token handle associated with this token.
- TokenHandle string `json:"token_handle,omitempty"`
-
- // UserId: The obfuscated user id.
- UserId string `json:"user_id,omitempty"`
-
- // VerifiedEmail: Boolean flag which is true if the email address is
- // verified. Present only if the email scope is present in the request.
- VerifiedEmail bool `json:"verified_email,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "AccessType") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-type Userinfoplus struct {
- // Email: The user's email address.
- Email string `json:"email,omitempty"`
-
- // FamilyName: The user's last name.
- FamilyName string `json:"family_name,omitempty"`
-
- // Gender: The user's gender.
- Gender string `json:"gender,omitempty"`
-
- // GivenName: The user's first name.
- GivenName string `json:"given_name,omitempty"`
-
- // Hd: The hosted domain e.g. example.com if the user is Google apps
- // user.
- Hd string `json:"hd,omitempty"`
-
- // Id: The obfuscated ID of the user.
- Id string `json:"id,omitempty"`
-
- // Link: URL of the profile page.
- Link string `json:"link,omitempty"`
-
- // Locale: The user's preferred locale.
- Locale string `json:"locale,omitempty"`
-
- // Name: The user's full name.
- Name string `json:"name,omitempty"`
-
- // Picture: URL of the user's picture image.
- Picture string `json:"picture,omitempty"`
-
- // VerifiedEmail: Boolean flag which is true if the email address is
- // verified. Always verified because we only return the user's primary
- // email address.
- //
- // Default: true
- VerifiedEmail *bool `json:"verified_email,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Email") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// method id "oauth2.getCertForOpenIdConnect":
-
-type GetCertForOpenIdConnectCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetCertForOpenIdConnect:
-func (s *Service) GetCertForOpenIdConnect() *GetCertForOpenIdConnectCall {
- c := &GetCertForOpenIdConnectCall{s: s, urlParams_: make(gensupport.URLParams)}
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *GetCertForOpenIdConnectCall) Fields(s ...googleapi.Field) *GetCertForOpenIdConnectCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *GetCertForOpenIdConnectCall) IfNoneMatch(entityTag string) *GetCertForOpenIdConnectCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *GetCertForOpenIdConnectCall) Context(ctx context.Context) *GetCertForOpenIdConnectCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *GetCertForOpenIdConnectCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *GetCertForOpenIdConnectCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v2/certs")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "oauth2.getCertForOpenIdConnect" call.
-// Exactly one of *Jwk or error will be non-nil. Any non-2xx status code
-// is an error. Response headers are in either
-// *Jwk.ServerResponse.Header or (if a response was returned at all) in
-// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
-// whether the returned error was because http.StatusNotModified was
-// returned.
-func (c *GetCertForOpenIdConnectCall) Do(opts ...googleapi.CallOption) (*Jwk, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Jwk{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "httpMethod": "GET",
- // "id": "oauth2.getCertForOpenIdConnect",
- // "path": "oauth2/v2/certs",
- // "response": {
- // "$ref": "Jwk"
- // }
- // }
-
-}
-
-// method id "oauth2.tokeninfo":
-
-type TokeninfoCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Tokeninfo:
-func (s *Service) Tokeninfo() *TokeninfoCall {
- c := &TokeninfoCall{s: s, urlParams_: make(gensupport.URLParams)}
- return c
-}
-
-// AccessToken sets the optional parameter "access_token":
-func (c *TokeninfoCall) AccessToken(accessToken string) *TokeninfoCall {
- c.urlParams_.Set("access_token", accessToken)
- return c
-}
-
-// IdToken sets the optional parameter "id_token":
-func (c *TokeninfoCall) IdToken(idToken string) *TokeninfoCall {
- c.urlParams_.Set("id_token", idToken)
- return c
-}
-
-// TokenHandle sets the optional parameter "token_handle":
-func (c *TokeninfoCall) TokenHandle(tokenHandle string) *TokeninfoCall {
- c.urlParams_.Set("token_handle", tokenHandle)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *TokeninfoCall) Fields(s ...googleapi.Field) *TokeninfoCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *TokeninfoCall) Context(ctx context.Context) *TokeninfoCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *TokeninfoCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *TokeninfoCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v2/tokeninfo")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "oauth2.tokeninfo" call.
-// Exactly one of *Tokeninfo or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Tokeninfo.ServerResponse.Header or (if a response was returned at
-// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
-// to check whether the returned error was because
-// http.StatusNotModified was returned.
-func (c *TokeninfoCall) Do(opts ...googleapi.CallOption) (*Tokeninfo, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Tokeninfo{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "httpMethod": "POST",
- // "id": "oauth2.tokeninfo",
- // "parameters": {
- // "access_token": {
- // "location": "query",
- // "type": "string"
- // },
- // "id_token": {
- // "location": "query",
- // "type": "string"
- // },
- // "token_handle": {
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "oauth2/v2/tokeninfo",
- // "response": {
- // "$ref": "Tokeninfo"
- // }
- // }
-
-}
-
-// method id "oauth2.userinfo.get":
-
-type UserinfoGetCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get:
-func (r *UserinfoService) Get() *UserinfoGetCall {
- c := &UserinfoGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *UserinfoGetCall) Fields(s ...googleapi.Field) *UserinfoGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *UserinfoGetCall) IfNoneMatch(entityTag string) *UserinfoGetCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *UserinfoGetCall) Context(ctx context.Context) *UserinfoGetCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *UserinfoGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *UserinfoGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "oauth2/v2/userinfo")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "oauth2.userinfo.get" call.
-// Exactly one of *Userinfoplus or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Userinfoplus.ServerResponse.Header or (if a response was returned at
-// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
-// to check whether the returned error was because
-// http.StatusNotModified was returned.
-func (c *UserinfoGetCall) Do(opts ...googleapi.CallOption) (*Userinfoplus, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Userinfoplus{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "httpMethod": "GET",
- // "id": "oauth2.userinfo.get",
- // "path": "oauth2/v2/userinfo",
- // "response": {
- // "$ref": "Userinfoplus"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/plus.login",
- // "https://www.googleapis.com/auth/plus.me",
- // "https://www.googleapis.com/auth/userinfo.email",
- // "https://www.googleapis.com/auth/userinfo.profile"
- // ]
- // }
-
-}
-
-// method id "oauth2.userinfo.v2.me.get":
-
-type UserinfoV2MeGetCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get:
-func (r *UserinfoV2MeService) Get() *UserinfoV2MeGetCall {
- c := &UserinfoV2MeGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *UserinfoV2MeGetCall) Fields(s ...googleapi.Field) *UserinfoV2MeGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *UserinfoV2MeGetCall) IfNoneMatch(entityTag string) *UserinfoV2MeGetCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *UserinfoV2MeGetCall) Context(ctx context.Context) *UserinfoV2MeGetCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *UserinfoV2MeGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *UserinfoV2MeGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "userinfo/v2/me")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "oauth2.userinfo.v2.me.get" call.
-// Exactly one of *Userinfoplus or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Userinfoplus.ServerResponse.Header or (if a response was returned at
-// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
-// to check whether the returned error was because
-// http.StatusNotModified was returned.
-func (c *UserinfoV2MeGetCall) Do(opts ...googleapi.CallOption) (*Userinfoplus, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Userinfoplus{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "httpMethod": "GET",
- // "id": "oauth2.userinfo.v2.me.get",
- // "path": "userinfo/v2/me",
- // "response": {
- // "$ref": "Userinfoplus"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/plus.login",
- // "https://www.googleapis.com/auth/plus.me",
- // "https://www.googleapis.com/auth/userinfo.email",
- // "https://www.googleapis.com/auth/userinfo.profile"
- // ]
- // }
-
-}
diff --git a/vendor/google.golang.org/api/option/credentials_go19.go b/vendor/google.golang.org/api/option/credentials_go19.go
deleted file mode 100644
index c08c114..0000000
--- a/vendor/google.golang.org/api/option/credentials_go19.go
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2018 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.
-
-// +build go1.9
-
-package option
-
-import (
- "golang.org/x/oauth2/google"
- "google.golang.org/api/internal"
-)
-
-type withCreds google.Credentials
-
-func (w *withCreds) Apply(o *internal.DialSettings) {
- o.Credentials = (*google.Credentials)(w)
-}
-
-func WithCredentials(creds *google.Credentials) ClientOption {
- return (*withCreds)(creds)
-}
diff --git a/vendor/google.golang.org/api/option/credentials_notgo19.go b/vendor/google.golang.org/api/option/credentials_notgo19.go
deleted file mode 100644
index 90d2290..0000000
--- a/vendor/google.golang.org/api/option/credentials_notgo19.go
+++ /dev/null
@@ -1,32 +0,0 @@
-// Copyright 2018 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.
-
-// +build !go1.9
-
-package option
-
-import (
- "golang.org/x/oauth2/google"
- "google.golang.org/api/internal"
-)
-
-type withCreds google.DefaultCredentials
-
-func (w *withCreds) Apply(o *internal.DialSettings) {
- o.Credentials = (*google.DefaultCredentials)(w)
-}
-
-func WithCredentials(creds *google.DefaultCredentials) ClientOption {
- return (*withCreds)(creds)
-}
diff --git a/vendor/google.golang.org/api/option/option.go b/vendor/google.golang.org/api/option/option.go
deleted file mode 100644
index c1499f9..0000000
--- a/vendor/google.golang.org/api/option/option.go
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright 2017 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 option contains options for Google API clients.
-package option
-
-import (
- "net/http"
-
- "golang.org/x/oauth2"
- "google.golang.org/api/internal"
- "google.golang.org/grpc"
-)
-
-// A ClientOption is an option for a Google API client.
-type ClientOption interface {
- Apply(*internal.DialSettings)
-}
-
-// WithTokenSource returns a ClientOption that specifies an OAuth2 token
-// source to be used as the basis for authentication.
-func WithTokenSource(s oauth2.TokenSource) ClientOption {
- return withTokenSource{s}
-}
-
-type withTokenSource struct{ ts oauth2.TokenSource }
-
-func (w withTokenSource) Apply(o *internal.DialSettings) {
- o.TokenSource = w.ts
-}
-
-type withCredFile string
-
-func (w withCredFile) Apply(o *internal.DialSettings) {
- o.CredentialsFile = string(w)
-}
-
-// WithCredentialsFile returns a ClientOption that authenticates
-// API calls with the given service account or refresh token JSON
-// credentials file.
-func WithCredentialsFile(filename string) ClientOption {
- return withCredFile(filename)
-}
-
-// WithServiceAccountFile returns a ClientOption that uses a Google service
-// account credentials file to authenticate.
-//
-// Deprecated: Use WithCredentialsFile instead.
-func WithServiceAccountFile(filename string) ClientOption {
- return WithCredentialsFile(filename)
-}
-
-// WithEndpoint returns a ClientOption that overrides the default endpoint
-// to be used for a service.
-func WithEndpoint(url string) ClientOption {
- return withEndpoint(url)
-}
-
-type withEndpoint string
-
-func (w withEndpoint) Apply(o *internal.DialSettings) {
- o.Endpoint = string(w)
-}
-
-// WithScopes returns a ClientOption that overrides the default OAuth2 scopes
-// to be used for a service.
-func WithScopes(scope ...string) ClientOption {
- return withScopes(scope)
-}
-
-type withScopes []string
-
-func (w withScopes) Apply(o *internal.DialSettings) {
- s := make([]string, len(w))
- copy(s, w)
- o.Scopes = s
-}
-
-// WithUserAgent returns a ClientOption that sets the User-Agent.
-func WithUserAgent(ua string) ClientOption {
- return withUA(ua)
-}
-
-type withUA string
-
-func (w withUA) Apply(o *internal.DialSettings) { o.UserAgent = string(w) }
-
-// WithHTTPClient returns a ClientOption that specifies the HTTP client to use
-// as the basis of communications. This option may only be used with services
-// that support HTTP as their communication transport. When used, the
-// WithHTTPClient option takes precedent over all other supplied options.
-func WithHTTPClient(client *http.Client) ClientOption {
- return withHTTPClient{client}
-}
-
-type withHTTPClient struct{ client *http.Client }
-
-func (w withHTTPClient) Apply(o *internal.DialSettings) {
- o.HTTPClient = w.client
-}
-
-// WithGRPCConn returns a ClientOption that specifies the gRPC client
-// connection to use as the basis of communications. This option many only be
-// used with services that support gRPC as their communication transport. When
-// used, the WithGRPCConn option takes precedent over all other supplied
-// options.
-func WithGRPCConn(conn *grpc.ClientConn) ClientOption {
- return withGRPCConn{conn}
-}
-
-type withGRPCConn struct{ conn *grpc.ClientConn }
-
-func (w withGRPCConn) Apply(o *internal.DialSettings) {
- o.GRPCConn = w.conn
-}
-
-// WithGRPCDialOption returns a ClientOption that appends a new grpc.DialOption
-// to an underlying gRPC dial. It does not work with WithGRPCConn.
-func WithGRPCDialOption(opt grpc.DialOption) ClientOption {
- return withGRPCDialOption{opt}
-}
-
-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))
-}
-
-// WithAPIKey returns a ClientOption that specifies an API key to be used
-// as the basis for authentication.
-//
-// API Keys can only be used for JSON-over-HTTP APIs, including those under
-// the import path google.golang.org/api/....
-func WithAPIKey(apiKey string) ClientOption {
- return withAPIKey(apiKey)
-}
-
-type withAPIKey string
-
-func (w withAPIKey) Apply(o *internal.DialSettings) { o.APIKey = string(w) }
-
-// WithoutAuthentication returns a ClientOption that specifies that no
-// authentication should be used. It is suitable only for testing and for
-// accessing public resources, like public Google Cloud Storage buckets.
-// It is an error to provide both WithoutAuthentication and any of WithAPIKey,
-// WithTokenSource, WithCredentialsFile or WithServiceAccountFile.
-func WithoutAuthentication() ClientOption {
- return withoutAuthentication{}
-}
-
-type withoutAuthentication struct{}
-
-func (w withoutAuthentication) Apply(o *internal.DialSettings) { o.NoAuth = true }
diff --git a/vendor/google.golang.org/api/storage/v1/storage-api.json b/vendor/google.golang.org/api/storage/v1/storage-api.json
deleted file mode 100644
index 7837a66..0000000
--- a/vendor/google.golang.org/api/storage/v1/storage-api.json
+++ /dev/null
@@ -1,3794 +0,0 @@
-{
- "auth": {
- "oauth2": {
- "scopes": {
- "https://www.googleapis.com/auth/cloud-platform": {
- "description": "View and manage your data across Google Cloud Platform services"
- },
- "https://www.googleapis.com/auth/cloud-platform.read-only": {
- "description": "View your data across Google Cloud Platform services"
- },
- "https://www.googleapis.com/auth/devstorage.full_control": {
- "description": "Manage your data and permissions in Google Cloud Storage"
- },
- "https://www.googleapis.com/auth/devstorage.read_only": {
- "description": "View your data in Google Cloud Storage"
- },
- "https://www.googleapis.com/auth/devstorage.read_write": {
- "description": "Manage your data in Google Cloud Storage"
- }
- }
- }
- },
- "basePath": "/storage/v1/",
- "baseUrl": "https://www.googleapis.com/storage/v1/",
- "batchPath": "batch/storage/v1",
- "description": "Stores and retrieves potentially large, immutable data objects.",
- "discoveryVersion": "v1",
- "documentationLink": "https://developers.google.com/storage/docs/json_api/",
- "etag": "\"Zkyw9ACJZUvcYmlFaKGChzhmtnE/naWmFZqBR_Eg7icNmYvZKp3Vbjs\"",
- "icons": {
- "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png",
- "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png"
- },
- "id": "storage:v1",
- "kind": "discovery#restDescription",
- "labels": [
- "labs"
- ],
- "name": "storage",
- "ownerDomain": "google.com",
- "ownerName": "Google",
- "parameters": {
- "alt": {
- "default": "json",
- "description": "Data format for the response.",
- "enum": [
- "json"
- ],
- "enumDescriptions": [
- "Responses with Content-Type of application/json"
- ],
- "location": "query",
- "type": "string"
- },
- "fields": {
- "description": "Selector specifying which fields to include in a partial response.",
- "location": "query",
- "type": "string"
- },
- "key": {
- "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.",
- "location": "query",
- "type": "string"
- },
- "oauth_token": {
- "description": "OAuth 2.0 token for the current user.",
- "location": "query",
- "type": "string"
- },
- "prettyPrint": {
- "default": "true",
- "description": "Returns response with indentations and line breaks.",
- "location": "query",
- "type": "boolean"
- },
- "quotaUser": {
- "description": "An opaque string that represents a user for quota purposes. Must not exceed 40 characters.",
- "location": "query",
- "type": "string"
- },
- "userIp": {
- "description": "Deprecated. Please use quotaUser instead.",
- "location": "query",
- "type": "string"
- }
- },
- "protocol": "rest",
- "resources": {
- "bucketAccessControls": {
- "methods": {
- "delete": {
- "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
- "httpMethod": "DELETE",
- "id": "storage.bucketAccessControls.delete",
- "parameterOrder": [
- "bucket",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/acl/{entity}",
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "get": {
- "description": "Returns the ACL entry for the specified entity on the specified bucket.",
- "httpMethod": "GET",
- "id": "storage.bucketAccessControls.get",
- "parameterOrder": [
- "bucket",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/acl/{entity}",
- "response": {
- "$ref": "BucketAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "insert": {
- "description": "Creates a new ACL entry on the specified bucket.",
- "httpMethod": "POST",
- "id": "storage.bucketAccessControls.insert",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/acl",
- "request": {
- "$ref": "BucketAccessControl"
- },
- "response": {
- "$ref": "BucketAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "list": {
- "description": "Retrieves ACL entries on the specified bucket.",
- "httpMethod": "GET",
- "id": "storage.bucketAccessControls.list",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/acl",
- "response": {
- "$ref": "BucketAccessControls"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "patch": {
- "description": "Patches an ACL entry on the specified bucket.",
- "httpMethod": "PATCH",
- "id": "storage.bucketAccessControls.patch",
- "parameterOrder": [
- "bucket",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/acl/{entity}",
- "request": {
- "$ref": "BucketAccessControl"
- },
- "response": {
- "$ref": "BucketAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "update": {
- "description": "Updates an ACL entry on the specified bucket.",
- "httpMethod": "PUT",
- "id": "storage.bucketAccessControls.update",
- "parameterOrder": [
- "bucket",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/acl/{entity}",
- "request": {
- "$ref": "BucketAccessControl"
- },
- "response": {
- "$ref": "BucketAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- }
- }
- },
- "buckets": {
- "methods": {
- "delete": {
- "description": "Permanently deletes an empty bucket.",
- "httpMethod": "DELETE",
- "id": "storage.buckets.delete",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "If set, only deletes the bucket if its metageneration matches this value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "If set, only deletes the bucket if its metageneration does not match this value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}",
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "get": {
- "description": "Returns metadata for the specified bucket.",
- "httpMethod": "GET",
- "id": "storage.buckets.get",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to noAcl.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit owner, acl and defaultObjectAcl properties."
- ],
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}",
- "response": {
- "$ref": "Bucket"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "getIamPolicy": {
- "description": "Returns an IAM policy for the specified bucket.",
- "httpMethod": "GET",
- "id": "storage.buckets.getIamPolicy",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/iam",
- "response": {
- "$ref": "Policy"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "insert": {
- "description": "Creates a new bucket.",
- "httpMethod": "POST",
- "id": "storage.buckets.insert",
- "parameterOrder": [
- "project"
- ],
- "parameters": {
- "predefinedAcl": {
- "description": "Apply a predefined set of access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "private",
- "projectPrivate",
- "publicRead",
- "publicReadWrite"
- ],
- "enumDescriptions": [
- "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
- "Project team owners get OWNER access.",
- "Project team members get access according to their roles.",
- "Project team owners get OWNER access, and allUsers get READER access.",
- "Project team owners get OWNER access, and allUsers get WRITER access."
- ],
- "location": "query",
- "type": "string"
- },
- "predefinedDefaultObjectAcl": {
- "description": "Apply a predefined set of default object access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query",
- "type": "string"
- },
- "project": {
- "description": "A valid API project identifier.",
- "location": "query",
- "required": true,
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit owner, acl and defaultObjectAcl properties."
- ],
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b",
- "request": {
- "$ref": "Bucket"
- },
- "response": {
- "$ref": "Bucket"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "list": {
- "description": "Retrieves a list of buckets for a given project.",
- "httpMethod": "GET",
- "id": "storage.buckets.list",
- "parameterOrder": [
- "project"
- ],
- "parameters": {
- "maxResults": {
- "default": "1000",
- "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.",
- "format": "uint32",
- "location": "query",
- "minimum": "0",
- "type": "integer"
- },
- "pageToken": {
- "description": "A previously-returned page token representing part of the larger set of results to view.",
- "location": "query",
- "type": "string"
- },
- "prefix": {
- "description": "Filter results to buckets whose names begin with this prefix.",
- "location": "query",
- "type": "string"
- },
- "project": {
- "description": "A valid API project identifier.",
- "location": "query",
- "required": true,
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to noAcl.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit owner, acl and defaultObjectAcl properties."
- ],
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b",
- "response": {
- "$ref": "Buckets"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "lockRetentionPolicy": {
- "description": "Locks retention policy on a bucket.",
- "httpMethod": "POST",
- "id": "storage.buckets.lockRetentionPolicy",
- "parameterOrder": [
- "bucket",
- "ifMetagenerationMatch"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/lockRetentionPolicy",
- "response": {
- "$ref": "Bucket"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "patch": {
- "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. This method supports patch semantics.",
- "httpMethod": "PATCH",
- "id": "storage.buckets.patch",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "predefinedAcl": {
- "description": "Apply a predefined set of access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "private",
- "projectPrivate",
- "publicRead",
- "publicReadWrite"
- ],
- "enumDescriptions": [
- "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
- "Project team owners get OWNER access.",
- "Project team members get access according to their roles.",
- "Project team owners get OWNER access, and allUsers get READER access.",
- "Project team owners get OWNER access, and allUsers get WRITER access."
- ],
- "location": "query",
- "type": "string"
- },
- "predefinedDefaultObjectAcl": {
- "description": "Apply a predefined set of default object access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query",
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit owner, acl and defaultObjectAcl properties."
- ],
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}",
- "request": {
- "$ref": "Bucket"
- },
- "response": {
- "$ref": "Bucket"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "setIamPolicy": {
- "description": "Updates an IAM policy for the specified bucket.",
- "httpMethod": "PUT",
- "id": "storage.buckets.setIamPolicy",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/iam",
- "request": {
- "$ref": "Policy"
- },
- "response": {
- "$ref": "Policy"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "testIamPermissions": {
- "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.",
- "httpMethod": "GET",
- "id": "storage.buckets.testIamPermissions",
- "parameterOrder": [
- "bucket",
- "permissions"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "permissions": {
- "description": "Permissions to test.",
- "location": "query",
- "repeated": true,
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/iam/testPermissions",
- "response": {
- "$ref": "TestIamPermissionsResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "update": {
- "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
- "httpMethod": "PUT",
- "id": "storage.buckets.update",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "predefinedAcl": {
- "description": "Apply a predefined set of access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "private",
- "projectPrivate",
- "publicRead",
- "publicReadWrite"
- ],
- "enumDescriptions": [
- "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
- "Project team owners get OWNER access.",
- "Project team members get access according to their roles.",
- "Project team owners get OWNER access, and allUsers get READER access.",
- "Project team owners get OWNER access, and allUsers get WRITER access."
- ],
- "location": "query",
- "type": "string"
- },
- "predefinedDefaultObjectAcl": {
- "description": "Apply a predefined set of default object access controls to this bucket.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query",
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit owner, acl and defaultObjectAcl properties."
- ],
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}",
- "request": {
- "$ref": "Bucket"
- },
- "response": {
- "$ref": "Bucket"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- }
- }
- },
- "channels": {
- "methods": {
- "stop": {
- "description": "Stop watching resources through this channel",
- "httpMethod": "POST",
- "id": "storage.channels.stop",
- "path": "channels/stop",
- "request": {
- "$ref": "Channel",
- "parameterName": "resource"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- }
- }
- },
- "defaultObjectAccessControls": {
- "methods": {
- "delete": {
- "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
- "httpMethod": "DELETE",
- "id": "storage.defaultObjectAccessControls.delete",
- "parameterOrder": [
- "bucket",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/defaultObjectAcl/{entity}",
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "get": {
- "description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
- "httpMethod": "GET",
- "id": "storage.defaultObjectAccessControls.get",
- "parameterOrder": [
- "bucket",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/defaultObjectAcl/{entity}",
- "response": {
- "$ref": "ObjectAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "insert": {
- "description": "Creates a new default object ACL entry on the specified bucket.",
- "httpMethod": "POST",
- "id": "storage.defaultObjectAccessControls.insert",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/defaultObjectAcl",
- "request": {
- "$ref": "ObjectAccessControl"
- },
- "response": {
- "$ref": "ObjectAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "list": {
- "description": "Retrieves default object ACL entries on the specified bucket.",
- "httpMethod": "GET",
- "id": "storage.defaultObjectAccessControls.list",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/defaultObjectAcl",
- "response": {
- "$ref": "ObjectAccessControls"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "patch": {
- "description": "Patches a default object ACL entry on the specified bucket.",
- "httpMethod": "PATCH",
- "id": "storage.defaultObjectAccessControls.patch",
- "parameterOrder": [
- "bucket",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/defaultObjectAcl/{entity}",
- "request": {
- "$ref": "ObjectAccessControl"
- },
- "response": {
- "$ref": "ObjectAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "update": {
- "description": "Updates a default object ACL entry on the specified bucket.",
- "httpMethod": "PUT",
- "id": "storage.defaultObjectAccessControls.update",
- "parameterOrder": [
- "bucket",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/defaultObjectAcl/{entity}",
- "request": {
- "$ref": "ObjectAccessControl"
- },
- "response": {
- "$ref": "ObjectAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- }
- }
- },
- "notifications": {
- "methods": {
- "delete": {
- "description": "Permanently deletes a notification subscription.",
- "httpMethod": "DELETE",
- "id": "storage.notifications.delete",
- "parameterOrder": [
- "bucket",
- "notification"
- ],
- "parameters": {
- "bucket": {
- "description": "The parent bucket of the notification.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "notification": {
- "description": "ID of the notification to delete.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/notificationConfigs/{notification}",
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "get": {
- "description": "View a notification configuration.",
- "httpMethod": "GET",
- "id": "storage.notifications.get",
- "parameterOrder": [
- "bucket",
- "notification"
- ],
- "parameters": {
- "bucket": {
- "description": "The parent bucket of the notification.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "notification": {
- "description": "Notification ID",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/notificationConfigs/{notification}",
- "response": {
- "$ref": "Notification"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "insert": {
- "description": "Creates a notification subscription for a given bucket.",
- "httpMethod": "POST",
- "id": "storage.notifications.insert",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "The parent bucket of the notification.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/notificationConfigs",
- "request": {
- "$ref": "Notification"
- },
- "response": {
- "$ref": "Notification"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "list": {
- "description": "Retrieves a list of notification subscriptions for a given bucket.",
- "httpMethod": "GET",
- "id": "storage.notifications.list",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a Google Cloud Storage bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/notificationConfigs",
- "response": {
- "$ref": "Notifications"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- }
- }
- },
- "objectAccessControls": {
- "methods": {
- "delete": {
- "description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
- "httpMethod": "DELETE",
- "id": "storage.objectAccessControls.delete",
- "parameterOrder": [
- "bucket",
- "object",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}/acl/{entity}",
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "get": {
- "description": "Returns the ACL entry for the specified entity on the specified object.",
- "httpMethod": "GET",
- "id": "storage.objectAccessControls.get",
- "parameterOrder": [
- "bucket",
- "object",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}/acl/{entity}",
- "response": {
- "$ref": "ObjectAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "insert": {
- "description": "Creates a new ACL entry on the specified object.",
- "httpMethod": "POST",
- "id": "storage.objectAccessControls.insert",
- "parameterOrder": [
- "bucket",
- "object"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}/acl",
- "request": {
- "$ref": "ObjectAccessControl"
- },
- "response": {
- "$ref": "ObjectAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "list": {
- "description": "Retrieves ACL entries on the specified object.",
- "httpMethod": "GET",
- "id": "storage.objectAccessControls.list",
- "parameterOrder": [
- "bucket",
- "object"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}/acl",
- "response": {
- "$ref": "ObjectAccessControls"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "patch": {
- "description": "Patches an ACL entry on the specified object.",
- "httpMethod": "PATCH",
- "id": "storage.objectAccessControls.patch",
- "parameterOrder": [
- "bucket",
- "object",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}/acl/{entity}",
- "request": {
- "$ref": "ObjectAccessControl"
- },
- "response": {
- "$ref": "ObjectAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "update": {
- "description": "Updates an ACL entry on the specified object.",
- "httpMethod": "PUT",
- "id": "storage.objectAccessControls.update",
- "parameterOrder": [
- "bucket",
- "object",
- "entity"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of a bucket.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "entity": {
- "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}/acl/{entity}",
- "request": {
- "$ref": "ObjectAccessControl"
- },
- "response": {
- "$ref": "ObjectAccessControl"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- }
- }
- },
- "objects": {
- "methods": {
- "compose": {
- "description": "Concatenates a list of existing objects into a new object in the same bucket.",
- "httpMethod": "POST",
- "id": "storage.objects.compose",
- "parameterOrder": [
- "destinationBucket",
- "destinationObject"
- ],
- "parameters": {
- "destinationBucket": {
- "description": "Name of the bucket in which to store the new object.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "destinationObject": {
- "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "destinationPredefinedAcl": {
- "description": "Apply a predefined set of access controls to the destination object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query",
- "type": "string"
- },
- "ifGenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "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"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{destinationBucket}/o/{destinationObject}/compose",
- "request": {
- "$ref": "ComposeRequest"
- },
- "response": {
- "$ref": "Object"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "copy": {
- "description": "Copies a source object to a destination object. Optionally overrides metadata.",
- "httpMethod": "POST",
- "id": "storage.objects.copy",
- "parameterOrder": [
- "sourceBucket",
- "sourceObject",
- "destinationBucket",
- "destinationObject"
- ],
- "parameters": {
- "destinationBucket": {
- "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "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.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "destinationPredefinedAcl": {
- "description": "Apply a predefined set of access controls to the destination object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query",
- "type": "string"
- },
- "ifGenerationMatch": {
- "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifGenerationNotMatch": {
- "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifSourceGenerationMatch": {
- "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifSourceGenerationNotMatch": {
- "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifSourceMetagenerationMatch": {
- "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifSourceMetagenerationNotMatch": {
- "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query",
- "type": "string"
- },
- "sourceBucket": {
- "description": "Name of the bucket in which to find the source object.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "sourceGeneration": {
- "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "sourceObject": {
- "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
- "request": {
- "$ref": "Object"
- },
- "response": {
- "$ref": "Object"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "delete": {
- "description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.",
- "httpMethod": "DELETE",
- "id": "storage.objects.delete",
- "parameterOrder": [
- "bucket",
- "object"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of the bucket in which the object resides.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifGenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifGenerationNotMatch": {
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}",
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "get": {
- "description": "Retrieves an object or its metadata.",
- "httpMethod": "GET",
- "id": "storage.objects.get",
- "parameterOrder": [
- "bucket",
- "object"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of the bucket in which the object resides.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifGenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifGenerationNotMatch": {
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to noAcl.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}",
- "response": {
- "$ref": "Object"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ],
- "supportsMediaDownload": true,
- "useMediaDownloadService": true
- },
- "getIamPolicy": {
- "description": "Returns an IAM policy for the specified object.",
- "httpMethod": "GET",
- "id": "storage.objects.getIamPolicy",
- "parameterOrder": [
- "bucket",
- "object"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of the bucket in which the object resides.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}/iam",
- "response": {
- "$ref": "Policy"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "insert": {
- "description": "Stores a new object and metadata.",
- "httpMethod": "POST",
- "id": "storage.objects.insert",
- "mediaUpload": {
- "accept": [
- "*/*"
- ],
- "protocols": {
- "resumable": {
- "multipart": true,
- "path": "/resumable/upload/storage/v1/b/{bucket}/o"
- },
- "simple": {
- "multipart": true,
- "path": "/upload/storage/v1/b/{bucket}/o"
- }
- }
- },
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "contentEncoding": {
- "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.",
- "location": "query",
- "type": "string"
- },
- "ifGenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifGenerationNotMatch": {
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- "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. Limited availability; usable only by enabled projects.",
- "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",
- "type": "string"
- },
- "predefinedAcl": {
- "description": "Apply a predefined set of access controls to this object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query",
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o",
- "request": {
- "$ref": "Object"
- },
- "response": {
- "$ref": "Object"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ],
- "supportsMediaUpload": true
- },
- "list": {
- "description": "Retrieves a list of objects matching the criteria.",
- "httpMethod": "GET",
- "id": "storage.objects.list",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of the bucket in which to look for objects.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "delimiter": {
- "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
- "location": "query",
- "type": "string"
- },
- "includeTrailingDelimiter": {
- "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
- "location": "query",
- "type": "boolean"
- },
- "maxResults": {
- "default": "1000",
- "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
- "format": "uint32",
- "location": "query",
- "minimum": "0",
- "type": "integer"
- },
- "pageToken": {
- "description": "A previously-returned page token representing part of the larger set of results to view.",
- "location": "query",
- "type": "string"
- },
- "prefix": {
- "description": "Filter results to objects whose names begin with this prefix.",
- "location": "query",
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to noAcl.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- },
- "versions": {
- "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
- "location": "query",
- "type": "boolean"
- }
- },
- "path": "b/{bucket}/o",
- "response": {
- "$ref": "Objects"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ],
- "supportsSubscription": true
- },
- "patch": {
- "description": "Patches an object's metadata.",
- "httpMethod": "PATCH",
- "id": "storage.objects.patch",
- "parameterOrder": [
- "bucket",
- "object"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of the bucket in which the object resides.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifGenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifGenerationNotMatch": {
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "predefinedAcl": {
- "description": "Apply a predefined set of access controls to this object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query",
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request, for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}",
- "request": {
- "$ref": "Object"
- },
- "response": {
- "$ref": "Object"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "rewrite": {
- "description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
- "httpMethod": "POST",
- "id": "storage.objects.rewrite",
- "parameterOrder": [
- "sourceBucket",
- "sourceObject",
- "destinationBucket",
- "destinationObject"
- ],
- "parameters": {
- "destinationBucket": {
- "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
- "location": "path",
- "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",
- "required": true,
- "type": "string"
- },
- "destinationPredefinedAcl": {
- "description": "Apply a predefined set of access controls to the destination object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query",
- "type": "string"
- },
- "ifGenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifGenerationNotMatch": {
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifSourceGenerationMatch": {
- "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifSourceGenerationNotMatch": {
- "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifSourceMetagenerationMatch": {
- "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifSourceMetagenerationNotMatch": {
- "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "maxBytesRewrittenPerCall": {
- "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query",
- "type": "string"
- },
- "rewriteToken": {
- "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.",
- "location": "query",
- "type": "string"
- },
- "sourceBucket": {
- "description": "Name of the bucket in which to find the source object.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "sourceGeneration": {
- "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "sourceObject": {
- "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
- "request": {
- "$ref": "Object"
- },
- "response": {
- "$ref": "RewriteResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "setIamPolicy": {
- "description": "Updates an IAM policy for the specified object.",
- "httpMethod": "PUT",
- "id": "storage.objects.setIamPolicy",
- "parameterOrder": [
- "bucket",
- "object"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of the bucket in which the object resides.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}/iam",
- "request": {
- "$ref": "Policy"
- },
- "response": {
- "$ref": "Policy"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "testIamPermissions": {
- "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.",
- "httpMethod": "GET",
- "id": "storage.objects.testIamPermissions",
- "parameterOrder": [
- "bucket",
- "object",
- "permissions"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of the bucket in which the object resides.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "permissions": {
- "description": "Permissions to test.",
- "location": "query",
- "repeated": true,
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}/iam/testPermissions",
- "response": {
- "$ref": "TestIamPermissionsResponse"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- },
- "update": {
- "description": "Updates an object's metadata.",
- "httpMethod": "PUT",
- "id": "storage.objects.update",
- "parameterOrder": [
- "bucket",
- "object"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of the bucket in which the object resides.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "generation": {
- "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifGenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifGenerationNotMatch": {
- "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationMatch": {
- "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "ifMetagenerationNotMatch": {
- "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- "format": "int64",
- "location": "query",
- "type": "string"
- },
- "object": {
- "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "predefinedAcl": {
- "description": "Apply a predefined set of access controls to this object.",
- "enum": [
- "authenticatedRead",
- "bucketOwnerFullControl",
- "bucketOwnerRead",
- "private",
- "projectPrivate",
- "publicRead"
- ],
- "enumDescriptions": [
- "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- "Object owner gets OWNER access, and project team owners get OWNER access.",
- "Object owner gets OWNER access, and project team owners get READER access.",
- "Object owner gets OWNER access.",
- "Object owner gets OWNER access, and project team members get access according to their roles.",
- "Object owner gets OWNER access, and allUsers get READER access."
- ],
- "location": "query",
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to full.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "b/{bucket}/o/{object}",
- "request": {
- "$ref": "Object"
- },
- "response": {
- "$ref": "Object"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/devstorage.full_control"
- ]
- },
- "watchAll": {
- "description": "Watch for changes on all objects in a bucket.",
- "httpMethod": "POST",
- "id": "storage.objects.watchAll",
- "parameterOrder": [
- "bucket"
- ],
- "parameters": {
- "bucket": {
- "description": "Name of the bucket in which to look for objects.",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "delimiter": {
- "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
- "location": "query",
- "type": "string"
- },
- "includeTrailingDelimiter": {
- "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
- "location": "query",
- "type": "boolean"
- },
- "maxResults": {
- "default": "1000",
- "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
- "format": "uint32",
- "location": "query",
- "minimum": "0",
- "type": "integer"
- },
- "pageToken": {
- "description": "A previously-returned page token representing part of the larger set of results to view.",
- "location": "query",
- "type": "string"
- },
- "prefix": {
- "description": "Filter results to objects whose names begin with this prefix.",
- "location": "query",
- "type": "string"
- },
- "projection": {
- "description": "Set of properties to return. Defaults to noAcl.",
- "enum": [
- "full",
- "noAcl"
- ],
- "enumDescriptions": [
- "Include all properties.",
- "Omit the owner, acl property."
- ],
- "location": "query",
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- "location": "query",
- "type": "string"
- },
- "versions": {
- "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
- "location": "query",
- "type": "boolean"
- }
- },
- "path": "b/{bucket}/o/watch",
- "request": {
- "$ref": "Channel",
- "parameterName": "resource"
- },
- "response": {
- "$ref": "Channel"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ],
- "supportsSubscription": true
- }
- }
- },
- "projects": {
- "resources": {
- "serviceAccount": {
- "methods": {
- "get": {
- "description": "Get the email address of this project's Google Cloud Storage service account.",
- "httpMethod": "GET",
- "id": "storage.projects.serviceAccount.get",
- "parameterOrder": [
- "projectId"
- ],
- "parameters": {
- "projectId": {
- "description": "Project ID",
- "location": "path",
- "required": true,
- "type": "string"
- },
- "userProject": {
- "description": "The project to be billed for this request.",
- "location": "query",
- "type": "string"
- }
- },
- "path": "projects/{projectId}/serviceAccount",
- "response": {
- "$ref": "ServiceAccount"
- },
- "scopes": [
- "https://www.googleapis.com/auth/cloud-platform",
- "https://www.googleapis.com/auth/cloud-platform.read-only",
- "https://www.googleapis.com/auth/devstorage.full_control",
- "https://www.googleapis.com/auth/devstorage.read_only",
- "https://www.googleapis.com/auth/devstorage.read_write"
- ]
- }
- }
- }
- }
- }
- },
- "revision": "20180518",
- "rootUrl": "https://www.googleapis.com/",
- "schemas": {
- "Bucket": {
- "description": "A bucket.",
- "id": "Bucket",
- "properties": {
- "acl": {
- "annotations": {
- "required": [
- "storage.buckets.update"
- ]
- },
- "description": "Access controls on the bucket.",
- "items": {
- "$ref": "BucketAccessControl"
- },
- "type": "array"
- },
- "billing": {
- "description": "The bucket's billing configuration.",
- "properties": {
- "requesterPays": {
- "description": "When set to true, Requester Pays is enabled for this bucket.",
- "type": "boolean"
- }
- },
- "type": "object"
- },
- "cors": {
- "description": "The bucket's Cross-Origin Resource Sharing (CORS) configuration.",
- "items": {
- "properties": {
- "maxAgeSeconds": {
- "description": "The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.",
- "format": "int32",
- "type": "integer"
- },
- "method": {
- "description": "The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: \"*\" is permitted in the list of methods, and means \"any method\".",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "origin": {
- "description": "The list of Origins eligible to receive CORS response headers. Note: \"*\" is permitted in the list of origins, and means \"any Origin\".",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "responseHeader": {
- "description": "The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "type": "array"
- },
- "defaultEventBasedHold": {
- "description": "The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed.",
- "type": "boolean"
- },
- "defaultObjectAcl": {
- "description": "Default access controls to apply to new objects when no ACL is provided.",
- "items": {
- "$ref": "ObjectAccessControl"
- },
- "type": "array"
- },
- "encryption": {
- "description": "Encryption configuration for a bucket.",
- "properties": {
- "defaultKmsKeyName": {
- "description": "A Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "etag": {
- "description": "HTTP 1.1 Entity tag for the bucket.",
- "type": "string"
- },
- "id": {
- "description": "The ID of the bucket. For buckets, the id and name properties are the same.",
- "type": "string"
- },
- "kind": {
- "default": "storage#bucket",
- "description": "The kind of item this is. For buckets, this is always storage#bucket.",
- "type": "string"
- },
- "labels": {
- "additionalProperties": {
- "description": "An individual label entry.",
- "type": "string"
- },
- "description": "User-provided labels, in key/value pairs.",
- "type": "object"
- },
- "lifecycle": {
- "description": "The bucket's lifecycle configuration. See lifecycle management for more information.",
- "properties": {
- "rule": {
- "description": "A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.",
- "items": {
- "properties": {
- "action": {
- "description": "The action to take.",
- "properties": {
- "storageClass": {
- "description": "Target storage class. Required iff the type of the action is SetStorageClass.",
- "type": "string"
- },
- "type": {
- "description": "Type of the action. Currently, only Delete and SetStorageClass are supported.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "condition": {
- "description": "The condition(s) under which the action will be taken.",
- "properties": {
- "age": {
- "description": "Age of an object (in days). This condition is satisfied when an object reaches the specified age.",
- "format": "int32",
- "type": "integer"
- },
- "createdBefore": {
- "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when an object is created before midnight of the specified date in UTC.",
- "format": "date",
- "type": "string"
- },
- "isLive": {
- "description": "Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects.",
- "type": "boolean"
- },
- "matchesStorageClass": {
- "description": "Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "numNewerVersions": {
- "description": "Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.",
- "format": "int32",
- "type": "integer"
- }
- },
- "type": "object"
- }
- },
- "type": "object"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "location": {
- "description": "The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list.",
- "type": "string"
- },
- "logging": {
- "description": "The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.",
- "properties": {
- "logBucket": {
- "description": "The destination bucket where the current bucket's logs should be placed.",
- "type": "string"
- },
- "logObjectPrefix": {
- "description": "A prefix for log object names.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "metageneration": {
- "description": "The metadata generation of this bucket.",
- "format": "int64",
- "type": "string"
- },
- "name": {
- "annotations": {
- "required": [
- "storage.buckets.insert"
- ]
- },
- "description": "The name of the bucket.",
- "type": "string"
- },
- "owner": {
- "description": "The owner of the bucket. This is always the project team's owner group.",
- "properties": {
- "entity": {
- "description": "The entity, in the form project-owner-projectId.",
- "type": "string"
- },
- "entityId": {
- "description": "The ID for the entity.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "projectNumber": {
- "description": "The project number of the project the bucket belongs to.",
- "format": "uint64",
- "type": "string"
- },
- "retentionPolicy": {
- "description": "The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.",
- "properties": {
- "effectiveTime": {
- "description": "Server-determined value that indicates the time from which policy was enforced and effective. This value is in RFC 3339 format.",
- "format": "date-time",
- "type": "string"
- },
- "isLocked": {
- "description": "Once locked, an object retention policy cannot be modified.",
- "type": "boolean"
- },
- "retentionPeriod": {
- "description": "The duration in seconds that objects need to be retained. Retention duration must be greater than zero and less than 100 years. Note that enforcement of retention periods less than a day is not guaranteed. Such periods should only be used for testing purposes.",
- "format": "int64",
- "type": "string"
- }
- },
- "type": "object"
- },
- "selfLink": {
- "description": "The URI of this bucket.",
- "type": "string"
- },
- "storageClass": {
- "description": "The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes.",
- "type": "string"
- },
- "timeCreated": {
- "description": "The creation time of the bucket in RFC 3339 format.",
- "format": "date-time",
- "type": "string"
- },
- "updated": {
- "description": "The modification time of the bucket in RFC 3339 format.",
- "format": "date-time",
- "type": "string"
- },
- "versioning": {
- "description": "The bucket's versioning configuration.",
- "properties": {
- "enabled": {
- "description": "While set to true, versioning is fully enabled for this bucket.",
- "type": "boolean"
- }
- },
- "type": "object"
- },
- "website": {
- "description": "The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information.",
- "properties": {
- "mainPageSuffix": {
- "description": "If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages.",
- "type": "string"
- },
- "notFoundPage": {
- "description": "If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result.",
- "type": "string"
- }
- },
- "type": "object"
- }
- },
- "type": "object"
- },
- "BucketAccessControl": {
- "description": "An access-control entry.",
- "id": "BucketAccessControl",
- "properties": {
- "bucket": {
- "description": "The name of the bucket.",
- "type": "string"
- },
- "domain": {
- "description": "The domain associated with the entity, if any.",
- "type": "string"
- },
- "email": {
- "description": "The email address associated with the entity, if any.",
- "type": "string"
- },
- "entity": {
- "annotations": {
- "required": [
- "storage.bucketAccessControls.insert"
- ]
- },
- "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.",
- "type": "string"
- },
- "entityId": {
- "description": "The ID for the entity, if any.",
- "type": "string"
- },
- "etag": {
- "description": "HTTP 1.1 Entity tag for the access-control entry.",
- "type": "string"
- },
- "id": {
- "description": "The ID of the access-control entry.",
- "type": "string"
- },
- "kind": {
- "default": "storage#bucketAccessControl",
- "description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.",
- "type": "string"
- },
- "projectTeam": {
- "description": "The project team associated with the entity, if any.",
- "properties": {
- "projectNumber": {
- "description": "The project number.",
- "type": "string"
- },
- "team": {
- "description": "The team.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "role": {
- "annotations": {
- "required": [
- "storage.bucketAccessControls.insert"
- ]
- },
- "description": "The access permission for the entity.",
- "type": "string"
- },
- "selfLink": {
- "description": "The link to this access-control entry.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "BucketAccessControls": {
- "description": "An access-control list.",
- "id": "BucketAccessControls",
- "properties": {
- "items": {
- "description": "The list of items.",
- "items": {
- "$ref": "BucketAccessControl"
- },
- "type": "array"
- },
- "kind": {
- "default": "storage#bucketAccessControls",
- "description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "Buckets": {
- "description": "A list of buckets.",
- "id": "Buckets",
- "properties": {
- "items": {
- "description": "The list of items.",
- "items": {
- "$ref": "Bucket"
- },
- "type": "array"
- },
- "kind": {
- "default": "storage#buckets",
- "description": "The kind of item this is. For lists of buckets, this is always storage#buckets.",
- "type": "string"
- },
- "nextPageToken": {
- "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "Channel": {
- "description": "An notification channel used to watch for resource changes.",
- "id": "Channel",
- "properties": {
- "address": {
- "description": "The address where notifications are delivered for this channel.",
- "type": "string"
- },
- "expiration": {
- "description": "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.",
- "format": "int64",
- "type": "string"
- },
- "id": {
- "description": "A UUID or similar unique string that identifies this channel.",
- "type": "string"
- },
- "kind": {
- "default": "api#channel",
- "description": "Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string \"api#channel\".",
- "type": "string"
- },
- "params": {
- "additionalProperties": {
- "description": "Declares a new parameter by name.",
- "type": "string"
- },
- "description": "Additional parameters controlling delivery channel behavior. Optional.",
- "type": "object"
- },
- "payload": {
- "description": "A Boolean value to indicate whether payload is wanted. Optional.",
- "type": "boolean"
- },
- "resourceId": {
- "description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions.",
- "type": "string"
- },
- "resourceUri": {
- "description": "A version-specific identifier for the watched resource.",
- "type": "string"
- },
- "token": {
- "description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional.",
- "type": "string"
- },
- "type": {
- "description": "The type of delivery mechanism used for this channel.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ComposeRequest": {
- "description": "A Compose request.",
- "id": "ComposeRequest",
- "properties": {
- "destination": {
- "$ref": "Object",
- "description": "Properties of the resulting object."
- },
- "kind": {
- "default": "storage#composeRequest",
- "description": "The kind of item this is.",
- "type": "string"
- },
- "sourceObjects": {
- "annotations": {
- "required": [
- "storage.objects.compose"
- ]
- },
- "description": "The list of source objects that will be concatenated into a single object.",
- "items": {
- "properties": {
- "generation": {
- "description": "The generation of this object to use as the source.",
- "format": "int64",
- "type": "string"
- },
- "name": {
- "annotations": {
- "required": [
- "storage.objects.compose"
- ]
- },
- "description": "The source object's name. The source object's bucket is implicitly the destination bucket.",
- "type": "string"
- },
- "objectPreconditions": {
- "description": "Conditions that must be met for this operation to execute.",
- "properties": {
- "ifGenerationMatch": {
- "description": "Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.",
- "format": "int64",
- "type": "string"
- }
- },
- "type": "object"
- }
- },
- "type": "object"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "Notification": {
- "description": "A subscription to receive Google PubSub notifications.",
- "id": "Notification",
- "properties": {
- "custom_attributes": {
- "additionalProperties": {
- "type": "string"
- },
- "description": "An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.",
- "type": "object"
- },
- "etag": {
- "description": "HTTP 1.1 Entity tag for this subscription notification.",
- "type": "string"
- },
- "event_types": {
- "description": "If present, only send notifications about listed event types. If empty, sent notifications for all event types.",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "id": {
- "description": "The ID of the notification.",
- "type": "string"
- },
- "kind": {
- "default": "storage#notification",
- "description": "The kind of item this is. For notifications, this is always storage#notification.",
- "type": "string"
- },
- "object_name_prefix": {
- "description": "If present, only apply this notification configuration to object names that begin with this prefix.",
- "type": "string"
- },
- "payload_format": {
- "annotations": {
- "required": [
- "storage.notifications.insert"
- ]
- },
- "default": "JSON_API_V1",
- "description": "The desired content of the Payload.",
- "type": "string"
- },
- "selfLink": {
- "description": "The canonical URL of this notification.",
- "type": "string"
- },
- "topic": {
- "annotations": {
- "required": [
- "storage.notifications.insert"
- ]
- },
- "description": "The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'",
- "type": "string"
- }
- },
- "type": "object"
- },
- "Notifications": {
- "description": "A list of notification subscriptions.",
- "id": "Notifications",
- "properties": {
- "items": {
- "description": "The list of items.",
- "items": {
- "$ref": "Notification"
- },
- "type": "array"
- },
- "kind": {
- "default": "storage#notifications",
- "description": "The kind of item this is. For lists of notifications, this is always storage#notifications.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "Object": {
- "description": "An object.",
- "id": "Object",
- "properties": {
- "acl": {
- "annotations": {
- "required": [
- "storage.objects.update"
- ]
- },
- "description": "Access controls on the object.",
- "items": {
- "$ref": "ObjectAccessControl"
- },
- "type": "array"
- },
- "bucket": {
- "description": "The name of the bucket containing this object.",
- "type": "string"
- },
- "cacheControl": {
- "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.",
- "type": "string"
- },
- "componentCount": {
- "description": "Number of underlying components that make up this object. Components are accumulated by compose operations.",
- "format": "int32",
- "type": "integer"
- },
- "contentDisposition": {
- "description": "Content-Disposition of the object data.",
- "type": "string"
- },
- "contentEncoding": {
- "description": "Content-Encoding of the object data.",
- "type": "string"
- },
- "contentLanguage": {
- "description": "Content-Language of the object data.",
- "type": "string"
- },
- "contentType": {
- "description": "Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream.",
- "type": "string"
- },
- "crc32c": {
- "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices.",
- "type": "string"
- },
- "customerEncryption": {
- "description": "Metadata of customer-supplied encryption key, if the object is encrypted by such a key.",
- "properties": {
- "encryptionAlgorithm": {
- "description": "The encryption algorithm.",
- "type": "string"
- },
- "keySha256": {
- "description": "SHA256 hash value of the encryption key.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "etag": {
- "description": "HTTP 1.1 Entity tag for the object.",
- "type": "string"
- },
- "eventBasedHold": {
- "description": "Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false.",
- "type": "boolean"
- },
- "generation": {
- "description": "The content generation of this object. Used for object versioning.",
- "format": "int64",
- "type": "string"
- },
- "id": {
- "description": "The ID of the object, including the bucket name, object name, and generation number.",
- "type": "string"
- },
- "kind": {
- "default": "storage#object",
- "description": "The kind of item this is. For objects, this is always storage#object.",
- "type": "string"
- },
- "kmsKeyName": {
- "description": "Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key. Limited availability; usable only by enabled projects.",
- "type": "string"
- },
- "md5Hash": {
- "description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices.",
- "type": "string"
- },
- "mediaLink": {
- "description": "Media download link.",
- "type": "string"
- },
- "metadata": {
- "additionalProperties": {
- "description": "An individual metadata entry.",
- "type": "string"
- },
- "description": "User-provided metadata, in key/value pairs.",
- "type": "object"
- },
- "metageneration": {
- "description": "The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.",
- "format": "int64",
- "type": "string"
- },
- "name": {
- "description": "The name of the object. Required if not specified by URL parameter.",
- "type": "string"
- },
- "owner": {
- "description": "The owner of the object. This will always be the uploader of the object.",
- "properties": {
- "entity": {
- "description": "The entity, in the form user-userId.",
- "type": "string"
- },
- "entityId": {
- "description": "The ID for the entity.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "retentionExpirationTime": {
- "description": "A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).",
- "format": "date-time",
- "type": "string"
- },
- "selfLink": {
- "description": "The link to this object.",
- "type": "string"
- },
- "size": {
- "description": "Content-Length of the data in bytes.",
- "format": "uint64",
- "type": "string"
- },
- "storageClass": {
- "description": "Storage class of the object.",
- "type": "string"
- },
- "temporaryHold": {
- "description": "Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object.",
- "type": "boolean"
- },
- "timeCreated": {
- "description": "The creation time of the object in RFC 3339 format.",
- "format": "date-time",
- "type": "string"
- },
- "timeDeleted": {
- "description": "The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.",
- "format": "date-time",
- "type": "string"
- },
- "timeStorageClassUpdated": {
- "description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.",
- "format": "date-time",
- "type": "string"
- },
- "updated": {
- "description": "The modification time of the object metadata in RFC 3339 format.",
- "format": "date-time",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ObjectAccessControl": {
- "description": "An access-control entry.",
- "id": "ObjectAccessControl",
- "properties": {
- "bucket": {
- "description": "The name of the bucket.",
- "type": "string"
- },
- "domain": {
- "description": "The domain associated with the entity, if any.",
- "type": "string"
- },
- "email": {
- "description": "The email address associated with the entity, if any.",
- "type": "string"
- },
- "entity": {
- "annotations": {
- "required": [
- "storage.defaultObjectAccessControls.insert",
- "storage.objectAccessControls.insert"
- ]
- },
- "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.",
- "type": "string"
- },
- "entityId": {
- "description": "The ID for the entity, if any.",
- "type": "string"
- },
- "etag": {
- "description": "HTTP 1.1 Entity tag for the access-control entry.",
- "type": "string"
- },
- "generation": {
- "description": "The content generation of the object, if applied to an object.",
- "format": "int64",
- "type": "string"
- },
- "id": {
- "description": "The ID of the access-control entry.",
- "type": "string"
- },
- "kind": {
- "default": "storage#objectAccessControl",
- "description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.",
- "type": "string"
- },
- "object": {
- "description": "The name of the object, if applied to an object.",
- "type": "string"
- },
- "projectTeam": {
- "description": "The project team associated with the entity, if any.",
- "properties": {
- "projectNumber": {
- "description": "The project number.",
- "type": "string"
- },
- "team": {
- "description": "The team.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "role": {
- "annotations": {
- "required": [
- "storage.defaultObjectAccessControls.insert",
- "storage.objectAccessControls.insert"
- ]
- },
- "description": "The access permission for the entity.",
- "type": "string"
- },
- "selfLink": {
- "description": "The link to this access-control entry.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ObjectAccessControls": {
- "description": "An access-control list.",
- "id": "ObjectAccessControls",
- "properties": {
- "items": {
- "description": "The list of items.",
- "items": {
- "$ref": "ObjectAccessControl"
- },
- "type": "array"
- },
- "kind": {
- "default": "storage#objectAccessControls",
- "description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "Objects": {
- "description": "A list of objects.",
- "id": "Objects",
- "properties": {
- "items": {
- "description": "The list of items.",
- "items": {
- "$ref": "Object"
- },
- "type": "array"
- },
- "kind": {
- "default": "storage#objects",
- "description": "The kind of item this is. For lists of objects, this is always storage#objects.",
- "type": "string"
- },
- "nextPageToken": {
- "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results.",
- "type": "string"
- },
- "prefixes": {
- "description": "The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- },
- "Policy": {
- "description": "A bucket/object IAM policy.",
- "id": "Policy",
- "properties": {
- "bindings": {
- "annotations": {
- "required": [
- "storage.buckets.setIamPolicy",
- "storage.objects.setIamPolicy"
- ]
- },
- "description": "An association between a role, which comes with a set of permissions, and members who may assume that role.",
- "items": {
- "properties": {
- "condition": {
- "type": "any"
- },
- "members": {
- "annotations": {
- "required": [
- "storage.buckets.setIamPolicy",
- "storage.objects.setIamPolicy"
- ]
- },
- "description": "A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: \n- allUsers — A special identifier that represents anyone on the internet; with or without a Google account. \n- allAuthenticatedUsers — A special identifier that represents anyone who is authenticated with a Google account or a service account. \n- user:emailid — An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. \n- serviceAccount:emailid — An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . \n- group:emailid — An email address that represents a Google group. For example, group:admins@example.com. \n- domain:domain — A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. \n- projectOwner:projectid — Owners of the given project. For example, projectOwner:my-example-project \n- projectEditor:projectid — Editors of the given project. For example, projectEditor:my-example-project \n- projectViewer:projectid — Viewers of the given project. For example, projectViewer:my-example-project",
- "items": {
- "type": "string"
- },
- "type": "array"
- },
- "role": {
- "annotations": {
- "required": [
- "storage.buckets.setIamPolicy",
- "storage.objects.setIamPolicy"
- ]
- },
- "description": "The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.\nThe new IAM roles are: \n- roles/storage.admin — Full control of Google Cloud Storage resources. \n- roles/storage.objectViewer — Read-Only access to Google Cloud Storage objects. \n- roles/storage.objectCreator — Access to create objects in Google Cloud Storage. \n- roles/storage.objectAdmin — Full control of Google Cloud Storage objects. The legacy IAM roles are: \n- roles/storage.legacyObjectReader — Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. \n- roles/storage.legacyObjectOwner — Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. \n- roles/storage.legacyBucketReader — Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. \n- roles/storage.legacyBucketWriter — Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. \n- roles/storage.legacyBucketOwner — Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "type": "array"
- },
- "etag": {
- "description": "HTTP 1.1 Entity tag for the policy.",
- "format": "byte",
- "type": "string"
- },
- "kind": {
- "default": "storage#policy",
- "description": "The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.",
- "type": "string"
- },
- "resourceId": {
- "description": "The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "RewriteResponse": {
- "description": "A rewrite response.",
- "id": "RewriteResponse",
- "properties": {
- "done": {
- "description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response.",
- "type": "boolean"
- },
- "kind": {
- "default": "storage#rewriteResponse",
- "description": "The kind of item this is.",
- "type": "string"
- },
- "objectSize": {
- "description": "The total size of the object being copied in bytes. This property is always present in the response.",
- "format": "int64",
- "type": "string"
- },
- "resource": {
- "$ref": "Object",
- "description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes."
- },
- "rewriteToken": {
- "description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy.",
- "type": "string"
- },
- "totalBytesRewritten": {
- "description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.",
- "format": "int64",
- "type": "string"
- }
- },
- "type": "object"
- },
- "ServiceAccount": {
- "description": "A subscription to receive Google PubSub notifications.",
- "id": "ServiceAccount",
- "properties": {
- "email_address": {
- "description": "The ID of the notification.",
- "type": "string"
- },
- "kind": {
- "default": "storage#serviceAccount",
- "description": "The kind of item this is. For notifications, this is always storage#notification.",
- "type": "string"
- }
- },
- "type": "object"
- },
- "TestIamPermissionsResponse": {
- "description": "A storage.(buckets|objects).testIamPermissions response.",
- "id": "TestIamPermissionsResponse",
- "properties": {
- "kind": {
- "default": "storage#testIamPermissionsResponse",
- "description": "The kind of item this is.",
- "type": "string"
- },
- "permissions": {
- "description": "The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets or objects. The supported permissions are as follows: \n- storage.buckets.delete — Delete bucket. \n- storage.buckets.get — Read bucket metadata. \n- storage.buckets.getIamPolicy — Read bucket IAM policy. \n- storage.buckets.create — Create bucket. \n- storage.buckets.list — List buckets. \n- storage.buckets.setIamPolicy — Update bucket IAM policy. \n- storage.buckets.update — Update bucket metadata. \n- storage.objects.delete — Delete object. \n- storage.objects.get — Read object data and metadata. \n- storage.objects.getIamPolicy — Read object IAM policy. \n- storage.objects.create — Create object. \n- storage.objects.list — List objects. \n- storage.objects.setIamPolicy — Update object IAM policy. \n- storage.objects.update — Update object metadata.",
- "items": {
- "type": "string"
- },
- "type": "array"
- }
- },
- "type": "object"
- }
- },
- "servicePath": "storage/v1/",
- "title": "Cloud Storage JSON API",
- "version": "v1"
-} \ No newline at end of file
diff --git a/vendor/google.golang.org/api/storage/v1/storage-gen.go b/vendor/google.golang.org/api/storage/v1/storage-gen.go
deleted file mode 100644
index df5d71f..0000000
--- a/vendor/google.golang.org/api/storage/v1/storage-gen.go
+++ /dev/null
@@ -1,11207 +0,0 @@
-// Package storage provides access to the Cloud Storage JSON API.
-//
-// This package is DEPRECATED. Use package cloud.google.com/go/storage instead.
-//
-// See https://developers.google.com/storage/docs/json_api/
-//
-// Usage example:
-//
-// import "google.golang.org/api/storage/v1"
-// ...
-// storageService, err := storage.New(oauthHttpClient)
-package storage // import "google.golang.org/api/storage/v1"
-
-import (
- "bytes"
- "encoding/json"
- "errors"
- "fmt"
- context "golang.org/x/net/context"
- ctxhttp "golang.org/x/net/context/ctxhttp"
- gensupport "google.golang.org/api/gensupport"
- googleapi "google.golang.org/api/googleapi"
- "io"
- "net/http"
- "net/url"
- "strconv"
- "strings"
-)
-
-// Always reference these packages, just in case the auto-generated code
-// below doesn't.
-var _ = bytes.NewBuffer
-var _ = strconv.Itoa
-var _ = fmt.Sprintf
-var _ = json.NewDecoder
-var _ = io.Copy
-var _ = url.Parse
-var _ = gensupport.MarshalJSON
-var _ = googleapi.Version
-var _ = errors.New
-var _ = strings.Replace
-var _ = context.Canceled
-var _ = ctxhttp.Do
-
-const apiId = "storage:v1"
-const apiName = "storage"
-const apiVersion = "v1"
-const basePath = "https://www.googleapis.com/storage/v1/"
-
-// OAuth2 scopes used by this API.
-const (
- // View and manage your data across Google Cloud Platform services
- CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
-
- // View your data across Google Cloud Platform services
- CloudPlatformReadOnlyScope = "https://www.googleapis.com/auth/cloud-platform.read-only"
-
- // Manage your data and permissions in Google Cloud Storage
- DevstorageFullControlScope = "https://www.googleapis.com/auth/devstorage.full_control"
-
- // View your data in Google Cloud Storage
- DevstorageReadOnlyScope = "https://www.googleapis.com/auth/devstorage.read_only"
-
- // Manage your data in Google Cloud Storage
- DevstorageReadWriteScope = "https://www.googleapis.com/auth/devstorage.read_write"
-)
-
-func New(client *http.Client) (*Service, error) {
- if client == nil {
- return nil, errors.New("client is nil")
- }
- s := &Service{client: client, BasePath: basePath}
- s.BucketAccessControls = NewBucketAccessControlsService(s)
- s.Buckets = NewBucketsService(s)
- s.Channels = NewChannelsService(s)
- s.DefaultObjectAccessControls = NewDefaultObjectAccessControlsService(s)
- s.Notifications = NewNotificationsService(s)
- s.ObjectAccessControls = NewObjectAccessControlsService(s)
- s.Objects = NewObjectsService(s)
- s.Projects = NewProjectsService(s)
- return s, nil
-}
-
-type Service struct {
- client *http.Client
- BasePath string // API endpoint base URL
- UserAgent string // optional additional User-Agent fragment
-
- BucketAccessControls *BucketAccessControlsService
-
- Buckets *BucketsService
-
- Channels *ChannelsService
-
- DefaultObjectAccessControls *DefaultObjectAccessControlsService
-
- Notifications *NotificationsService
-
- ObjectAccessControls *ObjectAccessControlsService
-
- Objects *ObjectsService
-
- Projects *ProjectsService
-}
-
-func (s *Service) userAgent() string {
- if s.UserAgent == "" {
- return googleapi.UserAgent
- }
- return googleapi.UserAgent + " " + s.UserAgent
-}
-
-func NewBucketAccessControlsService(s *Service) *BucketAccessControlsService {
- rs := &BucketAccessControlsService{s: s}
- return rs
-}
-
-type BucketAccessControlsService struct {
- s *Service
-}
-
-func NewBucketsService(s *Service) *BucketsService {
- rs := &BucketsService{s: s}
- return rs
-}
-
-type BucketsService struct {
- s *Service
-}
-
-func NewChannelsService(s *Service) *ChannelsService {
- rs := &ChannelsService{s: s}
- return rs
-}
-
-type ChannelsService struct {
- s *Service
-}
-
-func NewDefaultObjectAccessControlsService(s *Service) *DefaultObjectAccessControlsService {
- rs := &DefaultObjectAccessControlsService{s: s}
- return rs
-}
-
-type DefaultObjectAccessControlsService struct {
- s *Service
-}
-
-func NewNotificationsService(s *Service) *NotificationsService {
- rs := &NotificationsService{s: s}
- return rs
-}
-
-type NotificationsService struct {
- s *Service
-}
-
-func NewObjectAccessControlsService(s *Service) *ObjectAccessControlsService {
- rs := &ObjectAccessControlsService{s: s}
- return rs
-}
-
-type ObjectAccessControlsService struct {
- s *Service
-}
-
-func NewObjectsService(s *Service) *ObjectsService {
- rs := &ObjectsService{s: s}
- return rs
-}
-
-type ObjectsService struct {
- s *Service
-}
-
-func NewProjectsService(s *Service) *ProjectsService {
- rs := &ProjectsService{s: s}
- rs.ServiceAccount = NewProjectsServiceAccountService(s)
- return rs
-}
-
-type ProjectsService struct {
- s *Service
-
- ServiceAccount *ProjectsServiceAccountService
-}
-
-func NewProjectsServiceAccountService(s *Service) *ProjectsServiceAccountService {
- rs := &ProjectsServiceAccountService{s: s}
- return rs
-}
-
-type ProjectsServiceAccountService struct {
- s *Service
-}
-
-// Bucket: A bucket.
-type Bucket struct {
- // Acl: Access controls on the bucket.
- Acl []*BucketAccessControl `json:"acl,omitempty"`
-
- // Billing: The bucket's billing configuration.
- Billing *BucketBilling `json:"billing,omitempty"`
-
- // Cors: The bucket's Cross-Origin Resource Sharing (CORS)
- // configuration.
- Cors []*BucketCors `json:"cors,omitempty"`
-
- // DefaultEventBasedHold: The default value for event-based hold on
- // newly created objects in this bucket. Event-based hold is a way to
- // retain objects indefinitely until an event occurs, signified by the
- // hold's release. After being released, such objects will be subject to
- // bucket-level retention (if any). One sample use case of this flag is
- // for banks to hold loan documents for at least 3 years after loan is
- // paid in full. Here, bucket-level retention is 3 years and the event
- // is loan being paid in full. In this example, these objects will be
- // held intact for any number of years until the event has occurred
- // (event-based hold on the object is released) and then 3 more years
- // after that. That means retention duration of the objects begins from
- // the moment event-based hold transitioned from true to false. Objects
- // under event-based hold cannot be deleted, overwritten or archived
- // until the hold is removed.
- DefaultEventBasedHold bool `json:"defaultEventBasedHold,omitempty"`
-
- // DefaultObjectAcl: Default access controls to apply to new objects
- // when no ACL is provided.
- DefaultObjectAcl []*ObjectAccessControl `json:"defaultObjectAcl,omitempty"`
-
- // Encryption: Encryption configuration for a bucket.
- Encryption *BucketEncryption `json:"encryption,omitempty"`
-
- // Etag: HTTP 1.1 Entity tag for the bucket.
- Etag string `json:"etag,omitempty"`
-
- // Id: The ID of the bucket. For buckets, the id and name properties are
- // the same.
- Id string `json:"id,omitempty"`
-
- // Kind: The kind of item this is. For buckets, this is always
- // storage#bucket.
- Kind string `json:"kind,omitempty"`
-
- // Labels: User-provided labels, in key/value pairs.
- Labels map[string]string `json:"labels,omitempty"`
-
- // Lifecycle: The bucket's lifecycle configuration. See lifecycle
- // management for more information.
- Lifecycle *BucketLifecycle `json:"lifecycle,omitempty"`
-
- // Location: The location of the bucket. Object data for objects in the
- // bucket resides in physical storage within this region. Defaults to
- // US. See the developer's guide for the authoritative list.
- Location string `json:"location,omitempty"`
-
- // Logging: The bucket's logging configuration, which defines the
- // destination bucket and optional name prefix for the current bucket's
- // logs.
- Logging *BucketLogging `json:"logging,omitempty"`
-
- // Metageneration: The metadata generation of this bucket.
- Metageneration int64 `json:"metageneration,omitempty,string"`
-
- // Name: The name of the bucket.
- Name string `json:"name,omitempty"`
-
- // Owner: The owner of the bucket. This is always the project team's
- // owner group.
- Owner *BucketOwner `json:"owner,omitempty"`
-
- // ProjectNumber: The project number of the project the bucket belongs
- // to.
- ProjectNumber uint64 `json:"projectNumber,omitempty,string"`
-
- // RetentionPolicy: The bucket's retention policy. The retention policy
- // enforces a minimum retention time for all objects contained in the
- // bucket, based on their creation time. Any attempt to overwrite or
- // delete objects younger than the retention period will result in a
- // PERMISSION_DENIED error. An unlocked retention policy can be modified
- // or removed from the bucket via a storage.buckets.update operation. A
- // locked retention policy cannot be removed or shortened in duration
- // for the lifetime of the bucket. Attempting to remove or decrease
- // period of a locked retention policy will result in a
- // PERMISSION_DENIED error.
- RetentionPolicy *BucketRetentionPolicy `json:"retentionPolicy,omitempty"`
-
- // SelfLink: The URI of this bucket.
- SelfLink string `json:"selfLink,omitempty"`
-
- // StorageClass: The bucket's default storage class, used whenever no
- // storageClass is specified for a newly-created object. This defines
- // how objects in the bucket are stored and determines the SLA and the
- // cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD,
- // NEARLINE, COLDLINE, and DURABLE_REDUCED_AVAILABILITY. If this value
- // is not specified when the bucket is created, it will default to
- // STANDARD. For more information, see storage classes.
- StorageClass string `json:"storageClass,omitempty"`
-
- // TimeCreated: The creation time of the bucket in RFC 3339 format.
- TimeCreated string `json:"timeCreated,omitempty"`
-
- // Updated: The modification time of the bucket in RFC 3339 format.
- Updated string `json:"updated,omitempty"`
-
- // Versioning: The bucket's versioning configuration.
- Versioning *BucketVersioning `json:"versioning,omitempty"`
-
- // Website: The bucket's website configuration, controlling how the
- // service behaves when accessing bucket contents as a web site. See the
- // Static Website Examples for more information.
- Website *BucketWebsite `json:"website,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Acl") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// BucketBilling: The bucket's billing configuration.
-type BucketBilling struct {
- // RequesterPays: When set to true, Requester Pays is enabled for this
- // bucket.
- RequesterPays bool `json:"requesterPays,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "RequesterPays") 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:"-"`
-
- // NullFields is a list of field names (e.g. "RequesterPays") 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 *BucketBilling) MarshalJSON() ([]byte, error) {
- type NoMethod BucketBilling
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-type BucketCors struct {
- // MaxAgeSeconds: The value, in seconds, to return in the
- // Access-Control-Max-Age header used in preflight responses.
- MaxAgeSeconds int64 `json:"maxAgeSeconds,omitempty"`
-
- // Method: The list of HTTP methods on which to include CORS response
- // headers, (GET, OPTIONS, POST, etc) Note: "*" is permitted in the list
- // of methods, and means "any method".
- Method []string `json:"method,omitempty"`
-
- // Origin: The list of Origins eligible to receive CORS response
- // headers. Note: "*" is permitted in the list of origins, and means
- // "any Origin".
- Origin []string `json:"origin,omitempty"`
-
- // ResponseHeader: The list of HTTP headers other than the simple
- // response headers to give permission for the user-agent to share
- // across domains.
- ResponseHeader []string `json:"responseHeader,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "MaxAgeSeconds") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// BucketEncryption: Encryption configuration for a bucket.
-type BucketEncryption struct {
- // DefaultKmsKeyName: A Cloud KMS key that will be used to encrypt
- // objects inserted into this bucket, if no encryption method is
- // specified.
- DefaultKmsKeyName string `json:"defaultKmsKeyName,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:"-"`
-
- // NullFields is a list of field names (e.g. "DefaultKmsKeyName") 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 *BucketEncryption) MarshalJSON() ([]byte, error) {
- type NoMethod BucketEncryption
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// BucketLifecycle: The bucket's lifecycle configuration. See lifecycle
-// management for more information.
-type BucketLifecycle struct {
- // Rule: A lifecycle management rule, which is made of an action to take
- // and the condition(s) under which the action will be taken.
- Rule []*BucketLifecycleRule `json:"rule,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Rule") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-type BucketLifecycleRule struct {
- // Action: The action to take.
- Action *BucketLifecycleRuleAction `json:"action,omitempty"`
-
- // Condition: The condition(s) under which the action will be taken.
- Condition *BucketLifecycleRuleCondition `json:"condition,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Action") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// BucketLifecycleRuleAction: The action to take.
-type BucketLifecycleRuleAction struct {
- // StorageClass: Target storage class. Required iff the type of the
- // action is SetStorageClass.
- StorageClass string `json:"storageClass,omitempty"`
-
- // Type: Type of the action. Currently, only Delete and SetStorageClass
- // are supported.
- Type string `json:"type,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "StorageClass") 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:"-"`
-
- // NullFields is a list of field names (e.g. "StorageClass") 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, s.NullFields)
-}
-
-// BucketLifecycleRuleCondition: The condition(s) under which the action
-// will be taken.
-type BucketLifecycleRuleCondition struct {
- // Age: Age of an object (in days). This condition is satisfied when an
- // object reaches the specified age.
- Age int64 `json:"age,omitempty"`
-
- // CreatedBefore: A date in RFC 3339 format with only the date part (for
- // instance, "2013-01-15"). This condition is satisfied when an object
- // is created before midnight of the specified date in UTC.
- CreatedBefore string `json:"createdBefore,omitempty"`
-
- // IsLive: Relevant only for versioned objects. If the value is true,
- // this condition matches live objects; if the value is false, it
- // matches archived objects.
- IsLive *bool `json:"isLive,omitempty"`
-
- // MatchesStorageClass: Objects having any of the storage classes
- // specified by this condition will be matched. Values include
- // MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, STANDARD, and
- // DURABLE_REDUCED_AVAILABILITY.
- MatchesStorageClass []string `json:"matchesStorageClass,omitempty"`
-
- // NumNewerVersions: Relevant only for versioned objects. If the value
- // is N, this condition is satisfied when there are at least N versions
- // (including the live version) newer than this version of the object.
- NumNewerVersions int64 `json:"numNewerVersions,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Age") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// BucketLogging: The bucket's logging configuration, which defines the
-// destination bucket and optional name prefix for the current bucket's
-// logs.
-type BucketLogging struct {
- // LogBucket: The destination bucket where the current bucket's logs
- // should be placed.
- LogBucket string `json:"logBucket,omitempty"`
-
- // LogObjectPrefix: A prefix for log object names.
- LogObjectPrefix string `json:"logObjectPrefix,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "LogBucket") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// BucketOwner: The owner of the bucket. This is always the project
-// team's owner group.
-type BucketOwner struct {
- // Entity: The entity, in the form project-owner-projectId.
- Entity string `json:"entity,omitempty"`
-
- // EntityId: The ID for the entity.
- EntityId string `json:"entityId,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Entity") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// BucketRetentionPolicy: The bucket's retention policy. The retention
-// policy enforces a minimum retention time for all objects contained in
-// the bucket, based on their creation time. Any attempt to overwrite or
-// delete objects younger than the retention period will result in a
-// PERMISSION_DENIED error. An unlocked retention policy can be modified
-// or removed from the bucket via a storage.buckets.update operation. A
-// locked retention policy cannot be removed or shortened in duration
-// for the lifetime of the bucket. Attempting to remove or decrease
-// period of a locked retention policy will result in a
-// PERMISSION_DENIED error.
-type BucketRetentionPolicy struct {
- // EffectiveTime: Server-determined value that indicates the time from
- // which policy was enforced and effective. This value is in RFC 3339
- // format.
- EffectiveTime string `json:"effectiveTime,omitempty"`
-
- // IsLocked: Once locked, an object retention policy cannot be modified.
- IsLocked bool `json:"isLocked,omitempty"`
-
- // RetentionPeriod: The duration in seconds that objects need to be
- // retained. Retention duration must be greater than zero and less than
- // 100 years. Note that enforcement of retention periods less than a day
- // is not guaranteed. Such periods should only be used for testing
- // purposes.
- RetentionPeriod int64 `json:"retentionPeriod,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "EffectiveTime") 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:"-"`
-
- // NullFields is a list of field names (e.g. "EffectiveTime") 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 *BucketRetentionPolicy) MarshalJSON() ([]byte, error) {
- type NoMethod BucketRetentionPolicy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// BucketVersioning: The bucket's versioning configuration.
-type BucketVersioning struct {
- // Enabled: While set to true, versioning is fully enabled for this
- // bucket.
- Enabled bool `json:"enabled,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Enabled") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// BucketWebsite: The bucket's website configuration, controlling how
-// the service behaves when accessing bucket contents as a web site. See
-// the Static Website Examples for more information.
-type BucketWebsite struct {
- // MainPageSuffix: If the requested object path is missing, the service
- // will ensure the path has a trailing '/', append this suffix, and
- // attempt to retrieve the resulting object. This allows the creation of
- // index.html objects to represent directory pages.
- MainPageSuffix string `json:"mainPageSuffix,omitempty"`
-
- // NotFoundPage: If the requested object path is missing, and any
- // mainPageSuffix object is missing, if applicable, the service will
- // return the named object from this bucket as the content for a 404 Not
- // Found result.
- NotFoundPage string `json:"notFoundPage,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "MainPageSuffix") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// BucketAccessControl: An access-control entry.
-type BucketAccessControl struct {
- // Bucket: The name of the bucket.
- Bucket string `json:"bucket,omitempty"`
-
- // Domain: The domain associated with the entity, if any.
- Domain string `json:"domain,omitempty"`
-
- // Email: The email address associated with the entity, if any.
- Email string `json:"email,omitempty"`
-
- // Entity: The entity holding the permission, in one of the following
- // forms:
- // - user-userId
- // - user-email
- // - group-groupId
- // - group-email
- // - domain-domain
- // - project-team-projectId
- // - allUsers
- // - allAuthenticatedUsers Examples:
- // - The user liz@example.com would be user-liz@example.com.
- // - The group example@googlegroups.com would be
- // group-example@googlegroups.com.
- // - To refer to all members of the Google Apps for Business domain
- // example.com, the entity would be domain-example.com.
- Entity string `json:"entity,omitempty"`
-
- // EntityId: The ID for the entity, if any.
- EntityId string `json:"entityId,omitempty"`
-
- // Etag: HTTP 1.1 Entity tag for the access-control entry.
- Etag string `json:"etag,omitempty"`
-
- // Id: The ID of the access-control entry.
- Id string `json:"id,omitempty"`
-
- // Kind: The kind of item this is. For bucket access control entries,
- // this is always storage#bucketAccessControl.
- Kind string `json:"kind,omitempty"`
-
- // ProjectTeam: The project team associated with the entity, if any.
- ProjectTeam *BucketAccessControlProjectTeam `json:"projectTeam,omitempty"`
-
- // Role: The access permission for the entity.
- Role string `json:"role,omitempty"`
-
- // SelfLink: The link to this access-control entry.
- SelfLink string `json:"selfLink,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Bucket") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// BucketAccessControlProjectTeam: The project team associated with the
-// entity, if any.
-type BucketAccessControlProjectTeam struct {
- // ProjectNumber: The project number.
- ProjectNumber string `json:"projectNumber,omitempty"`
-
- // Team: The team.
- Team string `json:"team,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ProjectNumber") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// BucketAccessControls: An access-control list.
-type BucketAccessControls struct {
- // Items: The list of items.
- Items []*BucketAccessControl `json:"items,omitempty"`
-
- // Kind: The kind of item this is. For lists of bucket access control
- // entries, this is always storage#bucketAccessControls.
- Kind string `json:"kind,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// Buckets: A list of buckets.
-type Buckets struct {
- // Items: The list of items.
- Items []*Bucket `json:"items,omitempty"`
-
- // Kind: The kind of item this is. For lists of buckets, this is always
- // storage#buckets.
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: The continuation token, used to page through large
- // result sets. Provide this value in a subsequent request to return the
- // next page of results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// Channel: An notification channel used to watch for resource changes.
-type Channel struct {
- // Address: The address where notifications are delivered for this
- // channel.
- Address string `json:"address,omitempty"`
-
- // Expiration: Date and time of notification channel expiration,
- // expressed as a Unix timestamp, in milliseconds. Optional.
- Expiration int64 `json:"expiration,omitempty,string"`
-
- // Id: A UUID or similar unique string that identifies this channel.
- Id string `json:"id,omitempty"`
-
- // Kind: Identifies this as a notification channel used to watch for
- // changes to a resource. Value: the fixed string "api#channel".
- Kind string `json:"kind,omitempty"`
-
- // Params: Additional parameters controlling delivery channel behavior.
- // Optional.
- Params map[string]string `json:"params,omitempty"`
-
- // Payload: A Boolean value to indicate whether payload is wanted.
- // Optional.
- Payload bool `json:"payload,omitempty"`
-
- // ResourceId: An opaque ID that identifies the resource being watched
- // on this channel. Stable across different API versions.
- ResourceId string `json:"resourceId,omitempty"`
-
- // ResourceUri: A version-specific identifier for the watched resource.
- ResourceUri string `json:"resourceUri,omitempty"`
-
- // Token: An arbitrary string delivered to the target address with each
- // notification delivered over this channel. Optional.
- Token string `json:"token,omitempty"`
-
- // Type: The type of delivery mechanism used for this channel.
- Type string `json:"type,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Address") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// ComposeRequest: A Compose request.
-type ComposeRequest struct {
- // Destination: Properties of the resulting object.
- Destination *Object `json:"destination,omitempty"`
-
- // Kind: The kind of item this is.
- Kind string `json:"kind,omitempty"`
-
- // SourceObjects: The list of source objects that will be concatenated
- // into a single object.
- SourceObjects []*ComposeRequestSourceObjects `json:"sourceObjects,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Destination") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-type ComposeRequestSourceObjects struct {
- // Generation: The generation of this object to use as the source.
- Generation int64 `json:"generation,omitempty,string"`
-
- // Name: The source object's name. The source object's bucket is
- // implicitly the destination bucket.
- Name string `json:"name,omitempty"`
-
- // ObjectPreconditions: Conditions that must be met for this operation
- // to execute.
- ObjectPreconditions *ComposeRequestSourceObjectsObjectPreconditions `json:"objectPreconditions,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Generation") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// ComposeRequestSourceObjectsObjectPreconditions: Conditions that must
-// be met for this operation to execute.
-type ComposeRequestSourceObjectsObjectPreconditions struct {
- // IfGenerationMatch: Only perform the composition if the generation of
- // the source object that would be used matches this value. If this
- // value and a generation are both specified, they must be the same
- // value or the call will fail.
- IfGenerationMatch int64 `json:"ifGenerationMatch,omitempty,string"`
-
- // ForceSendFields is a list of field names (e.g. "IfGenerationMatch")
- // 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// Notification: A subscription to receive Google PubSub notifications.
-type Notification struct {
- // CustomAttributes: An optional list of additional attributes to attach
- // to each Cloud PubSub message published for this notification
- // subscription.
- CustomAttributes map[string]string `json:"custom_attributes,omitempty"`
-
- // Etag: HTTP 1.1 Entity tag for this subscription notification.
- Etag string `json:"etag,omitempty"`
-
- // EventTypes: If present, only send notifications about listed event
- // types. If empty, sent notifications for all event types.
- EventTypes []string `json:"event_types,omitempty"`
-
- // Id: The ID of the notification.
- Id string `json:"id,omitempty"`
-
- // Kind: The kind of item this is. For notifications, this is always
- // storage#notification.
- Kind string `json:"kind,omitempty"`
-
- // ObjectNamePrefix: If present, only apply this notification
- // configuration to object names that begin with this prefix.
- ObjectNamePrefix string `json:"object_name_prefix,omitempty"`
-
- // PayloadFormat: The desired content of the Payload.
- PayloadFormat string `json:"payload_format,omitempty"`
-
- // SelfLink: The canonical URL of this notification.
- SelfLink string `json:"selfLink,omitempty"`
-
- // Topic: The Cloud PubSub topic to which this subscription publishes.
- // Formatted as:
- // '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topi
- // c}'
- Topic string `json:"topic,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "CustomAttributes") 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:"-"`
-
- // NullFields is a list of field names (e.g. "CustomAttributes") 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 *Notification) MarshalJSON() ([]byte, error) {
- type NoMethod Notification
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Notifications: A list of notification subscriptions.
-type Notifications struct {
- // Items: The list of items.
- Items []*Notification `json:"items,omitempty"`
-
- // Kind: The kind of item this is. For lists of notifications, this is
- // always storage#notifications.
- Kind string `json:"kind,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") 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:"-"`
-
- // 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 *Notifications) MarshalJSON() ([]byte, error) {
- type NoMethod Notifications
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// Object: An object.
-type Object struct {
- // Acl: Access controls on the object.
- Acl []*ObjectAccessControl `json:"acl,omitempty"`
-
- // Bucket: The name of the bucket containing this object.
- Bucket string `json:"bucket,omitempty"`
-
- // 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
- // object. Components are accumulated by compose operations.
- ComponentCount int64 `json:"componentCount,omitempty"`
-
- // ContentDisposition: Content-Disposition of the object data.
- ContentDisposition string `json:"contentDisposition,omitempty"`
-
- // ContentEncoding: Content-Encoding of the object data.
- ContentEncoding string `json:"contentEncoding,omitempty"`
-
- // ContentLanguage: Content-Language of the object data.
- ContentLanguage string `json:"contentLanguage,omitempty"`
-
- // ContentType: Content-Type of the object data. If an object is stored
- // without a Content-Type, it is served as application/octet-stream.
- ContentType string `json:"contentType,omitempty"`
-
- // Crc32c: CRC32c checksum, as described in RFC 4960, Appendix B;
- // encoded using base64 in big-endian byte order. For more information
- // about using the CRC32c checksum, see Hashes and ETags: Best
- // Practices.
- Crc32c string `json:"crc32c,omitempty"`
-
- // CustomerEncryption: Metadata of customer-supplied encryption key, if
- // the object is encrypted by such a key.
- CustomerEncryption *ObjectCustomerEncryption `json:"customerEncryption,omitempty"`
-
- // Etag: HTTP 1.1 Entity tag for the object.
- Etag string `json:"etag,omitempty"`
-
- // EventBasedHold: Whether an object is under event-based hold.
- // Event-based hold is a way to retain objects until an event occurs,
- // which is signified by the hold's release (i.e. this value is set to
- // false). After being released (set to false), such objects will be
- // subject to bucket-level retention (if any). One sample use case of
- // this flag is for banks to hold loan documents for at least 3 years
- // after loan is paid in full. Here, bucket-level retention is 3 years
- // and the event is the loan being paid in full. In this example, these
- // objects will be held intact for any number of years until the event
- // has occurred (event-based hold on the object is released) and then 3
- // more years after that. That means retention duration of the objects
- // begins from the moment event-based hold transitioned from true to
- // false.
- EventBasedHold bool `json:"eventBasedHold,omitempty"`
-
- // Generation: The content generation of this object. Used for object
- // versioning.
- Generation int64 `json:"generation,omitempty,string"`
-
- // Id: The ID of the object, including the bucket name, object name, and
- // generation number.
- Id string `json:"id,omitempty"`
-
- // Kind: The kind of item this is. For objects, this is always
- // 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. Limited availability; usable only by
- // enabled projects.
- 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.
- Md5Hash string `json:"md5Hash,omitempty"`
-
- // MediaLink: Media download link.
- MediaLink string `json:"mediaLink,omitempty"`
-
- // Metadata: User-provided metadata, in key/value pairs.
- Metadata map[string]string `json:"metadata,omitempty"`
-
- // Metageneration: The version of the metadata for this object at this
- // generation. Used for preconditions and for detecting changes in
- // metadata. A metageneration number is only meaningful in the context
- // of a particular generation of a particular object.
- Metageneration int64 `json:"metageneration,omitempty,string"`
-
- // Name: The name of the object. Required if not specified by URL
- // parameter.
- Name string `json:"name,omitempty"`
-
- // Owner: The owner of the object. This will always be the uploader of
- // the object.
- Owner *ObjectOwner `json:"owner,omitempty"`
-
- // RetentionExpirationTime: A server-determined value that specifies the
- // earliest time that the object's retention period expires. This value
- // is in RFC 3339 format. Note 1: This field is not provided for objects
- // with an active event-based hold, since retention expiration is
- // unknown until the hold is removed. Note 2: This value can be provided
- // even when temporary hold is set (so that the user can reason about
- // policy without having to first unset the temporary hold).
- RetentionExpirationTime string `json:"retentionExpirationTime,omitempty"`
-
- // SelfLink: The link to this object.
- SelfLink string `json:"selfLink,omitempty"`
-
- // Size: Content-Length of the data in bytes.
- Size uint64 `json:"size,omitempty,string"`
-
- // StorageClass: Storage class of the object.
- StorageClass string `json:"storageClass,omitempty"`
-
- // TemporaryHold: Whether an object is under temporary hold. While this
- // flag is set to true, the object is protected against deletion and
- // overwrites. A common use case of this flag is regulatory
- // investigations where objects need to be retained while the
- // investigation is ongoing. Note that unlike event-based hold,
- // temporary hold does not impact retention expiration time of an
- // object.
- TemporaryHold bool `json:"temporaryHold,omitempty"`
-
- // TimeCreated: The creation time of the object in RFC 3339 format.
- TimeCreated string `json:"timeCreated,omitempty"`
-
- // TimeDeleted: The deletion time of the object in RFC 3339 format. Will
- // be returned if and only if this version of the object has been
- // deleted.
- TimeDeleted string `json:"timeDeleted,omitempty"`
-
- // TimeStorageClassUpdated: The time at which the object's storage class
- // was last changed. When the object is initially created, it will be
- // set to timeCreated.
- TimeStorageClassUpdated string `json:"timeStorageClassUpdated,omitempty"`
-
- // Updated: The modification time of the object metadata in RFC 3339
- // format.
- Updated string `json:"updated,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Acl") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// ObjectCustomerEncryption: Metadata of customer-supplied encryption
-// key, if the object is encrypted by such a key.
-type ObjectCustomerEncryption struct {
- // EncryptionAlgorithm: The encryption algorithm.
- EncryptionAlgorithm string `json:"encryptionAlgorithm,omitempty"`
-
- // KeySha256: SHA256 hash value of the encryption key.
- KeySha256 string `json:"keySha256,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "EncryptionAlgorithm")
- // 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// ObjectOwner: The owner of the object. This will always be the
-// uploader of the object.
-type ObjectOwner struct {
- // Entity: The entity, in the form user-userId.
- Entity string `json:"entity,omitempty"`
-
- // EntityId: The ID for the entity.
- EntityId string `json:"entityId,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Entity") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// ObjectAccessControl: An access-control entry.
-type ObjectAccessControl struct {
- // Bucket: The name of the bucket.
- Bucket string `json:"bucket,omitempty"`
-
- // Domain: The domain associated with the entity, if any.
- Domain string `json:"domain,omitempty"`
-
- // Email: The email address associated with the entity, if any.
- Email string `json:"email,omitempty"`
-
- // Entity: The entity holding the permission, in one of the following
- // forms:
- // - user-userId
- // - user-email
- // - group-groupId
- // - group-email
- // - domain-domain
- // - project-team-projectId
- // - allUsers
- // - allAuthenticatedUsers Examples:
- // - The user liz@example.com would be user-liz@example.com.
- // - The group example@googlegroups.com would be
- // group-example@googlegroups.com.
- // - To refer to all members of the Google Apps for Business domain
- // example.com, the entity would be domain-example.com.
- Entity string `json:"entity,omitempty"`
-
- // EntityId: The ID for the entity, if any.
- EntityId string `json:"entityId,omitempty"`
-
- // Etag: HTTP 1.1 Entity tag for the access-control entry.
- Etag string `json:"etag,omitempty"`
-
- // 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.
- Id string `json:"id,omitempty"`
-
- // Kind: The kind of item this is. For object access control entries,
- // this is always storage#objectAccessControl.
- Kind string `json:"kind,omitempty"`
-
- // 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.
- ProjectTeam *ObjectAccessControlProjectTeam `json:"projectTeam,omitempty"`
-
- // Role: The access permission for the entity.
- Role string `json:"role,omitempty"`
-
- // SelfLink: The link to this access-control entry.
- SelfLink string `json:"selfLink,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Bucket") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// ObjectAccessControlProjectTeam: The project team associated with the
-// entity, if any.
-type ObjectAccessControlProjectTeam struct {
- // ProjectNumber: The project number.
- ProjectNumber string `json:"projectNumber,omitempty"`
-
- // Team: The team.
- Team string `json:"team,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "ProjectNumber") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// ObjectAccessControls: An access-control list.
-type ObjectAccessControls struct {
- // Items: The list of items.
- Items []*ObjectAccessControl `json:"items,omitempty"`
-
- // Kind: The kind of item this is. For lists of object access control
- // entries, this is always storage#objectAccessControls.
- Kind string `json:"kind,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// Objects: A list of objects.
-type Objects struct {
- // Items: The list of items.
- Items []*Object `json:"items,omitempty"`
-
- // Kind: The kind of item this is. For lists of objects, this is always
- // storage#objects.
- Kind string `json:"kind,omitempty"`
-
- // NextPageToken: The continuation token, used to page through large
- // result sets. Provide this value in a subsequent request to return the
- // next page of results.
- NextPageToken string `json:"nextPageToken,omitempty"`
-
- // Prefixes: The list of prefixes of objects matching-but-not-listed up
- // to and including the requested delimiter.
- Prefixes []string `json:"prefixes,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Items") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// Policy: A bucket/object IAM policy.
-type Policy struct {
- // Bindings: An association between a role, which comes with a set of
- // permissions, and members who may assume that role.
- Bindings []*PolicyBindings `json:"bindings,omitempty"`
-
- // Etag: HTTP 1.1 Entity tag for the policy.
- Etag string `json:"etag,omitempty"`
-
- // Kind: The kind of item this is. For policies, this is always
- // storage#policy. This field is ignored on input.
- Kind string `json:"kind,omitempty"`
-
- // ResourceId: The ID of the resource to which this policy belongs. Will
- // be of the form projects/_/buckets/bucket for buckets, and
- // projects/_/buckets/bucket/objects/object for objects. A specific
- // generation may be specified by appending #generationNumber to the end
- // of the object name, e.g.
- // projects/_/buckets/my-bucket/objects/data.txt#17. The current
- // generation can be denoted with #0. This field is ignored on input.
- ResourceId string `json:"resourceId,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Bindings") 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:"-"`
-
- // NullFields is a list of field names (e.g. "Bindings") 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 *Policy) MarshalJSON() ([]byte, error) {
- type NoMethod Policy
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-type PolicyBindings struct {
- Condition interface{} `json:"condition,omitempty"`
-
- // Members: A collection of identifiers for members who may assume the
- // provided role. Recognized identifiers are as follows:
- // - allUsers — A special identifier that represents anyone on the
- // internet; with or without a Google account.
- // - allAuthenticatedUsers — A special identifier that represents
- // anyone who is authenticated with a Google account or a service
- // account.
- // - user:emailid — An email address that represents a specific
- // account. For example, user:alice@gmail.com or user:joe@example.com.
- //
- // - serviceAccount:emailid — An email address that represents a
- // service account. For example,
- // serviceAccount:my-other-app@appspot.gserviceaccount.com .
- // - group:emailid — An email address that represents a Google group.
- // For example, group:admins@example.com.
- // - domain:domain — A Google Apps domain name that represents all the
- // users of that domain. For example, domain:google.com or
- // domain:example.com.
- // - projectOwner:projectid — Owners of the given project. For
- // example, projectOwner:my-example-project
- // - projectEditor:projectid — Editors of the given project. For
- // example, projectEditor:my-example-project
- // - projectViewer:projectid — Viewers of the given project. For
- // example, projectViewer:my-example-project
- Members []string `json:"members,omitempty"`
-
- // Role: The role to which members belong. Two types of roles are
- // supported: new IAM roles, which grant permissions that do not map
- // directly to those provided by ACLs, and legacy IAM roles, which do
- // map directly to ACL permissions. All roles are of the format
- // roles/storage.specificRole.
- // The new IAM roles are:
- // - roles/storage.admin — Full control of Google Cloud Storage
- // resources.
- // - roles/storage.objectViewer — Read-Only access to Google Cloud
- // Storage objects.
- // - roles/storage.objectCreator — Access to create objects in Google
- // Cloud Storage.
- // - roles/storage.objectAdmin — Full control of Google Cloud Storage
- // objects. The legacy IAM roles are:
- // - roles/storage.legacyObjectReader — Read-only access to objects
- // without listing. Equivalent to an ACL entry on an object with the
- // READER role.
- // - roles/storage.legacyObjectOwner — Read/write access to existing
- // objects without listing. Equivalent to an ACL entry on an object with
- // the OWNER role.
- // - roles/storage.legacyBucketReader — Read access to buckets with
- // object listing. Equivalent to an ACL entry on a bucket with the
- // READER role.
- // - roles/storage.legacyBucketWriter — Read access to buckets with
- // object listing/creation/deletion. Equivalent to an ACL entry on a
- // bucket with the WRITER role.
- // - roles/storage.legacyBucketOwner — Read and write access to
- // existing buckets with object listing/creation/deletion. Equivalent to
- // an ACL entry on a bucket with the OWNER role.
- Role string `json:"role,omitempty"`
-
- // ForceSendFields is a list of field names (e.g. "Condition") 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:"-"`
-
- // NullFields is a list of field names (e.g. "Condition") 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 *PolicyBindings) MarshalJSON() ([]byte, error) {
- type NoMethod PolicyBindings
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// RewriteResponse: A rewrite response.
-type RewriteResponse struct {
- // Done: true if the copy is finished; otherwise, false if the copy is
- // in progress. This property is always present in the response.
- Done bool `json:"done,omitempty"`
-
- // Kind: The kind of item this is.
- Kind string `json:"kind,omitempty"`
-
- // ObjectSize: The total size of the object being copied in bytes. This
- // property is always present in the response.
- ObjectSize int64 `json:"objectSize,omitempty,string"`
-
- // Resource: A resource containing the metadata for the copied-to
- // object. This property is present in the response only when copying
- // completes.
- Resource *Object `json:"resource,omitempty"`
-
- // RewriteToken: A token to use in subsequent requests to continue
- // copying data. This token is present in the response only when there
- // is more data to copy.
- RewriteToken string `json:"rewriteToken,omitempty"`
-
- // TotalBytesRewritten: The total bytes written so far, which can be
- // used to provide a waiting user with a progress indicator. This
- // property is always present in the response.
- TotalBytesRewritten int64 `json:"totalBytesRewritten,omitempty,string"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Done") 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:"-"`
-
- // 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, s.NullFields)
-}
-
-// ServiceAccount: A subscription to receive Google PubSub
-// notifications.
-type ServiceAccount struct {
- // EmailAddress: The ID of the notification.
- EmailAddress string `json:"email_address,omitempty"`
-
- // Kind: The kind of item this is. For notifications, this is always
- // storage#notification.
- Kind string `json:"kind,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "EmailAddress") 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:"-"`
-
- // NullFields is a list of field names (e.g. "EmailAddress") 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 *ServiceAccount) MarshalJSON() ([]byte, error) {
- type NoMethod ServiceAccount
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// TestIamPermissionsResponse: A
-// storage.(buckets|objects).testIamPermissions response.
-type TestIamPermissionsResponse struct {
- // Kind: The kind of item this is.
- Kind string `json:"kind,omitempty"`
-
- // Permissions: The permissions held by the caller. Permissions are
- // always of the format storage.resource.capability, where resource is
- // one of buckets or objects. The supported permissions are as follows:
- //
- // - storage.buckets.delete — Delete bucket.
- // - storage.buckets.get — Read bucket metadata.
- // - storage.buckets.getIamPolicy — Read bucket IAM policy.
- // - storage.buckets.create — Create bucket.
- // - storage.buckets.list — List buckets.
- // - storage.buckets.setIamPolicy — Update bucket IAM policy.
- // - storage.buckets.update — Update bucket metadata.
- // - storage.objects.delete — Delete object.
- // - storage.objects.get — Read object data and metadata.
- // - storage.objects.getIamPolicy — Read object IAM policy.
- // - storage.objects.create — Create object.
- // - storage.objects.list — List objects.
- // - storage.objects.setIamPolicy — Update object IAM policy.
- // - storage.objects.update — Update object metadata.
- Permissions []string `json:"permissions,omitempty"`
-
- // ServerResponse contains the HTTP response code and headers from the
- // server.
- googleapi.ServerResponse `json:"-"`
-
- // ForceSendFields is a list of field names (e.g. "Kind") 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:"-"`
-
- // NullFields is a list of field names (e.g. "Kind") 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 *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
- type NoMethod TestIamPermissionsResponse
- raw := NoMethod(*s)
- return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
-}
-
-// method id "storage.bucketAccessControls.delete":
-
-type BucketAccessControlsDeleteCall struct {
- s *Service
- bucket string
- entity string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Permanently deletes the ACL entry for the specified entity on
-// the specified bucket.
-func (r *BucketAccessControlsService) Delete(bucket string, entity string) *BucketAccessControlsDeleteCall {
- c := &BucketAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.entity = entity
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketAccessControlsDeleteCall) UserProject(userProject string) *BucketAccessControlsDeleteCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketAccessControlsDeleteCall) Fields(s ...googleapi.Field) *BucketAccessControlsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketAccessControlsDeleteCall) Context(ctx context.Context) *BucketAccessControlsDeleteCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketAccessControlsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.bucketAccessControls.delete" call.
-func (c *BucketAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return err
- }
- return nil
- // {
- // "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.",
- // "httpMethod": "DELETE",
- // "id": "storage.bucketAccessControls.delete",
- // "parameterOrder": [
- // "bucket",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/acl/{entity}",
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.bucketAccessControls.get":
-
-type BucketAccessControlsGetCall struct {
- s *Service
- bucket string
- entity string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the ACL entry for the specified entity on the specified
-// bucket.
-func (r *BucketAccessControlsService) Get(bucket string, entity string) *BucketAccessControlsGetCall {
- c := &BucketAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.entity = entity
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketAccessControlsGetCall) UserProject(userProject string) *BucketAccessControlsGetCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketAccessControlsGetCall) Fields(s ...googleapi.Field) *BucketAccessControlsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *BucketAccessControlsGetCall) IfNoneMatch(entityTag string) *BucketAccessControlsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketAccessControlsGetCall) Context(ctx context.Context) *BucketAccessControlsGetCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketAccessControlsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.bucketAccessControls.get" call.
-// Exactly one of *BucketAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *BucketAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *BucketAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &BucketAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Returns the ACL entry for the specified entity on the specified bucket.",
- // "httpMethod": "GET",
- // "id": "storage.bucketAccessControls.get",
- // "parameterOrder": [
- // "bucket",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/acl/{entity}",
- // "response": {
- // "$ref": "BucketAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.bucketAccessControls.insert":
-
-type BucketAccessControlsInsertCall struct {
- s *Service
- bucket string
- bucketaccesscontrol *BucketAccessControl
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new ACL entry on the specified bucket.
-func (r *BucketAccessControlsService) Insert(bucket string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsInsertCall {
- c := &BucketAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.bucketaccesscontrol = bucketaccesscontrol
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketAccessControlsInsertCall) UserProject(userProject string) *BucketAccessControlsInsertCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketAccessControlsInsertCall) Fields(s ...googleapi.Field) *BucketAccessControlsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketAccessControlsInsertCall) Context(ctx context.Context) *BucketAccessControlsInsertCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketAccessControlsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.bucketAccessControls.insert" call.
-// Exactly one of *BucketAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *BucketAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *BucketAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &BucketAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a new ACL entry on the specified bucket.",
- // "httpMethod": "POST",
- // "id": "storage.bucketAccessControls.insert",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/acl",
- // "request": {
- // "$ref": "BucketAccessControl"
- // },
- // "response": {
- // "$ref": "BucketAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.bucketAccessControls.list":
-
-type BucketAccessControlsListCall struct {
- s *Service
- bucket string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves ACL entries on the specified bucket.
-func (r *BucketAccessControlsService) List(bucket string) *BucketAccessControlsListCall {
- c := &BucketAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketAccessControlsListCall) UserProject(userProject string) *BucketAccessControlsListCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketAccessControlsListCall) Fields(s ...googleapi.Field) *BucketAccessControlsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *BucketAccessControlsListCall) IfNoneMatch(entityTag string) *BucketAccessControlsListCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketAccessControlsListCall) Context(ctx context.Context) *BucketAccessControlsListCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketAccessControlsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.bucketAccessControls.list" call.
-// Exactly one of *BucketAccessControls or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *BucketAccessControls.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *BucketAccessControlsListCall) Do(opts ...googleapi.CallOption) (*BucketAccessControls, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &BucketAccessControls{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves ACL entries on the specified bucket.",
- // "httpMethod": "GET",
- // "id": "storage.bucketAccessControls.list",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/acl",
- // "response": {
- // "$ref": "BucketAccessControls"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.bucketAccessControls.patch":
-
-type BucketAccessControlsPatchCall struct {
- s *Service
- bucket string
- entity string
- bucketaccesscontrol *BucketAccessControl
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches an ACL entry on the specified bucket.
-func (r *BucketAccessControlsService) Patch(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsPatchCall {
- c := &BucketAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.entity = entity
- c.bucketaccesscontrol = bucketaccesscontrol
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketAccessControlsPatchCall) UserProject(userProject string) *BucketAccessControlsPatchCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketAccessControlsPatchCall) Fields(s ...googleapi.Field) *BucketAccessControlsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketAccessControlsPatchCall) Context(ctx context.Context) *BucketAccessControlsPatchCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketAccessControlsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PATCH", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.bucketAccessControls.patch" call.
-// Exactly one of *BucketAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *BucketAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *BucketAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &BucketAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Patches an ACL entry on the specified bucket.",
- // "httpMethod": "PATCH",
- // "id": "storage.bucketAccessControls.patch",
- // "parameterOrder": [
- // "bucket",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/acl/{entity}",
- // "request": {
- // "$ref": "BucketAccessControl"
- // },
- // "response": {
- // "$ref": "BucketAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.bucketAccessControls.update":
-
-type BucketAccessControlsUpdateCall struct {
- s *Service
- bucket string
- entity string
- bucketaccesscontrol *BucketAccessControl
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates an ACL entry on the specified bucket.
-func (r *BucketAccessControlsService) Update(bucket string, entity string, bucketaccesscontrol *BucketAccessControl) *BucketAccessControlsUpdateCall {
- c := &BucketAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.entity = entity
- c.bucketaccesscontrol = bucketaccesscontrol
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketAccessControlsUpdateCall) UserProject(userProject string) *BucketAccessControlsUpdateCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketAccessControlsUpdateCall) Fields(s ...googleapi.Field) *BucketAccessControlsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketAccessControlsUpdateCall) Context(ctx context.Context) *BucketAccessControlsUpdateCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketAccessControlsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucketaccesscontrol)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/acl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PUT", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.bucketAccessControls.update" call.
-// Exactly one of *BucketAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *BucketAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *BucketAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*BucketAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &BucketAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates an ACL entry on the specified bucket.",
- // "httpMethod": "PUT",
- // "id": "storage.bucketAccessControls.update",
- // "parameterOrder": [
- // "bucket",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/acl/{entity}",
- // "request": {
- // "$ref": "BucketAccessControl"
- // },
- // "response": {
- // "$ref": "BucketAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.buckets.delete":
-
-type BucketsDeleteCall struct {
- s *Service
- bucket string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Permanently deletes an empty bucket.
-func (r *BucketsService) Delete(bucket string) *BucketsDeleteCall {
- c := &BucketsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": If set, only deletes the bucket if its
-// metageneration matches this value.
-func (c *BucketsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsDeleteCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": If set, only deletes the bucket if its
-// metageneration does not match this value.
-func (c *BucketsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsDeleteCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketsDeleteCall) UserProject(userProject string) *BucketsDeleteCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketsDeleteCall) Fields(s ...googleapi.Field) *BucketsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketsDeleteCall) Context(ctx context.Context) *BucketsDeleteCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.buckets.delete" call.
-func (c *BucketsDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return err
- }
- return nil
- // {
- // "description": "Permanently deletes an empty bucket.",
- // "httpMethod": "DELETE",
- // "id": "storage.buckets.delete",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "If set, only deletes the bucket if its metageneration matches this value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "If set, only deletes the bucket if its metageneration does not match this value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}",
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.buckets.get":
-
-type BucketsGetCall struct {
- s *Service
- bucket string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns metadata for the specified bucket.
-func (r *BucketsService) Get(bucket string) *BucketsGetCall {
- c := &BucketsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": Makes the return of the bucket metadata
-// conditional on whether the bucket's current metageneration matches
-// the given value.
-func (c *BucketsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsGetCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
-// conditional on whether the bucket's current metageneration does not
-// match the given value.
-func (c *BucketsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsGetCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to noAcl.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit owner, acl and defaultObjectAcl properties.
-func (c *BucketsGetCall) Projection(projection string) *BucketsGetCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketsGetCall) UserProject(userProject string) *BucketsGetCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketsGetCall) Fields(s ...googleapi.Field) *BucketsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *BucketsGetCall) IfNoneMatch(entityTag string) *BucketsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketsGetCall) Context(ctx context.Context) *BucketsGetCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.buckets.get" call.
-// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Bucket.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *BucketsGetCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Bucket{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Returns metadata for the specified bucket.",
- // "httpMethod": "GET",
- // "id": "storage.buckets.get",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to noAcl.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit owner, acl and defaultObjectAcl properties."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}",
- // "response": {
- // "$ref": "Bucket"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.buckets.getIamPolicy":
-
-type BucketsGetIamPolicyCall struct {
- s *Service
- bucket string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Returns an IAM policy for the specified bucket.
-func (r *BucketsService) GetIamPolicy(bucket string) *BucketsGetIamPolicyCall {
- c := &BucketsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketsGetIamPolicyCall) UserProject(userProject string) *BucketsGetIamPolicyCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketsGetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsGetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *BucketsGetIamPolicyCall) IfNoneMatch(entityTag string) *BucketsGetIamPolicyCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketsGetIamPolicyCall) Context(ctx context.Context) *BucketsGetIamPolicyCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketsGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.buckets.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *BucketsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Policy{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Returns an IAM policy for the specified bucket.",
- // "httpMethod": "GET",
- // "id": "storage.buckets.getIamPolicy",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/iam",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.buckets.insert":
-
-type BucketsInsertCall struct {
- s *Service
- bucket *Bucket
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new bucket.
-func (r *BucketsService) Insert(projectid string, bucket *Bucket) *BucketsInsertCall {
- c := &BucketsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.urlParams_.Set("project", projectid)
- c.bucket = bucket
- return c
-}
-
-// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
-// predefined set of access controls to this bucket.
-//
-// Possible values:
-// "authenticatedRead" - Project team owners get OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "private" - Project team owners get OWNER access.
-// "projectPrivate" - Project team members get access according to
-// their roles.
-// "publicRead" - Project team owners get OWNER access, and allUsers
-// get READER access.
-// "publicReadWrite" - Project team owners get OWNER access, and
-// allUsers get WRITER access.
-func (c *BucketsInsertCall) PredefinedAcl(predefinedAcl string) *BucketsInsertCall {
- c.urlParams_.Set("predefinedAcl", predefinedAcl)
- return c
-}
-
-// PredefinedDefaultObjectAcl sets the optional parameter
-// "predefinedDefaultObjectAcl": Apply a predefined set of default
-// object access controls to this bucket.
-//
-// Possible values:
-// "authenticatedRead" - Object owner gets OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "bucketOwnerFullControl" - Object owner gets OWNER access, and
-// project team owners get OWNER access.
-// "bucketOwnerRead" - Object owner gets OWNER access, and project
-// team owners get READER access.
-// "private" - Object owner gets OWNER access.
-// "projectPrivate" - Object owner gets OWNER access, and project team
-// members get access according to their roles.
-// "publicRead" - Object owner gets OWNER access, and allUsers get
-// READER access.
-func (c *BucketsInsertCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsInsertCall {
- c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to noAcl, unless the bucket resource
-// specifies acl or defaultObjectAcl properties, when it defaults to
-// full.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit owner, acl and defaultObjectAcl properties.
-func (c *BucketsInsertCall) Projection(projection string) *BucketsInsertCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request.
-func (c *BucketsInsertCall) UserProject(userProject string) *BucketsInsertCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketsInsertCall) Fields(s ...googleapi.Field) *BucketsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketsInsertCall) Context(ctx context.Context) *BucketsInsertCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.buckets.insert" call.
-// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Bucket.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *BucketsInsertCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Bucket{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a new bucket.",
- // "httpMethod": "POST",
- // "id": "storage.buckets.insert",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "predefinedAcl": {
- // "description": "Apply a predefined set of access controls to this bucket.",
- // "enum": [
- // "authenticatedRead",
- // "private",
- // "projectPrivate",
- // "publicRead",
- // "publicReadWrite"
- // ],
- // "enumDescriptions": [
- // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
- // "Project team owners get OWNER access.",
- // "Project team members get access according to their roles.",
- // "Project team owners get OWNER access, and allUsers get READER access.",
- // "Project team owners get OWNER access, and allUsers get WRITER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "predefinedDefaultObjectAcl": {
- // "description": "Apply a predefined set of default object access controls to this bucket.",
- // "enum": [
- // "authenticatedRead",
- // "bucketOwnerFullControl",
- // "bucketOwnerRead",
- // "private",
- // "projectPrivate",
- // "publicRead"
- // ],
- // "enumDescriptions": [
- // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- // "Object owner gets OWNER access, and project team owners get OWNER access.",
- // "Object owner gets OWNER access, and project team owners get READER access.",
- // "Object owner gets OWNER access.",
- // "Object owner gets OWNER access, and project team members get access according to their roles.",
- // "Object owner gets OWNER access, and allUsers get READER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "A valid API project identifier.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit owner, acl and defaultObjectAcl properties."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b",
- // "request": {
- // "$ref": "Bucket"
- // },
- // "response": {
- // "$ref": "Bucket"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.buckets.list":
-
-type BucketsListCall struct {
- s *Service
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of buckets for a given project.
-func (r *BucketsService) List(projectid string) *BucketsListCall {
- c := &BucketsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.urlParams_.Set("project", projectid)
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": Maximum number
-// of buckets to return in a single response. The service will use this
-// parameter or 1,000 items, whichever is smaller.
-func (c *BucketsListCall) MaxResults(maxResults int64) *BucketsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": A
-// previously-returned page token representing part of the larger set of
-// results to view.
-func (c *BucketsListCall) PageToken(pageToken string) *BucketsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// Prefix sets the optional parameter "prefix": Filter results to
-// buckets whose names begin with this prefix.
-func (c *BucketsListCall) Prefix(prefix string) *BucketsListCall {
- c.urlParams_.Set("prefix", prefix)
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to noAcl.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit owner, acl and defaultObjectAcl properties.
-func (c *BucketsListCall) Projection(projection string) *BucketsListCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request.
-func (c *BucketsListCall) UserProject(userProject string) *BucketsListCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketsListCall) Fields(s ...googleapi.Field) *BucketsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *BucketsListCall) IfNoneMatch(entityTag string) *BucketsListCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketsListCall) Context(ctx context.Context) *BucketsListCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.buckets.list" call.
-// Exactly one of *Buckets or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Buckets.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *BucketsListCall) Do(opts ...googleapi.CallOption) (*Buckets, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Buckets{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves a list of buckets for a given project.",
- // "httpMethod": "GET",
- // "id": "storage.buckets.list",
- // "parameterOrder": [
- // "project"
- // ],
- // "parameters": {
- // "maxResults": {
- // "default": "1000",
- // "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A previously-returned page token representing part of the larger set of results to view.",
- // "location": "query",
- // "type": "string"
- // },
- // "prefix": {
- // "description": "Filter results to buckets whose names begin with this prefix.",
- // "location": "query",
- // "type": "string"
- // },
- // "project": {
- // "description": "A valid API project identifier.",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to noAcl.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit owner, acl and defaultObjectAcl properties."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b",
- // "response": {
- // "$ref": "Buckets"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// Pages invokes f for each page of results.
-// A non-nil error returned from f will halt the iteration.
-// The provided context supersedes any context provided to the Context method.
-func (c *BucketsListCall) Pages(ctx context.Context, f func(*Buckets) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
-}
-
-// method id "storage.buckets.lockRetentionPolicy":
-
-type BucketsLockRetentionPolicyCall struct {
- s *Service
- bucket string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// LockRetentionPolicy: Locks retention policy on a bucket.
-func (r *BucketsService) LockRetentionPolicy(bucket string, ifMetagenerationMatch int64) *BucketsLockRetentionPolicyCall {
- c := &BucketsLockRetentionPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketsLockRetentionPolicyCall) UserProject(userProject string) *BucketsLockRetentionPolicyCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketsLockRetentionPolicyCall) Fields(s ...googleapi.Field) *BucketsLockRetentionPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketsLockRetentionPolicyCall) Context(ctx context.Context) *BucketsLockRetentionPolicyCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketsLockRetentionPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/lockRetentionPolicy")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.buckets.lockRetentionPolicy" call.
-// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Bucket.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *BucketsLockRetentionPolicyCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Bucket{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Locks retention policy on a bucket.",
- // "httpMethod": "POST",
- // "id": "storage.buckets.lockRetentionPolicy",
- // "parameterOrder": [
- // "bucket",
- // "ifMetagenerationMatch"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/lockRetentionPolicy",
- // "response": {
- // "$ref": "Bucket"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.buckets.patch":
-
-type BucketsPatchCall struct {
- s *Service
- bucket string
- bucket2 *Bucket
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Updates a bucket. Changes to the bucket will be readable
-// immediately after writing, but configuration changes may take time to
-// propagate. This method supports patch semantics.
-func (r *BucketsService) Patch(bucket string, bucket2 *Bucket) *BucketsPatchCall {
- c := &BucketsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.bucket2 = bucket2
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": Makes the return of the bucket metadata
-// conditional on whether the bucket's current metageneration matches
-// the given value.
-func (c *BucketsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsPatchCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
-// conditional on whether the bucket's current metageneration does not
-// match the given value.
-func (c *BucketsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsPatchCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- return c
-}
-
-// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
-// predefined set of access controls to this bucket.
-//
-// Possible values:
-// "authenticatedRead" - Project team owners get OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "private" - Project team owners get OWNER access.
-// "projectPrivate" - Project team members get access according to
-// their roles.
-// "publicRead" - Project team owners get OWNER access, and allUsers
-// get READER access.
-// "publicReadWrite" - Project team owners get OWNER access, and
-// allUsers get WRITER access.
-func (c *BucketsPatchCall) PredefinedAcl(predefinedAcl string) *BucketsPatchCall {
- c.urlParams_.Set("predefinedAcl", predefinedAcl)
- return c
-}
-
-// PredefinedDefaultObjectAcl sets the optional parameter
-// "predefinedDefaultObjectAcl": Apply a predefined set of default
-// object access controls to this bucket.
-//
-// Possible values:
-// "authenticatedRead" - Object owner gets OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "bucketOwnerFullControl" - Object owner gets OWNER access, and
-// project team owners get OWNER access.
-// "bucketOwnerRead" - Object owner gets OWNER access, and project
-// team owners get READER access.
-// "private" - Object owner gets OWNER access.
-// "projectPrivate" - Object owner gets OWNER access, and project team
-// members get access according to their roles.
-// "publicRead" - Object owner gets OWNER access, and allUsers get
-// READER access.
-func (c *BucketsPatchCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsPatchCall {
- c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to full.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit owner, acl and defaultObjectAcl properties.
-func (c *BucketsPatchCall) Projection(projection string) *BucketsPatchCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketsPatchCall) UserProject(userProject string) *BucketsPatchCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketsPatchCall) Fields(s ...googleapi.Field) *BucketsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketsPatchCall) Context(ctx context.Context) *BucketsPatchCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PATCH", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.buckets.patch" call.
-// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Bucket.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *BucketsPatchCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Bucket{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate. This method supports patch semantics.",
- // "httpMethod": "PATCH",
- // "id": "storage.buckets.patch",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "predefinedAcl": {
- // "description": "Apply a predefined set of access controls to this bucket.",
- // "enum": [
- // "authenticatedRead",
- // "private",
- // "projectPrivate",
- // "publicRead",
- // "publicReadWrite"
- // ],
- // "enumDescriptions": [
- // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
- // "Project team owners get OWNER access.",
- // "Project team members get access according to their roles.",
- // "Project team owners get OWNER access, and allUsers get READER access.",
- // "Project team owners get OWNER access, and allUsers get WRITER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "predefinedDefaultObjectAcl": {
- // "description": "Apply a predefined set of default object access controls to this bucket.",
- // "enum": [
- // "authenticatedRead",
- // "bucketOwnerFullControl",
- // "bucketOwnerRead",
- // "private",
- // "projectPrivate",
- // "publicRead"
- // ],
- // "enumDescriptions": [
- // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- // "Object owner gets OWNER access, and project team owners get OWNER access.",
- // "Object owner gets OWNER access, and project team owners get READER access.",
- // "Object owner gets OWNER access.",
- // "Object owner gets OWNER access, and project team members get access according to their roles.",
- // "Object owner gets OWNER access, and allUsers get READER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to full.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit owner, acl and defaultObjectAcl properties."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}",
- // "request": {
- // "$ref": "Bucket"
- // },
- // "response": {
- // "$ref": "Bucket"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.buckets.setIamPolicy":
-
-type BucketsSetIamPolicyCall struct {
- s *Service
- bucket string
- policy *Policy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Updates an IAM policy for the specified bucket.
-func (r *BucketsService) SetIamPolicy(bucket string, policy *Policy) *BucketsSetIamPolicyCall {
- c := &BucketsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.policy = policy
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketsSetIamPolicyCall) UserProject(userProject string) *BucketsSetIamPolicyCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketsSetIamPolicyCall) Fields(s ...googleapi.Field) *BucketsSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketsSetIamPolicyCall) Context(ctx context.Context) *BucketsSetIamPolicyCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketsSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PUT", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.buckets.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *BucketsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Policy{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates an IAM policy for the specified bucket.",
- // "httpMethod": "PUT",
- // "id": "storage.buckets.setIamPolicy",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/iam",
- // "request": {
- // "$ref": "Policy"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.buckets.testIamPermissions":
-
-type BucketsTestIamPermissionsCall struct {
- s *Service
- bucket string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Tests a set of permissions on the given bucket to
-// see which, if any, are held by the caller.
-func (r *BucketsService) TestIamPermissions(bucket string, permissions []string) *BucketsTestIamPermissionsCall {
- c := &BucketsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketsTestIamPermissionsCall) UserProject(userProject string) *BucketsTestIamPermissionsCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketsTestIamPermissionsCall) Fields(s ...googleapi.Field) *BucketsTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *BucketsTestIamPermissionsCall) IfNoneMatch(entityTag string) *BucketsTestIamPermissionsCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketsTestIamPermissionsCall) Context(ctx context.Context) *BucketsTestIamPermissionsCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketsTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/iam/testPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.buckets.testIamPermissions" call.
-// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
-// was returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *BucketsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &TestIamPermissionsResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.",
- // "httpMethod": "GET",
- // "id": "storage.buckets.testIamPermissions",
- // "parameterOrder": [
- // "bucket",
- // "permissions"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "permissions": {
- // "description": "Permissions to test.",
- // "location": "query",
- // "repeated": true,
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/iam/testPermissions",
- // "response": {
- // "$ref": "TestIamPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.buckets.update":
-
-type BucketsUpdateCall struct {
- s *Service
- bucket string
- bucket2 *Bucket
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates a bucket. Changes to the bucket will be readable
-// immediately after writing, but configuration changes may take time to
-// propagate.
-func (r *BucketsService) Update(bucket string, bucket2 *Bucket) *BucketsUpdateCall {
- c := &BucketsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.bucket2 = bucket2
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": Makes the return of the bucket metadata
-// conditional on whether the bucket's current metageneration matches
-// the given value.
-func (c *BucketsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *BucketsUpdateCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": Makes the return of the bucket metadata
-// conditional on whether the bucket's current metageneration does not
-// match the given value.
-func (c *BucketsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *BucketsUpdateCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- return c
-}
-
-// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
-// predefined set of access controls to this bucket.
-//
-// Possible values:
-// "authenticatedRead" - Project team owners get OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "private" - Project team owners get OWNER access.
-// "projectPrivate" - Project team members get access according to
-// their roles.
-// "publicRead" - Project team owners get OWNER access, and allUsers
-// get READER access.
-// "publicReadWrite" - Project team owners get OWNER access, and
-// allUsers get WRITER access.
-func (c *BucketsUpdateCall) PredefinedAcl(predefinedAcl string) *BucketsUpdateCall {
- c.urlParams_.Set("predefinedAcl", predefinedAcl)
- return c
-}
-
-// PredefinedDefaultObjectAcl sets the optional parameter
-// "predefinedDefaultObjectAcl": Apply a predefined set of default
-// object access controls to this bucket.
-//
-// Possible values:
-// "authenticatedRead" - Object owner gets OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "bucketOwnerFullControl" - Object owner gets OWNER access, and
-// project team owners get OWNER access.
-// "bucketOwnerRead" - Object owner gets OWNER access, and project
-// team owners get READER access.
-// "private" - Object owner gets OWNER access.
-// "projectPrivate" - Object owner gets OWNER access, and project team
-// members get access according to their roles.
-// "publicRead" - Object owner gets OWNER access, and allUsers get
-// READER access.
-func (c *BucketsUpdateCall) PredefinedDefaultObjectAcl(predefinedDefaultObjectAcl string) *BucketsUpdateCall {
- c.urlParams_.Set("predefinedDefaultObjectAcl", predefinedDefaultObjectAcl)
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to full.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit owner, acl and defaultObjectAcl properties.
-func (c *BucketsUpdateCall) Projection(projection string) *BucketsUpdateCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *BucketsUpdateCall) UserProject(userProject string) *BucketsUpdateCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *BucketsUpdateCall) Fields(s ...googleapi.Field) *BucketsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *BucketsUpdateCall) Context(ctx context.Context) *BucketsUpdateCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *BucketsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.bucket2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PUT", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.buckets.update" call.
-// Exactly one of *Bucket or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Bucket.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *BucketsUpdateCall) Do(opts ...googleapi.CallOption) (*Bucket, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Bucket{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.",
- // "httpMethod": "PUT",
- // "id": "storage.buckets.update",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "predefinedAcl": {
- // "description": "Apply a predefined set of access controls to this bucket.",
- // "enum": [
- // "authenticatedRead",
- // "private",
- // "projectPrivate",
- // "publicRead",
- // "publicReadWrite"
- // ],
- // "enumDescriptions": [
- // "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.",
- // "Project team owners get OWNER access.",
- // "Project team members get access according to their roles.",
- // "Project team owners get OWNER access, and allUsers get READER access.",
- // "Project team owners get OWNER access, and allUsers get WRITER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "predefinedDefaultObjectAcl": {
- // "description": "Apply a predefined set of default object access controls to this bucket.",
- // "enum": [
- // "authenticatedRead",
- // "bucketOwnerFullControl",
- // "bucketOwnerRead",
- // "private",
- // "projectPrivate",
- // "publicRead"
- // ],
- // "enumDescriptions": [
- // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- // "Object owner gets OWNER access, and project team owners get OWNER access.",
- // "Object owner gets OWNER access, and project team owners get READER access.",
- // "Object owner gets OWNER access.",
- // "Object owner gets OWNER access, and project team members get access according to their roles.",
- // "Object owner gets OWNER access, and allUsers get READER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to full.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit owner, acl and defaultObjectAcl properties."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}",
- // "request": {
- // "$ref": "Bucket"
- // },
- // "response": {
- // "$ref": "Bucket"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.channels.stop":
-
-type ChannelsStopCall struct {
- s *Service
- channel *Channel
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Stop: Stop watching resources through this channel
-func (r *ChannelsService) Stop(channel *Channel) *ChannelsStopCall {
- c := &ChannelsStopCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.channel = channel
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ChannelsStopCall) Fields(s ...googleapi.Field) *ChannelsStopCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ChannelsStopCall) Context(ctx context.Context) *ChannelsStopCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ChannelsStopCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "channels/stop")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.channels.stop" call.
-func (c *ChannelsStopCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return err
- }
- return nil
- // {
- // "description": "Stop watching resources through this channel",
- // "httpMethod": "POST",
- // "id": "storage.channels.stop",
- // "path": "channels/stop",
- // "request": {
- // "$ref": "Channel",
- // "parameterName": "resource"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.defaultObjectAccessControls.delete":
-
-type DefaultObjectAccessControlsDeleteCall struct {
- s *Service
- bucket string
- entity string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Permanently deletes the default object ACL entry for the
-// specified entity on the specified bucket.
-func (r *DefaultObjectAccessControlsService) Delete(bucket string, entity string) *DefaultObjectAccessControlsDeleteCall {
- c := &DefaultObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.entity = entity
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *DefaultObjectAccessControlsDeleteCall) UserProject(userProject string) *DefaultObjectAccessControlsDeleteCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *DefaultObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *DefaultObjectAccessControlsDeleteCall) Context(ctx context.Context) *DefaultObjectAccessControlsDeleteCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.defaultObjectAccessControls.delete" call.
-func (c *DefaultObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return err
- }
- return nil
- // {
- // "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.",
- // "httpMethod": "DELETE",
- // "id": "storage.defaultObjectAccessControls.delete",
- // "parameterOrder": [
- // "bucket",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/defaultObjectAcl/{entity}",
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.defaultObjectAccessControls.get":
-
-type DefaultObjectAccessControlsGetCall struct {
- s *Service
- bucket string
- entity string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the default object ACL entry for the specified entity on
-// the specified bucket.
-func (r *DefaultObjectAccessControlsService) Get(bucket string, entity string) *DefaultObjectAccessControlsGetCall {
- c := &DefaultObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.entity = entity
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *DefaultObjectAccessControlsGetCall) UserProject(userProject string) *DefaultObjectAccessControlsGetCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *DefaultObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *DefaultObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *DefaultObjectAccessControlsGetCall) Context(ctx context.Context) *DefaultObjectAccessControlsGetCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *DefaultObjectAccessControlsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.defaultObjectAccessControls.get" call.
-// Exactly one of *ObjectAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ObjectAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *DefaultObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ObjectAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Returns the default object ACL entry for the specified entity on the specified bucket.",
- // "httpMethod": "GET",
- // "id": "storage.defaultObjectAccessControls.get",
- // "parameterOrder": [
- // "bucket",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/defaultObjectAcl/{entity}",
- // "response": {
- // "$ref": "ObjectAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.defaultObjectAccessControls.insert":
-
-type DefaultObjectAccessControlsInsertCall struct {
- s *Service
- bucket string
- objectaccesscontrol *ObjectAccessControl
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new default object ACL entry on the specified
-// bucket.
-func (r *DefaultObjectAccessControlsService) Insert(bucket string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsInsertCall {
- c := &DefaultObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.objectaccesscontrol = objectaccesscontrol
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *DefaultObjectAccessControlsInsertCall) UserProject(userProject string) *DefaultObjectAccessControlsInsertCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *DefaultObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *DefaultObjectAccessControlsInsertCall) Context(ctx context.Context) *DefaultObjectAccessControlsInsertCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.defaultObjectAccessControls.insert" call.
-// Exactly one of *ObjectAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ObjectAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *DefaultObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ObjectAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a new default object ACL entry on the specified bucket.",
- // "httpMethod": "POST",
- // "id": "storage.defaultObjectAccessControls.insert",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/defaultObjectAcl",
- // "request": {
- // "$ref": "ObjectAccessControl"
- // },
- // "response": {
- // "$ref": "ObjectAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.defaultObjectAccessControls.list":
-
-type DefaultObjectAccessControlsListCall struct {
- s *Service
- bucket string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves default object ACL entries on the specified bucket.
-func (r *DefaultObjectAccessControlsService) List(bucket string) *DefaultObjectAccessControlsListCall {
- c := &DefaultObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": If present, only return default ACL listing
-// if the bucket's current metageneration matches this value.
-func (c *DefaultObjectAccessControlsListCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *DefaultObjectAccessControlsListCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": If present, only return default ACL
-// listing if the bucket's current metageneration does not match the
-// given value.
-func (c *DefaultObjectAccessControlsListCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *DefaultObjectAccessControlsListCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *DefaultObjectAccessControlsListCall) UserProject(userProject string) *DefaultObjectAccessControlsListCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *DefaultObjectAccessControlsListCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *DefaultObjectAccessControlsListCall) IfNoneMatch(entityTag string) *DefaultObjectAccessControlsListCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *DefaultObjectAccessControlsListCall) Context(ctx context.Context) *DefaultObjectAccessControlsListCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *DefaultObjectAccessControlsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.defaultObjectAccessControls.list" call.
-// Exactly one of *ObjectAccessControls or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ObjectAccessControls.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *DefaultObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ObjectAccessControls{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves default object ACL entries on the specified bucket.",
- // "httpMethod": "GET",
- // "id": "storage.defaultObjectAccessControls.list",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/defaultObjectAcl",
- // "response": {
- // "$ref": "ObjectAccessControls"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.defaultObjectAccessControls.patch":
-
-type DefaultObjectAccessControlsPatchCall struct {
- s *Service
- bucket string
- entity string
- objectaccesscontrol *ObjectAccessControl
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches a default object ACL entry on the specified bucket.
-func (r *DefaultObjectAccessControlsService) Patch(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsPatchCall {
- c := &DefaultObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.entity = entity
- c.objectaccesscontrol = objectaccesscontrol
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *DefaultObjectAccessControlsPatchCall) UserProject(userProject string) *DefaultObjectAccessControlsPatchCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *DefaultObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *DefaultObjectAccessControlsPatchCall) Context(ctx context.Context) *DefaultObjectAccessControlsPatchCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PATCH", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.defaultObjectAccessControls.patch" call.
-// Exactly one of *ObjectAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ObjectAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *DefaultObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ObjectAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Patches a default object ACL entry on the specified bucket.",
- // "httpMethod": "PATCH",
- // "id": "storage.defaultObjectAccessControls.patch",
- // "parameterOrder": [
- // "bucket",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/defaultObjectAcl/{entity}",
- // "request": {
- // "$ref": "ObjectAccessControl"
- // },
- // "response": {
- // "$ref": "ObjectAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.defaultObjectAccessControls.update":
-
-type DefaultObjectAccessControlsUpdateCall struct {
- s *Service
- bucket string
- entity string
- objectaccesscontrol *ObjectAccessControl
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates a default object ACL entry on the specified bucket.
-func (r *DefaultObjectAccessControlsService) Update(bucket string, entity string, objectaccesscontrol *ObjectAccessControl) *DefaultObjectAccessControlsUpdateCall {
- c := &DefaultObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.entity = entity
- c.objectaccesscontrol = objectaccesscontrol
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *DefaultObjectAccessControlsUpdateCall) UserProject(userProject string) *DefaultObjectAccessControlsUpdateCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *DefaultObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *DefaultObjectAccessControlsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *DefaultObjectAccessControlsUpdateCall) Context(ctx context.Context) *DefaultObjectAccessControlsUpdateCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/defaultObjectAcl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PUT", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.defaultObjectAccessControls.update" call.
-// Exactly one of *ObjectAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ObjectAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *DefaultObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ObjectAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates a default object ACL entry on the specified bucket.",
- // "httpMethod": "PUT",
- // "id": "storage.defaultObjectAccessControls.update",
- // "parameterOrder": [
- // "bucket",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/defaultObjectAcl/{entity}",
- // "request": {
- // "$ref": "ObjectAccessControl"
- // },
- // "response": {
- // "$ref": "ObjectAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.notifications.delete":
-
-type NotificationsDeleteCall struct {
- s *Service
- bucket string
- notification string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Permanently deletes a notification subscription.
-func (r *NotificationsService) Delete(bucket string, notification string) *NotificationsDeleteCall {
- c := &NotificationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.notification = notification
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *NotificationsDeleteCall) UserProject(userProject string) *NotificationsDeleteCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *NotificationsDeleteCall) Fields(s ...googleapi.Field) *NotificationsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *NotificationsDeleteCall) Context(ctx context.Context) *NotificationsDeleteCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *NotificationsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "notification": c.notification,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.notifications.delete" call.
-func (c *NotificationsDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return err
- }
- return nil
- // {
- // "description": "Permanently deletes a notification subscription.",
- // "httpMethod": "DELETE",
- // "id": "storage.notifications.delete",
- // "parameterOrder": [
- // "bucket",
- // "notification"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "The parent bucket of the notification.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "notification": {
- // "description": "ID of the notification to delete.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/notificationConfigs/{notification}",
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.notifications.get":
-
-type NotificationsGetCall struct {
- s *Service
- bucket string
- notification string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: View a notification configuration.
-func (r *NotificationsService) Get(bucket string, notification string) *NotificationsGetCall {
- c := &NotificationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.notification = notification
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *NotificationsGetCall) UserProject(userProject string) *NotificationsGetCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *NotificationsGetCall) Fields(s ...googleapi.Field) *NotificationsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *NotificationsGetCall) IfNoneMatch(entityTag string) *NotificationsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *NotificationsGetCall) Context(ctx context.Context) *NotificationsGetCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *NotificationsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs/{notification}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "notification": c.notification,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.notifications.get" call.
-// Exactly one of *Notification or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Notification.ServerResponse.Header or (if a response was returned at
-// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
-// to check whether the returned error was because
-// http.StatusNotModified was returned.
-func (c *NotificationsGetCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Notification{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "View a notification configuration.",
- // "httpMethod": "GET",
- // "id": "storage.notifications.get",
- // "parameterOrder": [
- // "bucket",
- // "notification"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "The parent bucket of the notification.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "notification": {
- // "description": "Notification ID",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/notificationConfigs/{notification}",
- // "response": {
- // "$ref": "Notification"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.notifications.insert":
-
-type NotificationsInsertCall struct {
- s *Service
- bucket string
- notification *Notification
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a notification subscription for a given bucket.
-func (r *NotificationsService) Insert(bucket string, notification *Notification) *NotificationsInsertCall {
- c := &NotificationsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.notification = notification
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *NotificationsInsertCall) UserProject(userProject string) *NotificationsInsertCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *NotificationsInsertCall) Fields(s ...googleapi.Field) *NotificationsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *NotificationsInsertCall) Context(ctx context.Context) *NotificationsInsertCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *NotificationsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.notification)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.notifications.insert" call.
-// Exactly one of *Notification or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Notification.ServerResponse.Header or (if a response was returned at
-// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
-// to check whether the returned error was because
-// http.StatusNotModified was returned.
-func (c *NotificationsInsertCall) Do(opts ...googleapi.CallOption) (*Notification, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Notification{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a notification subscription for a given bucket.",
- // "httpMethod": "POST",
- // "id": "storage.notifications.insert",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "The parent bucket of the notification.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/notificationConfigs",
- // "request": {
- // "$ref": "Notification"
- // },
- // "response": {
- // "$ref": "Notification"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.notifications.list":
-
-type NotificationsListCall struct {
- s *Service
- bucket string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of notification subscriptions for a given
-// bucket.
-func (r *NotificationsService) List(bucket string) *NotificationsListCall {
- c := &NotificationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *NotificationsListCall) UserProject(userProject string) *NotificationsListCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *NotificationsListCall) Fields(s ...googleapi.Field) *NotificationsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *NotificationsListCall) IfNoneMatch(entityTag string) *NotificationsListCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *NotificationsListCall) Context(ctx context.Context) *NotificationsListCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *NotificationsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/notificationConfigs")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.notifications.list" call.
-// Exactly one of *Notifications or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *Notifications.ServerResponse.Header or (if a response was returned
-// at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *NotificationsListCall) Do(opts ...googleapi.CallOption) (*Notifications, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Notifications{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves a list of notification subscriptions for a given bucket.",
- // "httpMethod": "GET",
- // "id": "storage.notifications.list",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a Google Cloud Storage bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/notificationConfigs",
- // "response": {
- // "$ref": "Notifications"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.objectAccessControls.delete":
-
-type ObjectAccessControlsDeleteCall struct {
- s *Service
- bucket string
- object string
- entity string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Permanently deletes the ACL entry for the specified entity on
-// the specified object.
-func (r *ObjectAccessControlsService) Delete(bucket string, object string, entity string) *ObjectAccessControlsDeleteCall {
- c := &ObjectAccessControlsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- c.entity = entity
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectAccessControlsDeleteCall) Generation(generation int64) *ObjectAccessControlsDeleteCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectAccessControlsDeleteCall) UserProject(userProject string) *ObjectAccessControlsDeleteCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectAccessControlsDeleteCall) Fields(s ...googleapi.Field) *ObjectAccessControlsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectAccessControlsDeleteCall) Context(ctx context.Context) *ObjectAccessControlsDeleteCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectAccessControlsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objectAccessControls.delete" call.
-func (c *ObjectAccessControlsDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return err
- }
- return nil
- // {
- // "description": "Permanently deletes the ACL entry for the specified entity on the specified object.",
- // "httpMethod": "DELETE",
- // "id": "storage.objectAccessControls.delete",
- // "parameterOrder": [
- // "bucket",
- // "object",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}/acl/{entity}",
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.objectAccessControls.get":
-
-type ObjectAccessControlsGetCall struct {
- s *Service
- bucket string
- object string
- entity string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Returns the ACL entry for the specified entity on the specified
-// object.
-func (r *ObjectAccessControlsService) Get(bucket string, object string, entity string) *ObjectAccessControlsGetCall {
- c := &ObjectAccessControlsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- c.entity = entity
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectAccessControlsGetCall) Generation(generation int64) *ObjectAccessControlsGetCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectAccessControlsGetCall) UserProject(userProject string) *ObjectAccessControlsGetCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectAccessControlsGetCall) Fields(s ...googleapi.Field) *ObjectAccessControlsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *ObjectAccessControlsGetCall) IfNoneMatch(entityTag string) *ObjectAccessControlsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectAccessControlsGetCall) Context(ctx context.Context) *ObjectAccessControlsGetCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectAccessControlsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objectAccessControls.get" call.
-// Exactly one of *ObjectAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ObjectAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *ObjectAccessControlsGetCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ObjectAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Returns the ACL entry for the specified entity on the specified object.",
- // "httpMethod": "GET",
- // "id": "storage.objectAccessControls.get",
- // "parameterOrder": [
- // "bucket",
- // "object",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}/acl/{entity}",
- // "response": {
- // "$ref": "ObjectAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.objectAccessControls.insert":
-
-type ObjectAccessControlsInsertCall struct {
- s *Service
- bucket string
- object string
- objectaccesscontrol *ObjectAccessControl
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Creates a new ACL entry on the specified object.
-func (r *ObjectAccessControlsService) Insert(bucket string, object string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsInsertCall {
- c := &ObjectAccessControlsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- c.objectaccesscontrol = objectaccesscontrol
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectAccessControlsInsertCall) Generation(generation int64) *ObjectAccessControlsInsertCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectAccessControlsInsertCall) UserProject(userProject string) *ObjectAccessControlsInsertCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectAccessControlsInsertCall) Fields(s ...googleapi.Field) *ObjectAccessControlsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectAccessControlsInsertCall) Context(ctx context.Context) *ObjectAccessControlsInsertCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectAccessControlsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objectAccessControls.insert" call.
-// Exactly one of *ObjectAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ObjectAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *ObjectAccessControlsInsertCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ObjectAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Creates a new ACL entry on the specified object.",
- // "httpMethod": "POST",
- // "id": "storage.objectAccessControls.insert",
- // "parameterOrder": [
- // "bucket",
- // "object"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}/acl",
- // "request": {
- // "$ref": "ObjectAccessControl"
- // },
- // "response": {
- // "$ref": "ObjectAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.objectAccessControls.list":
-
-type ObjectAccessControlsListCall struct {
- s *Service
- bucket string
- object string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves ACL entries on the specified object.
-func (r *ObjectAccessControlsService) List(bucket string, object string) *ObjectAccessControlsListCall {
- c := &ObjectAccessControlsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectAccessControlsListCall) Generation(generation int64) *ObjectAccessControlsListCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectAccessControlsListCall) UserProject(userProject string) *ObjectAccessControlsListCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectAccessControlsListCall) Fields(s ...googleapi.Field) *ObjectAccessControlsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *ObjectAccessControlsListCall) IfNoneMatch(entityTag string) *ObjectAccessControlsListCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectAccessControlsListCall) Context(ctx context.Context) *ObjectAccessControlsListCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectAccessControlsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objectAccessControls.list" call.
-// Exactly one of *ObjectAccessControls or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ObjectAccessControls.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *ObjectAccessControlsListCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControls, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ObjectAccessControls{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves ACL entries on the specified object.",
- // "httpMethod": "GET",
- // "id": "storage.objectAccessControls.list",
- // "parameterOrder": [
- // "bucket",
- // "object"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}/acl",
- // "response": {
- // "$ref": "ObjectAccessControls"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.objectAccessControls.patch":
-
-type ObjectAccessControlsPatchCall struct {
- s *Service
- bucket string
- object string
- entity string
- objectaccesscontrol *ObjectAccessControl
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches an ACL entry on the specified object.
-func (r *ObjectAccessControlsService) Patch(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsPatchCall {
- c := &ObjectAccessControlsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- c.entity = entity
- c.objectaccesscontrol = objectaccesscontrol
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectAccessControlsPatchCall) Generation(generation int64) *ObjectAccessControlsPatchCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectAccessControlsPatchCall) UserProject(userProject string) *ObjectAccessControlsPatchCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectAccessControlsPatchCall) Fields(s ...googleapi.Field) *ObjectAccessControlsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectAccessControlsPatchCall) Context(ctx context.Context) *ObjectAccessControlsPatchCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectAccessControlsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PATCH", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objectAccessControls.patch" call.
-// Exactly one of *ObjectAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ObjectAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *ObjectAccessControlsPatchCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ObjectAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Patches an ACL entry on the specified object.",
- // "httpMethod": "PATCH",
- // "id": "storage.objectAccessControls.patch",
- // "parameterOrder": [
- // "bucket",
- // "object",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}/acl/{entity}",
- // "request": {
- // "$ref": "ObjectAccessControl"
- // },
- // "response": {
- // "$ref": "ObjectAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.objectAccessControls.update":
-
-type ObjectAccessControlsUpdateCall struct {
- s *Service
- bucket string
- object string
- entity string
- objectaccesscontrol *ObjectAccessControl
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates an ACL entry on the specified object.
-func (r *ObjectAccessControlsService) Update(bucket string, object string, entity string, objectaccesscontrol *ObjectAccessControl) *ObjectAccessControlsUpdateCall {
- c := &ObjectAccessControlsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- c.entity = entity
- c.objectaccesscontrol = objectaccesscontrol
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectAccessControlsUpdateCall) Generation(generation int64) *ObjectAccessControlsUpdateCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectAccessControlsUpdateCall) UserProject(userProject string) *ObjectAccessControlsUpdateCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectAccessControlsUpdateCall) Fields(s ...googleapi.Field) *ObjectAccessControlsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectAccessControlsUpdateCall) Context(ctx context.Context) *ObjectAccessControlsUpdateCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectAccessControlsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.objectaccesscontrol)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/acl/{entity}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PUT", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- "entity": c.entity,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objectAccessControls.update" call.
-// Exactly one of *ObjectAccessControl or error will be non-nil. Any
-// non-2xx status code is an error. Response headers are in either
-// *ObjectAccessControl.ServerResponse.Header or (if a response was
-// returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *ObjectAccessControlsUpdateCall) Do(opts ...googleapi.CallOption) (*ObjectAccessControl, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ObjectAccessControl{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates an ACL entry on the specified object.",
- // "httpMethod": "PUT",
- // "id": "storage.objectAccessControls.update",
- // "parameterOrder": [
- // "bucket",
- // "object",
- // "entity"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of a bucket.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "entity": {
- // "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}/acl/{entity}",
- // "request": {
- // "$ref": "ObjectAccessControl"
- // },
- // "response": {
- // "$ref": "ObjectAccessControl"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.objects.compose":
-
-type ObjectsComposeCall struct {
- s *Service
- destinationBucket string
- destinationObject string
- composerequest *ComposeRequest
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Compose: Concatenates a list of existing objects into a new object in
-// the same bucket.
-func (r *ObjectsService) Compose(destinationBucket string, destinationObject string, composerequest *ComposeRequest) *ObjectsComposeCall {
- c := &ObjectsComposeCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.destinationBucket = destinationBucket
- c.destinationObject = destinationObject
- c.composerequest = composerequest
- return c
-}
-
-// DestinationPredefinedAcl sets the optional parameter
-// "destinationPredefinedAcl": Apply a predefined set of access controls
-// to the destination object.
-//
-// Possible values:
-// "authenticatedRead" - Object owner gets OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "bucketOwnerFullControl" - Object owner gets OWNER access, and
-// project team owners get OWNER access.
-// "bucketOwnerRead" - Object owner gets OWNER access, and project
-// team owners get READER access.
-// "private" - Object owner gets OWNER access.
-// "projectPrivate" - Object owner gets OWNER access, and project team
-// members get access according to their roles.
-// "publicRead" - Object owner gets OWNER access, and allUsers get
-// READER access.
-func (c *ObjectsComposeCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsComposeCall {
- c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
- return c
-}
-
-// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
-// Makes the operation conditional on whether the object's current
-// generation matches the given value. Setting to 0 makes the operation
-// succeed only if there are no live versions of the object.
-func (c *ObjectsComposeCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsComposeCall {
- c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": Makes the operation conditional on whether
-// the object's current metageneration matches the given value.
-func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsComposeCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- 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
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsComposeCall) UserProject(userProject string) *ObjectsComposeCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsComposeCall) Fields(s ...googleapi.Field) *ObjectsComposeCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectsComposeCall) Context(ctx context.Context) *ObjectsComposeCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsComposeCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.composerequest)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{destinationBucket}/o/{destinationObject}/compose")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "destinationBucket": c.destinationBucket,
- "destinationObject": c.destinationObject,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.compose" call.
-// Exactly one of *Object or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Object.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Object{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Concatenates a list of existing objects into a new object in the same bucket.",
- // "httpMethod": "POST",
- // "id": "storage.objects.compose",
- // "parameterOrder": [
- // "destinationBucket",
- // "destinationObject"
- // ],
- // "parameters": {
- // "destinationBucket": {
- // "description": "Name of the bucket in which to store the new object.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "destinationObject": {
- // "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "destinationPredefinedAcl": {
- // "description": "Apply a predefined set of access controls to the destination object.",
- // "enum": [
- // "authenticatedRead",
- // "bucketOwnerFullControl",
- // "bucketOwnerRead",
- // "private",
- // "projectPrivate",
- // "publicRead"
- // ],
- // "enumDescriptions": [
- // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- // "Object owner gets OWNER access, and project team owners get OWNER access.",
- // "Object owner gets OWNER access, and project team owners get READER access.",
- // "Object owner gets OWNER access.",
- // "Object owner gets OWNER access, and project team members get access according to their roles.",
- // "Object owner gets OWNER access, and allUsers get READER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- // "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"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{destinationBucket}/o/{destinationObject}/compose",
- // "request": {
- // "$ref": "ComposeRequest"
- // },
- // "response": {
- // "$ref": "Object"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.objects.copy":
-
-type ObjectsCopyCall struct {
- s *Service
- sourceBucket string
- sourceObject string
- destinationBucket string
- destinationObject string
- object *Object
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Copy: Copies a source object to a destination object. Optionally
-// overrides metadata.
-func (r *ObjectsService) Copy(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsCopyCall {
- c := &ObjectsCopyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.sourceBucket = sourceBucket
- c.sourceObject = sourceObject
- c.destinationBucket = destinationBucket
- c.destinationObject = destinationObject
- c.object = object
- return c
-}
-
-// DestinationPredefinedAcl sets the optional parameter
-// "destinationPredefinedAcl": Apply a predefined set of access controls
-// to the destination object.
-//
-// Possible values:
-// "authenticatedRead" - Object owner gets OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "bucketOwnerFullControl" - Object owner gets OWNER access, and
-// project team owners get OWNER access.
-// "bucketOwnerRead" - Object owner gets OWNER access, and project
-// team owners get READER access.
-// "private" - Object owner gets OWNER access.
-// "projectPrivate" - Object owner gets OWNER access, and project team
-// members get access according to their roles.
-// "publicRead" - Object owner gets OWNER access, and allUsers get
-// READER access.
-func (c *ObjectsCopyCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsCopyCall {
- c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
- return c
-}
-
-// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
-// Makes the operation conditional on whether the destination object's
-// current generation matches the given value. Setting to 0 makes the
-// operation succeed only if there are no live versions of the object.
-func (c *ObjectsCopyCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsCopyCall {
- c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
- return c
-}
-
-// IfGenerationNotMatch sets the optional parameter
-// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the destination object's current generation does not match the given
-// value. If no live object exists, the precondition fails. Setting to 0
-// makes the operation succeed only if there is a live version of the
-// object.
-func (c *ObjectsCopyCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsCopyCall {
- c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": Makes the operation conditional on whether
-// the destination object's current metageneration matches the given
-// value.
-func (c *ObjectsCopyCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsCopyCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": Makes the operation conditional on
-// whether the destination object's current metageneration does not
-// match the given value.
-func (c *ObjectsCopyCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsCopyCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- return c
-}
-
-// IfSourceGenerationMatch sets the optional parameter
-// "ifSourceGenerationMatch": Makes the operation conditional on whether
-// the source object's current generation matches the given value.
-func (c *ObjectsCopyCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsCopyCall {
- c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
- return c
-}
-
-// IfSourceGenerationNotMatch sets the optional parameter
-// "ifSourceGenerationNotMatch": Makes the operation conditional on
-// whether the source object's current generation does not match the
-// given value.
-func (c *ObjectsCopyCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsCopyCall {
- c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
- return c
-}
-
-// IfSourceMetagenerationMatch sets the optional parameter
-// "ifSourceMetagenerationMatch": Makes the operation conditional on
-// whether the source object's current metageneration matches the given
-// value.
-func (c *ObjectsCopyCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsCopyCall {
- c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
- return c
-}
-
-// IfSourceMetagenerationNotMatch sets the optional parameter
-// "ifSourceMetagenerationNotMatch": Makes the operation conditional on
-// whether the source object's current metageneration does not match the
-// given value.
-func (c *ObjectsCopyCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsCopyCall {
- c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to noAcl, unless the object resource
-// specifies the acl property, when it defaults to full.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit the owner, acl property.
-func (c *ObjectsCopyCall) Projection(projection string) *ObjectsCopyCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// SourceGeneration sets the optional parameter "sourceGeneration": If
-// present, selects a specific revision of the source object (as opposed
-// to the latest version, the default).
-func (c *ObjectsCopyCall) SourceGeneration(sourceGeneration int64) *ObjectsCopyCall {
- c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsCopyCall) UserProject(userProject string) *ObjectsCopyCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsCopyCall) Fields(s ...googleapi.Field) *ObjectsCopyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectsCopyCall) Context(ctx context.Context) *ObjectsCopyCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsCopyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "sourceBucket": c.sourceBucket,
- "sourceObject": c.sourceObject,
- "destinationBucket": c.destinationBucket,
- "destinationObject": c.destinationObject,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.copy" call.
-// Exactly one of *Object or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Object.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ObjectsCopyCall) Do(opts ...googleapi.CallOption) (*Object, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Object{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Copies a source object to a destination object. Optionally overrides metadata.",
- // "httpMethod": "POST",
- // "id": "storage.objects.copy",
- // "parameterOrder": [
- // "sourceBucket",
- // "sourceObject",
- // "destinationBucket",
- // "destinationObject"
- // ],
- // "parameters": {
- // "destinationBucket": {
- // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "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.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "destinationPredefinedAcl": {
- // "description": "Apply a predefined set of access controls to the destination object.",
- // "enum": [
- // "authenticatedRead",
- // "bucketOwnerFullControl",
- // "bucketOwnerRead",
- // "private",
- // "projectPrivate",
- // "publicRead"
- // ],
- // "enumDescriptions": [
- // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- // "Object owner gets OWNER access, and project team owners get OWNER access.",
- // "Object owner gets OWNER access, and project team owners get READER access.",
- // "Object owner gets OWNER access.",
- // "Object owner gets OWNER access, and project team members get access according to their roles.",
- // "Object owner gets OWNER access, and allUsers get READER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifSourceGenerationMatch": {
- // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifSourceGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifSourceMetagenerationMatch": {
- // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifSourceMetagenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit the owner, acl property."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "sourceBucket": {
- // "description": "Name of the bucket in which to find the source object.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "sourceGeneration": {
- // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "sourceObject": {
- // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}",
- // "request": {
- // "$ref": "Object"
- // },
- // "response": {
- // "$ref": "Object"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.objects.delete":
-
-type ObjectsDeleteCall struct {
- s *Service
- bucket string
- object string
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Delete: Deletes an object and its metadata. Deletions are permanent
-// if versioning is not enabled for the bucket, or if the generation
-// parameter is used.
-func (r *ObjectsService) Delete(bucket string, object string) *ObjectsDeleteCall {
- c := &ObjectsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// permanently deletes a specific revision of this object (as opposed to
-// the latest version, the default).
-func (c *ObjectsDeleteCall) Generation(generation int64) *ObjectsDeleteCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
-// Makes the operation conditional on whether the object's current
-// generation matches the given value. Setting to 0 makes the operation
-// succeed only if there are no live versions of the object.
-func (c *ObjectsDeleteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsDeleteCall {
- c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
- return c
-}
-
-// IfGenerationNotMatch sets the optional parameter
-// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the object's current generation does not match the given value. If no
-// live object exists, the precondition fails. Setting to 0 makes the
-// operation succeed only if there is a live version of the object.
-func (c *ObjectsDeleteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsDeleteCall {
- c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": Makes the operation conditional on whether
-// the object's current metageneration matches the given value.
-func (c *ObjectsDeleteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsDeleteCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": Makes the operation conditional on
-// whether the object's current metageneration does not match the given
-// value.
-func (c *ObjectsDeleteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsDeleteCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsDeleteCall) UserProject(userProject string) *ObjectsDeleteCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsDeleteCall) Fields(s ...googleapi.Field) *ObjectsDeleteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectsDeleteCall) Context(ctx context.Context) *ObjectsDeleteCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsDeleteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("DELETE", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.delete" call.
-func (c *ObjectsDeleteCall) Do(opts ...googleapi.CallOption) error {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if err != nil {
- return err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return err
- }
- return nil
- // {
- // "description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.",
- // "httpMethod": "DELETE",
- // "id": "storage.objects.delete",
- // "parameterOrder": [
- // "bucket",
- // "object"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of the bucket in which the object resides.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}",
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.objects.get":
-
-type ObjectsGetCall struct {
- s *Service
- bucket string
- object string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Retrieves an object or its metadata.
-func (r *ObjectsService) Get(bucket string, object string) *ObjectsGetCall {
- c := &ObjectsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectsGetCall) Generation(generation int64) *ObjectsGetCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
-// Makes the operation conditional on whether the object's current
-// generation matches the given value. Setting to 0 makes the operation
-// succeed only if there are no live versions of the object.
-func (c *ObjectsGetCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsGetCall {
- c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
- return c
-}
-
-// IfGenerationNotMatch sets the optional parameter
-// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the object's current generation does not match the given value. If no
-// live object exists, the precondition fails. Setting to 0 makes the
-// operation succeed only if there is a live version of the object.
-func (c *ObjectsGetCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsGetCall {
- c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": Makes the operation conditional on whether
-// the object's current metageneration matches the given value.
-func (c *ObjectsGetCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsGetCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": Makes the operation conditional on
-// whether the object's current metageneration does not match the given
-// value.
-func (c *ObjectsGetCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsGetCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to noAcl.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit the owner, acl property.
-func (c *ObjectsGetCall) Projection(projection string) *ObjectsGetCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsGetCall) UserProject(userProject string) *ObjectsGetCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsGetCall) Fields(s ...googleapi.Field) *ObjectsGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *ObjectsGetCall) IfNoneMatch(entityTag string) *ObjectsGetCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do and Download
-// methods. Any pending HTTP request will be aborted if the provided
-// context is canceled.
-func (c *ObjectsGetCall) Context(ctx context.Context) *ObjectsGetCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Download fetches the API endpoint's "media" value, instead of the normal
-// API response value. If the returned error is nil, the Response is guaranteed to
-// have a 2xx status code. Callers must close the Response.Body as usual.
-func (c *ObjectsGetCall) Download(opts ...googleapi.CallOption) (*http.Response, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("media")
- if err != nil {
- return nil, err
- }
- if err := googleapi.CheckMediaResponse(res); err != nil {
- res.Body.Close()
- return nil, err
- }
- return res, nil
-}
-
-// Do executes the "storage.objects.get" call.
-// Exactly one of *Object or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Object.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ObjectsGetCall) Do(opts ...googleapi.CallOption) (*Object, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Object{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves an object or its metadata.",
- // "httpMethod": "GET",
- // "id": "storage.objects.get",
- // "parameterOrder": [
- // "bucket",
- // "object"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of the bucket in which the object resides.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to noAcl.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit the owner, acl property."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}",
- // "response": {
- // "$ref": "Object"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ],
- // "supportsMediaDownload": true,
- // "useMediaDownloadService": true
- // }
-
-}
-
-// method id "storage.objects.getIamPolicy":
-
-type ObjectsGetIamPolicyCall struct {
- s *Service
- bucket string
- object string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// GetIamPolicy: Returns an IAM policy for the specified object.
-func (r *ObjectsService) GetIamPolicy(bucket string, object string) *ObjectsGetIamPolicyCall {
- c := &ObjectsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectsGetIamPolicyCall) Generation(generation int64) *ObjectsGetIamPolicyCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsGetIamPolicyCall) UserProject(userProject string) *ObjectsGetIamPolicyCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsGetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsGetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *ObjectsGetIamPolicyCall) IfNoneMatch(entityTag string) *ObjectsGetIamPolicyCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectsGetIamPolicyCall) Context(ctx context.Context) *ObjectsGetIamPolicyCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsGetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.getIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ObjectsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Policy{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Returns an IAM policy for the specified object.",
- // "httpMethod": "GET",
- // "id": "storage.objects.getIamPolicy",
- // "parameterOrder": [
- // "bucket",
- // "object"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of the bucket in which the object resides.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}/iam",
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.objects.insert":
-
-type ObjectsInsertCall struct {
- s *Service
- bucket string
- object *Object
- urlParams_ gensupport.URLParams
- mediaInfo_ *gensupport.MediaInfo
- ctx_ context.Context
- header_ http.Header
-}
-
-// Insert: Stores a new object and metadata.
-func (r *ObjectsService) Insert(bucket string, object *Object) *ObjectsInsertCall {
- c := &ObjectsInsertCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- return c
-}
-
-// ContentEncoding sets the optional parameter "contentEncoding": If
-// set, sets the contentEncoding property of the final object to this
-// value. Setting this parameter is equivalent to setting the
-// contentEncoding metadata property. This can be useful when uploading
-// an object with uploadType=media to indicate the encoding of the
-// content being uploaded.
-func (c *ObjectsInsertCall) ContentEncoding(contentEncoding string) *ObjectsInsertCall {
- c.urlParams_.Set("contentEncoding", contentEncoding)
- return c
-}
-
-// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
-// Makes the operation conditional on whether the object's current
-// generation matches the given value. Setting to 0 makes the operation
-// succeed only if there are no live versions of the object.
-func (c *ObjectsInsertCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsInsertCall {
- c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
- return c
-}
-
-// IfGenerationNotMatch sets the optional parameter
-// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the object's current generation does not match the given value. If no
-// live object exists, the precondition fails. Setting to 0 makes the
-// operation succeed only if there is a live version of the object.
-func (c *ObjectsInsertCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsInsertCall {
- c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": Makes the operation conditional on whether
-// the object's current metageneration matches the given value.
-func (c *ObjectsInsertCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsInsertCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": Makes the operation conditional on
-// whether the object's current metageneration does not match the given
-// value.
-func (c *ObjectsInsertCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsInsertCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- 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. Limited availability; usable
-// only by enabled projects.
-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
-// URL encode object names to be path safe, see Encoding URI Path Parts.
-func (c *ObjectsInsertCall) Name(name string) *ObjectsInsertCall {
- c.urlParams_.Set("name", name)
- return c
-}
-
-// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
-// predefined set of access controls to this object.
-//
-// Possible values:
-// "authenticatedRead" - Object owner gets OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "bucketOwnerFullControl" - Object owner gets OWNER access, and
-// project team owners get OWNER access.
-// "bucketOwnerRead" - Object owner gets OWNER access, and project
-// team owners get READER access.
-// "private" - Object owner gets OWNER access.
-// "projectPrivate" - Object owner gets OWNER access, and project team
-// members get access according to their roles.
-// "publicRead" - Object owner gets OWNER access, and allUsers get
-// READER access.
-func (c *ObjectsInsertCall) PredefinedAcl(predefinedAcl string) *ObjectsInsertCall {
- c.urlParams_.Set("predefinedAcl", predefinedAcl)
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to noAcl, unless the object resource
-// specifies the acl property, when it defaults to full.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit the owner, acl property.
-func (c *ObjectsInsertCall) Projection(projection string) *ObjectsInsertCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsInsertCall) UserProject(userProject string) *ObjectsInsertCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Media specifies the media to upload in one or more chunks. The chunk
-// size may be controlled by supplying a MediaOption generated by
-// googleapi.ChunkSize. The chunk size defaults to
-// googleapi.DefaultUploadChunkSize.The Content-Type header used in the
-// upload request will be determined by sniffing the contents of r,
-// unless a MediaOption generated by googleapi.ContentType is
-// 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...)
- }
- c.mediaInfo_ = gensupport.NewInfoFromMedia(r, options)
- return c
-}
-
-// ResumableMedia specifies the media to upload in chunks and can be
-// canceled with ctx.
-//
-// Deprecated: use Media instead.
-//
-// At most one of Media and ResumableMedia may be set. mediaType
-// identifies the MIME media type of the upload, such as "image/png". If
-// mediaType is "", it will be auto-detected. The provided ctx will
-// supersede any context previously provided to the Context method.
-func (c *ObjectsInsertCall) ResumableMedia(ctx context.Context, r io.ReaderAt, size int64, mediaType string) *ObjectsInsertCall {
- c.ctx_ = ctx
- c.mediaInfo_ = gensupport.NewInfoFromResumableMedia(r, size, mediaType)
- return c
-}
-
-// ProgressUpdater provides a callback function that will be called
-// after every chunk. It should be a low-latency function in order to
-// not slow down the upload operation. This should only be called when
-// using ResumableMedia (as opposed to Media).
-func (c *ObjectsInsertCall) ProgressUpdater(pu googleapi.ProgressUpdater) *ObjectsInsertCall {
- c.mediaInfo_.SetProgressUpdater(pu)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsInsertCall) Fields(s ...googleapi.Field) *ObjectsInsertCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-// This context will supersede any context previously provided to the
-// ResumableMedia method.
-func (c *ObjectsInsertCall) Context(ctx context.Context) *ObjectsInsertCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsInsertCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
- if c.mediaInfo_ != nil {
- urls = strings.Replace(urls, "https://www.googleapis.com/", "https://www.googleapis.com/upload/", 1)
- c.urlParams_.Set("uploadType", c.mediaInfo_.UploadType())
- }
- if body == nil {
- body = new(bytes.Buffer)
- reqHeaders.Set("Content-Type", "application/json")
- }
- body, getBody, cleanup := c.mediaInfo_.UploadRequest(reqHeaders, body)
- defer cleanup()
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- gensupport.SetGetBody(req, getBody)
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.insert" call.
-// Exactly one of *Object or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Object.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ObjectsInsertCall) Do(opts ...googleapi.CallOption) (*Object, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- rx := c.mediaInfo_.ResumableUpload(res.Header.Get("Location"))
- if rx != nil {
- rx.Client = c.s.client
- rx.UserAgent = c.s.userAgent()
- ctx := c.ctx_
- if ctx == nil {
- ctx = context.TODO()
- }
- res, err = rx.Upload(ctx)
- if err != nil {
- return nil, err
- }
- defer res.Body.Close()
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- }
- ret := &Object{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Stores a new object and metadata.",
- // "httpMethod": "POST",
- // "id": "storage.objects.insert",
- // "mediaUpload": {
- // "accept": [
- // "*/*"
- // ],
- // "protocols": {
- // "resumable": {
- // "multipart": true,
- // "path": "/resumable/upload/storage/v1/b/{bucket}/o"
- // },
- // "simple": {
- // "multipart": true,
- // "path": "/upload/storage/v1/b/{bucket}/o"
- // }
- // }
- // },
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "contentEncoding": {
- // "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- // "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. Limited availability; usable only by enabled projects.",
- // "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",
- // "type": "string"
- // },
- // "predefinedAcl": {
- // "description": "Apply a predefined set of access controls to this object.",
- // "enum": [
- // "authenticatedRead",
- // "bucketOwnerFullControl",
- // "bucketOwnerRead",
- // "private",
- // "projectPrivate",
- // "publicRead"
- // ],
- // "enumDescriptions": [
- // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- // "Object owner gets OWNER access, and project team owners get OWNER access.",
- // "Object owner gets OWNER access, and project team owners get READER access.",
- // "Object owner gets OWNER access.",
- // "Object owner gets OWNER access, and project team members get access according to their roles.",
- // "Object owner gets OWNER access, and allUsers get READER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit the owner, acl property."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o",
- // "request": {
- // "$ref": "Object"
- // },
- // "response": {
- // "$ref": "Object"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ],
- // "supportsMediaUpload": true
- // }
-
-}
-
-// method id "storage.objects.list":
-
-type ObjectsListCall struct {
- s *Service
- bucket string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// List: Retrieves a list of objects matching the criteria.
-func (r *ObjectsService) List(bucket string) *ObjectsListCall {
- c := &ObjectsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- return c
-}
-
-// Delimiter sets the optional parameter "delimiter": Returns results in
-// a directory-like mode. items will contain only objects whose names,
-// aside from the prefix, do not contain delimiter. Objects whose names,
-// aside from the prefix, contain delimiter will have their name,
-// truncated after the delimiter, returned in prefixes. Duplicate
-// prefixes are omitted.
-func (c *ObjectsListCall) Delimiter(delimiter string) *ObjectsListCall {
- c.urlParams_.Set("delimiter", delimiter)
- return c
-}
-
-// IncludeTrailingDelimiter sets the optional parameter
-// "includeTrailingDelimiter": If true, objects that end in exactly one
-// instance of delimiter will have their metadata included in items in
-// addition to prefixes.
-func (c *ObjectsListCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsListCall {
- c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": Maximum number
-// of items plus prefixes to return in a single page of responses. As
-// duplicate prefixes are omitted, fewer total results may be returned
-// than requested. The service will use this parameter or 1,000 items,
-// whichever is smaller.
-func (c *ObjectsListCall) MaxResults(maxResults int64) *ObjectsListCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": A
-// previously-returned page token representing part of the larger set of
-// results to view.
-func (c *ObjectsListCall) PageToken(pageToken string) *ObjectsListCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// Prefix sets the optional parameter "prefix": Filter results to
-// objects whose names begin with this prefix.
-func (c *ObjectsListCall) Prefix(prefix string) *ObjectsListCall {
- c.urlParams_.Set("prefix", prefix)
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to noAcl.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit the owner, acl property.
-func (c *ObjectsListCall) Projection(projection string) *ObjectsListCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsListCall) UserProject(userProject string) *ObjectsListCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Versions sets the optional parameter "versions": If true, lists all
-// versions of an object as distinct results. The default is false. For
-// more information, see Object Versioning.
-func (c *ObjectsListCall) Versions(versions bool) *ObjectsListCall {
- c.urlParams_.Set("versions", fmt.Sprint(versions))
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsListCall) Fields(s ...googleapi.Field) *ObjectsListCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *ObjectsListCall) IfNoneMatch(entityTag string) *ObjectsListCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectsListCall) Context(ctx context.Context) *ObjectsListCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsListCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.list" call.
-// Exactly one of *Objects or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Objects.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ObjectsListCall) Do(opts ...googleapi.CallOption) (*Objects, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Objects{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Retrieves a list of objects matching the criteria.",
- // "httpMethod": "GET",
- // "id": "storage.objects.list",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of the bucket in which to look for objects.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "delimiter": {
- // "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeTrailingDelimiter": {
- // "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "1000",
- // "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A previously-returned page token representing part of the larger set of results to view.",
- // "location": "query",
- // "type": "string"
- // },
- // "prefix": {
- // "description": "Filter results to objects whose names begin with this prefix.",
- // "location": "query",
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to noAcl.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit the owner, acl property."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // },
- // "versions": {
- // "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "b/{bucket}/o",
- // "response": {
- // "$ref": "Objects"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ],
- // "supportsSubscription": true
- // }
-
-}
-
-// Pages invokes f for each page of results.
-// A non-nil error returned from f will halt the iteration.
-// The provided context supersedes any context provided to the Context method.
-func (c *ObjectsListCall) Pages(ctx context.Context, f func(*Objects) error) error {
- c.ctx_ = ctx
- defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
- for {
- x, err := c.Do()
- if err != nil {
- return err
- }
- if err := f(x); err != nil {
- return err
- }
- if x.NextPageToken == "" {
- return nil
- }
- c.PageToken(x.NextPageToken)
- }
-}
-
-// method id "storage.objects.patch":
-
-type ObjectsPatchCall struct {
- s *Service
- bucket string
- object string
- object2 *Object
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Patch: Patches an object's metadata.
-func (r *ObjectsService) Patch(bucket string, object string, object2 *Object) *ObjectsPatchCall {
- c := &ObjectsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- c.object2 = object2
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectsPatchCall) Generation(generation int64) *ObjectsPatchCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
-// Makes the operation conditional on whether the object's current
-// generation matches the given value. Setting to 0 makes the operation
-// succeed only if there are no live versions of the object.
-func (c *ObjectsPatchCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsPatchCall {
- c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
- return c
-}
-
-// IfGenerationNotMatch sets the optional parameter
-// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the object's current generation does not match the given value. If no
-// live object exists, the precondition fails. Setting to 0 makes the
-// operation succeed only if there is a live version of the object.
-func (c *ObjectsPatchCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsPatchCall {
- c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": Makes the operation conditional on whether
-// the object's current metageneration matches the given value.
-func (c *ObjectsPatchCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsPatchCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": Makes the operation conditional on
-// whether the object's current metageneration does not match the given
-// value.
-func (c *ObjectsPatchCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsPatchCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- return c
-}
-
-// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
-// predefined set of access controls to this object.
-//
-// Possible values:
-// "authenticatedRead" - Object owner gets OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "bucketOwnerFullControl" - Object owner gets OWNER access, and
-// project team owners get OWNER access.
-// "bucketOwnerRead" - Object owner gets OWNER access, and project
-// team owners get READER access.
-// "private" - Object owner gets OWNER access.
-// "projectPrivate" - Object owner gets OWNER access, and project team
-// members get access according to their roles.
-// "publicRead" - Object owner gets OWNER access, and allUsers get
-// READER access.
-func (c *ObjectsPatchCall) PredefinedAcl(predefinedAcl string) *ObjectsPatchCall {
- c.urlParams_.Set("predefinedAcl", predefinedAcl)
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to full.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit the owner, acl property.
-func (c *ObjectsPatchCall) Projection(projection string) *ObjectsPatchCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request, for Requester Pays buckets.
-func (c *ObjectsPatchCall) UserProject(userProject string) *ObjectsPatchCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsPatchCall) Fields(s ...googleapi.Field) *ObjectsPatchCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectsPatchCall) Context(ctx context.Context) *ObjectsPatchCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsPatchCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PATCH", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.patch" call.
-// Exactly one of *Object or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Object.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ObjectsPatchCall) Do(opts ...googleapi.CallOption) (*Object, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Object{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Patches an object's metadata.",
- // "httpMethod": "PATCH",
- // "id": "storage.objects.patch",
- // "parameterOrder": [
- // "bucket",
- // "object"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of the bucket in which the object resides.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "predefinedAcl": {
- // "description": "Apply a predefined set of access controls to this object.",
- // "enum": [
- // "authenticatedRead",
- // "bucketOwnerFullControl",
- // "bucketOwnerRead",
- // "private",
- // "projectPrivate",
- // "publicRead"
- // ],
- // "enumDescriptions": [
- // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- // "Object owner gets OWNER access, and project team owners get OWNER access.",
- // "Object owner gets OWNER access, and project team owners get READER access.",
- // "Object owner gets OWNER access.",
- // "Object owner gets OWNER access, and project team members get access according to their roles.",
- // "Object owner gets OWNER access, and allUsers get READER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to full.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit the owner, acl property."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request, for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}",
- // "request": {
- // "$ref": "Object"
- // },
- // "response": {
- // "$ref": "Object"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.objects.rewrite":
-
-type ObjectsRewriteCall struct {
- s *Service
- sourceBucket string
- sourceObject string
- destinationBucket string
- destinationObject string
- object *Object
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Rewrite: Rewrites a source object to a destination object. Optionally
-// overrides metadata.
-func (r *ObjectsService) Rewrite(sourceBucket string, sourceObject string, destinationBucket string, destinationObject string, object *Object) *ObjectsRewriteCall {
- c := &ObjectsRewriteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.sourceBucket = sourceBucket
- c.sourceObject = sourceObject
- c.destinationBucket = destinationBucket
- c.destinationObject = destinationObject
- c.object = object
- 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.
-//
-// Possible values:
-// "authenticatedRead" - Object owner gets OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "bucketOwnerFullControl" - Object owner gets OWNER access, and
-// project team owners get OWNER access.
-// "bucketOwnerRead" - Object owner gets OWNER access, and project
-// team owners get READER access.
-// "private" - Object owner gets OWNER access.
-// "projectPrivate" - Object owner gets OWNER access, and project team
-// members get access according to their roles.
-// "publicRead" - Object owner gets OWNER access, and allUsers get
-// READER access.
-func (c *ObjectsRewriteCall) DestinationPredefinedAcl(destinationPredefinedAcl string) *ObjectsRewriteCall {
- c.urlParams_.Set("destinationPredefinedAcl", destinationPredefinedAcl)
- return c
-}
-
-// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
-// Makes the operation conditional on whether the object's current
-// generation matches the given value. Setting to 0 makes the operation
-// succeed only if there are no live versions of the object.
-func (c *ObjectsRewriteCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsRewriteCall {
- c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
- return c
-}
-
-// IfGenerationNotMatch sets the optional parameter
-// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the object's current generation does not match the given value. If no
-// live object exists, the precondition fails. Setting to 0 makes the
-// operation succeed only if there is a live version of the object.
-func (c *ObjectsRewriteCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsRewriteCall {
- c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": Makes the operation conditional on whether
-// the destination object's current metageneration matches the given
-// value.
-func (c *ObjectsRewriteCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsRewriteCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": Makes the operation conditional on
-// whether the destination object's current metageneration does not
-// match the given value.
-func (c *ObjectsRewriteCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsRewriteCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- return c
-}
-
-// IfSourceGenerationMatch sets the optional parameter
-// "ifSourceGenerationMatch": Makes the operation conditional on whether
-// the source object's current generation matches the given value.
-func (c *ObjectsRewriteCall) IfSourceGenerationMatch(ifSourceGenerationMatch int64) *ObjectsRewriteCall {
- c.urlParams_.Set("ifSourceGenerationMatch", fmt.Sprint(ifSourceGenerationMatch))
- return c
-}
-
-// IfSourceGenerationNotMatch sets the optional parameter
-// "ifSourceGenerationNotMatch": Makes the operation conditional on
-// whether the source object's current generation does not match the
-// given value.
-func (c *ObjectsRewriteCall) IfSourceGenerationNotMatch(ifSourceGenerationNotMatch int64) *ObjectsRewriteCall {
- c.urlParams_.Set("ifSourceGenerationNotMatch", fmt.Sprint(ifSourceGenerationNotMatch))
- return c
-}
-
-// IfSourceMetagenerationMatch sets the optional parameter
-// "ifSourceMetagenerationMatch": Makes the operation conditional on
-// whether the source object's current metageneration matches the given
-// value.
-func (c *ObjectsRewriteCall) IfSourceMetagenerationMatch(ifSourceMetagenerationMatch int64) *ObjectsRewriteCall {
- c.urlParams_.Set("ifSourceMetagenerationMatch", fmt.Sprint(ifSourceMetagenerationMatch))
- return c
-}
-
-// IfSourceMetagenerationNotMatch sets the optional parameter
-// "ifSourceMetagenerationNotMatch": Makes the operation conditional on
-// whether the source object's current metageneration does not match the
-// given value.
-func (c *ObjectsRewriteCall) IfSourceMetagenerationNotMatch(ifSourceMetagenerationNotMatch int64) *ObjectsRewriteCall {
- c.urlParams_.Set("ifSourceMetagenerationNotMatch", fmt.Sprint(ifSourceMetagenerationNotMatch))
- return c
-}
-
-// MaxBytesRewrittenPerCall sets the optional parameter
-// "maxBytesRewrittenPerCall": The maximum number of bytes that will be
-// rewritten per rewrite request. Most callers shouldn't need to specify
-// this parameter - it is primarily in place to support testing. If
-// specified the value must be an integral multiple of 1 MiB (1048576).
-// Also, this only applies to requests where the source and destination
-// span locations and/or storage classes. Finally, this value must not
-// change across rewrite calls else you'll get an error that the
-// rewriteToken is invalid.
-func (c *ObjectsRewriteCall) MaxBytesRewrittenPerCall(maxBytesRewrittenPerCall int64) *ObjectsRewriteCall {
- c.urlParams_.Set("maxBytesRewrittenPerCall", fmt.Sprint(maxBytesRewrittenPerCall))
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to noAcl, unless the object resource
-// specifies the acl property, when it defaults to full.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit the owner, acl property.
-func (c *ObjectsRewriteCall) Projection(projection string) *ObjectsRewriteCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// RewriteToken sets the optional parameter "rewriteToken": Include this
-// field (from the previous rewrite response) on each rewrite request
-// after the first one, until the rewrite response 'done' flag is true.
-// Calls that provide a rewriteToken can omit all other request fields,
-// but if included those fields must match the values provided in the
-// first rewrite request.
-func (c *ObjectsRewriteCall) RewriteToken(rewriteToken string) *ObjectsRewriteCall {
- c.urlParams_.Set("rewriteToken", rewriteToken)
- return c
-}
-
-// SourceGeneration sets the optional parameter "sourceGeneration": If
-// present, selects a specific revision of the source object (as opposed
-// to the latest version, the default).
-func (c *ObjectsRewriteCall) SourceGeneration(sourceGeneration int64) *ObjectsRewriteCall {
- c.urlParams_.Set("sourceGeneration", fmt.Sprint(sourceGeneration))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsRewriteCall) UserProject(userProject string) *ObjectsRewriteCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsRewriteCall) Fields(s ...googleapi.Field) *ObjectsRewriteCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectsRewriteCall) Context(ctx context.Context) *ObjectsRewriteCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsRewriteCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.object)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "sourceBucket": c.sourceBucket,
- "sourceObject": c.sourceObject,
- "destinationBucket": c.destinationBucket,
- "destinationObject": c.destinationObject,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.rewrite" call.
-// Exactly one of *RewriteResponse or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *RewriteResponse.ServerResponse.Header or (if a response was returned
-// at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *ObjectsRewriteCall) Do(opts ...googleapi.CallOption) (*RewriteResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &RewriteResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Rewrites a source object to a destination object. Optionally overrides metadata.",
- // "httpMethod": "POST",
- // "id": "storage.objects.rewrite",
- // "parameterOrder": [
- // "sourceBucket",
- // "sourceObject",
- // "destinationBucket",
- // "destinationObject"
- // ],
- // "parameters": {
- // "destinationBucket": {
- // "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.",
- // "location": "path",
- // "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",
- // "required": true,
- // "type": "string"
- // },
- // "destinationPredefinedAcl": {
- // "description": "Apply a predefined set of access controls to the destination object.",
- // "enum": [
- // "authenticatedRead",
- // "bucketOwnerFullControl",
- // "bucketOwnerRead",
- // "private",
- // "projectPrivate",
- // "publicRead"
- // ],
- // "enumDescriptions": [
- // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- // "Object owner gets OWNER access, and project team owners get OWNER access.",
- // "Object owner gets OWNER access, and project team owners get READER access.",
- // "Object owner gets OWNER access.",
- // "Object owner gets OWNER access, and project team members get access according to their roles.",
- // "Object owner gets OWNER access, and allUsers get READER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifSourceGenerationMatch": {
- // "description": "Makes the operation conditional on whether the source object's current generation matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifSourceGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifSourceMetagenerationMatch": {
- // "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifSourceMetagenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "maxBytesRewrittenPerCall": {
- // "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit the owner, acl property."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "rewriteToken": {
- // "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.",
- // "location": "query",
- // "type": "string"
- // },
- // "sourceBucket": {
- // "description": "Name of the bucket in which to find the source object.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "sourceGeneration": {
- // "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "sourceObject": {
- // "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}",
- // "request": {
- // "$ref": "Object"
- // },
- // "response": {
- // "$ref": "RewriteResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.objects.setIamPolicy":
-
-type ObjectsSetIamPolicyCall struct {
- s *Service
- bucket string
- object string
- policy *Policy
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// SetIamPolicy: Updates an IAM policy for the specified object.
-func (r *ObjectsService) SetIamPolicy(bucket string, object string, policy *Policy) *ObjectsSetIamPolicyCall {
- c := &ObjectsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- c.policy = policy
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectsSetIamPolicyCall) Generation(generation int64) *ObjectsSetIamPolicyCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsSetIamPolicyCall) UserProject(userProject string) *ObjectsSetIamPolicyCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsSetIamPolicyCall) Fields(s ...googleapi.Field) *ObjectsSetIamPolicyCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectsSetIamPolicyCall) Context(ctx context.Context) *ObjectsSetIamPolicyCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsSetIamPolicyCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.policy)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PUT", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.setIamPolicy" call.
-// Exactly one of *Policy or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Policy.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ObjectsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Policy{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates an IAM policy for the specified object.",
- // "httpMethod": "PUT",
- // "id": "storage.objects.setIamPolicy",
- // "parameterOrder": [
- // "bucket",
- // "object"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of the bucket in which the object resides.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}/iam",
- // "request": {
- // "$ref": "Policy"
- // },
- // "response": {
- // "$ref": "Policy"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.objects.testIamPermissions":
-
-type ObjectsTestIamPermissionsCall struct {
- s *Service
- bucket string
- object string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// TestIamPermissions: Tests a set of permissions on the given object to
-// see which, if any, are held by the caller.
-func (r *ObjectsService) TestIamPermissions(bucket string, object string, permissions []string) *ObjectsTestIamPermissionsCall {
- c := &ObjectsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- c.urlParams_.SetMulti("permissions", append([]string{}, permissions...))
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectsTestIamPermissionsCall) Generation(generation int64) *ObjectsTestIamPermissionsCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsTestIamPermissionsCall) UserProject(userProject string) *ObjectsTestIamPermissionsCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ObjectsTestIamPermissionsCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *ObjectsTestIamPermissionsCall) IfNoneMatch(entityTag string) *ObjectsTestIamPermissionsCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectsTestIamPermissionsCall) Context(ctx context.Context) *ObjectsTestIamPermissionsCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsTestIamPermissionsCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}/iam/testPermissions")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.testIamPermissions" call.
-// Exactly one of *TestIamPermissionsResponse or error will be non-nil.
-// Any non-2xx status code is an error. Response headers are in either
-// *TestIamPermissionsResponse.ServerResponse.Header or (if a response
-// was returned at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *ObjectsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &TestIamPermissionsResponse{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.",
- // "httpMethod": "GET",
- // "id": "storage.objects.testIamPermissions",
- // "parameterOrder": [
- // "bucket",
- // "object",
- // "permissions"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of the bucket in which the object resides.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "permissions": {
- // "description": "Permissions to test.",
- // "location": "query",
- // "repeated": true,
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}/iam/testPermissions",
- // "response": {
- // "$ref": "TestIamPermissionsResponse"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
-
-// method id "storage.objects.update":
-
-type ObjectsUpdateCall struct {
- s *Service
- bucket string
- object string
- object2 *Object
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// Update: Updates an object's metadata.
-func (r *ObjectsService) Update(bucket string, object string, object2 *Object) *ObjectsUpdateCall {
- c := &ObjectsUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.object = object
- c.object2 = object2
- return c
-}
-
-// Generation sets the optional parameter "generation": If present,
-// selects a specific revision of this object (as opposed to the latest
-// version, the default).
-func (c *ObjectsUpdateCall) Generation(generation int64) *ObjectsUpdateCall {
- c.urlParams_.Set("generation", fmt.Sprint(generation))
- return c
-}
-
-// IfGenerationMatch sets the optional parameter "ifGenerationMatch":
-// Makes the operation conditional on whether the object's current
-// generation matches the given value. Setting to 0 makes the operation
-// succeed only if there are no live versions of the object.
-func (c *ObjectsUpdateCall) IfGenerationMatch(ifGenerationMatch int64) *ObjectsUpdateCall {
- c.urlParams_.Set("ifGenerationMatch", fmt.Sprint(ifGenerationMatch))
- return c
-}
-
-// IfGenerationNotMatch sets the optional parameter
-// "ifGenerationNotMatch": Makes the operation conditional on whether
-// the object's current generation does not match the given value. If no
-// live object exists, the precondition fails. Setting to 0 makes the
-// operation succeed only if there is a live version of the object.
-func (c *ObjectsUpdateCall) IfGenerationNotMatch(ifGenerationNotMatch int64) *ObjectsUpdateCall {
- c.urlParams_.Set("ifGenerationNotMatch", fmt.Sprint(ifGenerationNotMatch))
- return c
-}
-
-// IfMetagenerationMatch sets the optional parameter
-// "ifMetagenerationMatch": Makes the operation conditional on whether
-// the object's current metageneration matches the given value.
-func (c *ObjectsUpdateCall) IfMetagenerationMatch(ifMetagenerationMatch int64) *ObjectsUpdateCall {
- c.urlParams_.Set("ifMetagenerationMatch", fmt.Sprint(ifMetagenerationMatch))
- return c
-}
-
-// IfMetagenerationNotMatch sets the optional parameter
-// "ifMetagenerationNotMatch": Makes the operation conditional on
-// whether the object's current metageneration does not match the given
-// value.
-func (c *ObjectsUpdateCall) IfMetagenerationNotMatch(ifMetagenerationNotMatch int64) *ObjectsUpdateCall {
- c.urlParams_.Set("ifMetagenerationNotMatch", fmt.Sprint(ifMetagenerationNotMatch))
- return c
-}
-
-// PredefinedAcl sets the optional parameter "predefinedAcl": Apply a
-// predefined set of access controls to this object.
-//
-// Possible values:
-// "authenticatedRead" - Object owner gets OWNER access, and
-// allAuthenticatedUsers get READER access.
-// "bucketOwnerFullControl" - Object owner gets OWNER access, and
-// project team owners get OWNER access.
-// "bucketOwnerRead" - Object owner gets OWNER access, and project
-// team owners get READER access.
-// "private" - Object owner gets OWNER access.
-// "projectPrivate" - Object owner gets OWNER access, and project team
-// members get access according to their roles.
-// "publicRead" - Object owner gets OWNER access, and allUsers get
-// READER access.
-func (c *ObjectsUpdateCall) PredefinedAcl(predefinedAcl string) *ObjectsUpdateCall {
- c.urlParams_.Set("predefinedAcl", predefinedAcl)
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to full.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit the owner, acl property.
-func (c *ObjectsUpdateCall) Projection(projection string) *ObjectsUpdateCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsUpdateCall) UserProject(userProject string) *ObjectsUpdateCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsUpdateCall) Fields(s ...googleapi.Field) *ObjectsUpdateCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectsUpdateCall) Context(ctx context.Context) *ObjectsUpdateCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsUpdateCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.object2)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/{object}")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("PUT", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- "object": c.object,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.update" call.
-// Exactly one of *Object or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Object.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ObjectsUpdateCall) Do(opts ...googleapi.CallOption) (*Object, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Object{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Updates an object's metadata.",
- // "httpMethod": "PUT",
- // "id": "storage.objects.update",
- // "parameterOrder": [
- // "bucket",
- // "object"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of the bucket in which the object resides.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "generation": {
- // "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifGenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationMatch": {
- // "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "ifMetagenerationNotMatch": {
- // "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.",
- // "format": "int64",
- // "location": "query",
- // "type": "string"
- // },
- // "object": {
- // "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "predefinedAcl": {
- // "description": "Apply a predefined set of access controls to this object.",
- // "enum": [
- // "authenticatedRead",
- // "bucketOwnerFullControl",
- // "bucketOwnerRead",
- // "private",
- // "projectPrivate",
- // "publicRead"
- // ],
- // "enumDescriptions": [
- // "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.",
- // "Object owner gets OWNER access, and project team owners get OWNER access.",
- // "Object owner gets OWNER access, and project team owners get READER access.",
- // "Object owner gets OWNER access.",
- // "Object owner gets OWNER access, and project team members get access according to their roles.",
- // "Object owner gets OWNER access, and allUsers get READER access."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to full.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit the owner, acl property."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "b/{bucket}/o/{object}",
- // "request": {
- // "$ref": "Object"
- // },
- // "response": {
- // "$ref": "Object"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/devstorage.full_control"
- // ]
- // }
-
-}
-
-// method id "storage.objects.watchAll":
-
-type ObjectsWatchAllCall struct {
- s *Service
- bucket string
- channel *Channel
- urlParams_ gensupport.URLParams
- ctx_ context.Context
- header_ http.Header
-}
-
-// WatchAll: Watch for changes on all objects in a bucket.
-func (r *ObjectsService) WatchAll(bucket string, channel *Channel) *ObjectsWatchAllCall {
- c := &ObjectsWatchAllCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.bucket = bucket
- c.channel = channel
- return c
-}
-
-// Delimiter sets the optional parameter "delimiter": Returns results in
-// a directory-like mode. items will contain only objects whose names,
-// aside from the prefix, do not contain delimiter. Objects whose names,
-// aside from the prefix, contain delimiter will have their name,
-// truncated after the delimiter, returned in prefixes. Duplicate
-// prefixes are omitted.
-func (c *ObjectsWatchAllCall) Delimiter(delimiter string) *ObjectsWatchAllCall {
- c.urlParams_.Set("delimiter", delimiter)
- return c
-}
-
-// IncludeTrailingDelimiter sets the optional parameter
-// "includeTrailingDelimiter": If true, objects that end in exactly one
-// instance of delimiter will have their metadata included in items in
-// addition to prefixes.
-func (c *ObjectsWatchAllCall) IncludeTrailingDelimiter(includeTrailingDelimiter bool) *ObjectsWatchAllCall {
- c.urlParams_.Set("includeTrailingDelimiter", fmt.Sprint(includeTrailingDelimiter))
- return c
-}
-
-// MaxResults sets the optional parameter "maxResults": Maximum number
-// of items plus prefixes to return in a single page of responses. As
-// duplicate prefixes are omitted, fewer total results may be returned
-// than requested. The service will use this parameter or 1,000 items,
-// whichever is smaller.
-func (c *ObjectsWatchAllCall) MaxResults(maxResults int64) *ObjectsWatchAllCall {
- c.urlParams_.Set("maxResults", fmt.Sprint(maxResults))
- return c
-}
-
-// PageToken sets the optional parameter "pageToken": A
-// previously-returned page token representing part of the larger set of
-// results to view.
-func (c *ObjectsWatchAllCall) PageToken(pageToken string) *ObjectsWatchAllCall {
- c.urlParams_.Set("pageToken", pageToken)
- return c
-}
-
-// Prefix sets the optional parameter "prefix": Filter results to
-// objects whose names begin with this prefix.
-func (c *ObjectsWatchAllCall) Prefix(prefix string) *ObjectsWatchAllCall {
- c.urlParams_.Set("prefix", prefix)
- return c
-}
-
-// Projection sets the optional parameter "projection": Set of
-// properties to return. Defaults to noAcl.
-//
-// Possible values:
-// "full" - Include all properties.
-// "noAcl" - Omit the owner, acl property.
-func (c *ObjectsWatchAllCall) Projection(projection string) *ObjectsWatchAllCall {
- c.urlParams_.Set("projection", projection)
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request. Required for Requester Pays buckets.
-func (c *ObjectsWatchAllCall) UserProject(userProject string) *ObjectsWatchAllCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Versions sets the optional parameter "versions": If true, lists all
-// versions of an object as distinct results. The default is false. For
-// more information, see Object Versioning.
-func (c *ObjectsWatchAllCall) Versions(versions bool) *ObjectsWatchAllCall {
- c.urlParams_.Set("versions", fmt.Sprint(versions))
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ObjectsWatchAllCall) Fields(s ...googleapi.Field) *ObjectsWatchAllCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ObjectsWatchAllCall) Context(ctx context.Context) *ObjectsWatchAllCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ObjectsWatchAllCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- var body io.Reader = nil
- body, err := googleapi.WithoutDataWrapper.JSONReader(c.channel)
- if err != nil {
- return nil, err
- }
- reqHeaders.Set("Content-Type", "application/json")
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "b/{bucket}/o/watch")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("POST", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "bucket": c.bucket,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.objects.watchAll" call.
-// Exactly one of *Channel or error will be non-nil. Any non-2xx status
-// code is an error. Response headers are in either
-// *Channel.ServerResponse.Header or (if a response was returned at all)
-// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
-// check whether the returned error was because http.StatusNotModified
-// was returned.
-func (c *ObjectsWatchAllCall) Do(opts ...googleapi.CallOption) (*Channel, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &Channel{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Watch for changes on all objects in a bucket.",
- // "httpMethod": "POST",
- // "id": "storage.objects.watchAll",
- // "parameterOrder": [
- // "bucket"
- // ],
- // "parameters": {
- // "bucket": {
- // "description": "Name of the bucket in which to look for objects.",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "delimiter": {
- // "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.",
- // "location": "query",
- // "type": "string"
- // },
- // "includeTrailingDelimiter": {
- // "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.",
- // "location": "query",
- // "type": "boolean"
- // },
- // "maxResults": {
- // "default": "1000",
- // "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.",
- // "format": "uint32",
- // "location": "query",
- // "minimum": "0",
- // "type": "integer"
- // },
- // "pageToken": {
- // "description": "A previously-returned page token representing part of the larger set of results to view.",
- // "location": "query",
- // "type": "string"
- // },
- // "prefix": {
- // "description": "Filter results to objects whose names begin with this prefix.",
- // "location": "query",
- // "type": "string"
- // },
- // "projection": {
- // "description": "Set of properties to return. Defaults to noAcl.",
- // "enum": [
- // "full",
- // "noAcl"
- // ],
- // "enumDescriptions": [
- // "Include all properties.",
- // "Omit the owner, acl property."
- // ],
- // "location": "query",
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request. Required for Requester Pays buckets.",
- // "location": "query",
- // "type": "string"
- // },
- // "versions": {
- // "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.",
- // "location": "query",
- // "type": "boolean"
- // }
- // },
- // "path": "b/{bucket}/o/watch",
- // "request": {
- // "$ref": "Channel",
- // "parameterName": "resource"
- // },
- // "response": {
- // "$ref": "Channel"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ],
- // "supportsSubscription": true
- // }
-
-}
-
-// method id "storage.projects.serviceAccount.get":
-
-type ProjectsServiceAccountGetCall struct {
- s *Service
- projectId string
- urlParams_ gensupport.URLParams
- ifNoneMatch_ string
- ctx_ context.Context
- header_ http.Header
-}
-
-// Get: Get the email address of this project's Google Cloud Storage
-// service account.
-func (r *ProjectsServiceAccountService) Get(projectId string) *ProjectsServiceAccountGetCall {
- c := &ProjectsServiceAccountGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
- c.projectId = projectId
- return c
-}
-
-// UserProject sets the optional parameter "userProject": The project to
-// be billed for this request.
-func (c *ProjectsServiceAccountGetCall) UserProject(userProject string) *ProjectsServiceAccountGetCall {
- c.urlParams_.Set("userProject", userProject)
- return c
-}
-
-// Fields allows partial responses to be retrieved. See
-// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
-// for more information.
-func (c *ProjectsServiceAccountGetCall) Fields(s ...googleapi.Field) *ProjectsServiceAccountGetCall {
- c.urlParams_.Set("fields", googleapi.CombineFields(s))
- return c
-}
-
-// IfNoneMatch sets the optional parameter which makes the operation
-// fail if the object's ETag matches the given value. This is useful for
-// getting updates only after the object has changed since the last
-// request. Use googleapi.IsNotModified to check whether the response
-// error from Do is the result of In-None-Match.
-func (c *ProjectsServiceAccountGetCall) IfNoneMatch(entityTag string) *ProjectsServiceAccountGetCall {
- c.ifNoneMatch_ = entityTag
- return c
-}
-
-// Context sets the context to be used in this call's Do method. Any
-// pending HTTP request will be aborted if the provided context is
-// canceled.
-func (c *ProjectsServiceAccountGetCall) Context(ctx context.Context) *ProjectsServiceAccountGetCall {
- c.ctx_ = ctx
- return c
-}
-
-// Header returns an http.Header that can be modified by the caller to
-// add HTTP headers to the request.
-func (c *ProjectsServiceAccountGetCall) Header() http.Header {
- if c.header_ == nil {
- c.header_ = make(http.Header)
- }
- return c.header_
-}
-
-func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) {
- reqHeaders := make(http.Header)
- for k, v := range c.header_ {
- reqHeaders[k] = v
- }
- reqHeaders.Set("User-Agent", c.s.userAgent())
- if c.ifNoneMatch_ != "" {
- reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
- }
- var body io.Reader = nil
- c.urlParams_.Set("alt", alt)
- urls := googleapi.ResolveRelative(c.s.BasePath, "projects/{projectId}/serviceAccount")
- urls += "?" + c.urlParams_.Encode()
- req, _ := http.NewRequest("GET", urls, body)
- req.Header = reqHeaders
- googleapi.Expand(req.URL, map[string]string{
- "projectId": c.projectId,
- })
- return gensupport.SendRequest(c.ctx_, c.s.client, req)
-}
-
-// Do executes the "storage.projects.serviceAccount.get" call.
-// Exactly one of *ServiceAccount or error will be non-nil. Any non-2xx
-// status code is an error. Response headers are in either
-// *ServiceAccount.ServerResponse.Header or (if a response was returned
-// at all) in error.(*googleapi.Error).Header. Use
-// googleapi.IsNotModified to check whether the returned error was
-// because http.StatusNotModified was returned.
-func (c *ProjectsServiceAccountGetCall) Do(opts ...googleapi.CallOption) (*ServiceAccount, error) {
- gensupport.SetOptions(c.urlParams_, opts...)
- res, err := c.doRequest("json")
- if res != nil && res.StatusCode == http.StatusNotModified {
- if res.Body != nil {
- res.Body.Close()
- }
- return nil, &googleapi.Error{
- Code: res.StatusCode,
- Header: res.Header,
- }
- }
- if err != nil {
- return nil, err
- }
- defer googleapi.CloseBody(res)
- if err := googleapi.CheckResponse(res); err != nil {
- return nil, err
- }
- ret := &ServiceAccount{
- ServerResponse: googleapi.ServerResponse{
- Header: res.Header,
- HTTPStatusCode: res.StatusCode,
- },
- }
- target := &ret
- if err := gensupport.DecodeResponse(target, res); err != nil {
- return nil, err
- }
- return ret, nil
- // {
- // "description": "Get the email address of this project's Google Cloud Storage service account.",
- // "httpMethod": "GET",
- // "id": "storage.projects.serviceAccount.get",
- // "parameterOrder": [
- // "projectId"
- // ],
- // "parameters": {
- // "projectId": {
- // "description": "Project ID",
- // "location": "path",
- // "required": true,
- // "type": "string"
- // },
- // "userProject": {
- // "description": "The project to be billed for this request.",
- // "location": "query",
- // "type": "string"
- // }
- // },
- // "path": "projects/{projectId}/serviceAccount",
- // "response": {
- // "$ref": "ServiceAccount"
- // },
- // "scopes": [
- // "https://www.googleapis.com/auth/cloud-platform",
- // "https://www.googleapis.com/auth/cloud-platform.read-only",
- // "https://www.googleapis.com/auth/devstorage.full_control",
- // "https://www.googleapis.com/auth/devstorage.read_only",
- // "https://www.googleapis.com/auth/devstorage.read_write"
- // ]
- // }
-
-}
diff --git a/vendor/google.golang.org/api/transport/http/dial.go b/vendor/google.golang.org/api/transport/http/dial.go
deleted file mode 100644
index 5184ff5..0000000
--- a/vendor/google.golang.org/api/transport/http/dial.go
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright 2015 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 transport/http supports network connections to HTTP servers.
-// This package is not intended for use by end developers. Use the
-// google.golang.org/api/option package to configure API clients.
-package http
-
-import (
- "errors"
- "net/http"
-
- "golang.org/x/net/context"
- "golang.org/x/oauth2"
- "google.golang.org/api/googleapi/transport"
- "google.golang.org/api/internal"
- "google.golang.org/api/option"
-)
-
-// NewClient returns an HTTP client for use communicating with a Google cloud
-// service, configured with the given ClientOptions. It also returns the endpoint
-// for the service as specified in the options.
-func NewClient(ctx context.Context, opts ...option.ClientOption) (*http.Client, string, error) {
- settings, err := newSettings(opts)
- if err != nil {
- return nil, "", err
- }
- // TODO(cbro): consider injecting the User-Agent even if an explicit HTTP client is provided?
- if settings.HTTPClient != nil {
- return settings.HTTPClient, settings.Endpoint, nil
- }
- trans, err := newTransport(ctx, defaultBaseTransport(ctx), settings)
- if err != nil {
- return nil, "", err
- }
- return &http.Client{Transport: trans}, settings.Endpoint, nil
-}
-
-// NewTransport creates an http.RoundTripper for use communicating with a Google
-// cloud service, configured with the given ClientOptions. Its RoundTrip method delegates to base.
-func NewTransport(ctx context.Context, base http.RoundTripper, opts ...option.ClientOption) (http.RoundTripper, error) {
- settings, err := newSettings(opts)
- if err != nil {
- return nil, err
- }
- if settings.HTTPClient != nil {
- return nil, errors.New("transport/http: WithHTTPClient passed to NewTransport")
- }
- return newTransport(ctx, base, settings)
-}
-
-func newTransport(ctx context.Context, base http.RoundTripper, settings *internal.DialSettings) (http.RoundTripper, error) {
- trans := base
- trans = userAgentTransport{
- base: trans,
- userAgent: settings.UserAgent,
- }
- trans = addOCTransport(trans)
- switch {
- case settings.NoAuth:
- // Do nothing.
- case settings.APIKey != "":
- trans = &transport.APIKey{
- Transport: trans,
- Key: settings.APIKey,
- }
- default:
- creds, err := internal.Creds(ctx, settings)
- if err != nil {
- return nil, err
- }
- trans = &oauth2.Transport{
- Base: trans,
- Source: creds.TokenSource,
- }
- }
- return trans, nil
-}
-
-func newSettings(opts []option.ClientOption) (*internal.DialSettings, error) {
- var o internal.DialSettings
- for _, opt := range opts {
- opt.Apply(&o)
- }
- if err := o.Validate(); err != nil {
- return nil, err
- }
- if o.GRPCConn != nil {
- return nil, errors.New("unsupported gRPC connection specified")
- }
- return &o, nil
-}
-
-type userAgentTransport struct {
- userAgent string
- base http.RoundTripper
-}
-
-func (t userAgentTransport) RoundTrip(req *http.Request) (*http.Response, error) {
- rt := t.base
- if rt == nil {
- return nil, errors.New("transport: no Transport specified")
- }
- if t.userAgent == "" {
- return rt.RoundTrip(req)
- }
- newReq := *req
- newReq.Header = make(http.Header)
- for k, vv := range req.Header {
- newReq.Header[k] = vv
- }
- // TODO(cbro): append to existing User-Agent header?
- newReq.Header["User-Agent"] = []string{t.userAgent}
- return rt.RoundTrip(&newReq)
-}
-
-// Set at init time by dial_appengine.go. If nil, we're not on App Engine.
-var appengineUrlfetchHook func(context.Context) http.RoundTripper
-
-// defaultBaseTransport returns the base HTTP transport.
-// On App Engine, this is urlfetch.Transport, otherwise it's http.DefaultTransport.
-func defaultBaseTransport(ctx context.Context) http.RoundTripper {
- if appengineUrlfetchHook != nil {
- return appengineUrlfetchHook(ctx)
- }
- return http.DefaultTransport
-}
diff --git a/vendor/google.golang.org/api/transport/http/go18.go b/vendor/google.golang.org/api/transport/http/go18.go
deleted file mode 100644
index 0b01c70..0000000
--- a/vendor/google.golang.org/api/transport/http/go18.go
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2018 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.
-
-// +build go1.8
-
-package http
-
-import (
- "net/http"
-
- "contrib.go.opencensus.io/exporter/stackdriver/propagation"
- "go.opencensus.io/plugin/ochttp"
-)
-
-func addOCTransport(trans http.RoundTripper) http.RoundTripper {
- return &ochttp.Transport{
- Base: trans,
- Propagation: &propagation.HTTPFormat{},
- }
-}
diff --git a/vendor/google.golang.org/api/transport/http/not_go18.go b/vendor/google.golang.org/api/transport/http/not_go18.go
deleted file mode 100644
index 628a21a..0000000
--- a/vendor/google.golang.org/api/transport/http/not_go18.go
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2018 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.
-
-// +build !go1.8
-
-package http
-
-import "net/http"
-
-func addOCTransport(trans http.RoundTripper) http.RoundTripper { return trans }