mirror of
https://github.com/willnorris/imageproxy.git
synced 2026-05-18 08:15:14 +02:00
update all vendored dependencies
This commit is contained in:
parent
0c20cbe5b5
commit
1933f5bf1c
284 changed files with 37534 additions and 11024 deletions
17
vendor/google.golang.org/api/gensupport/go18.go
generated
vendored
Normal file
17
vendor/google.golang.org/api/gensupport/go18.go
generated
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
// 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
|
||||
}
|
||||
166
vendor/google.golang.org/api/gensupport/media.go
generated
vendored
166
vendor/google.golang.org/api/gensupport/media.go
generated
vendored
|
|
@ -5,12 +5,14 @@
|
|||
package gensupport
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/textproto"
|
||||
"strings"
|
||||
|
||||
"google.golang.org/api/googleapi"
|
||||
)
|
||||
|
|
@ -174,26 +176,156 @@ func typeHeader(contentType string) textproto.MIMEHeader {
|
|||
// 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 non-zero and the contents of media do not fit in a single
|
||||
// chunk (or there is an error reading media), then media will be returned as a
|
||||
// MediaBuffer. Otherwise, media will be returned as a Reader.
|
||||
//
|
||||
// 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) (io.Reader, *MediaBuffer) {
|
||||
func PrepareUpload(media io.Reader, chunkSize int) (r io.Reader, mb *MediaBuffer, singleChunk bool) {
|
||||
if chunkSize == 0 { // do not chunk
|
||||
return media, nil
|
||||
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)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
mb := NewMediaBuffer(media, chunkSize)
|
||||
rdr, _, _, err := mb.Chunk()
|
||||
|
||||
if err == io.EOF { // we can upload this in a single request
|
||||
return rdr, nil
|
||||
}
|
||||
// err might be a non-EOF error. If it is, 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
|
||||
}
|
||||
|
|
|
|||
14
vendor/google.golang.org/api/gensupport/not_go18.go
generated
vendored
Normal file
14
vendor/google.golang.org/api/gensupport/not_go18.go
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
// 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)) {}
|
||||
10
vendor/google.golang.org/api/gensupport/send.go
generated
vendored
10
vendor/google.golang.org/api/gensupport/send.go
generated
vendored
|
|
@ -5,6 +5,7 @@
|
|||
package gensupport
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
|
|
@ -59,3 +60,12 @@ func SendRequest(ctx context.Context, client *http.Client, req *http.Request) (*
|
|||
}
|
||||
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)
|
||||
}
|
||||
|
|
|
|||
17
vendor/google.golang.org/api/internal/settings.go
generated
vendored
17
vendor/google.golang.org/api/internal/settings.go
generated
vendored
|
|
@ -16,6 +16,7 @@
|
|||
package internal
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/http"
|
||||
|
||||
"golang.org/x/oauth2"
|
||||
|
|
@ -34,4 +35,20 @@ type DialSettings struct {
|
|||
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 != ""
|
||||
if ds.NoAuth && hasCreds {
|
||||
return errors.New("options.WithoutAuthentication is incompatible with any option that provides credentials")
|
||||
}
|
||||
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
|
||||
}
|
||||
|
|
|
|||
2
vendor/google.golang.org/api/iterator/iterator.go
generated
vendored
2
vendor/google.golang.org/api/iterator/iterator.go
generated
vendored
|
|
@ -67,7 +67,7 @@ type PageInfo struct {
|
|||
// be silently truncated.
|
||||
fetch func(pageSize int, pageToken string) (nextPageToken string, err error)
|
||||
|
||||
// Function that clears the iterator's buffer, returning any currently buffered items.
|
||||
// Function that returns the number of currently buffered items.
|
||||
bufLen func() int
|
||||
|
||||
// Function that returns the buffer, after setting the buffer variable to nil.
|
||||
|
|
|
|||
13
vendor/google.golang.org/api/option/option.go
generated
vendored
13
vendor/google.golang.org/api/option/option.go
generated
vendored
|
|
@ -160,3 +160,16 @@ func WithAPIKey(apiKey string) ClientOption {
|
|||
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 }
|
||||
|
|
|
|||
215
vendor/google.golang.org/api/storage/v1/storage-api.json
generated
vendored
215
vendor/google.golang.org/api/storage/v1/storage-api.json
generated
vendored
|
|
@ -1,11 +1,11 @@
|
|||
{
|
||||
"kind": "discovery#restDescription",
|
||||
"etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/tlgWHRfLf7fwkqtOCpLemeoORxg\"",
|
||||
"etag": "\"YWOzh2SDasdU84ArJnpYek-OMdg/aE5XnXblJMQy68d2aZIGrlTQ05U\"",
|
||||
"discoveryVersion": "v1",
|
||||
"id": "storage:v1",
|
||||
"name": "storage",
|
||||
"version": "v1",
|
||||
"revision": "20170810",
|
||||
"revision": "20171212",
|
||||
"title": "Cloud Storage JSON API",
|
||||
"description": "Stores and retrieves potentially large, immutable data objects.",
|
||||
"ownerDomain": "google.com",
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
"basePath": "/storage/v1/",
|
||||
"rootUrl": "https://www.googleapis.com/",
|
||||
"servicePath": "storage/v1/",
|
||||
"batchPath": "batch",
|
||||
"batchPath": "batch/storage/v1",
|
||||
"parameters": {
|
||||
"alt": {
|
||||
"type": "string",
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
"properties": {
|
||||
"requesterPays": {
|
||||
"type": "boolean",
|
||||
"description": "When set to true, bucket is requester pays."
|
||||
"description": "When set to true, Requester Pays is enabled for this bucket."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -153,6 +153,10 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"defaultEventBasedHold": {
|
||||
"type": "boolean",
|
||||
"description": "Defines 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 (hold is released) and then 3 more years after that. Objects under Event-Based hold cannot be deleted, overwritten or archived until the hold is removed."
|
||||
},
|
||||
"defaultObjectAcl": {
|
||||
"type": "array",
|
||||
"description": "Default access controls to apply to new objects when no ACL is provided.",
|
||||
|
|
@ -165,7 +169,8 @@
|
|||
"description": "Encryption configuration used by default for newly inserted objects, when no encryption config is specified.",
|
||||
"properties": {
|
||||
"defaultKmsKeyName": {
|
||||
"type": "string"
|
||||
"type": "string",
|
||||
"description": "A Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified. Limited availability; usable only by enabled projects."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
@ -175,7 +180,7 @@
|
|||
},
|
||||
"id": {
|
||||
"type": "string",
|
||||
"description": "The ID of the bucket. For buckets, the id and name properities are the same."
|
||||
"description": "The ID of the bucket. For buckets, the id and name properties are the same."
|
||||
},
|
||||
"kind": {
|
||||
"type": "string",
|
||||
|
|
@ -302,6 +307,26 @@
|
|||
"description": "The project number of the project the bucket belongs to.",
|
||||
"format": "uint64"
|
||||
},
|
||||
"retentionPolicy": {
|
||||
"type": "object",
|
||||
"description": "Defines the retention policy for a bucket. 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 the UpdateBucketMetadata RPC. 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": {
|
||||
"type": "string",
|
||||
"description": "The time from which policy was enforced and effective. RFC 3339 format.",
|
||||
"format": "date-time"
|
||||
},
|
||||
"isLocked": {
|
||||
"type": "boolean",
|
||||
"description": "Once locked, an object retention policy cannot be modified."
|
||||
},
|
||||
"retentionPeriod": {
|
||||
"type": "string",
|
||||
"description": "Specifies the duration 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"
|
||||
}
|
||||
}
|
||||
},
|
||||
"selfLink": {
|
||||
"type": "string",
|
||||
"description": "The URI of this bucket."
|
||||
|
|
@ -607,7 +632,12 @@
|
|||
"payload_format": {
|
||||
"type": "string",
|
||||
"description": "The desired content of the Payload.",
|
||||
"default": "JSON_API_V1"
|
||||
"default": "JSON_API_V1",
|
||||
"annotations": {
|
||||
"required": [
|
||||
"storage.notifications.insert"
|
||||
]
|
||||
}
|
||||
},
|
||||
"selfLink": {
|
||||
"type": "string",
|
||||
|
|
@ -711,6 +741,10 @@
|
|||
"type": "string",
|
||||
"description": "HTTP 1.1 Entity tag for the object."
|
||||
},
|
||||
"eventBasedHold": {
|
||||
"type": "boolean",
|
||||
"description": "Defines the Event-Based hold for an object. 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 (hold is released) and then 3 more years after that."
|
||||
},
|
||||
"generation": {
|
||||
"type": "string",
|
||||
"description": "The content generation of this object. Used for object versioning.",
|
||||
|
|
@ -727,7 +761,7 @@
|
|||
},
|
||||
"kmsKeyName": {
|
||||
"type": "string",
|
||||
"description": "Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key."
|
||||
"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."
|
||||
},
|
||||
"md5Hash": {
|
||||
"type": "string",
|
||||
|
|
@ -768,6 +802,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"retentionExpirationTime": {
|
||||
"type": "string",
|
||||
"description": "Specifies the earliest time that the object's retention period expires. This value is server-determined and 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 TemporaryHold is set (so that the user can reason about policy without having to first unset the TemporaryHold).",
|
||||
"format": "date-time"
|
||||
},
|
||||
"selfLink": {
|
||||
"type": "string",
|
||||
"description": "The link to this object."
|
||||
|
|
@ -781,6 +820,10 @@
|
|||
"type": "string",
|
||||
"description": "Storage class of the object."
|
||||
},
|
||||
"temporaryHold": {
|
||||
"type": "boolean",
|
||||
"description": "Defines the temporary hold for an object. This flag is used to enforce a temporary hold on an object. While it 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."
|
||||
},
|
||||
"timeCreated": {
|
||||
"type": "string",
|
||||
"description": "The creation time of the object in RFC 3339 format.",
|
||||
|
|
@ -946,6 +989,9 @@
|
|||
"items": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"condition": {
|
||||
"type": "any"
|
||||
},
|
||||
"members": {
|
||||
"type": "array",
|
||||
"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",
|
||||
|
|
@ -1087,7 +1133,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1120,7 +1166,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1150,7 +1196,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1182,7 +1228,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1217,7 +1263,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1256,7 +1302,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1305,7 +1351,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1357,7 +1403,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1389,7 +1435,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1471,6 +1517,11 @@
|
|||
"Omit owner, acl and defaultObjectAcl properties."
|
||||
],
|
||||
"location": "query"
|
||||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
"parameterOrder": [
|
||||
|
|
@ -1530,6 +1581,11 @@
|
|||
"Omit owner, acl and defaultObjectAcl properties."
|
||||
],
|
||||
"location": "query"
|
||||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
"parameterOrder": [
|
||||
|
|
@ -1546,6 +1602,44 @@
|
|||
"https://www.googleapis.com/auth/devstorage.read_write"
|
||||
]
|
||||
},
|
||||
"lockRetentionPolicy": {
|
||||
"id": "storage.buckets.lockRetentionPolicy",
|
||||
"path": "b/{bucket}/lockRetentionPolicy",
|
||||
"httpMethod": "POST",
|
||||
"description": "Locks retention policy on a bucket.",
|
||||
"parameters": {
|
||||
"bucket": {
|
||||
"type": "string",
|
||||
"description": "Name of a bucket.",
|
||||
"required": true,
|
||||
"location": "path"
|
||||
},
|
||||
"ifMetagenerationMatch": {
|
||||
"type": "string",
|
||||
"description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.",
|
||||
"required": true,
|
||||
"format": "int64",
|
||||
"location": "query"
|
||||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
"parameterOrder": [
|
||||
"bucket",
|
||||
"ifMetagenerationMatch"
|
||||
],
|
||||
"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": {
|
||||
"id": "storage.buckets.patch",
|
||||
"path": "b/{bucket}",
|
||||
|
|
@ -1625,7 +1719,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1657,7 +1751,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1697,7 +1791,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1795,7 +1889,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1858,7 +1952,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1891,7 +1985,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1921,7 +2015,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -1965,7 +2059,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2000,7 +2094,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2039,7 +2133,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2082,7 +2176,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2116,7 +2210,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2149,7 +2243,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2182,7 +2276,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2236,7 +2330,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2282,7 +2376,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2325,7 +2419,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2370,7 +2464,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2418,7 +2512,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2470,7 +2564,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2552,7 +2646,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2570,9 +2664,7 @@
|
|||
"https://www.googleapis.com/auth/cloud-platform",
|
||||
"https://www.googleapis.com/auth/devstorage.full_control",
|
||||
"https://www.googleapis.com/auth/devstorage.read_write"
|
||||
],
|
||||
"supportsMediaDownload": true,
|
||||
"useMediaDownloadService": true
|
||||
]
|
||||
},
|
||||
"copy": {
|
||||
"id": "storage.objects.copy",
|
||||
|
|
@ -2694,7 +2786,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2714,9 +2806,7 @@
|
|||
"https://www.googleapis.com/auth/cloud-platform",
|
||||
"https://www.googleapis.com/auth/devstorage.full_control",
|
||||
"https://www.googleapis.com/auth/devstorage.read_write"
|
||||
],
|
||||
"supportsMediaDownload": true,
|
||||
"useMediaDownloadService": true
|
||||
]
|
||||
},
|
||||
"delete": {
|
||||
"id": "storage.objects.delete",
|
||||
|
|
@ -2768,7 +2858,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2845,7 +2935,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2892,7 +2982,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -2954,7 +3044,7 @@
|
|||
},
|
||||
"kmsKeyName": {
|
||||
"type": "string",
|
||||
"description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.",
|
||||
"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"
|
||||
},
|
||||
"name": {
|
||||
|
|
@ -2998,7 +3088,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -3016,8 +3106,6 @@
|
|||
"https://www.googleapis.com/auth/devstorage.full_control",
|
||||
"https://www.googleapis.com/auth/devstorage.read_write"
|
||||
],
|
||||
"supportsMediaDownload": true,
|
||||
"useMediaDownloadService": true,
|
||||
"supportsMediaUpload": true,
|
||||
"mediaUpload": {
|
||||
"accept": [
|
||||
|
|
@ -3085,7 +3173,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
},
|
||||
"versions": {
|
||||
|
|
@ -3113,7 +3201,7 @@
|
|||
"id": "storage.objects.patch",
|
||||
"path": "b/{bucket}/o/{object}",
|
||||
"httpMethod": "PATCH",
|
||||
"description": "Updates an object's metadata. This method supports patch semantics.",
|
||||
"description": "Patches an object's metadata.",
|
||||
"parameters": {
|
||||
"bucket": {
|
||||
"type": "string",
|
||||
|
|
@ -3348,7 +3436,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -3396,7 +3484,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -3449,7 +3537,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -3553,7 +3641,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
|
|
@ -3570,9 +3658,7 @@
|
|||
"scopes": [
|
||||
"https://www.googleapis.com/auth/cloud-platform",
|
||||
"https://www.googleapis.com/auth/devstorage.full_control"
|
||||
],
|
||||
"supportsMediaDownload": true,
|
||||
"useMediaDownloadService": true
|
||||
]
|
||||
},
|
||||
"watchAll": {
|
||||
"id": "storage.objects.watchAll",
|
||||
|
|
@ -3624,7 +3710,7 @@
|
|||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request, for Requester Pays buckets.",
|
||||
"description": "The project to be billed for this request. Required for Requester Pays buckets.",
|
||||
"location": "query"
|
||||
},
|
||||
"versions": {
|
||||
|
|
@ -3669,6 +3755,11 @@
|
|||
"description": "Project ID",
|
||||
"required": true,
|
||||
"location": "path"
|
||||
},
|
||||
"userProject": {
|
||||
"type": "string",
|
||||
"description": "The project to be billed for this request.",
|
||||
"location": "query"
|
||||
}
|
||||
},
|
||||
"parameterOrder": [
|
||||
|
|
|
|||
844
vendor/google.golang.org/api/storage/v1/storage-gen.go
generated
vendored
844
vendor/google.golang.org/api/storage/v1/storage-gen.go
generated
vendored
File diff suppressed because it is too large
Load diff
45
vendor/google.golang.org/api/transport/http/dial.go
generated
vendored
45
vendor/google.golang.org/api/transport/http/dial.go
generated
vendored
|
|
@ -36,6 +36,9 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*http.Client,
|
|||
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")
|
||||
}
|
||||
|
|
@ -43,30 +46,32 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*http.Client,
|
|||
if o.HTTPClient != nil {
|
||||
return o.HTTPClient, o.Endpoint, nil
|
||||
}
|
||||
if o.APIKey != "" {
|
||||
hc := &http.Client{
|
||||
uat := userAgentTransport{
|
||||
base: baseTransport(ctx),
|
||||
userAgent: o.UserAgent,
|
||||
}
|
||||
var hc *http.Client
|
||||
switch {
|
||||
case o.NoAuth:
|
||||
hc = &http.Client{Transport: uat}
|
||||
case o.APIKey != "":
|
||||
hc = &http.Client{
|
||||
Transport: &transport.APIKey{
|
||||
Key: o.APIKey,
|
||||
Transport: userAgentTransport{
|
||||
base: baseTransport(ctx),
|
||||
userAgent: o.UserAgent,
|
||||
},
|
||||
Key: o.APIKey,
|
||||
Transport: uat,
|
||||
},
|
||||
}
|
||||
return hc, o.Endpoint, nil
|
||||
}
|
||||
creds, err := internal.Creds(ctx, &o)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
hc := &http.Client{
|
||||
Transport: &oauth2.Transport{
|
||||
Source: creds.TokenSource,
|
||||
Base: userAgentTransport{
|
||||
base: baseTransport(ctx),
|
||||
userAgent: o.UserAgent,
|
||||
default:
|
||||
creds, err := internal.Creds(ctx, &o)
|
||||
if err != nil {
|
||||
return nil, "", err
|
||||
}
|
||||
hc = &http.Client{
|
||||
Transport: &oauth2.Transport{
|
||||
Source: creds.TokenSource,
|
||||
Base: uat,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
return hc, o.Endpoint, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue