deps: update osbuild/images to 246b718310ea

Current main.
246b718310
This commit is contained in:
Achilleas Koutsou 2023-07-19 17:22:28 +02:00 committed by Ondřej Budai
parent 326f0cfa2f
commit 5c292c61c6
1437 changed files with 208886 additions and 87131 deletions

168
go.mod
View file

@ -5,14 +5,14 @@ go 1.18
exclude github.com/mattn/go-sqlite3 v2.0.3+incompatible
require (
cloud.google.com/go/compute v1.19.3
cloud.google.com/go/storage v1.30.1
cloud.google.com/go/compute v1.22.0
cloud.google.com/go/storage v1.31.0
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.0.0
github.com/Azure/go-autorest/autorest v0.11.28
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.1.0
github.com/Azure/go-autorest/autorest v0.11.29
github.com/Azure/go-autorest/autorest/azure/auth v0.5.12
github.com/BurntSushi/toml v1.2.1
github.com/aws/aws-sdk-go v1.44.230
github.com/BurntSushi/toml v1.3.2
github.com/aws/aws-sdk-go v1.44.304
github.com/coreos/go-semver v0.3.1
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f
github.com/deepmap/oapi-codegen v1.8.2
@ -21,77 +21,85 @@ require (
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/google/go-cmp v0.5.9
github.com/google/uuid v1.3.0
github.com/gophercloud/gophercloud v1.0.0
github.com/hashicorp/go-retryablehttp v0.7.1
github.com/jackc/pgtype v1.12.0
github.com/jackc/pgx/v4 v4.17.2
github.com/gophercloud/gophercloud v1.5.0
github.com/hashicorp/go-retryablehttp v0.7.4
github.com/jackc/pgtype v1.14.0
github.com/jackc/pgx/v4 v4.18.1
github.com/julienschmidt/httprouter v1.3.0
github.com/kolo/xmlrpc v0.0.0-20201022064351-38db28db192b
github.com/labstack/echo/v4 v4.10.2
github.com/labstack/echo/v4 v4.11.1
github.com/labstack/gommon v0.4.0
github.com/openshift-online/ocm-sdk-go v0.1.315
github.com/oracle/oci-go-sdk/v54 v54.0.0
github.com/osbuild/images v0.0.0-20230710155525-7045e8251769
github.com/prometheus/client_golang v1.13.0
github.com/osbuild/images v0.0.0-20230720095604-246b718310ea
github.com/prometheus/client_golang v1.16.0
github.com/segmentio/ksuid v1.0.4
github.com/sirupsen/logrus v1.9.0
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.7.0
github.com/stretchr/testify v1.8.3
github.com/stretchr/testify v1.8.4
github.com/ubccr/kerby v0.0.0-20170626144437-201a958fc453
github.com/vmware/govmomi v0.30.5
golang.org/x/exp v0.0.0-20230307190834-24139beb5833
golang.org/x/oauth2 v0.8.0
golang.org/x/sync v0.2.0
golang.org/x/sys v0.8.0
google.golang.org/api v0.126.0
github.com/vmware/govmomi v0.30.6
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
golang.org/x/oauth2 v0.10.0
golang.org/x/sync v0.3.0
golang.org/x/sys v0.10.0
google.golang.org/api v0.132.0
)
require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go v0.110.4 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.13.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.3.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.1.1 // indirect
cloud.google.com/go/iam v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 // indirect
github.com/Azure/go-autorest/autorest/adal v0.9.22 // indirect
github.com/Azure/go-autorest/autorest/azure/cli v0.4.6 // indirect
github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.3.1 // indirect
github.com/Azure/go-autorest/logger v0.2.1 // indirect
github.com/Azure/go-autorest/tracing v0.6.0 // indirect
github.com/Microsoft/go-winio v0.5.2 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d // indirect
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 // indirect
github.com/aymerick/douceur v0.2.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cenkalti/backoff/v4 v4.1.3 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/containers/common v0.49.1 // indirect
github.com/containers/image/v5 v5.22.0 // indirect
github.com/containers/libtrust v0.0.0-20200511145503-9c3a6c22cd9a // indirect
github.com/containers/ocicrypt v1.1.5 // indirect
github.com/containers/storage v1.42.0 // indirect
github.com/containers/common v0.55.2 // indirect
github.com/containers/image/v5 v5.26.1 // indirect
github.com/containers/libtrust v0.0.0-20230121012942-c1716e8a8d01 // indirect
github.com/containers/ocicrypt v1.1.7 // indirect
github.com/containers/storage v1.48.0 // indirect
github.com/cyberphone/json-canonicalization v0.0.0-20230514072755-504adb8a8af1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/dimchansky/utfbom v1.1.1 // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v20.10.24+incompatible // indirect
github.com/docker/docker-credential-helpers v0.6.4 // indirect
github.com/docker/docker v24.0.2+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/docker/go-connections v0.4.0 // indirect
github.com/docker/go-metrics v0.0.1 // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/dougm/pretty v0.0.0-20171025230240-2ee9d7453c02 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.20.3 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/go-openapi/jsonreference v0.20.0 // indirect
github.com/go-openapi/loads v0.21.2 // indirect
github.com/go-openapi/runtime v0.26.0 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/strfmt v0.21.7 // indirect
github.com/go-openapi/swag v0.22.4 // indirect
github.com/go-openapi/validate v0.22.1 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-containerregistry v0.10.0 // indirect
github.com/google/go-containerregistry v0.15.2 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.10.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.5 // indirect
github.com/googleapis/gax-go/v2 v2.12.0 // indirect
github.com/gorilla/css v1.0.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
@ -99,70 +107,76 @@ require (
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgconn v1.13.0 // indirect
github.com/jackc/pgconn v1.14.0 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.1 // indirect
github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect
github.com/jackc/pgproto3/v2 v2.3.2 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/puddle v1.3.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/compress v1.15.9 // indirect
github.com/klauspost/pgzip v1.2.5 // indirect
github.com/klauspost/compress v1.16.6 // indirect
github.com/klauspost/pgzip v1.2.6 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/letsencrypt/boulder v0.0.0-20220331220046-b23ab962616e // indirect
github.com/mailru/easyjson v0.7.6 // indirect
github.com/letsencrypt/boulder v0.0.0-20230213213521-fdfea0d469b6 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/microcosm-cc/bluemonday v1.0.18 // indirect
github.com/miekg/pkcs11 v1.1.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/sys/mountinfo v0.6.2 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/oklog/ulid v1.3.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.3-0.20220114050600-8b9d41f48198 // indirect
github.com/opencontainers/runc v1.1.5 // indirect
github.com/opencontainers/runtime-spec v1.0.3-0.20210326190908-1c3f411f0417 // indirect
github.com/opencontainers/image-spec v1.1.0-rc4 // indirect
github.com/opencontainers/runc v1.1.7 // indirect
github.com/opencontainers/runtime-spec v1.1.0-rc.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/proglottis/gpgme v0.1.3 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/sigstore/sigstore v1.3.1-0.20220629021053-b95fc0d626c1 // indirect
github.com/prometheus/client_model v0.4.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/sigstore/fulcio v1.3.1 // indirect
github.com/sigstore/rekor v1.2.2-0.20230601122533-4c81ff246d12 // indirect
github.com/sigstore/sigstore v1.7.1 // indirect
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stefanberger/go-pkcs11uri v0.0.0-20201008174630-78d3cae3a980 // indirect
github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635 // indirect
github.com/theupdateframework/go-tuf v0.3.2 // indirect
github.com/theupdateframework/go-tuf v0.5.2 // indirect
github.com/titanous/rocacheck v0.0.0-20171023193734-afe73141d399 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
github.com/ulikunitz/xz v0.5.11 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/vbatts/tar-split v0.11.2 // indirect
github.com/vbauerster/mpb/v7 v7.4.2 // indirect
go.etcd.io/bbolt v1.3.6 // indirect
go.mozilla.org/pkcs7 v0.0.0-20200128120323-432b2356ecb1 // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
github.com/vbauerster/mpb/v8 v8.4.0 // indirect
go.etcd.io/bbolt v1.3.7 // indirect
go.mongodb.org/mongo-driver v1.11.3 // indirect
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 // indirect
go.opencensus.io v0.24.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/mod v0.10.0 // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/tools v0.9.3 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
google.golang.org/grpc v1.55.0 // indirect
google.golang.org/protobuf v1.30.0 // indirect
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230706204954-ccb25ca9f130 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/grpc v1.56.2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/square/go-jose.v2 v2.6.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect

1516
go.sum

File diff suppressed because it is too large Load diff

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -51,6 +51,7 @@ type AcceleratorTypesCallOptions struct {
func defaultAcceleratorTypesRESTCallOptions() *AcceleratorTypesCallOptions {
return &AcceleratorTypesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -62,6 +63,7 @@ func defaultAcceleratorTypesRESTCallOptions() *AcceleratorTypesCallOptions {
}),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -73,6 +75,7 @@ func defaultAcceleratorTypesRESTCallOptions() *AcceleratorTypesCallOptions {
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -199,7 +202,7 @@ func defaultAcceleratorTypesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *acceleratorTypesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -284,13 +287,13 @@ func (c *acceleratorTypesRESTClient) AggregatedList(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -361,13 +364,13 @@ func (c *acceleratorTypesRESTClient) Get(ctx context.Context, req *computepb.Get
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -440,13 +443,13 @@ func (c *acceleratorTypesRESTClient) List(ctx context.Context, req *computepb.Li
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -49,12 +49,14 @@ type AddressesCallOptions struct {
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Move []gax.CallOption
SetLabels []gax.CallOption
}
func defaultAddressesRESTCallOptions() *AddressesCallOptions {
return &AddressesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -65,8 +67,11 @@ func defaultAddressesRESTCallOptions() *AddressesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -77,8 +82,11 @@ func defaultAddressesRESTCallOptions() *AddressesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -89,7 +97,12 @@ func defaultAddressesRESTCallOptions() *AddressesCallOptions {
http.StatusServiceUnavailable)
}),
},
SetLabels: []gax.CallOption{},
Move: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -103,6 +116,7 @@ type internalAddressesClient interface {
Get(context.Context, *computepb.GetAddressRequest, ...gax.CallOption) (*computepb.Address, error)
Insert(context.Context, *computepb.InsertAddressRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListAddressesRequest, ...gax.CallOption) *AddressIterator
Move(context.Context, *computepb.MoveAddressRequest, ...gax.CallOption) (*Operation, error)
SetLabels(context.Context, *computepb.SetLabelsAddressRequest, ...gax.CallOption) (*Operation, error)
}
@ -166,6 +180,11 @@ func (c *AddressesClient) List(ctx context.Context, req *computepb.ListAddresses
return c.internalClient.List(ctx, req, opts...)
}
// Move moves the specified address resource.
func (c *AddressesClient) Move(ctx context.Context, req *computepb.MoveAddressRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Move(ctx, req, opts...)
}
// SetLabels sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.
func (c *AddressesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsAddressRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.SetLabels(ctx, req, opts...)
@ -233,7 +252,7 @@ func defaultAddressesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *addressesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -321,13 +340,13 @@ func (c *addressesRESTClient) AggregatedList(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -405,13 +424,13 @@ func (c *addressesRESTClient) Delete(ctx context.Context, req *computepb.DeleteA
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -466,13 +485,13 @@ func (c *addressesRESTClient) Get(ctx context.Context, req *computepb.GetAddress
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -533,13 +552,13 @@ func (c *addressesRESTClient) Insert(ctx context.Context, req *computepb.InsertA
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -620,13 +639,13 @@ func (c *addressesRESTClient) List(ctx context.Context, req *computepb.ListAddre
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -654,6 +673,81 @@ func (c *addressesRESTClient) List(ctx context.Context, req *computepb.ListAddre
return it
}
// Move moves the specified address resource.
func (c *addressesRESTClient) Move(ctx context.Context, req *computepb.MoveAddressRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetRegionAddressesMoveRequestResource()
jsonReq, err := m.Marshal(body)
if err != nil {
return nil, err
}
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/addresses/%v/move", req.GetProject(), req.GetRegion(), req.GetAddress())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "address", url.QueryEscape(req.GetAddress())))
headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json"))
opts = append((*c.CallOptions).Move[0:len((*c.CallOptions).Move):len((*c.CallOptions).Move)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Operation{}
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
if err != nil {
return err
}
httpReq = httpReq.WithContext(ctx)
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
}, opts...)
if e != nil {
return nil, e
}
op := &Operation{
&regionOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
region: req.GetRegion(),
},
}
return op, nil
}
// SetLabels sets the labels on an Address. To learn more about labels, read the Labeling Resources documentation.
func (c *addressesRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsAddressRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -704,13 +798,13 @@ func (c *addressesRESTClient) SetLabels(ctx context.Context, req *computepb.SetL
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -56,6 +56,7 @@ type AutoscalersCallOptions struct {
func defaultAutoscalersRESTCallOptions() *AutoscalersCallOptions {
return &AutoscalersCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -66,8 +67,11 @@ func defaultAutoscalersRESTCallOptions() *AutoscalersCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,8 +82,11 @@ func defaultAutoscalersRESTCallOptions() *AutoscalersCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,8 +97,12 @@ func defaultAutoscalersRESTCallOptions() *AutoscalersCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Update: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -241,7 +252,7 @@ func defaultAutoscalersRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *autoscalersRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -329,13 +340,13 @@ func (c *autoscalersRESTClient) AggregatedList(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -413,13 +424,13 @@ func (c *autoscalersRESTClient) Delete(ctx context.Context, req *computepb.Delet
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -474,13 +485,13 @@ func (c *autoscalersRESTClient) Get(ctx context.Context, req *computepb.GetAutos
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -541,13 +552,13 @@ func (c *autoscalersRESTClient) Insert(ctx context.Context, req *computepb.Inser
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -628,13 +639,13 @@ func (c *autoscalersRESTClient) List(ctx context.Context, req *computepb.ListAut
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -715,13 +726,13 @@ func (c *autoscalersRESTClient) Patch(ctx context.Context, req *computepb.PatchA
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -793,13 +804,13 @@ func (c *autoscalersRESTClient) Update(ctx context.Context, req *computepb.Updat
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -56,10 +56,17 @@ type BackendBucketsCallOptions struct {
func defaultBackendBucketsRESTCallOptions() *BackendBucketsCallOptions {
return &BackendBucketsCallOptions{
AddSignedUrlKey: []gax.CallOption{},
Delete: []gax.CallOption{},
DeleteSignedUrlKey: []gax.CallOption{},
AddSignedUrlKey: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DeleteSignedUrlKey: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -70,8 +77,11 @@ func defaultBackendBucketsRESTCallOptions() *BackendBucketsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -82,9 +92,15 @@ func defaultBackendBucketsRESTCallOptions() *BackendBucketsCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetEdgeSecurityPolicy: []gax.CallOption{},
Update: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetEdgeSecurityPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -246,7 +262,7 @@ func defaultBackendBucketsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *backendBucketsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -319,13 +335,13 @@ func (c *backendBucketsRESTClient) AddSignedUrlKey(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -386,13 +402,13 @@ func (c *backendBucketsRESTClient) Delete(ctx context.Context, req *computepb.De
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -454,13 +470,13 @@ func (c *backendBucketsRESTClient) DeleteSignedUrlKey(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -514,13 +530,13 @@ func (c *backendBucketsRESTClient) Get(ctx context.Context, req *computepb.GetBa
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -581,13 +597,13 @@ func (c *backendBucketsRESTClient) Insert(ctx context.Context, req *computepb.In
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -667,13 +683,13 @@ func (c *backendBucketsRESTClient) List(ctx context.Context, req *computepb.List
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -751,13 +767,13 @@ func (c *backendBucketsRESTClient) Patch(ctx context.Context, req *computepb.Pat
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -825,13 +841,13 @@ func (c *backendBucketsRESTClient) SetEdgeSecurityPolicy(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -899,13 +915,13 @@ func (c *backendBucketsRESTClient) Update(ctx context.Context, req *computepb.Up
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -62,8 +62,11 @@ type BackendServicesCallOptions struct {
func defaultBackendServicesRESTCallOptions() *BackendServicesCallOptions {
return &BackendServicesCallOptions{
AddSignedUrlKey: []gax.CallOption{},
AddSignedUrlKey: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -74,9 +77,14 @@ func defaultBackendServicesRESTCallOptions() *BackendServicesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
DeleteSignedUrlKey: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DeleteSignedUrlKey: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -87,8 +95,11 @@ func defaultBackendServicesRESTCallOptions() *BackendServicesCallOptions {
http.StatusServiceUnavailable)
}),
},
GetHealth: []gax.CallOption{},
GetHealth: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -99,8 +110,11 @@ func defaultBackendServicesRESTCallOptions() *BackendServicesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -111,11 +125,21 @@ func defaultBackendServicesRESTCallOptions() *BackendServicesCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetEdgeSecurityPolicy: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
SetSecurityPolicy: []gax.CallOption{},
Update: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetEdgeSecurityPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetSecurityPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -307,7 +331,7 @@ func defaultBackendServicesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *backendServicesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -380,13 +404,13 @@ func (c *backendServicesRESTClient) AddSignedUrlKey(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -469,13 +493,13 @@ func (c *backendServicesRESTClient) AggregatedList(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -553,13 +577,13 @@ func (c *backendServicesRESTClient) Delete(ctx context.Context, req *computepb.D
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -621,13 +645,13 @@ func (c *backendServicesRESTClient) DeleteSignedUrlKey(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -681,13 +705,13 @@ func (c *backendServicesRESTClient) Get(ctx context.Context, req *computepb.GetB
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -741,13 +765,13 @@ func (c *backendServicesRESTClient) GetHealth(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -801,13 +825,13 @@ func (c *backendServicesRESTClient) GetIamPolicy(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -868,13 +892,13 @@ func (c *backendServicesRESTClient) Insert(ctx context.Context, req *computepb.I
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -954,13 +978,13 @@ func (c *backendServicesRESTClient) List(ctx context.Context, req *computepb.Lis
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1038,13 +1062,13 @@ func (c *backendServicesRESTClient) Patch(ctx context.Context, req *computepb.Pa
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1112,13 +1136,13 @@ func (c *backendServicesRESTClient) SetEdgeSecurityPolicy(ctx context.Context, r
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1179,13 +1203,13 @@ func (c *backendServicesRESTClient) SetIamPolicy(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1246,13 +1270,13 @@ func (c *backendServicesRESTClient) SetSecurityPolicy(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1320,13 +1344,13 @@ func (c *backendServicesRESTClient) Update(ctx context.Context, req *computepb.U
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

File diff suppressed because it is too large Load diff

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -51,6 +51,7 @@ type DiskTypesCallOptions struct {
func defaultDiskTypesRESTCallOptions() *DiskTypesCallOptions {
return &DiskTypesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -62,6 +63,7 @@ func defaultDiskTypesRESTCallOptions() *DiskTypesCallOptions {
}),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -73,6 +75,7 @@ func defaultDiskTypesRESTCallOptions() *DiskTypesCallOptions {
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -195,7 +198,7 @@ func defaultDiskTypesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *diskTypesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -280,13 +283,13 @@ func (c *diskTypesRESTClient) AggregatedList(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -357,13 +360,13 @@ func (c *diskTypesRESTClient) Get(ctx context.Context, req *computepb.GetDiskTyp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -436,13 +439,13 @@ func (c *diskTypesRESTClient) List(ctx context.Context, req *computepb.ListDiskT
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -46,6 +46,7 @@ var newDisksClientHook clientHook
type DisksCallOptions struct {
AddResourcePolicies []gax.CallOption
AggregatedList []gax.CallOption
BulkInsert []gax.CallOption
CreateSnapshot []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
@ -56,14 +57,20 @@ type DisksCallOptions struct {
Resize []gax.CallOption
SetIamPolicy []gax.CallOption
SetLabels []gax.CallOption
StartAsyncReplication []gax.CallOption
StopAsyncReplication []gax.CallOption
StopGroupAsyncReplication []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
func defaultDisksRESTCallOptions() *DisksCallOptions {
return &DisksCallOptions{
AddResourcePolicies: []gax.CallOption{},
AddResourcePolicies: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -74,9 +81,17 @@ func defaultDisksRESTCallOptions() *DisksCallOptions {
http.StatusServiceUnavailable)
}),
},
CreateSnapshot: []gax.CallOption{},
Delete: []gax.CallOption{},
BulkInsert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
CreateSnapshot: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -88,6 +103,7 @@ func defaultDisksRESTCallOptions() *DisksCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -98,8 +114,11 @@ func defaultDisksRESTCallOptions() *DisksCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -110,12 +129,33 @@ func defaultDisksRESTCallOptions() *DisksCallOptions {
http.StatusServiceUnavailable)
}),
},
RemoveResourcePolicies: []gax.CallOption{},
Resize: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
SetLabels: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
Update: []gax.CallOption{},
RemoveResourcePolicies: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Resize: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
StartAsyncReplication: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
StopAsyncReplication: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
StopGroupAsyncReplication: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -126,6 +166,7 @@ type internalDisksClient interface {
Connection() *grpc.ClientConn
AddResourcePolicies(context.Context, *computepb.AddResourcePoliciesDiskRequest, ...gax.CallOption) (*Operation, error)
AggregatedList(context.Context, *computepb.AggregatedListDisksRequest, ...gax.CallOption) *DisksScopedListPairIterator
BulkInsert(context.Context, *computepb.BulkInsertDiskRequest, ...gax.CallOption) (*Operation, error)
CreateSnapshot(context.Context, *computepb.CreateSnapshotDiskRequest, ...gax.CallOption) (*Operation, error)
Delete(context.Context, *computepb.DeleteDiskRequest, ...gax.CallOption) (*Operation, error)
Get(context.Context, *computepb.GetDiskRequest, ...gax.CallOption) (*computepb.Disk, error)
@ -136,6 +177,9 @@ type internalDisksClient interface {
Resize(context.Context, *computepb.ResizeDiskRequest, ...gax.CallOption) (*Operation, error)
SetIamPolicy(context.Context, *computepb.SetIamPolicyDiskRequest, ...gax.CallOption) (*computepb.Policy, error)
SetLabels(context.Context, *computepb.SetLabelsDiskRequest, ...gax.CallOption) (*Operation, error)
StartAsyncReplication(context.Context, *computepb.StartAsyncReplicationDiskRequest, ...gax.CallOption) (*Operation, error)
StopAsyncReplication(context.Context, *computepb.StopAsyncReplicationDiskRequest, ...gax.CallOption) (*Operation, error)
StopGroupAsyncReplication(context.Context, *computepb.StopGroupAsyncReplicationDiskRequest, ...gax.CallOption) (*Operation, error)
TestIamPermissions(context.Context, *computepb.TestIamPermissionsDiskRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
Update(context.Context, *computepb.UpdateDiskRequest, ...gax.CallOption) (*Operation, error)
}
@ -185,6 +229,11 @@ func (c *DisksClient) AggregatedList(ctx context.Context, req *computepb.Aggrega
return c.internalClient.AggregatedList(ctx, req, opts...)
}
// BulkInsert bulk create a set of disks.
func (c *DisksClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertDiskRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.BulkInsert(ctx, req, opts...)
}
// CreateSnapshot creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.
func (c *DisksClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotDiskRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.CreateSnapshot(ctx, req, opts...)
@ -235,6 +284,21 @@ func (c *DisksClient) SetLabels(ctx context.Context, req *computepb.SetLabelsDis
return c.internalClient.SetLabels(ctx, req, opts...)
}
// StartAsyncReplication starts asynchronous replication. Must be invoked on the primary disk.
func (c *DisksClient) StartAsyncReplication(ctx context.Context, req *computepb.StartAsyncReplicationDiskRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.StartAsyncReplication(ctx, req, opts...)
}
// StopAsyncReplication stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.
func (c *DisksClient) StopAsyncReplication(ctx context.Context, req *computepb.StopAsyncReplicationDiskRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.StopAsyncReplication(ctx, req, opts...)
}
// StopGroupAsyncReplication stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.
func (c *DisksClient) StopGroupAsyncReplication(ctx context.Context, req *computepb.StopGroupAsyncReplicationDiskRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.StopGroupAsyncReplication(ctx, req, opts...)
}
// TestIamPermissions returns permissions that a caller has on the specified resource.
func (c *DisksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsDiskRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) {
return c.internalClient.TestIamPermissions(ctx, req, opts...)
@ -307,7 +371,7 @@ func defaultDisksRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *disksRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -380,13 +444,13 @@ func (c *disksRESTClient) AddResourcePolicies(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -470,13 +534,13 @@ func (c *disksRESTClient) AggregatedList(ctx context.Context, req *computepb.Agg
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -511,6 +575,81 @@ func (c *disksRESTClient) AggregatedList(ctx context.Context, req *computepb.Agg
return it
}
// BulkInsert bulk create a set of disks.
func (c *disksRESTClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertDiskRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetBulkInsertDiskResourceResource()
jsonReq, err := m.Marshal(body)
if err != nil {
return nil, err
}
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/bulkInsert", req.GetProject(), req.GetZone())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "zone", url.QueryEscape(req.GetZone())))
headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json"))
opts = append((*c.CallOptions).BulkInsert[0:len((*c.CallOptions).BulkInsert):len((*c.CallOptions).BulkInsert)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Operation{}
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
if err != nil {
return err
}
httpReq = httpReq.WithContext(ctx)
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
}, opts...)
if e != nil {
return nil, e
}
op := &Operation{
&zoneOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
zone: req.GetZone(),
},
}
return op, nil
}
// CreateSnapshot creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.
func (c *disksRESTClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotDiskRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -564,13 +703,13 @@ func (c *disksRESTClient) CreateSnapshot(ctx context.Context, req *computepb.Cre
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -632,13 +771,13 @@ func (c *disksRESTClient) Delete(ctx context.Context, req *computepb.DeleteDiskR
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -693,13 +832,13 @@ func (c *disksRESTClient) Get(ctx context.Context, req *computepb.GetDiskRequest
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -753,13 +892,13 @@ func (c *disksRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIa
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -823,13 +962,13 @@ func (c *disksRESTClient) Insert(ctx context.Context, req *computepb.InsertDiskR
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -910,13 +1049,13 @@ func (c *disksRESTClient) List(ctx context.Context, req *computepb.ListDisksRequ
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -994,13 +1133,13 @@ func (c *disksRESTClient) RemoveResourcePolicies(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1069,13 +1208,13 @@ func (c *disksRESTClient) Resize(ctx context.Context, req *computepb.ResizeDiskR
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1137,13 +1276,13 @@ func (c *disksRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIa
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1204,13 +1343,231 @@ func (c *disksRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabel
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
}, opts...)
if e != nil {
return nil, e
}
op := &Operation{
&zoneOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
zone: req.GetZone(),
},
}
return op, nil
}
// StartAsyncReplication starts asynchronous replication. Must be invoked on the primary disk.
func (c *disksRESTClient) StartAsyncReplication(ctx context.Context, req *computepb.StartAsyncReplicationDiskRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetDisksStartAsyncReplicationRequestResource()
jsonReq, err := m.Marshal(body)
if err != nil {
return nil, err
}
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v/startAsyncReplication", req.GetProject(), req.GetZone(), req.GetDisk())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "zone", url.QueryEscape(req.GetZone()), "disk", url.QueryEscape(req.GetDisk())))
headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json"))
opts = append((*c.CallOptions).StartAsyncReplication[0:len((*c.CallOptions).StartAsyncReplication):len((*c.CallOptions).StartAsyncReplication)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Operation{}
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
if err != nil {
return err
}
httpReq = httpReq.WithContext(ctx)
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
}, opts...)
if e != nil {
return nil, e
}
op := &Operation{
&zoneOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
zone: req.GetZone(),
},
}
return op, nil
}
// StopAsyncReplication stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.
func (c *disksRESTClient) StopAsyncReplication(ctx context.Context, req *computepb.StopAsyncReplicationDiskRequest, opts ...gax.CallOption) (*Operation, error) {
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/%v/stopAsyncReplication", req.GetProject(), req.GetZone(), req.GetDisk())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "zone", url.QueryEscape(req.GetZone()), "disk", url.QueryEscape(req.GetDisk())))
headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json"))
opts = append((*c.CallOptions).StopAsyncReplication[0:len((*c.CallOptions).StopAsyncReplication):len((*c.CallOptions).StopAsyncReplication)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Operation{}
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("POST", baseUrl.String(), nil)
if err != nil {
return err
}
httpReq = httpReq.WithContext(ctx)
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
}, opts...)
if e != nil {
return nil, e
}
op := &Operation{
&zoneOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
zone: req.GetZone(),
},
}
return op, nil
}
// StopGroupAsyncReplication stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.
func (c *disksRESTClient) StopGroupAsyncReplication(ctx context.Context, req *computepb.StopGroupAsyncReplicationDiskRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetDisksStopGroupAsyncReplicationResourceResource()
jsonReq, err := m.Marshal(body)
if err != nil {
return nil, err
}
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/disks/stopGroupAsyncReplication", req.GetProject(), req.GetZone())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "zone", url.QueryEscape(req.GetZone())))
headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json"))
opts = append((*c.CallOptions).StopGroupAsyncReplication[0:len((*c.CallOptions).StopGroupAsyncReplication):len((*c.CallOptions).StopGroupAsyncReplication)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Operation{}
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
if err != nil {
return err
}
httpReq = httpReq.WithContext(ctx)
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
@ -1272,13 +1629,13 @@ func (c *disksRESTClient) TestIamPermissions(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1345,13 +1702,13 @@ func (c *disksRESTClient) Update(ctx context.Context, req *computepb.UpdateDiskR
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -75,6 +75,11 @@
// _ = resp
// }
//
// # Inspecting errors
//
// To see examples of how to inspect errors returned by this package please reference
// [Inspecting errors](https://pkg.go.dev/cloud.google.com/go#hdr-Inspecting_errors).
//
// # Use of Context
//
// The ctx passed to NewAcceleratorTypesClient is used for authentication requests and
@ -86,13 +91,7 @@ package compute // import "cloud.google.com/go/compute/apiv1"
import (
"context"
"fmt"
"net/http"
"os"
"runtime"
"strconv"
"strings"
"unicode"
"google.golang.org/api/option"
"google.golang.org/grpc/metadata"
@ -123,16 +122,6 @@ func insertMetadata(ctx context.Context, mds ...metadata.MD) context.Context {
return metadata.NewOutgoingContext(ctx, out)
}
func checkDisableDeadlines() (bool, error) {
raw, ok := os.LookupEnv("GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE")
if !ok {
return false, nil
}
b, err := strconv.ParseBool(raw)
return b, err
}
// DefaultAuthScopes reports the default set of authentication scopes to use with this package.
func DefaultAuthScopes() []string {
return []string{
@ -142,52 +131,6 @@ func DefaultAuthScopes() []string {
}
}
// versionGo returns the Go runtime version. The returned string
// has no whitespace, suitable for reporting in header.
func versionGo() string {
const develPrefix = "devel +"
s := runtime.Version()
if strings.HasPrefix(s, develPrefix) {
s = s[len(develPrefix):]
if p := strings.IndexFunc(s, unicode.IsSpace); p >= 0 {
s = s[:p]
}
return s
}
notSemverRune := func(r rune) bool {
return !strings.ContainsRune("0123456789.", r)
}
if strings.HasPrefix(s, "go1") {
s = s[2:]
var prerelease string
if p := strings.IndexFunc(s, notSemverRune); p >= 0 {
s, prerelease = s[:p], s[p:]
}
if strings.HasSuffix(s, ".") {
s += "0"
} else if strings.Count(s, ".") < 2 {
s += ".0"
}
if prerelease != "" {
s += "-" + prerelease
}
return s
}
return "UNKNOWN"
}
// maybeUnknownEnum wraps the given proto-JSON parsing error if it is the result
// of receiving an unknown enum value.
func maybeUnknownEnum(err error) error {
if strings.Contains(err.Error(), "invalid value for enum type") {
err = fmt.Errorf("received an unknown enum value; a later version of the library may support it: %w", err)
}
return err
}
// buildHeaders extracts metadata from the outgoing context, joins it with any other
// given metadata, and converts them into a http.Header.
func buildHeaders(ctx context.Context, mds ...metadata.MD) http.Header {

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -53,8 +53,11 @@ type ExternalVpnGatewaysCallOptions struct {
func defaultExternalVpnGatewaysRESTCallOptions() *ExternalVpnGatewaysCallOptions {
return &ExternalVpnGatewaysCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -65,8 +68,11 @@ func defaultExternalVpnGatewaysRESTCallOptions() *ExternalVpnGatewaysCallOptions
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -77,8 +83,12 @@ func defaultExternalVpnGatewaysRESTCallOptions() *ExternalVpnGatewaysCallOptions
http.StatusServiceUnavailable)
}),
},
SetLabels: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -222,7 +232,7 @@ func defaultExternalVpnGatewaysRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *externalVpnGatewaysRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -288,13 +298,13 @@ func (c *externalVpnGatewaysRESTClient) Delete(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -348,13 +358,13 @@ func (c *externalVpnGatewaysRESTClient) Get(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -415,13 +425,13 @@ func (c *externalVpnGatewaysRESTClient) Insert(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -501,13 +511,13 @@ func (c *externalVpnGatewaysRESTClient) List(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -578,13 +588,13 @@ func (c *externalVpnGatewaysRESTClient) SetLabels(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -645,13 +655,13 @@ func (c *externalVpnGatewaysRESTClient) TestIamPermissions(ctx context.Context,
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -65,11 +65,20 @@ type FirewallPoliciesCallOptions struct {
func defaultFirewallPoliciesRESTCallOptions() *FirewallPoliciesCallOptions {
return &FirewallPoliciesCallOptions{
AddAssociation: []gax.CallOption{},
AddRule: []gax.CallOption{},
CloneRules: []gax.CallOption{},
Delete: []gax.CallOption{},
AddAssociation: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AddRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
CloneRules: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -81,6 +90,7 @@ func defaultFirewallPoliciesRESTCallOptions() *FirewallPoliciesCallOptions {
}),
},
GetAssociation: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -92,6 +102,7 @@ func defaultFirewallPoliciesRESTCallOptions() *FirewallPoliciesCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -103,6 +114,7 @@ func defaultFirewallPoliciesRESTCallOptions() *FirewallPoliciesCallOptions {
}),
},
GetRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -113,8 +125,11 @@ func defaultFirewallPoliciesRESTCallOptions() *FirewallPoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -126,6 +141,7 @@ func defaultFirewallPoliciesRESTCallOptions() *FirewallPoliciesCallOptions {
}),
},
ListAssociations: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -136,13 +152,27 @@ func defaultFirewallPoliciesRESTCallOptions() *FirewallPoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Move: []gax.CallOption{},
Patch: []gax.CallOption{},
PatchRule: []gax.CallOption{},
RemoveAssociation: []gax.CallOption{},
RemoveRule: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
Move: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
PatchRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RemoveAssociation: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RemoveRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -358,7 +388,7 @@ func defaultFirewallPoliciesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *firewallPoliciesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -434,13 +464,13 @@ func (c *firewallPoliciesRESTClient) AddAssociation(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -507,13 +537,13 @@ func (c *firewallPoliciesRESTClient) AddRule(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -576,13 +606,13 @@ func (c *firewallPoliciesRESTClient) CloneRules(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -642,13 +672,13 @@ func (c *firewallPoliciesRESTClient) Delete(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -701,13 +731,13 @@ func (c *firewallPoliciesRESTClient) Get(ctx context.Context, req *computepb.Get
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -761,13 +791,13 @@ func (c *firewallPoliciesRESTClient) GetAssociation(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -821,13 +851,13 @@ func (c *firewallPoliciesRESTClient) GetIamPolicy(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -881,13 +911,13 @@ func (c *firewallPoliciesRESTClient) GetRule(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -947,13 +977,13 @@ func (c *firewallPoliciesRESTClient) Insert(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1035,13 +1065,13 @@ func (c *firewallPoliciesRESTClient) List(ctx context.Context, req *computepb.Li
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1110,13 +1140,13 @@ func (c *firewallPoliciesRESTClient) ListAssociations(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1171,13 +1201,13 @@ func (c *firewallPoliciesRESTClient) Move(ctx context.Context, req *computepb.Mo
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1244,13 +1274,13 @@ func (c *firewallPoliciesRESTClient) Patch(ctx context.Context, req *computepb.P
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1320,13 +1350,13 @@ func (c *firewallPoliciesRESTClient) PatchRule(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1389,13 +1419,13 @@ func (c *firewallPoliciesRESTClient) RemoveAssociation(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1458,13 +1488,13 @@ func (c *firewallPoliciesRESTClient) RemoveRule(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1524,13 +1554,13 @@ func (c *firewallPoliciesRESTClient) SetIamPolicy(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1584,13 +1614,13 @@ func (c *firewallPoliciesRESTClient) TestIamPermissions(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -53,8 +53,11 @@ type FirewallsCallOptions struct {
func defaultFirewallsRESTCallOptions() *FirewallsCallOptions {
return &FirewallsCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -65,8 +68,11 @@ func defaultFirewallsRESTCallOptions() *FirewallsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -77,8 +83,12 @@ func defaultFirewallsRESTCallOptions() *FirewallsCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Update: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -222,7 +232,7 @@ func defaultFirewallsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *firewallsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -288,13 +298,13 @@ func (c *firewallsRESTClient) Delete(ctx context.Context, req *computepb.DeleteF
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -348,13 +358,13 @@ func (c *firewallsRESTClient) Get(ctx context.Context, req *computepb.GetFirewal
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -415,13 +425,13 @@ func (c *firewallsRESTClient) Insert(ctx context.Context, req *computepb.InsertF
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -501,13 +511,13 @@ func (c *firewallsRESTClient) List(ctx context.Context, req *computepb.ListFirew
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -585,13 +595,13 @@ func (c *firewallsRESTClient) Patch(ctx context.Context, req *computepb.PatchFir
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -659,13 +669,13 @@ func (c *firewallsRESTClient) Update(ctx context.Context, req *computepb.UpdateF
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -57,6 +57,7 @@ type ForwardingRulesCallOptions struct {
func defaultForwardingRulesRESTCallOptions() *ForwardingRulesCallOptions {
return &ForwardingRulesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -67,8 +68,11 @@ func defaultForwardingRulesRESTCallOptions() *ForwardingRulesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -79,8 +83,11 @@ func defaultForwardingRulesRESTCallOptions() *ForwardingRulesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -91,9 +98,15 @@ func defaultForwardingRulesRESTCallOptions() *ForwardingRulesCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetLabels: []gax.CallOption{},
SetTarget: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetTarget: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -249,7 +262,7 @@ func defaultForwardingRulesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *forwardingRulesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -337,13 +350,13 @@ func (c *forwardingRulesRESTClient) AggregatedList(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -421,13 +434,13 @@ func (c *forwardingRulesRESTClient) Delete(ctx context.Context, req *computepb.D
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -482,13 +495,13 @@ func (c *forwardingRulesRESTClient) Get(ctx context.Context, req *computepb.GetF
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -549,13 +562,13 @@ func (c *forwardingRulesRESTClient) Insert(ctx context.Context, req *computepb.I
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -636,13 +649,13 @@ func (c *forwardingRulesRESTClient) List(ctx context.Context, req *computepb.Lis
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -720,13 +733,13 @@ func (c *forwardingRulesRESTClient) Patch(ctx context.Context, req *computepb.Pa
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -795,13 +808,13 @@ func (c *forwardingRulesRESTClient) SetLabels(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -870,13 +883,13 @@ func (c *forwardingRulesRESTClient) SetTarget(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -59,6 +59,11 @@
"List"
]
},
"Move": {
"methods": [
"Move"
]
},
"SetLabels": {
"methods": [
"SetLabels"
@ -284,6 +289,11 @@
"AggregatedList"
]
},
"BulkInsert": {
"methods": [
"BulkInsert"
]
},
"CreateSnapshot": {
"methods": [
"CreateSnapshot"
@ -334,6 +344,21 @@
"SetLabels"
]
},
"StartAsyncReplication": {
"methods": [
"StartAsyncReplication"
]
},
"StopAsyncReplication": {
"methods": [
"StopAsyncReplication"
]
},
"StopGroupAsyncReplication": {
"methods": [
"StopGroupAsyncReplication"
]
},
"TestIamPermissions": {
"methods": [
"TestIamPermissions"
@ -599,6 +624,11 @@
"List"
]
},
"Move": {
"methods": [
"Move"
]
},
"SetLabels": {
"methods": [
"SetLabels"
@ -1424,6 +1454,25 @@
}
}
},
"InterconnectRemoteLocations": {
"clients": {
"rest": {
"libraryClient": "InterconnectRemoteLocationsClient",
"rpcs": {
"Get": {
"methods": [
"Get"
]
},
"List": {
"methods": [
"List"
]
}
}
}
}
},
"Interconnects": {
"clients": {
"rest": {
@ -2388,6 +2437,11 @@
"AddResourcePolicies"
]
},
"BulkInsert": {
"methods": [
"BulkInsert"
]
},
"CreateSnapshot": {
"methods": [
"CreateSnapshot"
@ -2438,6 +2492,21 @@
"SetLabels"
]
},
"StartAsyncReplication": {
"methods": [
"StartAsyncReplication"
]
},
"StopAsyncReplication": {
"methods": [
"StopAsyncReplication"
]
},
"StopGroupAsyncReplication": {
"methods": [
"StopGroupAsyncReplication"
]
},
"TestIamPermissions": {
"methods": [
"TestIamPermissions"

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -47,13 +47,17 @@ type GlobalAddressesCallOptions struct {
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Move []gax.CallOption
SetLabels []gax.CallOption
}
func defaultGlobalAddressesRESTCallOptions() *GlobalAddressesCallOptions {
return &GlobalAddressesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -64,8 +68,11 @@ func defaultGlobalAddressesRESTCallOptions() *GlobalAddressesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,7 +83,12 @@ func defaultGlobalAddressesRESTCallOptions() *GlobalAddressesCallOptions {
http.StatusServiceUnavailable)
}),
},
SetLabels: []gax.CallOption{},
Move: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -89,6 +101,7 @@ type internalGlobalAddressesClient interface {
Get(context.Context, *computepb.GetGlobalAddressRequest, ...gax.CallOption) (*computepb.Address, error)
Insert(context.Context, *computepb.InsertGlobalAddressRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListGlobalAddressesRequest, ...gax.CallOption) *AddressIterator
Move(context.Context, *computepb.MoveGlobalAddressRequest, ...gax.CallOption) (*Operation, error)
SetLabels(context.Context, *computepb.SetLabelsGlobalAddressRequest, ...gax.CallOption) (*Operation, error)
}
@ -147,6 +160,11 @@ func (c *GlobalAddressesClient) List(ctx context.Context, req *computepb.ListGlo
return c.internalClient.List(ctx, req, opts...)
}
// Move moves the specified address resource from one project to another project.
func (c *GlobalAddressesClient) Move(ctx context.Context, req *computepb.MoveGlobalAddressRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Move(ctx, req, opts...)
}
// SetLabels sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.
func (c *GlobalAddressesClient) SetLabels(ctx context.Context, req *computepb.SetLabelsGlobalAddressRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.SetLabels(ctx, req, opts...)
@ -214,7 +232,7 @@ func defaultGlobalAddressesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *globalAddressesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -280,13 +298,13 @@ func (c *globalAddressesRESTClient) Delete(ctx context.Context, req *computepb.D
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -340,13 +358,13 @@ func (c *globalAddressesRESTClient) Get(ctx context.Context, req *computepb.GetG
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -407,13 +425,13 @@ func (c *globalAddressesRESTClient) Insert(ctx context.Context, req *computepb.I
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -493,13 +511,13 @@ func (c *globalAddressesRESTClient) List(ctx context.Context, req *computepb.Lis
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -527,6 +545,80 @@ func (c *globalAddressesRESTClient) List(ctx context.Context, req *computepb.Lis
return it
}
// Move moves the specified address resource from one project to another project.
func (c *globalAddressesRESTClient) Move(ctx context.Context, req *computepb.MoveGlobalAddressRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetGlobalAddressesMoveRequestResource()
jsonReq, err := m.Marshal(body)
if err != nil {
return nil, err
}
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/addresses/%v/move", req.GetProject(), req.GetAddress())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "address", url.QueryEscape(req.GetAddress())))
headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json"))
opts = append((*c.CallOptions).Move[0:len((*c.CallOptions).Move):len((*c.CallOptions).Move)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Operation{}
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
if err != nil {
return err
}
httpReq = httpReq.WithContext(ctx)
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
}, opts...)
if e != nil {
return nil, e
}
op := &Operation{
&globalOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
},
}
return op, nil
}
// SetLabels sets the labels on a GlobalAddress. To learn more about labels, read the Labeling Resources documentation.
func (c *globalAddressesRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabelsGlobalAddressRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -570,13 +662,13 @@ func (c *globalAddressesRESTClient) SetLabels(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -54,8 +54,11 @@ type GlobalForwardingRulesCallOptions struct {
func defaultGlobalForwardingRulesRESTCallOptions() *GlobalForwardingRulesCallOptions {
return &GlobalForwardingRulesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -66,8 +69,11 @@ func defaultGlobalForwardingRulesRESTCallOptions() *GlobalForwardingRulesCallOpt
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,9 +84,15 @@ func defaultGlobalForwardingRulesRESTCallOptions() *GlobalForwardingRulesCallOpt
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetLabels: []gax.CallOption{},
SetTarget: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetTarget: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -230,7 +242,7 @@ func defaultGlobalForwardingRulesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *globalForwardingRulesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -296,13 +308,13 @@ func (c *globalForwardingRulesRESTClient) Delete(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -356,13 +368,13 @@ func (c *globalForwardingRulesRESTClient) Get(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -423,13 +435,13 @@ func (c *globalForwardingRulesRESTClient) Insert(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -509,13 +521,13 @@ func (c *globalForwardingRulesRESTClient) List(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -593,13 +605,13 @@ func (c *globalForwardingRulesRESTClient) Patch(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -660,13 +672,13 @@ func (c *globalForwardingRulesRESTClient) SetLabels(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -734,13 +746,13 @@ func (c *globalForwardingRulesRESTClient) SetTarget(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -54,10 +54,17 @@ type GlobalNetworkEndpointGroupsCallOptions struct {
func defaultGlobalNetworkEndpointGroupsRESTCallOptions() *GlobalNetworkEndpointGroupsCallOptions {
return &GlobalNetworkEndpointGroupsCallOptions{
AttachNetworkEndpoints: []gax.CallOption{},
Delete: []gax.CallOption{},
DetachNetworkEndpoints: []gax.CallOption{},
AttachNetworkEndpoints: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DetachNetworkEndpoints: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -68,8 +75,11 @@ func defaultGlobalNetworkEndpointGroupsRESTCallOptions() *GlobalNetworkEndpointG
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -80,7 +90,9 @@ func defaultGlobalNetworkEndpointGroupsRESTCallOptions() *GlobalNetworkEndpointG
http.StatusServiceUnavailable)
}),
},
ListNetworkEndpoints: []gax.CallOption{},
ListNetworkEndpoints: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -230,7 +242,7 @@ func defaultGlobalNetworkEndpointGroupsRESTClientOptions() []option.ClientOption
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *globalNetworkEndpointGroupsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -303,13 +315,13 @@ func (c *globalNetworkEndpointGroupsRESTClient) AttachNetworkEndpoints(ctx conte
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -370,13 +382,13 @@ func (c *globalNetworkEndpointGroupsRESTClient) Delete(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -444,13 +456,13 @@ func (c *globalNetworkEndpointGroupsRESTClient) DetachNetworkEndpoints(ctx conte
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -504,13 +516,13 @@ func (c *globalNetworkEndpointGroupsRESTClient) Get(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -571,13 +583,13 @@ func (c *globalNetworkEndpointGroupsRESTClient) Insert(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -657,13 +669,13 @@ func (c *globalNetworkEndpointGroupsRESTClient) List(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -753,13 +765,13 @@ func (c *globalNetworkEndpointGroupsRESTClient) ListNetworkEndpoints(ctx context
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -53,6 +53,7 @@ type GlobalOperationsCallOptions struct {
func defaultGlobalOperationsRESTCallOptions() *GlobalOperationsCallOptions {
return &GlobalOperationsCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -63,8 +64,11 @@ func defaultGlobalOperationsRESTCallOptions() *GlobalOperationsCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,6 +80,7 @@ func defaultGlobalOperationsRESTCallOptions() *GlobalOperationsCallOptions {
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -86,7 +91,9 @@ func defaultGlobalOperationsRESTCallOptions() *GlobalOperationsCallOptions {
http.StatusServiceUnavailable)
}),
},
Wait: []gax.CallOption{},
Wait: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -211,7 +218,7 @@ func defaultGlobalOperationsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *globalOperationsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -296,13 +303,13 @@ func (c *globalOperationsRESTClient) AggregatedList(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -373,13 +380,13 @@ func (c *globalOperationsRESTClient) Delete(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -426,13 +433,13 @@ func (c *globalOperationsRESTClient) Get(ctx context.Context, req *computepb.Get
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -505,13 +512,13 @@ func (c *globalOperationsRESTClient) List(ctx context.Context, req *computepb.Li
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -575,13 +582,13 @@ func (c *globalOperationsRESTClient) Wait(ctx context.Context, req *computepb.Wa
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -49,8 +49,11 @@ type GlobalOrganizationOperationsCallOptions struct {
func defaultGlobalOrganizationOperationsRESTCallOptions() *GlobalOrganizationOperationsCallOptions {
return &GlobalOrganizationOperationsCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -62,6 +65,7 @@ func defaultGlobalOrganizationOperationsRESTCallOptions() *GlobalOrganizationOpe
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -184,7 +188,7 @@ func defaultGlobalOrganizationOperationsRESTClientOptions() []option.ClientOptio
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *globalOrganizationOperationsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -247,13 +251,13 @@ func (c *globalOrganizationOperationsRESTClient) Delete(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -307,13 +311,13 @@ func (c *globalOrganizationOperationsRESTClient) Get(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -389,13 +393,13 @@ func (c *globalOrganizationOperationsRESTClient) List(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -52,8 +52,11 @@ type GlobalPublicDelegatedPrefixesCallOptions struct {
func defaultGlobalPublicDelegatedPrefixesRESTCallOptions() *GlobalPublicDelegatedPrefixesCallOptions {
return &GlobalPublicDelegatedPrefixesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -64,8 +67,11 @@ func defaultGlobalPublicDelegatedPrefixesRESTCallOptions() *GlobalPublicDelegate
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,7 +82,9 @@ func defaultGlobalPublicDelegatedPrefixesRESTCallOptions() *GlobalPublicDelegate
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -214,7 +222,7 @@ func defaultGlobalPublicDelegatedPrefixesRESTClientOptions() []option.ClientOpti
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *globalPublicDelegatedPrefixesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -280,13 +288,13 @@ func (c *globalPublicDelegatedPrefixesRESTClient) Delete(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -340,13 +348,13 @@ func (c *globalPublicDelegatedPrefixesRESTClient) Get(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -407,13 +415,13 @@ func (c *globalPublicDelegatedPrefixesRESTClient) Insert(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -493,13 +501,13 @@ func (c *globalPublicDelegatedPrefixesRESTClient) List(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -577,13 +585,13 @@ func (c *globalPublicDelegatedPrefixesRESTClient) Patch(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -56,6 +56,7 @@ type HealthChecksCallOptions struct {
func defaultHealthChecksRESTCallOptions() *HealthChecksCallOptions {
return &HealthChecksCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -66,8 +67,11 @@ func defaultHealthChecksRESTCallOptions() *HealthChecksCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,8 +82,11 @@ func defaultHealthChecksRESTCallOptions() *HealthChecksCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,8 +97,12 @@ func defaultHealthChecksRESTCallOptions() *HealthChecksCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Update: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -241,7 +252,7 @@ func defaultHealthChecksRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *healthChecksRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -329,13 +340,13 @@ func (c *healthChecksRESTClient) AggregatedList(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -413,13 +424,13 @@ func (c *healthChecksRESTClient) Delete(ctx context.Context, req *computepb.Dele
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -473,13 +484,13 @@ func (c *healthChecksRESTClient) Get(ctx context.Context, req *computepb.GetHeal
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -540,13 +551,13 @@ func (c *healthChecksRESTClient) Insert(ctx context.Context, req *computepb.Inse
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -626,13 +637,13 @@ func (c *healthChecksRESTClient) List(ctx context.Context, req *computepb.ListHe
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -710,13 +721,13 @@ func (c *healthChecksRESTClient) Patch(ctx context.Context, req *computepb.Patch
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -784,13 +795,13 @@ func (c *healthChecksRESTClient) Update(ctx context.Context, req *computepb.Upda
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"time"
@ -45,6 +45,7 @@ type ImageFamilyViewsCallOptions struct {
func defaultImageFamilyViewsRESTCallOptions() *ImageFamilyViewsCallOptions {
return &ImageFamilyViewsCallOptions{
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -155,7 +156,7 @@ func defaultImageFamilyViewsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *imageFamilyViewsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -211,13 +212,13 @@ func (c *imageFamilyViewsRESTClient) Get(ctx context.Context, req *computepb.Get
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -58,9 +58,14 @@ type ImagesCallOptions struct {
func defaultImagesRESTCallOptions() *ImagesCallOptions {
return &ImagesCallOptions{
Delete: []gax.CallOption{},
Deprecate: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Deprecate: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -72,6 +77,7 @@ func defaultImagesRESTCallOptions() *ImagesCallOptions {
}),
},
GetFromFamily: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -83,6 +89,7 @@ func defaultImagesRESTCallOptions() *ImagesCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -93,8 +100,11 @@ func defaultImagesRESTCallOptions() *ImagesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -105,10 +115,18 @@ func defaultImagesRESTCallOptions() *ImagesCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
SetLabels: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -282,7 +300,7 @@ func defaultImagesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *imagesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -348,13 +366,13 @@ func (c *imagesRESTClient) Delete(ctx context.Context, req *computepb.DeleteImag
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -422,13 +440,13 @@ func (c *imagesRESTClient) Deprecate(ctx context.Context, req *computepb.Depreca
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -482,13 +500,13 @@ func (c *imagesRESTClient) Get(ctx context.Context, req *computepb.GetImageReque
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -535,13 +553,13 @@ func (c *imagesRESTClient) GetFromFamily(ctx context.Context, req *computepb.Get
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -595,13 +613,13 @@ func (c *imagesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetI
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -665,13 +683,13 @@ func (c *imagesRESTClient) Insert(ctx context.Context, req *computepb.InsertImag
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -751,13 +769,13 @@ func (c *imagesRESTClient) List(ctx context.Context, req *computepb.ListImagesRe
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -835,13 +853,13 @@ func (c *imagesRESTClient) Patch(ctx context.Context, req *computepb.PatchImageR
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -902,13 +920,13 @@ func (c *imagesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetI
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -962,13 +980,13 @@ func (c *imagesRESTClient) SetLabels(ctx context.Context, req *computepb.SetLabe
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1029,13 +1047,13 @@ func (c *imagesRESTClient) TestIamPermissions(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -68,8 +68,11 @@ type InstanceGroupManagersCallOptions struct {
func defaultInstanceGroupManagersRESTCallOptions() *InstanceGroupManagersCallOptions {
return &InstanceGroupManagersCallOptions{
AbandonInstances: []gax.CallOption{},
AbandonInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -80,12 +83,23 @@ func defaultInstanceGroupManagersRESTCallOptions() *InstanceGroupManagersCallOpt
http.StatusServiceUnavailable)
}),
},
ApplyUpdatesToInstances: []gax.CallOption{},
CreateInstances: []gax.CallOption{},
Delete: []gax.CallOption{},
DeleteInstances: []gax.CallOption{},
DeletePerInstanceConfigs: []gax.CallOption{},
ApplyUpdatesToInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
CreateInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DeleteInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DeletePerInstanceConfigs: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -96,8 +110,11 @@ func defaultInstanceGroupManagersRESTCallOptions() *InstanceGroupManagersCallOpt
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -109,6 +126,7 @@ func defaultInstanceGroupManagersRESTCallOptions() *InstanceGroupManagersCallOpt
}),
},
ListErrors: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -119,15 +137,33 @@ func defaultInstanceGroupManagersRESTCallOptions() *InstanceGroupManagersCallOpt
http.StatusServiceUnavailable)
}),
},
ListManagedInstances: []gax.CallOption{},
ListPerInstanceConfigs: []gax.CallOption{},
Patch: []gax.CallOption{},
PatchPerInstanceConfigs: []gax.CallOption{},
RecreateInstances: []gax.CallOption{},
Resize: []gax.CallOption{},
SetInstanceTemplate: []gax.CallOption{},
SetTargetPools: []gax.CallOption{},
UpdatePerInstanceConfigs: []gax.CallOption{},
ListManagedInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
ListPerInstanceConfigs: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
PatchPerInstanceConfigs: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RecreateInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Resize: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetInstanceTemplate: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetTargetPools: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
UpdatePerInstanceConfigs: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -355,7 +391,7 @@ func defaultInstanceGroupManagersRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *instanceGroupManagersRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -428,13 +464,13 @@ func (c *instanceGroupManagersRESTClient) AbandonInstances(ctx context.Context,
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -518,13 +554,13 @@ func (c *instanceGroupManagersRESTClient) AggregatedList(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -602,13 +638,13 @@ func (c *instanceGroupManagersRESTClient) ApplyUpdatesToInstances(ctx context.Co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -677,13 +713,13 @@ func (c *instanceGroupManagersRESTClient) CreateInstances(ctx context.Context, r
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -745,13 +781,13 @@ func (c *instanceGroupManagersRESTClient) Delete(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -820,13 +856,13 @@ func (c *instanceGroupManagersRESTClient) DeleteInstances(ctx context.Context, r
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -888,13 +924,13 @@ func (c *instanceGroupManagersRESTClient) DeletePerInstanceConfigs(ctx context.C
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -949,13 +985,13 @@ func (c *instanceGroupManagersRESTClient) Get(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1016,13 +1052,13 @@ func (c *instanceGroupManagersRESTClient) Insert(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1103,13 +1139,13 @@ func (c *instanceGroupManagersRESTClient) List(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1199,13 +1235,13 @@ func (c *instanceGroupManagersRESTClient) ListErrors(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1295,13 +1331,13 @@ func (c *instanceGroupManagersRESTClient) ListManagedInstances(ctx context.Conte
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1391,13 +1427,13 @@ func (c *instanceGroupManagersRESTClient) ListPerInstanceConfigs(ctx context.Con
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1475,13 +1511,13 @@ func (c *instanceGroupManagersRESTClient) Patch(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1550,13 +1586,13 @@ func (c *instanceGroupManagersRESTClient) PatchPerInstanceConfigs(ctx context.Co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1625,13 +1661,13 @@ func (c *instanceGroupManagersRESTClient) RecreateInstances(ctx context.Context,
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1694,13 +1730,13 @@ func (c *instanceGroupManagersRESTClient) Resize(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1769,13 +1805,13 @@ func (c *instanceGroupManagersRESTClient) SetInstanceTemplate(ctx context.Contex
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1844,13 +1880,13 @@ func (c *instanceGroupManagersRESTClient) SetTargetPools(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1919,13 +1955,13 @@ func (c *instanceGroupManagersRESTClient) UpdatePerInstanceConfigs(ctx context.C
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -57,8 +57,11 @@ type InstanceGroupsCallOptions struct {
func defaultInstanceGroupsRESTCallOptions() *InstanceGroupsCallOptions {
return &InstanceGroupsCallOptions{
AddInstances: []gax.CallOption{},
AddInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -69,8 +72,11 @@ func defaultInstanceGroupsRESTCallOptions() *InstanceGroupsCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -81,8 +87,11 @@ func defaultInstanceGroupsRESTCallOptions() *InstanceGroupsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -93,9 +102,15 @@ func defaultInstanceGroupsRESTCallOptions() *InstanceGroupsCallOptions {
http.StatusServiceUnavailable)
}),
},
ListInstances: []gax.CallOption{},
RemoveInstances: []gax.CallOption{},
SetNamedPorts: []gax.CallOption{},
ListInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RemoveInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetNamedPorts: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -257,7 +272,7 @@ func defaultInstanceGroupsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *instanceGroupsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -330,13 +345,13 @@ func (c *instanceGroupsRESTClient) AddInstances(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -420,13 +435,13 @@ func (c *instanceGroupsRESTClient) AggregatedList(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -504,13 +519,13 @@ func (c *instanceGroupsRESTClient) Delete(ctx context.Context, req *computepb.De
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -565,13 +580,13 @@ func (c *instanceGroupsRESTClient) Get(ctx context.Context, req *computepb.GetIn
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -632,13 +647,13 @@ func (c *instanceGroupsRESTClient) Insert(ctx context.Context, req *computepb.In
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -719,13 +734,13 @@ func (c *instanceGroupsRESTClient) List(ctx context.Context, req *computepb.List
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -821,13 +836,13 @@ func (c *instanceGroupsRESTClient) ListInstances(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -905,13 +920,13 @@ func (c *instanceGroupsRESTClient) RemoveInstances(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -980,13 +995,13 @@ func (c *instanceGroupsRESTClient) SetNamedPorts(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -57,6 +57,7 @@ type InstanceTemplatesCallOptions struct {
func defaultInstanceTemplatesRESTCallOptions() *InstanceTemplatesCallOptions {
return &InstanceTemplatesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -67,8 +68,11 @@ func defaultInstanceTemplatesRESTCallOptions() *InstanceTemplatesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -80,6 +84,7 @@ func defaultInstanceTemplatesRESTCallOptions() *InstanceTemplatesCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,8 +95,11 @@ func defaultInstanceTemplatesRESTCallOptions() *InstanceTemplatesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -102,8 +110,12 @@ func defaultInstanceTemplatesRESTCallOptions() *InstanceTemplatesCallOptions {
http.StatusServiceUnavailable)
}),
},
SetIamPolicy: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -259,7 +271,7 @@ func defaultInstanceTemplatesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *instanceTemplatesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -347,13 +359,13 @@ func (c *instanceTemplatesRESTClient) AggregatedList(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -431,13 +443,13 @@ func (c *instanceTemplatesRESTClient) Delete(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -491,13 +503,13 @@ func (c *instanceTemplatesRESTClient) Get(ctx context.Context, req *computepb.Ge
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -551,13 +563,13 @@ func (c *instanceTemplatesRESTClient) GetIamPolicy(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -618,13 +630,13 @@ func (c *instanceTemplatesRESTClient) Insert(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -704,13 +716,13 @@ func (c *instanceTemplatesRESTClient) List(ctx context.Context, req *computepb.L
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -781,13 +793,13 @@ func (c *instanceTemplatesRESTClient) SetIamPolicy(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -841,13 +853,13 @@ func (c *instanceTemplatesRESTClient) TestIamPermissions(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -94,9 +94,14 @@ type InstancesCallOptions struct {
func defaultInstancesRESTCallOptions() *InstancesCallOptions {
return &InstancesCallOptions{
AddAccessConfig: []gax.CallOption{},
AddResourcePolicies: []gax.CallOption{},
AddAccessConfig: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AddResourcePolicies: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -107,12 +112,23 @@ func defaultInstancesRESTCallOptions() *InstancesCallOptions {
http.StatusServiceUnavailable)
}),
},
AttachDisk: []gax.CallOption{},
BulkInsert: []gax.CallOption{},
Delete: []gax.CallOption{},
DeleteAccessConfig: []gax.CallOption{},
DetachDisk: []gax.CallOption{},
AttachDisk: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
BulkInsert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DeleteAccessConfig: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DetachDisk: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -124,6 +140,7 @@ func defaultInstancesRESTCallOptions() *InstancesCallOptions {
}),
},
GetEffectiveFirewalls: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -135,6 +152,7 @@ func defaultInstancesRESTCallOptions() *InstancesCallOptions {
}),
},
GetGuestAttributes: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -146,6 +164,7 @@ func defaultInstancesRESTCallOptions() *InstancesCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -157,6 +176,7 @@ func defaultInstancesRESTCallOptions() *InstancesCallOptions {
}),
},
GetScreenshot: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -168,6 +188,7 @@ func defaultInstancesRESTCallOptions() *InstancesCallOptions {
}),
},
GetSerialPortOutput: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -179,6 +200,7 @@ func defaultInstancesRESTCallOptions() *InstancesCallOptions {
}),
},
GetShieldedInstanceIdentity: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -189,8 +211,11 @@ func defaultInstancesRESTCallOptions() *InstancesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -202,6 +227,7 @@ func defaultInstancesRESTCallOptions() *InstancesCallOptions {
}),
},
ListReferrers: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -212,34 +238,90 @@ func defaultInstancesRESTCallOptions() *InstancesCallOptions {
http.StatusServiceUnavailable)
}),
},
RemoveResourcePolicies: []gax.CallOption{},
Reset: []gax.CallOption{},
Resume: []gax.CallOption{},
SendDiagnosticInterrupt: []gax.CallOption{},
SetDeletionProtection: []gax.CallOption{},
SetDiskAutoDelete: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
SetLabels: []gax.CallOption{},
SetMachineResources: []gax.CallOption{},
SetMachineType: []gax.CallOption{},
SetMetadata: []gax.CallOption{},
SetMinCpuPlatform: []gax.CallOption{},
SetName: []gax.CallOption{},
SetScheduling: []gax.CallOption{},
SetServiceAccount: []gax.CallOption{},
SetShieldedInstanceIntegrityPolicy: []gax.CallOption{},
SetTags: []gax.CallOption{},
SimulateMaintenanceEvent: []gax.CallOption{},
Start: []gax.CallOption{},
StartWithEncryptionKey: []gax.CallOption{},
Stop: []gax.CallOption{},
Suspend: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
Update: []gax.CallOption{},
UpdateAccessConfig: []gax.CallOption{},
UpdateDisplayDevice: []gax.CallOption{},
UpdateNetworkInterface: []gax.CallOption{},
UpdateShieldedInstanceConfig: []gax.CallOption{},
RemoveResourcePolicies: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Reset: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Resume: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SendDiagnosticInterrupt: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetDeletionProtection: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetDiskAutoDelete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetMachineResources: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetMachineType: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetMetadata: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetMinCpuPlatform: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetName: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetScheduling: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetServiceAccount: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetShieldedInstanceIntegrityPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetTags: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SimulateMaintenanceEvent: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Start: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
StartWithEncryptionKey: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Stop: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Suspend: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
UpdateAccessConfig: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
UpdateDisplayDevice: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
UpdateNetworkInterface: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
UpdateShieldedInstanceConfig: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -623,7 +705,7 @@ func defaultInstancesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *instancesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -697,13 +779,13 @@ func (c *instancesRESTClient) AddAccessConfig(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -772,13 +854,13 @@ func (c *instancesRESTClient) AddResourcePolicies(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -862,13 +944,13 @@ func (c *instancesRESTClient) AggregatedList(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -956,13 +1038,13 @@ func (c *instancesRESTClient) AttachDisk(ctx context.Context, req *computepb.Att
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1031,13 +1113,13 @@ func (c *instancesRESTClient) BulkInsert(ctx context.Context, req *computepb.Bul
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1099,13 +1181,13 @@ func (c *instancesRESTClient) Delete(ctx context.Context, req *computepb.DeleteI
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1169,13 +1251,13 @@ func (c *instancesRESTClient) DeleteAccessConfig(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1238,13 +1320,13 @@ func (c *instancesRESTClient) DetachDisk(ctx context.Context, req *computepb.Det
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1299,13 +1381,13 @@ func (c *instancesRESTClient) Get(ctx context.Context, req *computepb.GetInstanc
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1357,13 +1439,13 @@ func (c *instancesRESTClient) GetEffectiveFirewalls(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1420,13 +1502,13 @@ func (c *instancesRESTClient) GetGuestAttributes(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1480,13 +1562,13 @@ func (c *instancesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.G
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1533,13 +1615,13 @@ func (c *instancesRESTClient) GetScreenshot(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1596,13 +1678,13 @@ func (c *instancesRESTClient) GetSerialPortOutput(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1649,13 +1731,13 @@ func (c *instancesRESTClient) GetShieldedInstanceIdentity(ctx context.Context, r
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1722,13 +1804,13 @@ func (c *instancesRESTClient) Insert(ctx context.Context, req *computepb.InsertI
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1809,13 +1891,13 @@ func (c *instancesRESTClient) List(ctx context.Context, req *computepb.ListInsta
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1905,13 +1987,13 @@ func (c *instancesRESTClient) ListReferrers(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1989,13 +2071,13 @@ func (c *instancesRESTClient) RemoveResourcePolicies(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2057,13 +2139,13 @@ func (c *instancesRESTClient) Reset(ctx context.Context, req *computepb.ResetIns
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2125,13 +2207,13 @@ func (c *instancesRESTClient) Resume(ctx context.Context, req *computepb.ResumeI
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2186,13 +2268,13 @@ func (c *instancesRESTClient) SendDiagnosticInterrupt(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2249,13 +2331,13 @@ func (c *instancesRESTClient) SetDeletionProtection(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2319,13 +2401,13 @@ func (c *instancesRESTClient) SetDiskAutoDelete(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2387,13 +2469,13 @@ func (c *instancesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.S
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2454,13 +2536,13 @@ func (c *instancesRESTClient) SetLabels(ctx context.Context, req *computepb.SetL
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2529,13 +2611,13 @@ func (c *instancesRESTClient) SetMachineResources(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2604,13 +2686,13 @@ func (c *instancesRESTClient) SetMachineType(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2679,13 +2761,13 @@ func (c *instancesRESTClient) SetMetadata(ctx context.Context, req *computepb.Se
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2754,13 +2836,13 @@ func (c *instancesRESTClient) SetMinCpuPlatform(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2829,13 +2911,13 @@ func (c *instancesRESTClient) SetName(ctx context.Context, req *computepb.SetNam
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2904,13 +2986,13 @@ func (c *instancesRESTClient) SetScheduling(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -2979,13 +3061,13 @@ func (c *instancesRESTClient) SetServiceAccount(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3054,13 +3136,13 @@ func (c *instancesRESTClient) SetShieldedInstanceIntegrityPolicy(ctx context.Con
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3129,13 +3211,13 @@ func (c *instancesRESTClient) SetTags(ctx context.Context, req *computepb.SetTag
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3162,6 +3244,13 @@ func (c *instancesRESTClient) SimulateMaintenanceEvent(ctx context.Context, req
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/instances/%v/simulateMaintenanceEvent", req.GetProject(), req.GetZone(), req.GetInstance())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "zone", url.QueryEscape(req.GetZone()), "instance", url.QueryEscape(req.GetInstance())))
@ -3190,13 +3279,13 @@ func (c *instancesRESTClient) SimulateMaintenanceEvent(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3258,13 +3347,13 @@ func (c *instancesRESTClient) Start(ctx context.Context, req *computepb.StartIns
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3333,13 +3422,13 @@ func (c *instancesRESTClient) StartWithEncryptionKey(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3404,13 +3493,13 @@ func (c *instancesRESTClient) Stop(ctx context.Context, req *computepb.StopInsta
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3475,13 +3564,13 @@ func (c *instancesRESTClient) Suspend(ctx context.Context, req *computepb.Suspen
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3543,13 +3632,13 @@ func (c *instancesRESTClient) TestIamPermissions(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3616,13 +3705,13 @@ func (c *instancesRESTClient) Update(ctx context.Context, req *computepb.UpdateI
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3692,13 +3781,13 @@ func (c *instancesRESTClient) UpdateAccessConfig(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3767,13 +3856,13 @@ func (c *instancesRESTClient) UpdateDisplayDevice(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3843,13 +3932,13 @@ func (c *instancesRESTClient) UpdateNetworkInterface(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -3918,13 +4007,13 @@ func (c *instancesRESTClient) UpdateShieldedInstanceConfig(ctx context.Context,
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -56,6 +56,7 @@ type InterconnectAttachmentsCallOptions struct {
func defaultInterconnectAttachmentsRESTCallOptions() *InterconnectAttachmentsCallOptions {
return &InterconnectAttachmentsCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -66,8 +67,11 @@ func defaultInterconnectAttachmentsRESTCallOptions() *InterconnectAttachmentsCal
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,8 +82,11 @@ func defaultInterconnectAttachmentsRESTCallOptions() *InterconnectAttachmentsCal
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,8 +97,12 @@ func defaultInterconnectAttachmentsRESTCallOptions() *InterconnectAttachmentsCal
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetLabels: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -241,7 +252,7 @@ func defaultInterconnectAttachmentsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *interconnectAttachmentsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -329,13 +340,13 @@ func (c *interconnectAttachmentsRESTClient) AggregatedList(ctx context.Context,
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -413,13 +424,13 @@ func (c *interconnectAttachmentsRESTClient) Delete(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -474,13 +485,13 @@ func (c *interconnectAttachmentsRESTClient) Get(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -544,13 +555,13 @@ func (c *interconnectAttachmentsRESTClient) Insert(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -631,13 +642,13 @@ func (c *interconnectAttachmentsRESTClient) List(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -715,13 +726,13 @@ func (c *interconnectAttachmentsRESTClient) Patch(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -790,13 +801,13 @@ func (c *interconnectAttachmentsRESTClient) SetLabels(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -49,6 +49,7 @@ type InterconnectLocationsCallOptions struct {
func defaultInterconnectLocationsRESTCallOptions() *InterconnectLocationsCallOptions {
return &InterconnectLocationsCallOptions{
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -60,6 +61,7 @@ func defaultInterconnectLocationsRESTCallOptions() *InterconnectLocationsCallOpt
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -176,7 +178,7 @@ func defaultInterconnectLocationsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *interconnectLocationsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -232,13 +234,13 @@ func (c *interconnectLocationsRESTClient) Get(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -311,13 +313,13 @@ func (c *interconnectLocationsRESTClient) List(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -0,0 +1,395 @@
// Copyright 2023 Google LLC
//
// 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
//
// https://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.
// Code generated by protoc-gen-go_gapic. DO NOT EDIT.
package compute
import (
"context"
"fmt"
"io"
"math"
"net/http"
"net/url"
"time"
computepb "cloud.google.com/go/compute/apiv1/computepb"
gax "github.com/googleapis/gax-go/v2"
"google.golang.org/api/googleapi"
"google.golang.org/api/iterator"
"google.golang.org/api/option"
"google.golang.org/api/option/internaloption"
httptransport "google.golang.org/api/transport/http"
"google.golang.org/grpc"
"google.golang.org/grpc/metadata"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
)
var newInterconnectRemoteLocationsClientHook clientHook
// InterconnectRemoteLocationsCallOptions contains the retry settings for each method of InterconnectRemoteLocationsClient.
type InterconnectRemoteLocationsCallOptions struct {
Get []gax.CallOption
List []gax.CallOption
}
func defaultInterconnectRemoteLocationsRESTCallOptions() *InterconnectRemoteLocationsCallOptions {
return &InterconnectRemoteLocationsCallOptions{
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.30,
},
http.StatusGatewayTimeout,
http.StatusServiceUnavailable)
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
Max: 60000 * time.Millisecond,
Multiplier: 1.30,
},
http.StatusGatewayTimeout,
http.StatusServiceUnavailable)
}),
},
}
}
// internalInterconnectRemoteLocationsClient is an interface that defines the methods available from Google Compute Engine API.
type internalInterconnectRemoteLocationsClient interface {
Close() error
setGoogleClientInfo(...string)
Connection() *grpc.ClientConn
Get(context.Context, *computepb.GetInterconnectRemoteLocationRequest, ...gax.CallOption) (*computepb.InterconnectRemoteLocation, error)
List(context.Context, *computepb.ListInterconnectRemoteLocationsRequest, ...gax.CallOption) *InterconnectRemoteLocationIterator
}
// InterconnectRemoteLocationsClient is a client for interacting with Google Compute Engine API.
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
//
// The InterconnectRemoteLocations API.
type InterconnectRemoteLocationsClient struct {
// The internal transport-dependent client.
internalClient internalInterconnectRemoteLocationsClient
// The call options for this service.
CallOptions *InterconnectRemoteLocationsCallOptions
}
// Wrapper methods routed to the internal client.
// Close closes the connection to the API service. The user should invoke this when
// the client is no longer required.
func (c *InterconnectRemoteLocationsClient) Close() error {
return c.internalClient.Close()
}
// setGoogleClientInfo sets the name and version of the application in
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *InterconnectRemoteLocationsClient) setGoogleClientInfo(keyval ...string) {
c.internalClient.setGoogleClientInfo(keyval...)
}
// Connection returns a connection to the API service.
//
// Deprecated: Connections are now pooled so this method does not always
// return the same resource.
func (c *InterconnectRemoteLocationsClient) Connection() *grpc.ClientConn {
return c.internalClient.Connection()
}
// Get returns the details for the specified interconnect remote location. Gets a list of available interconnect remote locations by making a list() request.
func (c *InterconnectRemoteLocationsClient) Get(ctx context.Context, req *computepb.GetInterconnectRemoteLocationRequest, opts ...gax.CallOption) (*computepb.InterconnectRemoteLocation, error) {
return c.internalClient.Get(ctx, req, opts...)
}
// List retrieves the list of interconnect remote locations available to the specified project.
func (c *InterconnectRemoteLocationsClient) List(ctx context.Context, req *computepb.ListInterconnectRemoteLocationsRequest, opts ...gax.CallOption) *InterconnectRemoteLocationIterator {
return c.internalClient.List(ctx, req, opts...)
}
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type interconnectRemoteLocationsRESTClient struct {
// The http endpoint to connect to.
endpoint string
// The http client.
httpClient *http.Client
// The x-goog-* metadata to be sent with each request.
xGoogMetadata metadata.MD
// Points back to the CallOptions field of the containing InterconnectRemoteLocationsClient
CallOptions **InterconnectRemoteLocationsCallOptions
}
// NewInterconnectRemoteLocationsRESTClient creates a new interconnect remote locations rest client.
//
// The InterconnectRemoteLocations API.
func NewInterconnectRemoteLocationsRESTClient(ctx context.Context, opts ...option.ClientOption) (*InterconnectRemoteLocationsClient, error) {
clientOpts := append(defaultInterconnectRemoteLocationsRESTClientOptions(), opts...)
httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
if err != nil {
return nil, err
}
callOpts := defaultInterconnectRemoteLocationsRESTCallOptions()
c := &interconnectRemoteLocationsRESTClient{
endpoint: endpoint,
httpClient: httpClient,
CallOptions: &callOpts,
}
c.setGoogleClientInfo()
return &InterconnectRemoteLocationsClient{internalClient: c, CallOptions: callOpts}, nil
}
func defaultInterconnectRemoteLocationsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
}
// setGoogleClientInfo sets the name and version of the application in
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *interconnectRemoteLocationsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
// Close closes the connection to the API service. The user should invoke this when
// the client is no longer required.
func (c *interconnectRemoteLocationsRESTClient) Close() error {
// Replace httpClient with nil to force cleanup.
c.httpClient = nil
return nil
}
// Connection returns a connection to the API service.
//
// Deprecated: This method always returns nil.
func (c *interconnectRemoteLocationsRESTClient) Connection() *grpc.ClientConn {
return nil
}
// Get returns the details for the specified interconnect remote location. Gets a list of available interconnect remote locations by making a list() request.
func (c *interconnectRemoteLocationsRESTClient) Get(ctx context.Context, req *computepb.GetInterconnectRemoteLocationRequest, opts ...gax.CallOption) (*computepb.InterconnectRemoteLocation, error) {
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnectRemoteLocations/%v", req.GetProject(), req.GetInterconnectRemoteLocation())
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "interconnect_remote_location", url.QueryEscape(req.GetInterconnectRemoteLocation())))
headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json"))
opts = append((*c.CallOptions).Get[0:len((*c.CallOptions).Get):len((*c.CallOptions).Get)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.InterconnectRemoteLocation{}
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
if err != nil {
return err
}
httpReq = httpReq.WithContext(ctx)
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
}, opts...)
if e != nil {
return nil, e
}
return resp, nil
}
// List retrieves the list of interconnect remote locations available to the specified project.
func (c *interconnectRemoteLocationsRESTClient) List(ctx context.Context, req *computepb.ListInterconnectRemoteLocationsRequest, opts ...gax.CallOption) *InterconnectRemoteLocationIterator {
it := &InterconnectRemoteLocationIterator{}
req = proto.Clone(req).(*computepb.ListInterconnectRemoteLocationsRequest)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
it.InternalFetch = func(pageSize int, pageToken string) ([]*computepb.InterconnectRemoteLocation, string, error) {
resp := &computepb.InterconnectRemoteLocationList{}
if pageToken != "" {
req.PageToken = proto.String(pageToken)
}
if pageSize > math.MaxInt32 {
req.MaxResults = proto.Uint32(math.MaxInt32)
} else if pageSize != 0 {
req.MaxResults = proto.Uint32(uint32(pageSize))
}
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, "", err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnectRemoteLocations", req.GetProject())
params := url.Values{}
if req != nil && req.Filter != nil {
params.Add("filter", fmt.Sprintf("%v", req.GetFilter()))
}
if req != nil && req.MaxResults != nil {
params.Add("maxResults", fmt.Sprintf("%v", req.GetMaxResults()))
}
if req != nil && req.OrderBy != nil {
params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy()))
}
if req != nil && req.PageToken != nil {
params.Add("pageToken", fmt.Sprintf("%v", req.GetPageToken()))
}
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
headers := buildHeaders(ctx, c.xGoogMetadata, metadata.Pairs("Content-Type", "application/json"))
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("GET", baseUrl.String(), nil)
if err != nil {
return err
}
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
}, opts...)
if e != nil {
return nil, "", e
}
it.Response = resp
return resp.GetItems(), resp.GetNextPageToken(), nil
}
fetch := func(pageSize int, pageToken string) (string, error) {
items, nextPageToken, err := it.InternalFetch(pageSize, pageToken)
if err != nil {
return "", err
}
it.items = append(it.items, items...)
return nextPageToken, nil
}
it.pageInfo, it.nextFunc = iterator.NewPageInfo(fetch, it.bufLen, it.takeBuf)
it.pageInfo.MaxSize = int(req.GetMaxResults())
it.pageInfo.Token = req.GetPageToken()
return it
}
// InterconnectRemoteLocationIterator manages a stream of *computepb.InterconnectRemoteLocation.
type InterconnectRemoteLocationIterator struct {
items []*computepb.InterconnectRemoteLocation
pageInfo *iterator.PageInfo
nextFunc func() error
// Response is the raw response for the current page.
// It must be cast to the RPC response type.
// Calling Next() or InternalFetch() updates this value.
Response interface{}
// InternalFetch is for use by the Google Cloud Libraries only.
// It is not part of the stable interface of this package.
//
// InternalFetch returns results from a single call to the underlying RPC.
// The number of results is no greater than pageSize.
// If there are no more results, nextPageToken is empty and err is nil.
InternalFetch func(pageSize int, pageToken string) (results []*computepb.InterconnectRemoteLocation, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InterconnectRemoteLocationIterator) PageInfo() *iterator.PageInfo {
return it.pageInfo
}
// Next returns the next result. Its second return value is iterator.Done if there are no more
// results. Once Next returns Done, all subsequent calls will return Done.
func (it *InterconnectRemoteLocationIterator) Next() (*computepb.InterconnectRemoteLocation, error) {
var item *computepb.InterconnectRemoteLocation
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InterconnectRemoteLocationIterator) bufLen() int {
return len(it.items)
}
func (it *InterconnectRemoteLocationIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -54,8 +54,11 @@ type InterconnectsCallOptions struct {
func defaultInterconnectsRESTCallOptions() *InterconnectsCallOptions {
return &InterconnectsCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -67,6 +70,7 @@ func defaultInterconnectsRESTCallOptions() *InterconnectsCallOptions {
}),
},
GetDiagnostics: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -77,8 +81,11 @@ func defaultInterconnectsRESTCallOptions() *InterconnectsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -89,8 +96,12 @@ func defaultInterconnectsRESTCallOptions() *InterconnectsCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetLabels: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -240,7 +251,7 @@ func defaultInterconnectsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *interconnectsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -306,13 +317,13 @@ func (c *interconnectsRESTClient) Delete(ctx context.Context, req *computepb.Del
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -366,13 +377,13 @@ func (c *interconnectsRESTClient) Get(ctx context.Context, req *computepb.GetInt
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -419,13 +430,13 @@ func (c *interconnectsRESTClient) GetDiagnostics(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -486,13 +497,13 @@ func (c *interconnectsRESTClient) Insert(ctx context.Context, req *computepb.Ins
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -572,13 +583,13 @@ func (c *interconnectsRESTClient) List(ctx context.Context, req *computepb.ListI
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -656,13 +667,13 @@ func (c *interconnectsRESTClient) Patch(ctx context.Context, req *computepb.Patc
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -723,13 +734,13 @@ func (c *interconnectsRESTClient) SetLabels(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"time"
@ -47,6 +47,7 @@ type LicenseCodesCallOptions struct {
func defaultLicenseCodesRESTCallOptions() *LicenseCodesCallOptions {
return &LicenseCodesCallOptions{
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -57,7 +58,9 @@ func defaultLicenseCodesRESTCallOptions() *LicenseCodesCallOptions {
http.StatusServiceUnavailable)
}),
},
TestIamPermissions: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -164,7 +167,7 @@ func defaultLicenseCodesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *licenseCodesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -220,13 +223,13 @@ func (c *licenseCodesRESTClient) Get(ctx context.Context, req *computepb.GetLice
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -280,13 +283,13 @@ func (c *licenseCodesRESTClient) TestIamPermissions(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -54,8 +54,11 @@ type LicensesCallOptions struct {
func defaultLicensesRESTCallOptions() *LicensesCallOptions {
return &LicensesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -67,6 +70,7 @@ func defaultLicensesRESTCallOptions() *LicensesCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -77,8 +81,11 @@ func defaultLicensesRESTCallOptions() *LicensesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -89,8 +96,12 @@ func defaultLicensesRESTCallOptions() *LicensesCallOptions {
http.StatusServiceUnavailable)
}),
},
SetIamPolicy: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -240,7 +251,7 @@ func defaultLicensesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *licensesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -306,13 +317,13 @@ func (c *licensesRESTClient) Delete(ctx context.Context, req *computepb.DeleteLi
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -366,13 +377,13 @@ func (c *licensesRESTClient) Get(ctx context.Context, req *computepb.GetLicenseR
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -426,13 +437,13 @@ func (c *licensesRESTClient) GetIamPolicy(ctx context.Context, req *computepb.Ge
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -493,13 +504,13 @@ func (c *licensesRESTClient) Insert(ctx context.Context, req *computepb.InsertLi
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -579,13 +590,13 @@ func (c *licensesRESTClient) List(ctx context.Context, req *computepb.ListLicens
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -656,13 +667,13 @@ func (c *licensesRESTClient) SetIamPolicy(ctx context.Context, req *computepb.Se
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -716,13 +727,13 @@ func (c *licensesRESTClient) TestIamPermissions(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -54,8 +54,11 @@ type MachineImagesCallOptions struct {
func defaultMachineImagesRESTCallOptions() *MachineImagesCallOptions {
return &MachineImagesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -67,6 +70,7 @@ func defaultMachineImagesRESTCallOptions() *MachineImagesCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -77,8 +81,11 @@ func defaultMachineImagesRESTCallOptions() *MachineImagesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -89,8 +96,12 @@ func defaultMachineImagesRESTCallOptions() *MachineImagesCallOptions {
http.StatusServiceUnavailable)
}),
},
SetIamPolicy: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -240,7 +251,7 @@ func defaultMachineImagesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *machineImagesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -306,13 +317,13 @@ func (c *machineImagesRESTClient) Delete(ctx context.Context, req *computepb.Del
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -366,13 +377,13 @@ func (c *machineImagesRESTClient) Get(ctx context.Context, req *computepb.GetMac
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -426,13 +437,13 @@ func (c *machineImagesRESTClient) GetIamPolicy(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -496,13 +507,13 @@ func (c *machineImagesRESTClient) Insert(ctx context.Context, req *computepb.Ins
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -582,13 +593,13 @@ func (c *machineImagesRESTClient) List(ctx context.Context, req *computepb.ListM
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -659,13 +670,13 @@ func (c *machineImagesRESTClient) SetIamPolicy(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -719,13 +730,13 @@ func (c *machineImagesRESTClient) TestIamPermissions(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -51,6 +51,7 @@ type MachineTypesCallOptions struct {
func defaultMachineTypesRESTCallOptions() *MachineTypesCallOptions {
return &MachineTypesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -62,6 +63,7 @@ func defaultMachineTypesRESTCallOptions() *MachineTypesCallOptions {
}),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -73,6 +75,7 @@ func defaultMachineTypesRESTCallOptions() *MachineTypesCallOptions {
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -195,7 +198,7 @@ func defaultMachineTypesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *machineTypesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -280,13 +283,13 @@ func (c *machineTypesRESTClient) AggregatedList(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -357,13 +360,13 @@ func (c *machineTypesRESTClient) Get(ctx context.Context, req *computepb.GetMach
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -436,13 +439,13 @@ func (c *machineTypesRESTClient) List(ctx context.Context, req *computepb.ListMa
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -57,6 +57,7 @@ type NetworkAttachmentsCallOptions struct {
func defaultNetworkAttachmentsRESTCallOptions() *NetworkAttachmentsCallOptions {
return &NetworkAttachmentsCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -67,8 +68,11 @@ func defaultNetworkAttachmentsRESTCallOptions() *NetworkAttachmentsCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -80,6 +84,7 @@ func defaultNetworkAttachmentsRESTCallOptions() *NetworkAttachmentsCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,8 +95,11 @@ func defaultNetworkAttachmentsRESTCallOptions() *NetworkAttachmentsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -102,8 +110,12 @@ func defaultNetworkAttachmentsRESTCallOptions() *NetworkAttachmentsCallOptions {
http.StatusServiceUnavailable)
}),
},
SetIamPolicy: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -259,7 +271,7 @@ func defaultNetworkAttachmentsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *networkAttachmentsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -347,13 +359,13 @@ func (c *networkAttachmentsRESTClient) AggregatedList(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -431,13 +443,13 @@ func (c *networkAttachmentsRESTClient) Delete(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -492,13 +504,13 @@ func (c *networkAttachmentsRESTClient) Get(ctx context.Context, req *computepb.G
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -552,13 +564,13 @@ func (c *networkAttachmentsRESTClient) GetIamPolicy(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -619,13 +631,13 @@ func (c *networkAttachmentsRESTClient) Insert(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -706,13 +718,13 @@ func (c *networkAttachmentsRESTClient) List(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -783,13 +795,13 @@ func (c *networkAttachmentsRESTClient) SetIamPolicy(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -843,13 +855,13 @@ func (c *networkAttachmentsRESTClient) TestIamPermissions(ctx context.Context, r
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -54,6 +54,7 @@ type NetworkEdgeSecurityServicesCallOptions struct {
func defaultNetworkEdgeSecurityServicesRESTCallOptions() *NetworkEdgeSecurityServicesCallOptions {
return &NetworkEdgeSecurityServicesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -64,8 +65,11 @@ func defaultNetworkEdgeSecurityServicesRESTCallOptions() *NetworkEdgeSecuritySer
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,8 +80,12 @@ func defaultNetworkEdgeSecurityServicesRESTCallOptions() *NetworkEdgeSecuritySer
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Patch: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -215,7 +223,7 @@ func defaultNetworkEdgeSecurityServicesRESTClientOptions() []option.ClientOption
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *networkEdgeSecurityServicesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -303,13 +311,13 @@ func (c *networkEdgeSecurityServicesRESTClient) AggregatedList(ctx context.Conte
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -387,13 +395,13 @@ func (c *networkEdgeSecurityServicesRESTClient) Delete(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -448,13 +456,13 @@ func (c *networkEdgeSecurityServicesRESTClient) Get(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -518,13 +526,13 @@ func (c *networkEdgeSecurityServicesRESTClient) Insert(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -599,13 +607,13 @@ func (c *networkEdgeSecurityServicesRESTClient) Patch(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -58,6 +58,7 @@ type NetworkEndpointGroupsCallOptions struct {
func defaultNetworkEndpointGroupsRESTCallOptions() *NetworkEndpointGroupsCallOptions {
return &NetworkEndpointGroupsCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -68,10 +69,17 @@ func defaultNetworkEndpointGroupsRESTCallOptions() *NetworkEndpointGroupsCallOpt
http.StatusServiceUnavailable)
}),
},
AttachNetworkEndpoints: []gax.CallOption{},
Delete: []gax.CallOption{},
DetachNetworkEndpoints: []gax.CallOption{},
AttachNetworkEndpoints: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DetachNetworkEndpoints: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -82,8 +90,11 @@ func defaultNetworkEndpointGroupsRESTCallOptions() *NetworkEndpointGroupsCallOpt
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -94,8 +105,12 @@ func defaultNetworkEndpointGroupsRESTCallOptions() *NetworkEndpointGroupsCallOpt
http.StatusServiceUnavailable)
}),
},
ListNetworkEndpoints: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
ListNetworkEndpoints: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -257,7 +272,7 @@ func defaultNetworkEndpointGroupsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *networkEndpointGroupsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -345,13 +360,13 @@ func (c *networkEndpointGroupsRESTClient) AggregatedList(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -436,13 +451,13 @@ func (c *networkEndpointGroupsRESTClient) AttachNetworkEndpoints(ctx context.Con
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -504,13 +519,13 @@ func (c *networkEndpointGroupsRESTClient) Delete(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -579,13 +594,13 @@ func (c *networkEndpointGroupsRESTClient) DetachNetworkEndpoints(ctx context.Con
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -640,13 +655,13 @@ func (c *networkEndpointGroupsRESTClient) Get(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -707,13 +722,13 @@ func (c *networkEndpointGroupsRESTClient) Insert(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -794,13 +809,13 @@ func (c *networkEndpointGroupsRESTClient) List(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -896,13 +911,13 @@ func (c *networkEndpointGroupsRESTClient) ListNetworkEndpoints(ctx context.Conte
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -973,13 +988,13 @@ func (c *networkEndpointGroupsRESTClient) TestIamPermissions(ctx context.Context
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -63,11 +63,20 @@ type NetworkFirewallPoliciesCallOptions struct {
func defaultNetworkFirewallPoliciesRESTCallOptions() *NetworkFirewallPoliciesCallOptions {
return &NetworkFirewallPoliciesCallOptions{
AddAssociation: []gax.CallOption{},
AddRule: []gax.CallOption{},
CloneRules: []gax.CallOption{},
Delete: []gax.CallOption{},
AddAssociation: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AddRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
CloneRules: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -79,6 +88,7 @@ func defaultNetworkFirewallPoliciesRESTCallOptions() *NetworkFirewallPoliciesCal
}),
},
GetAssociation: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,6 +100,7 @@ func defaultNetworkFirewallPoliciesRESTCallOptions() *NetworkFirewallPoliciesCal
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -101,6 +112,7 @@ func defaultNetworkFirewallPoliciesRESTCallOptions() *NetworkFirewallPoliciesCal
}),
},
GetRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -111,8 +123,11 @@ func defaultNetworkFirewallPoliciesRESTCallOptions() *NetworkFirewallPoliciesCal
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -123,12 +138,24 @@ func defaultNetworkFirewallPoliciesRESTCallOptions() *NetworkFirewallPoliciesCal
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
PatchRule: []gax.CallOption{},
RemoveAssociation: []gax.CallOption{},
RemoveRule: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
PatchRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RemoveAssociation: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RemoveRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -332,7 +359,7 @@ func defaultNetworkFirewallPoliciesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *networkFirewallPoliciesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -408,13 +435,13 @@ func (c *networkFirewallPoliciesRESTClient) AddAssociation(ctx context.Context,
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -488,13 +515,13 @@ func (c *networkFirewallPoliciesRESTClient) AddRule(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -558,13 +585,13 @@ func (c *networkFirewallPoliciesRESTClient) CloneRules(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -625,13 +652,13 @@ func (c *networkFirewallPoliciesRESTClient) Delete(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -685,13 +712,13 @@ func (c *networkFirewallPoliciesRESTClient) Get(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -745,13 +772,13 @@ func (c *networkFirewallPoliciesRESTClient) GetAssociation(ctx context.Context,
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -805,13 +832,13 @@ func (c *networkFirewallPoliciesRESTClient) GetIamPolicy(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -865,13 +892,13 @@ func (c *networkFirewallPoliciesRESTClient) GetRule(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -932,13 +959,13 @@ func (c *networkFirewallPoliciesRESTClient) Insert(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1018,13 +1045,13 @@ func (c *networkFirewallPoliciesRESTClient) List(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1102,13 +1129,13 @@ func (c *networkFirewallPoliciesRESTClient) Patch(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1179,13 +1206,13 @@ func (c *networkFirewallPoliciesRESTClient) PatchRule(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1249,13 +1276,13 @@ func (c *networkFirewallPoliciesRESTClient) RemoveAssociation(ctx context.Contex
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1319,13 +1346,13 @@ func (c *networkFirewallPoliciesRESTClient) RemoveRule(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1386,13 +1413,13 @@ func (c *networkFirewallPoliciesRESTClient) SetIamPolicy(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1446,13 +1473,13 @@ func (c *networkFirewallPoliciesRESTClient) TestIamPermissions(ctx context.Conte
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -58,9 +58,14 @@ type NetworksCallOptions struct {
func defaultNetworksRESTCallOptions() *NetworksCallOptions {
return &NetworksCallOptions{
AddPeering: []gax.CallOption{},
Delete: []gax.CallOption{},
AddPeering: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -72,6 +77,7 @@ func defaultNetworksRESTCallOptions() *NetworksCallOptions {
}),
},
GetEffectiveFirewalls: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -82,8 +88,11 @@ func defaultNetworksRESTCallOptions() *NetworksCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -95,6 +104,7 @@ func defaultNetworksRESTCallOptions() *NetworksCallOptions {
}),
},
ListPeeringRoutes: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -105,10 +115,18 @@ func defaultNetworksRESTCallOptions() *NetworksCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
RemovePeering: []gax.CallOption{},
SwitchToCustomMode: []gax.CallOption{},
UpdatePeering: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RemovePeering: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SwitchToCustomMode: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
UpdatePeering: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -282,7 +300,7 @@ func defaultNetworksRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *networksRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -355,13 +373,13 @@ func (c *networksRESTClient) AddPeering(ctx context.Context, req *computepb.AddP
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -422,13 +440,13 @@ func (c *networksRESTClient) Delete(ctx context.Context, req *computepb.DeleteNe
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -482,13 +500,13 @@ func (c *networksRESTClient) Get(ctx context.Context, req *computepb.GetNetworkR
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -535,13 +553,13 @@ func (c *networksRESTClient) GetEffectiveFirewalls(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -602,13 +620,13 @@ func (c *networksRESTClient) Insert(ctx context.Context, req *computepb.InsertNe
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -688,13 +706,13 @@ func (c *networksRESTClient) List(ctx context.Context, req *computepb.ListNetwor
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -793,13 +811,13 @@ func (c *networksRESTClient) ListPeeringRoutes(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -877,13 +895,13 @@ func (c *networksRESTClient) Patch(ctx context.Context, req *computepb.PatchNetw
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -951,13 +969,13 @@ func (c *networksRESTClient) RemovePeering(ctx context.Context, req *computepb.R
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1018,13 +1036,13 @@ func (c *networksRESTClient) SwitchToCustomMode(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1092,13 +1110,13 @@ func (c *networksRESTClient) UpdatePeering(ctx context.Context, req *computepb.U
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -62,8 +62,11 @@ type NodeGroupsCallOptions struct {
func defaultNodeGroupsRESTCallOptions() *NodeGroupsCallOptions {
return &NodeGroupsCallOptions{
AddNodes: []gax.CallOption{},
AddNodes: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -74,9 +77,14 @@ func defaultNodeGroupsRESTCallOptions() *NodeGroupsCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
DeleteNodes: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DeleteNodes: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -88,6 +96,7 @@ func defaultNodeGroupsRESTCallOptions() *NodeGroupsCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -98,8 +107,11 @@ func defaultNodeGroupsRESTCallOptions() *NodeGroupsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -110,12 +122,24 @@ func defaultNodeGroupsRESTCallOptions() *NodeGroupsCallOptions {
http.StatusServiceUnavailable)
}),
},
ListNodes: []gax.CallOption{},
Patch: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
SetNodeTemplate: []gax.CallOption{},
SimulateMaintenanceEvent: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
ListNodes: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetNodeTemplate: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SimulateMaintenanceEvent: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -307,7 +331,7 @@ func defaultNodeGroupsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *nodeGroupsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -380,13 +404,13 @@ func (c *nodeGroupsRESTClient) AddNodes(ctx context.Context, req *computepb.AddN
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -470,13 +494,13 @@ func (c *nodeGroupsRESTClient) AggregatedList(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -554,13 +578,13 @@ func (c *nodeGroupsRESTClient) Delete(ctx context.Context, req *computepb.Delete
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -629,13 +653,13 @@ func (c *nodeGroupsRESTClient) DeleteNodes(ctx context.Context, req *computepb.D
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -690,13 +714,13 @@ func (c *nodeGroupsRESTClient) Get(ctx context.Context, req *computepb.GetNodeGr
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -750,13 +774,13 @@ func (c *nodeGroupsRESTClient) GetIamPolicy(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -818,13 +842,13 @@ func (c *nodeGroupsRESTClient) Insert(ctx context.Context, req *computepb.Insert
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -905,13 +929,13 @@ func (c *nodeGroupsRESTClient) List(ctx context.Context, req *computepb.ListNode
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1001,13 +1025,13 @@ func (c *nodeGroupsRESTClient) ListNodes(ctx context.Context, req *computepb.Lis
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1085,13 +1109,13 @@ func (c *nodeGroupsRESTClient) Patch(ctx context.Context, req *computepb.PatchNo
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1153,13 +1177,13 @@ func (c *nodeGroupsRESTClient) SetIamPolicy(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1220,13 +1244,13 @@ func (c *nodeGroupsRESTClient) SetNodeTemplate(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1295,13 +1319,13 @@ func (c *nodeGroupsRESTClient) SimulateMaintenanceEvent(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1363,13 +1387,13 @@ func (c *nodeGroupsRESTClient) TestIamPermissions(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -57,6 +57,7 @@ type NodeTemplatesCallOptions struct {
func defaultNodeTemplatesRESTCallOptions() *NodeTemplatesCallOptions {
return &NodeTemplatesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -67,8 +68,11 @@ func defaultNodeTemplatesRESTCallOptions() *NodeTemplatesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -80,6 +84,7 @@ func defaultNodeTemplatesRESTCallOptions() *NodeTemplatesCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,8 +95,11 @@ func defaultNodeTemplatesRESTCallOptions() *NodeTemplatesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -102,8 +110,12 @@ func defaultNodeTemplatesRESTCallOptions() *NodeTemplatesCallOptions {
http.StatusServiceUnavailable)
}),
},
SetIamPolicy: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -259,7 +271,7 @@ func defaultNodeTemplatesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *nodeTemplatesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -347,13 +359,13 @@ func (c *nodeTemplatesRESTClient) AggregatedList(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -431,13 +443,13 @@ func (c *nodeTemplatesRESTClient) Delete(ctx context.Context, req *computepb.Del
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -492,13 +504,13 @@ func (c *nodeTemplatesRESTClient) Get(ctx context.Context, req *computepb.GetNod
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -552,13 +564,13 @@ func (c *nodeTemplatesRESTClient) GetIamPolicy(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -619,13 +631,13 @@ func (c *nodeTemplatesRESTClient) Insert(ctx context.Context, req *computepb.Ins
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -706,13 +718,13 @@ func (c *nodeTemplatesRESTClient) List(ctx context.Context, req *computepb.ListN
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -783,13 +795,13 @@ func (c *nodeTemplatesRESTClient) SetIamPolicy(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -843,13 +855,13 @@ func (c *nodeTemplatesRESTClient) TestIamPermissions(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -51,6 +51,7 @@ type NodeTypesCallOptions struct {
func defaultNodeTypesRESTCallOptions() *NodeTypesCallOptions {
return &NodeTypesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -62,6 +63,7 @@ func defaultNodeTypesRESTCallOptions() *NodeTypesCallOptions {
}),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -73,6 +75,7 @@ func defaultNodeTypesRESTCallOptions() *NodeTypesCallOptions {
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -195,7 +198,7 @@ func defaultNodeTypesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *nodeTypesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -280,13 +283,13 @@ func (c *nodeTypesRESTClient) AggregatedList(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -357,13 +360,13 @@ func (c *nodeTypesRESTClient) Get(ctx context.Context, req *computepb.GetNodeTyp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -436,13 +439,13 @@ func (c *nodeTypesRESTClient) List(ctx context.Context, req *computepb.ListNodeT
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -56,6 +56,7 @@ type PacketMirroringsCallOptions struct {
func defaultPacketMirroringsRESTCallOptions() *PacketMirroringsCallOptions {
return &PacketMirroringsCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -66,8 +67,11 @@ func defaultPacketMirroringsRESTCallOptions() *PacketMirroringsCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,8 +82,11 @@ func defaultPacketMirroringsRESTCallOptions() *PacketMirroringsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,8 +97,12 @@ func defaultPacketMirroringsRESTCallOptions() *PacketMirroringsCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -241,7 +252,7 @@ func defaultPacketMirroringsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *packetMirroringsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -329,13 +340,13 @@ func (c *packetMirroringsRESTClient) AggregatedList(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -413,13 +424,13 @@ func (c *packetMirroringsRESTClient) Delete(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -474,13 +485,13 @@ func (c *packetMirroringsRESTClient) Get(ctx context.Context, req *computepb.Get
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -541,13 +552,13 @@ func (c *packetMirroringsRESTClient) Insert(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -628,13 +639,13 @@ func (c *packetMirroringsRESTClient) List(ctx context.Context, req *computepb.Li
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -712,13 +723,13 @@ func (c *packetMirroringsRESTClient) Patch(ctx context.Context, req *computepb.P
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -780,13 +791,13 @@ func (c *packetMirroringsRESTClient) TestIamPermissions(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -60,11 +60,20 @@ type ProjectsCallOptions struct {
func defaultProjectsRESTCallOptions() *ProjectsCallOptions {
return &ProjectsCallOptions{
DisableXpnHost: []gax.CallOption{},
DisableXpnResource: []gax.CallOption{},
EnableXpnHost: []gax.CallOption{},
EnableXpnResource: []gax.CallOption{},
DisableXpnHost: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DisableXpnResource: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
EnableXpnHost: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
EnableXpnResource: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,6 +85,7 @@ func defaultProjectsRESTCallOptions() *ProjectsCallOptions {
}),
},
GetXpnHost: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -87,6 +97,7 @@ func defaultProjectsRESTCallOptions() *ProjectsCallOptions {
}),
},
GetXpnResources: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -97,12 +108,24 @@ func defaultProjectsRESTCallOptions() *ProjectsCallOptions {
http.StatusServiceUnavailable)
}),
},
ListXpnHosts: []gax.CallOption{},
MoveDisk: []gax.CallOption{},
MoveInstance: []gax.CallOption{},
SetCommonInstanceMetadata: []gax.CallOption{},
SetDefaultNetworkTier: []gax.CallOption{},
SetUsageExportBucket: []gax.CallOption{},
ListXpnHosts: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
MoveDisk: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
MoveInstance: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetCommonInstanceMetadata: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetDefaultNetworkTier: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetUsageExportBucket: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -206,7 +229,7 @@ func (c *ProjectsClient) MoveDisk(ctx context.Context, req *computepb.MoveDiskPr
return c.internalClient.MoveDisk(ctx, req, opts...)
}
// MoveInstance moves an instance and its attached persistent disks from one zone to another. Note: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the known issue (at /compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior).
// MoveInstance moves an instance and its attached persistent disks from one zone to another. Note: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the known issue (at /compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior). [Deprecated] This method is deprecated. See moving instance across zones (at /compute/docs/instances/moving-instance-across-zones) instead.
func (c *ProjectsClient) MoveInstance(ctx context.Context, req *computepb.MoveInstanceProjectRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.MoveInstance(ctx, req, opts...)
}
@ -288,7 +311,7 @@ func defaultProjectsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *projectsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -354,13 +377,13 @@ func (c *projectsRESTClient) DisableXpnHost(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -428,13 +451,13 @@ func (c *projectsRESTClient) DisableXpnResource(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -495,13 +518,13 @@ func (c *projectsRESTClient) EnableXpnHost(ctx context.Context, req *computepb.E
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -569,13 +592,13 @@ func (c *projectsRESTClient) EnableXpnResource(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -629,13 +652,13 @@ func (c *projectsRESTClient) Get(ctx context.Context, req *computepb.GetProjectR
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -682,13 +705,13 @@ func (c *projectsRESTClient) GetXpnHost(ctx context.Context, req *computepb.GetX
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -761,13 +784,13 @@ func (c *projectsRESTClient) GetXpnResources(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -863,13 +886,13 @@ func (c *projectsRESTClient) ListXpnHosts(ctx context.Context, req *computepb.Li
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -947,13 +970,13 @@ func (c *projectsRESTClient) MoveDisk(ctx context.Context, req *computepb.MoveDi
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -971,7 +994,7 @@ func (c *projectsRESTClient) MoveDisk(ctx context.Context, req *computepb.MoveDi
return op, nil
}
// MoveInstance moves an instance and its attached persistent disks from one zone to another. Note: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the known issue (at /compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior).
// MoveInstance moves an instance and its attached persistent disks from one zone to another. Note: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the known issue (at /compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior). [Deprecated] This method is deprecated. See moving instance across zones (at /compute/docs/instances/moving-instance-across-zones) instead.
func (c *projectsRESTClient) MoveInstance(ctx context.Context, req *computepb.MoveInstanceProjectRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetInstanceMoveRequestResource()
@ -1021,13 +1044,13 @@ func (c *projectsRESTClient) MoveInstance(ctx context.Context, req *computepb.Mo
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1095,13 +1118,13 @@ func (c *projectsRESTClient) SetCommonInstanceMetadata(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1169,13 +1192,13 @@ func (c *projectsRESTClient) SetDefaultNetworkTier(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1243,13 +1266,13 @@ func (c *projectsRESTClient) SetUsageExportBucket(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -52,8 +52,11 @@ type PublicAdvertisedPrefixesCallOptions struct {
func defaultPublicAdvertisedPrefixesRESTCallOptions() *PublicAdvertisedPrefixesCallOptions {
return &PublicAdvertisedPrefixesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -64,8 +67,11 @@ func defaultPublicAdvertisedPrefixesRESTCallOptions() *PublicAdvertisedPrefixesC
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,7 +82,9 @@ func defaultPublicAdvertisedPrefixesRESTCallOptions() *PublicAdvertisedPrefixesC
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -214,7 +222,7 @@ func defaultPublicAdvertisedPrefixesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *publicAdvertisedPrefixesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -280,13 +288,13 @@ func (c *publicAdvertisedPrefixesRESTClient) Delete(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -340,13 +348,13 @@ func (c *publicAdvertisedPrefixesRESTClient) Get(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -407,13 +415,13 @@ func (c *publicAdvertisedPrefixesRESTClient) Insert(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -493,13 +501,13 @@ func (c *publicAdvertisedPrefixesRESTClient) List(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -577,13 +585,13 @@ func (c *publicAdvertisedPrefixesRESTClient) Patch(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -55,6 +55,7 @@ type PublicDelegatedPrefixesCallOptions struct {
func defaultPublicDelegatedPrefixesRESTCallOptions() *PublicDelegatedPrefixesCallOptions {
return &PublicDelegatedPrefixesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -65,8 +66,11 @@ func defaultPublicDelegatedPrefixesRESTCallOptions() *PublicDelegatedPrefixesCal
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -77,8 +81,11 @@ func defaultPublicDelegatedPrefixesRESTCallOptions() *PublicDelegatedPrefixesCal
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -89,7 +96,9 @@ func defaultPublicDelegatedPrefixesRESTCallOptions() *PublicDelegatedPrefixesCal
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -233,7 +242,7 @@ func defaultPublicDelegatedPrefixesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *publicDelegatedPrefixesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -321,13 +330,13 @@ func (c *publicDelegatedPrefixesRESTClient) AggregatedList(ctx context.Context,
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -405,13 +414,13 @@ func (c *publicDelegatedPrefixesRESTClient) Delete(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -466,13 +475,13 @@ func (c *publicDelegatedPrefixesRESTClient) Get(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -533,13 +542,13 @@ func (c *publicDelegatedPrefixesRESTClient) Insert(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -620,13 +629,13 @@ func (c *publicDelegatedPrefixesRESTClient) List(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -704,13 +713,13 @@ func (c *publicDelegatedPrefixesRESTClient) Patch(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -53,8 +53,11 @@ type RegionAutoscalersCallOptions struct {
func defaultRegionAutoscalersRESTCallOptions() *RegionAutoscalersCallOptions {
return &RegionAutoscalersCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -65,8 +68,11 @@ func defaultRegionAutoscalersRESTCallOptions() *RegionAutoscalersCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -77,8 +83,12 @@ func defaultRegionAutoscalersRESTCallOptions() *RegionAutoscalersCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Update: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -222,7 +232,7 @@ func defaultRegionAutoscalersRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionAutoscalersRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -288,13 +298,13 @@ func (c *regionAutoscalersRESTClient) Delete(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -349,13 +359,13 @@ func (c *regionAutoscalersRESTClient) Get(ctx context.Context, req *computepb.Ge
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -416,13 +426,13 @@ func (c *regionAutoscalersRESTClient) Insert(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -503,13 +513,13 @@ func (c *regionAutoscalersRESTClient) List(ctx context.Context, req *computepb.L
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -590,13 +600,13 @@ func (c *regionAutoscalersRESTClient) Patch(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -668,13 +678,13 @@ func (c *regionAutoscalersRESTClient) Update(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -56,8 +56,11 @@ type RegionBackendServicesCallOptions struct {
func defaultRegionBackendServicesRESTCallOptions() *RegionBackendServicesCallOptions {
return &RegionBackendServicesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -68,8 +71,11 @@ func defaultRegionBackendServicesRESTCallOptions() *RegionBackendServicesCallOpt
http.StatusServiceUnavailable)
}),
},
GetHealth: []gax.CallOption{},
GetHealth: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -80,8 +86,11 @@ func defaultRegionBackendServicesRESTCallOptions() *RegionBackendServicesCallOpt
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -92,9 +101,15 @@ func defaultRegionBackendServicesRESTCallOptions() *RegionBackendServicesCallOpt
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
Update: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -256,7 +271,7 @@ func defaultRegionBackendServicesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionBackendServicesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -322,13 +337,13 @@ func (c *regionBackendServicesRESTClient) Delete(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -383,13 +398,13 @@ func (c *regionBackendServicesRESTClient) Get(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -443,13 +458,13 @@ func (c *regionBackendServicesRESTClient) GetHealth(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -503,13 +518,13 @@ func (c *regionBackendServicesRESTClient) GetIamPolicy(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -570,13 +585,13 @@ func (c *regionBackendServicesRESTClient) Insert(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -657,13 +672,13 @@ func (c *regionBackendServicesRESTClient) List(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -741,13 +756,13 @@ func (c *regionBackendServicesRESTClient) Patch(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -809,13 +824,13 @@ func (c *regionBackendServicesRESTClient) SetIamPolicy(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -876,13 +891,13 @@ func (c *regionBackendServicesRESTClient) Update(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -54,6 +54,7 @@ type RegionCommitmentsCallOptions struct {
func defaultRegionCommitmentsRESTCallOptions() *RegionCommitmentsCallOptions {
return &RegionCommitmentsCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -65,6 +66,7 @@ func defaultRegionCommitmentsRESTCallOptions() *RegionCommitmentsCallOptions {
}),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -75,8 +77,11 @@ func defaultRegionCommitmentsRESTCallOptions() *RegionCommitmentsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -87,7 +92,9 @@ func defaultRegionCommitmentsRESTCallOptions() *RegionCommitmentsCallOptions {
http.StatusServiceUnavailable)
}),
},
Update: []gax.CallOption{},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -225,7 +232,7 @@ func defaultRegionCommitmentsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionCommitmentsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -313,13 +320,13 @@ func (c *regionCommitmentsRESTClient) AggregatedList(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -390,13 +397,13 @@ func (c *regionCommitmentsRESTClient) Get(ctx context.Context, req *computepb.Ge
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -457,13 +464,13 @@ func (c *regionCommitmentsRESTClient) Insert(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -544,13 +551,13 @@ func (c *regionCommitmentsRESTClient) List(ctx context.Context, req *computepb.L
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -634,13 +641,13 @@ func (c *regionCommitmentsRESTClient) Update(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -49,6 +49,7 @@ type RegionDiskTypesCallOptions struct {
func defaultRegionDiskTypesRESTCallOptions() *RegionDiskTypesCallOptions {
return &RegionDiskTypesCallOptions{
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -60,6 +61,7 @@ func defaultRegionDiskTypesRESTCallOptions() *RegionDiskTypesCallOptions {
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -176,7 +178,7 @@ func defaultRegionDiskTypesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionDiskTypesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -232,13 +234,13 @@ func (c *regionDiskTypesRESTClient) Get(ctx context.Context, req *computepb.GetR
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -311,13 +313,13 @@ func (c *regionDiskTypesRESTClient) List(ctx context.Context, req *computepb.Lis
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -44,6 +44,7 @@ var newRegionDisksClientHook clientHook
// RegionDisksCallOptions contains the retry settings for each method of RegionDisksClient.
type RegionDisksCallOptions struct {
AddResourcePolicies []gax.CallOption
BulkInsert []gax.CallOption
CreateSnapshot []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
@ -54,16 +55,29 @@ type RegionDisksCallOptions struct {
Resize []gax.CallOption
SetIamPolicy []gax.CallOption
SetLabels []gax.CallOption
StartAsyncReplication []gax.CallOption
StopAsyncReplication []gax.CallOption
StopGroupAsyncReplication []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
func defaultRegionDisksRESTCallOptions() *RegionDisksCallOptions {
return &RegionDisksCallOptions{
AddResourcePolicies: []gax.CallOption{},
CreateSnapshot: []gax.CallOption{},
Delete: []gax.CallOption{},
AddResourcePolicies: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
BulkInsert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
CreateSnapshot: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -75,6 +89,7 @@ func defaultRegionDisksRESTCallOptions() *RegionDisksCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -85,8 +100,11 @@ func defaultRegionDisksRESTCallOptions() *RegionDisksCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -97,12 +115,33 @@ func defaultRegionDisksRESTCallOptions() *RegionDisksCallOptions {
http.StatusServiceUnavailable)
}),
},
RemoveResourcePolicies: []gax.CallOption{},
Resize: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
SetLabels: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
Update: []gax.CallOption{},
RemoveResourcePolicies: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Resize: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
StartAsyncReplication: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
StopAsyncReplication: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
StopGroupAsyncReplication: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -112,6 +151,7 @@ type internalRegionDisksClient interface {
setGoogleClientInfo(...string)
Connection() *grpc.ClientConn
AddResourcePolicies(context.Context, *computepb.AddResourcePoliciesRegionDiskRequest, ...gax.CallOption) (*Operation, error)
BulkInsert(context.Context, *computepb.BulkInsertRegionDiskRequest, ...gax.CallOption) (*Operation, error)
CreateSnapshot(context.Context, *computepb.CreateSnapshotRegionDiskRequest, ...gax.CallOption) (*Operation, error)
Delete(context.Context, *computepb.DeleteRegionDiskRequest, ...gax.CallOption) (*Operation, error)
Get(context.Context, *computepb.GetRegionDiskRequest, ...gax.CallOption) (*computepb.Disk, error)
@ -122,6 +162,9 @@ type internalRegionDisksClient interface {
Resize(context.Context, *computepb.ResizeRegionDiskRequest, ...gax.CallOption) (*Operation, error)
SetIamPolicy(context.Context, *computepb.SetIamPolicyRegionDiskRequest, ...gax.CallOption) (*computepb.Policy, error)
SetLabels(context.Context, *computepb.SetLabelsRegionDiskRequest, ...gax.CallOption) (*Operation, error)
StartAsyncReplication(context.Context, *computepb.StartAsyncReplicationRegionDiskRequest, ...gax.CallOption) (*Operation, error)
StopAsyncReplication(context.Context, *computepb.StopAsyncReplicationRegionDiskRequest, ...gax.CallOption) (*Operation, error)
StopGroupAsyncReplication(context.Context, *computepb.StopGroupAsyncReplicationRegionDiskRequest, ...gax.CallOption) (*Operation, error)
TestIamPermissions(context.Context, *computepb.TestIamPermissionsRegionDiskRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
Update(context.Context, *computepb.UpdateRegionDiskRequest, ...gax.CallOption) (*Operation, error)
}
@ -166,6 +209,11 @@ func (c *RegionDisksClient) AddResourcePolicies(ctx context.Context, req *comput
return c.internalClient.AddResourcePolicies(ctx, req, opts...)
}
// BulkInsert bulk create a set of disks.
func (c *RegionDisksClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertRegionDiskRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.BulkInsert(ctx, req, opts...)
}
// CreateSnapshot creates a snapshot of a specified persistent disk. For regular snapshot creation, consider using snapshots.insert instead, as that method supports more features, such as creating snapshots in a project different from the source disk project.
func (c *RegionDisksClient) CreateSnapshot(ctx context.Context, req *computepb.CreateSnapshotRegionDiskRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.CreateSnapshot(ctx, req, opts...)
@ -216,6 +264,21 @@ func (c *RegionDisksClient) SetLabels(ctx context.Context, req *computepb.SetLab
return c.internalClient.SetLabels(ctx, req, opts...)
}
// StartAsyncReplication starts asynchronous replication. Must be invoked on the primary disk.
func (c *RegionDisksClient) StartAsyncReplication(ctx context.Context, req *computepb.StartAsyncReplicationRegionDiskRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.StartAsyncReplication(ctx, req, opts...)
}
// StopAsyncReplication stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.
func (c *RegionDisksClient) StopAsyncReplication(ctx context.Context, req *computepb.StopAsyncReplicationRegionDiskRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.StopAsyncReplication(ctx, req, opts...)
}
// StopGroupAsyncReplication stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.
func (c *RegionDisksClient) StopGroupAsyncReplication(ctx context.Context, req *computepb.StopGroupAsyncReplicationRegionDiskRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.StopGroupAsyncReplication(ctx, req, opts...)
}
// TestIamPermissions returns permissions that a caller has on the specified resource.
func (c *RegionDisksClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionDiskRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) {
return c.internalClient.TestIamPermissions(ctx, req, opts...)
@ -288,7 +351,7 @@ func defaultRegionDisksRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionDisksRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -361,13 +424,88 @@ func (c *regionDisksRESTClient) AddResourcePolicies(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
}, opts...)
if e != nil {
return nil, e
}
op := &Operation{
&regionOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
region: req.GetRegion(),
},
}
return op, nil
}
// BulkInsert bulk create a set of disks.
func (c *regionDisksRESTClient) BulkInsert(ctx context.Context, req *computepb.BulkInsertRegionDiskRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetBulkInsertDiskResourceResource()
jsonReq, err := m.Marshal(body)
if err != nil {
return nil, err
}
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/bulkInsert", req.GetProject(), req.GetRegion())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion())))
headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json"))
opts = append((*c.CallOptions).BulkInsert[0:len((*c.CallOptions).BulkInsert):len((*c.CallOptions).BulkInsert)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Operation{}
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
if err != nil {
return err
}
httpReq = httpReq.WithContext(ctx)
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
@ -436,13 +574,13 @@ func (c *regionDisksRESTClient) CreateSnapshot(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -504,13 +642,13 @@ func (c *regionDisksRESTClient) Delete(ctx context.Context, req *computepb.Delet
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -565,13 +703,13 @@ func (c *regionDisksRESTClient) Get(ctx context.Context, req *computepb.GetRegio
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -625,13 +763,13 @@ func (c *regionDisksRESTClient) GetIamPolicy(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -695,13 +833,13 @@ func (c *regionDisksRESTClient) Insert(ctx context.Context, req *computepb.Inser
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -782,13 +920,13 @@ func (c *regionDisksRESTClient) List(ctx context.Context, req *computepb.ListReg
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -866,13 +1004,13 @@ func (c *regionDisksRESTClient) RemoveResourcePolicies(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -941,13 +1079,13 @@ func (c *regionDisksRESTClient) Resize(ctx context.Context, req *computepb.Resiz
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1009,13 +1147,13 @@ func (c *regionDisksRESTClient) SetIamPolicy(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1076,13 +1214,231 @@ func (c *regionDisksRESTClient) SetLabels(ctx context.Context, req *computepb.Se
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
}, opts...)
if e != nil {
return nil, e
}
op := &Operation{
&regionOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
region: req.GetRegion(),
},
}
return op, nil
}
// StartAsyncReplication starts asynchronous replication. Must be invoked on the primary disk.
func (c *regionDisksRESTClient) StartAsyncReplication(ctx context.Context, req *computepb.StartAsyncReplicationRegionDiskRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetRegionDisksStartAsyncReplicationRequestResource()
jsonReq, err := m.Marshal(body)
if err != nil {
return nil, err
}
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v/startAsyncReplication", req.GetProject(), req.GetRegion(), req.GetDisk())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "disk", url.QueryEscape(req.GetDisk())))
headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json"))
opts = append((*c.CallOptions).StartAsyncReplication[0:len((*c.CallOptions).StartAsyncReplication):len((*c.CallOptions).StartAsyncReplication)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Operation{}
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
if err != nil {
return err
}
httpReq = httpReq.WithContext(ctx)
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
}, opts...)
if e != nil {
return nil, e
}
op := &Operation{
&regionOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
region: req.GetRegion(),
},
}
return op, nil
}
// StopAsyncReplication stops asynchronous replication. Can be invoked either on the primary or on the secondary disk.
func (c *regionDisksRESTClient) StopAsyncReplication(ctx context.Context, req *computepb.StopAsyncReplicationRegionDiskRequest, opts ...gax.CallOption) (*Operation, error) {
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/%v/stopAsyncReplication", req.GetProject(), req.GetRegion(), req.GetDisk())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "disk", url.QueryEscape(req.GetDisk())))
headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json"))
opts = append((*c.CallOptions).StopAsyncReplication[0:len((*c.CallOptions).StopAsyncReplication):len((*c.CallOptions).StopAsyncReplication)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Operation{}
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("POST", baseUrl.String(), nil)
if err != nil {
return err
}
httpReq = httpReq.WithContext(ctx)
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
}, opts...)
if e != nil {
return nil, e
}
op := &Operation{
&regionOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
region: req.GetRegion(),
},
}
return op, nil
}
// StopGroupAsyncReplication stops asynchronous replication for a consistency group of disks. Can be invoked either in the primary or secondary scope.
func (c *regionDisksRESTClient) StopGroupAsyncReplication(ctx context.Context, req *computepb.StopGroupAsyncReplicationRegionDiskRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetDisksStopGroupAsyncReplicationResourceResource()
jsonReq, err := m.Marshal(body)
if err != nil {
return nil, err
}
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/disks/stopGroupAsyncReplication", req.GetProject(), req.GetRegion())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
md := metadata.Pairs("x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion())))
headers := buildHeaders(ctx, c.xGoogMetadata, md, metadata.Pairs("Content-Type", "application/json"))
opts = append((*c.CallOptions).StopGroupAsyncReplication[0:len((*c.CallOptions).StopGroupAsyncReplication):len((*c.CallOptions).StopGroupAsyncReplication)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Operation{}
e := gax.Invoke(ctx, func(ctx context.Context, settings gax.CallSettings) error {
if settings.Path != "" {
baseUrl.Path = settings.Path
}
httpReq, err := http.NewRequest("POST", baseUrl.String(), bytes.NewReader(jsonReq))
if err != nil {
return err
}
httpReq = httpReq.WithContext(ctx)
httpReq.Header = headers
httpRsp, err := c.httpClient.Do(httpReq)
if err != nil {
return err
}
defer httpRsp.Body.Close()
if err = googleapi.CheckResponse(httpRsp); err != nil {
return err
}
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
return nil
@ -1144,13 +1500,13 @@ func (c *regionDisksRESTClient) TestIamPermissions(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1217,13 +1573,13 @@ func (c *regionDisksRESTClient) Update(ctx context.Context, req *computepb.Updat
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -52,8 +52,11 @@ type RegionHealthCheckServicesCallOptions struct {
func defaultRegionHealthCheckServicesRESTCallOptions() *RegionHealthCheckServicesCallOptions {
return &RegionHealthCheckServicesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -64,8 +67,11 @@ func defaultRegionHealthCheckServicesRESTCallOptions() *RegionHealthCheckService
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,7 +82,9 @@ func defaultRegionHealthCheckServicesRESTCallOptions() *RegionHealthCheckService
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -214,7 +222,7 @@ func defaultRegionHealthCheckServicesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionHealthCheckServicesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -280,13 +288,13 @@ func (c *regionHealthCheckServicesRESTClient) Delete(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -341,13 +349,13 @@ func (c *regionHealthCheckServicesRESTClient) Get(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -408,13 +416,13 @@ func (c *regionHealthCheckServicesRESTClient) Insert(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -495,13 +503,13 @@ func (c *regionHealthCheckServicesRESTClient) List(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -579,13 +587,13 @@ func (c *regionHealthCheckServicesRESTClient) Patch(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -53,8 +53,11 @@ type RegionHealthChecksCallOptions struct {
func defaultRegionHealthChecksRESTCallOptions() *RegionHealthChecksCallOptions {
return &RegionHealthChecksCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -65,8 +68,11 @@ func defaultRegionHealthChecksRESTCallOptions() *RegionHealthChecksCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -77,8 +83,12 @@ func defaultRegionHealthChecksRESTCallOptions() *RegionHealthChecksCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Update: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -222,7 +232,7 @@ func defaultRegionHealthChecksRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionHealthChecksRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -288,13 +298,13 @@ func (c *regionHealthChecksRESTClient) Delete(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -349,13 +359,13 @@ func (c *regionHealthChecksRESTClient) Get(ctx context.Context, req *computepb.G
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -416,13 +426,13 @@ func (c *regionHealthChecksRESTClient) Insert(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -503,13 +513,13 @@ func (c *regionHealthChecksRESTClient) List(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -587,13 +597,13 @@ func (c *regionHealthChecksRESTClient) Patch(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -662,13 +672,13 @@ func (c *regionHealthChecksRESTClient) Update(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -66,13 +66,26 @@ type RegionInstanceGroupManagersCallOptions struct {
func defaultRegionInstanceGroupManagersRESTCallOptions() *RegionInstanceGroupManagersCallOptions {
return &RegionInstanceGroupManagersCallOptions{
AbandonInstances: []gax.CallOption{},
ApplyUpdatesToInstances: []gax.CallOption{},
CreateInstances: []gax.CallOption{},
Delete: []gax.CallOption{},
DeleteInstances: []gax.CallOption{},
DeletePerInstanceConfigs: []gax.CallOption{},
AbandonInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
ApplyUpdatesToInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
CreateInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DeleteInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
DeletePerInstanceConfigs: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -83,8 +96,11 @@ func defaultRegionInstanceGroupManagersRESTCallOptions() *RegionInstanceGroupMan
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -96,6 +112,7 @@ func defaultRegionInstanceGroupManagersRESTCallOptions() *RegionInstanceGroupMan
}),
},
ListErrors: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -106,15 +123,33 @@ func defaultRegionInstanceGroupManagersRESTCallOptions() *RegionInstanceGroupMan
http.StatusServiceUnavailable)
}),
},
ListManagedInstances: []gax.CallOption{},
ListPerInstanceConfigs: []gax.CallOption{},
Patch: []gax.CallOption{},
PatchPerInstanceConfigs: []gax.CallOption{},
RecreateInstances: []gax.CallOption{},
Resize: []gax.CallOption{},
SetInstanceTemplate: []gax.CallOption{},
SetTargetPools: []gax.CallOption{},
UpdatePerInstanceConfigs: []gax.CallOption{},
ListManagedInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
ListPerInstanceConfigs: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
PatchPerInstanceConfigs: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RecreateInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Resize: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetInstanceTemplate: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetTargetPools: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
UpdatePerInstanceConfigs: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -336,7 +371,7 @@ func defaultRegionInstanceGroupManagersRESTClientOptions() []option.ClientOption
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionInstanceGroupManagersRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -409,13 +444,13 @@ func (c *regionInstanceGroupManagersRESTClient) AbandonInstances(ctx context.Con
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -477,13 +512,13 @@ func (c *regionInstanceGroupManagersRESTClient) ApplyUpdatesToInstances(ctx cont
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -552,13 +587,13 @@ func (c *regionInstanceGroupManagersRESTClient) CreateInstances(ctx context.Cont
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -620,13 +655,13 @@ func (c *regionInstanceGroupManagersRESTClient) Delete(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -695,13 +730,13 @@ func (c *regionInstanceGroupManagersRESTClient) DeleteInstances(ctx context.Cont
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -763,13 +798,13 @@ func (c *regionInstanceGroupManagersRESTClient) DeletePerInstanceConfigs(ctx con
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -824,13 +859,13 @@ func (c *regionInstanceGroupManagersRESTClient) Get(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -891,13 +926,13 @@ func (c *regionInstanceGroupManagersRESTClient) Insert(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -978,13 +1013,13 @@ func (c *regionInstanceGroupManagersRESTClient) List(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1074,13 +1109,13 @@ func (c *regionInstanceGroupManagersRESTClient) ListErrors(ctx context.Context,
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1170,13 +1205,13 @@ func (c *regionInstanceGroupManagersRESTClient) ListManagedInstances(ctx context
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1266,13 +1301,13 @@ func (c *regionInstanceGroupManagersRESTClient) ListPerInstanceConfigs(ctx conte
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1350,13 +1385,13 @@ func (c *regionInstanceGroupManagersRESTClient) Patch(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1425,13 +1460,13 @@ func (c *regionInstanceGroupManagersRESTClient) PatchPerInstanceConfigs(ctx cont
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1500,13 +1535,13 @@ func (c *regionInstanceGroupManagersRESTClient) RecreateInstances(ctx context.Co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1569,13 +1604,13 @@ func (c *regionInstanceGroupManagersRESTClient) Resize(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1644,13 +1679,13 @@ func (c *regionInstanceGroupManagersRESTClient) SetInstanceTemplate(ctx context.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1719,13 +1754,13 @@ func (c *regionInstanceGroupManagersRESTClient) SetTargetPools(ctx context.Conte
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1794,13 +1829,13 @@ func (c *regionInstanceGroupManagersRESTClient) UpdatePerInstanceConfigs(ctx con
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -52,6 +52,7 @@ type RegionInstanceGroupsCallOptions struct {
func defaultRegionInstanceGroupsRESTCallOptions() *RegionInstanceGroupsCallOptions {
return &RegionInstanceGroupsCallOptions{
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -63,6 +64,7 @@ func defaultRegionInstanceGroupsRESTCallOptions() *RegionInstanceGroupsCallOptio
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -73,8 +75,12 @@ func defaultRegionInstanceGroupsRESTCallOptions() *RegionInstanceGroupsCallOptio
http.StatusServiceUnavailable)
}),
},
ListInstances: []gax.CallOption{},
SetNamedPorts: []gax.CallOption{},
ListInstances: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetNamedPorts: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -206,7 +212,7 @@ func defaultRegionInstanceGroupsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionInstanceGroupsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -265,13 +271,13 @@ func (c *regionInstanceGroupsRESTClient) Get(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -344,13 +350,13 @@ func (c *regionInstanceGroupsRESTClient) List(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -446,13 +452,13 @@ func (c *regionInstanceGroupsRESTClient) ListInstances(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -530,13 +536,13 @@ func (c *regionInstanceGroupsRESTClient) SetNamedPorts(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -51,8 +51,11 @@ type RegionInstanceTemplatesCallOptions struct {
func defaultRegionInstanceTemplatesRESTCallOptions() *RegionInstanceTemplatesCallOptions {
return &RegionInstanceTemplatesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -63,8 +66,11 @@ func defaultRegionInstanceTemplatesRESTCallOptions() *RegionInstanceTemplatesCal
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -206,7 +212,7 @@ func defaultRegionInstanceTemplatesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionInstanceTemplatesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -272,13 +278,13 @@ func (c *regionInstanceTemplatesRESTClient) Delete(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -333,13 +339,13 @@ func (c *regionInstanceTemplatesRESTClient) Get(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -400,13 +406,13 @@ func (c *regionInstanceTemplatesRESTClient) Insert(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -487,13 +493,13 @@ func (c *regionInstanceTemplatesRESTClient) List(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,9 +20,10 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/url"
"time"
computepb "cloud.google.com/go/compute/apiv1/computepb"
gax "github.com/googleapis/gax-go/v2"
@ -44,7 +45,9 @@ type RegionInstancesCallOptions struct {
func defaultRegionInstancesRESTCallOptions() *RegionInstancesCallOptions {
return &RegionInstancesCallOptions{
BulkInsert: []gax.CallOption{},
BulkInsert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -158,7 +161,7 @@ func defaultRegionInstancesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionInstancesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -231,13 +234,13 @@ func (c *regionInstancesRESTClient) BulkInsert(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -51,8 +51,11 @@ type RegionNetworkEndpointGroupsCallOptions struct {
func defaultRegionNetworkEndpointGroupsRESTCallOptions() *RegionNetworkEndpointGroupsCallOptions {
return &RegionNetworkEndpointGroupsCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -63,8 +66,11 @@ func defaultRegionNetworkEndpointGroupsRESTCallOptions() *RegionNetworkEndpointG
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -206,7 +212,7 @@ func defaultRegionNetworkEndpointGroupsRESTClientOptions() []option.ClientOption
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionNetworkEndpointGroupsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -272,13 +278,13 @@ func (c *regionNetworkEndpointGroupsRESTClient) Delete(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -333,13 +339,13 @@ func (c *regionNetworkEndpointGroupsRESTClient) Get(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -400,13 +406,13 @@ func (c *regionNetworkEndpointGroupsRESTClient) Insert(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -487,13 +493,13 @@ func (c *regionNetworkEndpointGroupsRESTClient) List(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -64,11 +64,20 @@ type RegionNetworkFirewallPoliciesCallOptions struct {
func defaultRegionNetworkFirewallPoliciesRESTCallOptions() *RegionNetworkFirewallPoliciesCallOptions {
return &RegionNetworkFirewallPoliciesCallOptions{
AddAssociation: []gax.CallOption{},
AddRule: []gax.CallOption{},
CloneRules: []gax.CallOption{},
Delete: []gax.CallOption{},
AddAssociation: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AddRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
CloneRules: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -80,6 +89,7 @@ func defaultRegionNetworkFirewallPoliciesRESTCallOptions() *RegionNetworkFirewal
}),
},
GetAssociation: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -91,6 +101,7 @@ func defaultRegionNetworkFirewallPoliciesRESTCallOptions() *RegionNetworkFirewal
}),
},
GetEffectiveFirewalls: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -102,6 +113,7 @@ func defaultRegionNetworkFirewallPoliciesRESTCallOptions() *RegionNetworkFirewal
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -113,6 +125,7 @@ func defaultRegionNetworkFirewallPoliciesRESTCallOptions() *RegionNetworkFirewal
}),
},
GetRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -123,8 +136,11 @@ func defaultRegionNetworkFirewallPoliciesRESTCallOptions() *RegionNetworkFirewal
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -135,12 +151,24 @@ func defaultRegionNetworkFirewallPoliciesRESTCallOptions() *RegionNetworkFirewal
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
PatchRule: []gax.CallOption{},
RemoveAssociation: []gax.CallOption{},
RemoveRule: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
PatchRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RemoveAssociation: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RemoveRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -350,7 +378,7 @@ func defaultRegionNetworkFirewallPoliciesRESTClientOptions() []option.ClientOpti
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionNetworkFirewallPoliciesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -426,13 +454,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) AddAssociation(ctx context.Con
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -507,13 +535,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) AddRule(ctx context.Context, r
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -578,13 +606,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) CloneRules(ctx context.Context
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -646,13 +674,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) Delete(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -707,13 +735,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) Get(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -767,13 +795,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) GetAssociation(ctx context.Con
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -825,13 +853,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) GetEffectiveFirewalls(ctx cont
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -885,13 +913,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) GetIamPolicy(ctx context.Conte
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -945,13 +973,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) GetRule(ctx context.Context, r
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1012,13 +1040,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) Insert(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1099,13 +1127,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) List(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1183,13 +1211,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) Patch(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1261,13 +1289,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) PatchRule(ctx context.Context,
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1332,13 +1360,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) RemoveAssociation(ctx context.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1403,13 +1431,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) RemoveRule(ctx context.Context
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1471,13 +1499,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) SetIamPolicy(ctx context.Conte
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1531,13 +1559,13 @@ func (c *regionNetworkFirewallPoliciesRESTClient) TestIamPermissions(ctx context
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -51,8 +51,11 @@ type RegionNotificationEndpointsCallOptions struct {
func defaultRegionNotificationEndpointsRESTCallOptions() *RegionNotificationEndpointsCallOptions {
return &RegionNotificationEndpointsCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -63,8 +66,11 @@ func defaultRegionNotificationEndpointsRESTCallOptions() *RegionNotificationEndp
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -206,7 +212,7 @@ func defaultRegionNotificationEndpointsRESTClientOptions() []option.ClientOption
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionNotificationEndpointsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -272,13 +278,13 @@ func (c *regionNotificationEndpointsRESTClient) Delete(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -333,13 +339,13 @@ func (c *regionNotificationEndpointsRESTClient) Get(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -400,13 +406,13 @@ func (c *regionNotificationEndpointsRESTClient) Insert(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -487,13 +493,13 @@ func (c *regionNotificationEndpointsRESTClient) List(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -50,8 +50,11 @@ type RegionOperationsCallOptions struct {
func defaultRegionOperationsRESTCallOptions() *RegionOperationsCallOptions {
return &RegionOperationsCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -63,6 +66,7 @@ func defaultRegionOperationsRESTCallOptions() *RegionOperationsCallOptions {
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -73,7 +77,9 @@ func defaultRegionOperationsRESTCallOptions() *RegionOperationsCallOptions {
http.StatusServiceUnavailable)
}),
},
Wait: []gax.CallOption{},
Wait: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -192,7 +198,7 @@ func defaultRegionOperationsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionOperationsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -248,13 +254,13 @@ func (c *regionOperationsRESTClient) Delete(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -301,13 +307,13 @@ func (c *regionOperationsRESTClient) Get(ctx context.Context, req *computepb.Get
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -380,13 +386,13 @@ func (c *regionOperationsRESTClient) List(ctx context.Context, req *computepb.Li
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -450,13 +456,13 @@ func (c *regionOperationsRESTClient) Wait(ctx context.Context, req *computepb.Wa
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -52,8 +52,11 @@ type RegionSecurityPoliciesCallOptions struct {
func defaultRegionSecurityPoliciesRESTCallOptions() *RegionSecurityPoliciesCallOptions {
return &RegionSecurityPoliciesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -64,8 +67,11 @@ func defaultRegionSecurityPoliciesRESTCallOptions() *RegionSecurityPoliciesCallO
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,7 +82,9 @@ func defaultRegionSecurityPoliciesRESTCallOptions() *RegionSecurityPoliciesCallO
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -214,7 +222,7 @@ func defaultRegionSecurityPoliciesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionSecurityPoliciesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -280,13 +288,13 @@ func (c *regionSecurityPoliciesRESTClient) Delete(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -341,13 +349,13 @@ func (c *regionSecurityPoliciesRESTClient) Get(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -411,13 +419,13 @@ func (c *regionSecurityPoliciesRESTClient) Insert(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -498,13 +506,13 @@ func (c *regionSecurityPoliciesRESTClient) List(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -582,13 +590,13 @@ func (c *regionSecurityPoliciesRESTClient) Patch(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -51,8 +51,11 @@ type RegionSslCertificatesCallOptions struct {
func defaultRegionSslCertificatesRESTCallOptions() *RegionSslCertificatesCallOptions {
return &RegionSslCertificatesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -63,8 +66,11 @@ func defaultRegionSslCertificatesRESTCallOptions() *RegionSslCertificatesCallOpt
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -206,7 +212,7 @@ func defaultRegionSslCertificatesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionSslCertificatesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -272,13 +278,13 @@ func (c *regionSslCertificatesRESTClient) Delete(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -333,13 +339,13 @@ func (c *regionSslCertificatesRESTClient) Get(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -400,13 +406,13 @@ func (c *regionSslCertificatesRESTClient) Insert(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -487,13 +493,13 @@ func (c *regionSslCertificatesRESTClient) List(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -53,8 +53,11 @@ type RegionSslPoliciesCallOptions struct {
func defaultRegionSslPoliciesRESTCallOptions() *RegionSslPoliciesCallOptions {
return &RegionSslPoliciesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -65,8 +68,11 @@ func defaultRegionSslPoliciesRESTCallOptions() *RegionSslPoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,6 +84,7 @@ func defaultRegionSslPoliciesRESTCallOptions() *RegionSslPoliciesCallOptions {
}),
},
ListAvailableFeatures: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -88,7 +95,9 @@ func defaultRegionSslPoliciesRESTCallOptions() *RegionSslPoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -232,7 +241,7 @@ func defaultRegionSslPoliciesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionSslPoliciesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -298,13 +307,13 @@ func (c *regionSslPoliciesRESTClient) Delete(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -359,13 +368,13 @@ func (c *regionSslPoliciesRESTClient) Get(ctx context.Context, req *computepb.Ge
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -426,13 +435,13 @@ func (c *regionSslPoliciesRESTClient) Insert(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -513,13 +522,13 @@ func (c *regionSslPoliciesRESTClient) List(ctx context.Context, req *computepb.L
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -602,13 +611,13 @@ func (c *regionSslPoliciesRESTClient) ListAvailableFeatures(ctx context.Context,
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -669,13 +678,13 @@ func (c *regionSslPoliciesRESTClient) Patch(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -52,8 +52,11 @@ type RegionTargetHttpProxiesCallOptions struct {
func defaultRegionTargetHttpProxiesRESTCallOptions() *RegionTargetHttpProxiesCallOptions {
return &RegionTargetHttpProxiesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -64,8 +67,11 @@ func defaultRegionTargetHttpProxiesRESTCallOptions() *RegionTargetHttpProxiesCal
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,7 +82,9 @@ func defaultRegionTargetHttpProxiesRESTCallOptions() *RegionTargetHttpProxiesCal
http.StatusServiceUnavailable)
}),
},
SetUrlMap: []gax.CallOption{},
SetUrlMap: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -214,7 +222,7 @@ func defaultRegionTargetHttpProxiesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionTargetHttpProxiesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -280,13 +288,13 @@ func (c *regionTargetHttpProxiesRESTClient) Delete(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -341,13 +349,13 @@ func (c *regionTargetHttpProxiesRESTClient) Get(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -408,13 +416,13 @@ func (c *regionTargetHttpProxiesRESTClient) Insert(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -495,13 +503,13 @@ func (c *regionTargetHttpProxiesRESTClient) List(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -579,13 +587,13 @@ func (c *regionTargetHttpProxiesRESTClient) SetUrlMap(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -54,8 +54,11 @@ type RegionTargetHttpsProxiesCallOptions struct {
func defaultRegionTargetHttpsProxiesRESTCallOptions() *RegionTargetHttpsProxiesCallOptions {
return &RegionTargetHttpsProxiesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -66,8 +69,11 @@ func defaultRegionTargetHttpsProxiesRESTCallOptions() *RegionTargetHttpsProxiesC
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,9 +84,15 @@ func defaultRegionTargetHttpsProxiesRESTCallOptions() *RegionTargetHttpsProxiesC
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetSslCertificates: []gax.CallOption{},
SetUrlMap: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetSslCertificates: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetUrlMap: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -230,7 +242,7 @@ func defaultRegionTargetHttpsProxiesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionTargetHttpsProxiesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -296,13 +308,13 @@ func (c *regionTargetHttpsProxiesRESTClient) Delete(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -357,13 +369,13 @@ func (c *regionTargetHttpsProxiesRESTClient) Get(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -424,13 +436,13 @@ func (c *regionTargetHttpsProxiesRESTClient) Insert(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -511,13 +523,13 @@ func (c *regionTargetHttpsProxiesRESTClient) List(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -595,13 +607,13 @@ func (c *regionTargetHttpsProxiesRESTClient) Patch(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -670,13 +682,13 @@ func (c *regionTargetHttpsProxiesRESTClient) SetSslCertificates(ctx context.Cont
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -745,13 +757,13 @@ func (c *regionTargetHttpsProxiesRESTClient) SetUrlMap(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -51,8 +51,11 @@ type RegionTargetTcpProxiesCallOptions struct {
func defaultRegionTargetTcpProxiesRESTCallOptions() *RegionTargetTcpProxiesCallOptions {
return &RegionTargetTcpProxiesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -63,8 +66,11 @@ func defaultRegionTargetTcpProxiesRESTCallOptions() *RegionTargetTcpProxiesCallO
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -206,7 +212,7 @@ func defaultRegionTargetTcpProxiesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionTargetTcpProxiesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -272,13 +278,13 @@ func (c *regionTargetTcpProxiesRESTClient) Delete(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -333,13 +339,13 @@ func (c *regionTargetTcpProxiesRESTClient) Get(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -400,13 +406,13 @@ func (c *regionTargetTcpProxiesRESTClient) Insert(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -487,13 +493,13 @@ func (c *regionTargetTcpProxiesRESTClient) List(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -54,8 +54,11 @@ type RegionUrlMapsCallOptions struct {
func defaultRegionUrlMapsRESTCallOptions() *RegionUrlMapsCallOptions {
return &RegionUrlMapsCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -66,8 +69,11 @@ func defaultRegionUrlMapsRESTCallOptions() *RegionUrlMapsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,9 +84,15 @@ func defaultRegionUrlMapsRESTCallOptions() *RegionUrlMapsCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Update: []gax.CallOption{},
Validate: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Validate: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -230,7 +242,7 @@ func defaultRegionUrlMapsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionUrlMapsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -296,13 +308,13 @@ func (c *regionUrlMapsRESTClient) Delete(ctx context.Context, req *computepb.Del
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -357,13 +369,13 @@ func (c *regionUrlMapsRESTClient) Get(ctx context.Context, req *computepb.GetReg
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -424,13 +436,13 @@ func (c *regionUrlMapsRESTClient) Insert(ctx context.Context, req *computepb.Ins
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -511,13 +523,13 @@ func (c *regionUrlMapsRESTClient) List(ctx context.Context, req *computepb.ListR
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -595,13 +607,13 @@ func (c *regionUrlMapsRESTClient) Patch(ctx context.Context, req *computepb.Patc
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -670,13 +682,13 @@ func (c *regionUrlMapsRESTClient) Update(ctx context.Context, req *computepb.Upd
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -738,13 +750,13 @@ func (c *regionUrlMapsRESTClient) Validate(ctx context.Context, req *computepb.V
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -49,6 +49,7 @@ type RegionsCallOptions struct {
func defaultRegionsRESTCallOptions() *RegionsCallOptions {
return &RegionsCallOptions{
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -60,6 +61,7 @@ func defaultRegionsRESTCallOptions() *RegionsCallOptions {
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -176,7 +178,7 @@ func defaultRegionsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *regionsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -232,13 +234,13 @@ func (c *regionsRESTClient) Get(ctx context.Context, req *computepb.GetRegionReq
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -311,13 +313,13 @@ func (c *regionsRESTClient) List(ctx context.Context, req *computepb.ListRegions
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -59,6 +59,7 @@ type ReservationsCallOptions struct {
func defaultReservationsRESTCallOptions() *ReservationsCallOptions {
return &ReservationsCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -69,8 +70,11 @@ func defaultReservationsRESTCallOptions() *ReservationsCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -82,6 +86,7 @@ func defaultReservationsRESTCallOptions() *ReservationsCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -92,8 +97,11 @@ func defaultReservationsRESTCallOptions() *ReservationsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -104,10 +112,18 @@ func defaultReservationsRESTCallOptions() *ReservationsCallOptions {
http.StatusServiceUnavailable)
}),
},
Resize: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
Update: []gax.CallOption{},
Resize: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -275,7 +291,7 @@ func defaultReservationsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *reservationsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -363,13 +379,13 @@ func (c *reservationsRESTClient) AggregatedList(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -447,13 +463,13 @@ func (c *reservationsRESTClient) Delete(ctx context.Context, req *computepb.Dele
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -508,13 +524,13 @@ func (c *reservationsRESTClient) Get(ctx context.Context, req *computepb.GetRese
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -568,13 +584,13 @@ func (c *reservationsRESTClient) GetIamPolicy(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -635,13 +651,13 @@ func (c *reservationsRESTClient) Insert(ctx context.Context, req *computepb.Inse
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -722,13 +738,13 @@ func (c *reservationsRESTClient) List(ctx context.Context, req *computepb.ListRe
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -806,13 +822,13 @@ func (c *reservationsRESTClient) Resize(ctx context.Context, req *computepb.Resi
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -874,13 +890,13 @@ func (c *reservationsRESTClient) SetIamPolicy(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -934,13 +950,13 @@ func (c *reservationsRESTClient) TestIamPermissions(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1007,13 +1023,13 @@ func (c *reservationsRESTClient) Update(ctx context.Context, req *computepb.Upda
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -57,6 +57,7 @@ type ResourcePoliciesCallOptions struct {
func defaultResourcePoliciesRESTCallOptions() *ResourcePoliciesCallOptions {
return &ResourcePoliciesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -67,8 +68,11 @@ func defaultResourcePoliciesRESTCallOptions() *ResourcePoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -80,6 +84,7 @@ func defaultResourcePoliciesRESTCallOptions() *ResourcePoliciesCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,8 +95,11 @@ func defaultResourcePoliciesRESTCallOptions() *ResourcePoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -102,8 +110,12 @@ func defaultResourcePoliciesRESTCallOptions() *ResourcePoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
SetIamPolicy: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -259,7 +271,7 @@ func defaultResourcePoliciesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *resourcePoliciesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -347,13 +359,13 @@ func (c *resourcePoliciesRESTClient) AggregatedList(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -431,13 +443,13 @@ func (c *resourcePoliciesRESTClient) Delete(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -492,13 +504,13 @@ func (c *resourcePoliciesRESTClient) Get(ctx context.Context, req *computepb.Get
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -552,13 +564,13 @@ func (c *resourcePoliciesRESTClient) GetIamPolicy(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -619,13 +631,13 @@ func (c *resourcePoliciesRESTClient) Insert(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -706,13 +718,13 @@ func (c *resourcePoliciesRESTClient) List(ctx context.Context, req *computepb.Li
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -783,13 +795,13 @@ func (c *resourcePoliciesRESTClient) SetIamPolicy(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -843,13 +855,13 @@ func (c *resourcePoliciesRESTClient) TestIamPermissions(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -59,6 +59,7 @@ type RoutersCallOptions struct {
func defaultRoutersRESTCallOptions() *RoutersCallOptions {
return &RoutersCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -69,8 +70,11 @@ func defaultRoutersRESTCallOptions() *RoutersCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -82,6 +86,7 @@ func defaultRoutersRESTCallOptions() *RoutersCallOptions {
}),
},
GetNatMappingInfo: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -93,6 +98,7 @@ func defaultRoutersRESTCallOptions() *RoutersCallOptions {
}),
},
GetRouterStatus: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -103,8 +109,11 @@ func defaultRoutersRESTCallOptions() *RoutersCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -115,9 +124,15 @@ func defaultRoutersRESTCallOptions() *RoutersCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Preview: []gax.CallOption{},
Update: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Preview: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -285,7 +300,7 @@ func defaultRoutersRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *routersRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -373,13 +388,13 @@ func (c *routersRESTClient) AggregatedList(ctx context.Context, req *computepb.A
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -457,13 +472,13 @@ func (c *routersRESTClient) Delete(ctx context.Context, req *computepb.DeleteRou
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -518,13 +533,13 @@ func (c *routersRESTClient) Get(ctx context.Context, req *computepb.GetRouterReq
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -563,6 +578,9 @@ func (c *routersRESTClient) GetNatMappingInfo(ctx context.Context, req *computep
if req != nil && req.MaxResults != nil {
params.Add("maxResults", fmt.Sprintf("%v", req.GetMaxResults()))
}
if req != nil && req.NatName != nil {
params.Add("natName", fmt.Sprintf("%v", req.GetNatName()))
}
if req != nil && req.OrderBy != nil {
params.Add("orderBy", fmt.Sprintf("%v", req.GetOrderBy()))
}
@ -597,13 +615,13 @@ func (c *routersRESTClient) GetNatMappingInfo(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -667,13 +685,13 @@ func (c *routersRESTClient) GetRouterStatus(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -734,13 +752,13 @@ func (c *routersRESTClient) Insert(ctx context.Context, req *computepb.InsertRou
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -821,13 +839,13 @@ func (c *routersRESTClient) List(ctx context.Context, req *computepb.ListRouters
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -905,13 +923,13 @@ func (c *routersRESTClient) Patch(ctx context.Context, req *computepb.PatchRoute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -973,13 +991,13 @@ func (c *routersRESTClient) Preview(ctx context.Context, req *computepb.PreviewR
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1040,13 +1058,13 @@ func (c *routersRESTClient) Update(ctx context.Context, req *computepb.UpdateRou
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -51,8 +51,11 @@ type RoutesCallOptions struct {
func defaultRoutesRESTCallOptions() *RoutesCallOptions {
return &RoutesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -63,8 +66,11 @@ func defaultRoutesRESTCallOptions() *RoutesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -206,7 +212,7 @@ func defaultRoutesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *routesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -272,13 +278,13 @@ func (c *routesRESTClient) Delete(ctx context.Context, req *computepb.DeleteRout
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -332,13 +338,13 @@ func (c *routesRESTClient) Get(ctx context.Context, req *computepb.GetRouteReque
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -399,13 +405,13 @@ func (c *routesRESTClient) Insert(ctx context.Context, req *computepb.InsertRout
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -485,13 +491,13 @@ func (c *routesRESTClient) List(ctx context.Context, req *computepb.ListRoutesRe
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -60,8 +60,11 @@ type SecurityPoliciesCallOptions struct {
func defaultSecurityPoliciesRESTCallOptions() *SecurityPoliciesCallOptions {
return &SecurityPoliciesCallOptions{
AddRule: []gax.CallOption{},
AddRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -72,8 +75,11 @@ func defaultSecurityPoliciesRESTCallOptions() *SecurityPoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -85,6 +91,7 @@ func defaultSecurityPoliciesRESTCallOptions() *SecurityPoliciesCallOptions {
}),
},
GetRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -95,8 +102,11 @@ func defaultSecurityPoliciesRESTCallOptions() *SecurityPoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -108,6 +118,7 @@ func defaultSecurityPoliciesRESTCallOptions() *SecurityPoliciesCallOptions {
}),
},
ListPreconfiguredExpressionSets: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -118,10 +129,18 @@ func defaultSecurityPoliciesRESTCallOptions() *SecurityPoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
PatchRule: []gax.CallOption{},
RemoveRule: []gax.CallOption{},
SetLabels: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
PatchRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RemoveRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -301,7 +320,7 @@ func defaultSecurityPoliciesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *securityPoliciesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -374,13 +393,13 @@ func (c *securityPoliciesRESTClient) AddRule(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -463,13 +482,13 @@ func (c *securityPoliciesRESTClient) AggregatedList(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -547,13 +566,13 @@ func (c *securityPoliciesRESTClient) Delete(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -607,13 +626,13 @@ func (c *securityPoliciesRESTClient) Get(ctx context.Context, req *computepb.Get
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -667,13 +686,13 @@ func (c *securityPoliciesRESTClient) GetRule(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -737,13 +756,13 @@ func (c *securityPoliciesRESTClient) Insert(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -823,13 +842,13 @@ func (c *securityPoliciesRESTClient) List(ctx context.Context, req *computepb.Li
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -912,13 +931,13 @@ func (c *securityPoliciesRESTClient) ListPreconfiguredExpressionSets(ctx context
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -979,13 +998,13 @@ func (c *securityPoliciesRESTClient) Patch(ctx context.Context, req *computepb.P
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1056,13 +1075,13 @@ func (c *securityPoliciesRESTClient) PatchRule(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1123,13 +1142,13 @@ func (c *securityPoliciesRESTClient) RemoveRule(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1190,13 +1209,13 @@ func (c *securityPoliciesRESTClient) SetLabels(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -58,6 +58,7 @@ type ServiceAttachmentsCallOptions struct {
func defaultServiceAttachmentsRESTCallOptions() *ServiceAttachmentsCallOptions {
return &ServiceAttachmentsCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -68,8 +69,11 @@ func defaultServiceAttachmentsRESTCallOptions() *ServiceAttachmentsCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -81,6 +85,7 @@ func defaultServiceAttachmentsRESTCallOptions() *ServiceAttachmentsCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -91,8 +96,11 @@ func defaultServiceAttachmentsRESTCallOptions() *ServiceAttachmentsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -103,9 +111,15 @@ func defaultServiceAttachmentsRESTCallOptions() *ServiceAttachmentsCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -267,7 +281,7 @@ func defaultServiceAttachmentsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *serviceAttachmentsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -355,13 +369,13 @@ func (c *serviceAttachmentsRESTClient) AggregatedList(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -439,13 +453,13 @@ func (c *serviceAttachmentsRESTClient) Delete(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -500,13 +514,13 @@ func (c *serviceAttachmentsRESTClient) Get(ctx context.Context, req *computepb.G
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -560,13 +574,13 @@ func (c *serviceAttachmentsRESTClient) GetIamPolicy(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -627,13 +641,13 @@ func (c *serviceAttachmentsRESTClient) Insert(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -714,13 +728,13 @@ func (c *serviceAttachmentsRESTClient) List(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -798,13 +812,13 @@ func (c *serviceAttachmentsRESTClient) Patch(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -866,13 +880,13 @@ func (c *serviceAttachmentsRESTClient) SetIamPolicy(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -926,13 +940,13 @@ func (c *serviceAttachmentsRESTClient) TestIamPermissions(ctx context.Context, r
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -55,8 +55,11 @@ type SnapshotsCallOptions struct {
func defaultSnapshotsRESTCallOptions() *SnapshotsCallOptions {
return &SnapshotsCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -68,6 +71,7 @@ func defaultSnapshotsRESTCallOptions() *SnapshotsCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,8 +82,11 @@ func defaultSnapshotsRESTCallOptions() *SnapshotsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,9 +97,15 @@ func defaultSnapshotsRESTCallOptions() *SnapshotsCallOptions {
http.StatusServiceUnavailable)
}),
},
SetIamPolicy: []gax.CallOption{},
SetLabels: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -248,7 +261,7 @@ func defaultSnapshotsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *snapshotsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -314,13 +327,13 @@ func (c *snapshotsRESTClient) Delete(ctx context.Context, req *computepb.DeleteS
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -374,13 +387,13 @@ func (c *snapshotsRESTClient) Get(ctx context.Context, req *computepb.GetSnapsho
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -434,13 +447,13 @@ func (c *snapshotsRESTClient) GetIamPolicy(ctx context.Context, req *computepb.G
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -501,13 +514,13 @@ func (c *snapshotsRESTClient) Insert(ctx context.Context, req *computepb.InsertS
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -587,13 +600,13 @@ func (c *snapshotsRESTClient) List(ctx context.Context, req *computepb.ListSnaps
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -664,13 +677,13 @@ func (c *snapshotsRESTClient) SetIamPolicy(ctx context.Context, req *computepb.S
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -724,13 +737,13 @@ func (c *snapshotsRESTClient) SetLabels(ctx context.Context, req *computepb.SetL
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -791,13 +804,13 @@ func (c *snapshotsRESTClient) TestIamPermissions(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -54,6 +54,7 @@ type SslCertificatesCallOptions struct {
func defaultSslCertificatesRESTCallOptions() *SslCertificatesCallOptions {
return &SslCertificatesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -64,8 +65,11 @@ func defaultSslCertificatesRESTCallOptions() *SslCertificatesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,8 +80,11 @@ func defaultSslCertificatesRESTCallOptions() *SslCertificatesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -225,7 +232,7 @@ func defaultSslCertificatesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *sslCertificatesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -313,13 +320,13 @@ func (c *sslCertificatesRESTClient) AggregatedList(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -397,13 +404,13 @@ func (c *sslCertificatesRESTClient) Delete(ctx context.Context, req *computepb.D
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -457,13 +464,13 @@ func (c *sslCertificatesRESTClient) Get(ctx context.Context, req *computepb.GetS
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -524,13 +531,13 @@ func (c *sslCertificatesRESTClient) Insert(ctx context.Context, req *computepb.I
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -610,13 +617,13 @@ func (c *sslCertificatesRESTClient) List(ctx context.Context, req *computepb.Lis
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -56,6 +56,7 @@ type SslPoliciesCallOptions struct {
func defaultSslPoliciesRESTCallOptions() *SslPoliciesCallOptions {
return &SslPoliciesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -66,8 +67,11 @@ func defaultSslPoliciesRESTCallOptions() *SslPoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,8 +82,11 @@ func defaultSslPoliciesRESTCallOptions() *SslPoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -91,6 +98,7 @@ func defaultSslPoliciesRESTCallOptions() *SslPoliciesCallOptions {
}),
},
ListAvailableFeatures: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -101,7 +109,9 @@ func defaultSslPoliciesRESTCallOptions() *SslPoliciesCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -251,7 +261,7 @@ func defaultSslPoliciesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *sslPoliciesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -339,13 +349,13 @@ func (c *sslPoliciesRESTClient) AggregatedList(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -423,13 +433,13 @@ func (c *sslPoliciesRESTClient) Delete(ctx context.Context, req *computepb.Delet
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -483,13 +493,13 @@ func (c *sslPoliciesRESTClient) Get(ctx context.Context, req *computepb.GetSslPo
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -550,13 +560,13 @@ func (c *sslPoliciesRESTClient) Insert(ctx context.Context, req *computepb.Inser
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -636,13 +646,13 @@ func (c *sslPoliciesRESTClient) List(ctx context.Context, req *computepb.ListSsl
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -725,13 +735,13 @@ func (c *sslPoliciesRESTClient) ListAvailableFeatures(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -792,13 +802,13 @@ func (c *sslPoliciesRESTClient) Patch(ctx context.Context, req *computepb.PatchS
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -61,6 +61,7 @@ type SubnetworksCallOptions struct {
func defaultSubnetworksRESTCallOptions() *SubnetworksCallOptions {
return &SubnetworksCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -71,9 +72,14 @@ func defaultSubnetworksRESTCallOptions() *SubnetworksCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
ExpandIpCidrRange: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
ExpandIpCidrRange: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -85,6 +91,7 @@ func defaultSubnetworksRESTCallOptions() *SubnetworksCallOptions {
}),
},
GetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -95,8 +102,11 @@ func defaultSubnetworksRESTCallOptions() *SubnetworksCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -108,6 +118,7 @@ func defaultSubnetworksRESTCallOptions() *SubnetworksCallOptions {
}),
},
ListUsable: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -118,10 +129,18 @@ func defaultSubnetworksRESTCallOptions() *SubnetworksCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetIamPolicy: []gax.CallOption{},
SetPrivateIpGoogleAccess: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetPrivateIpGoogleAccess: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -301,7 +320,7 @@ func defaultSubnetworksRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *subnetworksRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -389,13 +408,13 @@ func (c *subnetworksRESTClient) AggregatedList(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -473,13 +492,13 @@ func (c *subnetworksRESTClient) Delete(ctx context.Context, req *computepb.Delet
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -548,13 +567,13 @@ func (c *subnetworksRESTClient) ExpandIpCidrRange(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -609,13 +628,13 @@ func (c *subnetworksRESTClient) Get(ctx context.Context, req *computepb.GetSubne
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -669,13 +688,13 @@ func (c *subnetworksRESTClient) GetIamPolicy(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -736,13 +755,13 @@ func (c *subnetworksRESTClient) Insert(ctx context.Context, req *computepb.Inser
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -823,13 +842,13 @@ func (c *subnetworksRESTClient) List(ctx context.Context, req *computepb.ListSub
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -919,13 +938,13 @@ func (c *subnetworksRESTClient) ListUsable(ctx context.Context, req *computepb.L
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1006,13 +1025,13 @@ func (c *subnetworksRESTClient) Patch(ctx context.Context, req *computepb.PatchS
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1074,13 +1093,13 @@ func (c *subnetworksRESTClient) SetIamPolicy(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1141,13 +1160,13 @@ func (c *subnetworksRESTClient) SetPrivateIpGoogleAccess(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1209,13 +1228,13 @@ func (c *subnetworksRESTClient) TestIamPermissions(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -52,8 +52,11 @@ type TargetGrpcProxiesCallOptions struct {
func defaultTargetGrpcProxiesRESTCallOptions() *TargetGrpcProxiesCallOptions {
return &TargetGrpcProxiesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -64,8 +67,11 @@ func defaultTargetGrpcProxiesRESTCallOptions() *TargetGrpcProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,7 +82,9 @@ func defaultTargetGrpcProxiesRESTCallOptions() *TargetGrpcProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -214,7 +222,7 @@ func defaultTargetGrpcProxiesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *targetGrpcProxiesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -280,13 +288,13 @@ func (c *targetGrpcProxiesRESTClient) Delete(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -340,13 +348,13 @@ func (c *targetGrpcProxiesRESTClient) Get(ctx context.Context, req *computepb.Ge
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -407,13 +415,13 @@ func (c *targetGrpcProxiesRESTClient) Insert(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -493,13 +501,13 @@ func (c *targetGrpcProxiesRESTClient) List(ctx context.Context, req *computepb.L
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -577,13 +585,13 @@ func (c *targetGrpcProxiesRESTClient) Patch(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -56,6 +56,7 @@ type TargetHttpProxiesCallOptions struct {
func defaultTargetHttpProxiesRESTCallOptions() *TargetHttpProxiesCallOptions {
return &TargetHttpProxiesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -66,8 +67,11 @@ func defaultTargetHttpProxiesRESTCallOptions() *TargetHttpProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,8 +82,11 @@ func defaultTargetHttpProxiesRESTCallOptions() *TargetHttpProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,8 +97,12 @@ func defaultTargetHttpProxiesRESTCallOptions() *TargetHttpProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetUrlMap: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetUrlMap: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -241,7 +252,7 @@ func defaultTargetHttpProxiesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *targetHttpProxiesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -329,13 +340,13 @@ func (c *targetHttpProxiesRESTClient) AggregatedList(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -413,13 +424,13 @@ func (c *targetHttpProxiesRESTClient) Delete(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -473,13 +484,13 @@ func (c *targetHttpProxiesRESTClient) Get(ctx context.Context, req *computepb.Ge
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -540,13 +551,13 @@ func (c *targetHttpProxiesRESTClient) Insert(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -626,13 +637,13 @@ func (c *targetHttpProxiesRESTClient) List(ctx context.Context, req *computepb.L
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -710,13 +721,13 @@ func (c *targetHttpProxiesRESTClient) Patch(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -784,13 +795,13 @@ func (c *targetHttpProxiesRESTClient) SetUrlMap(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -60,6 +60,7 @@ type TargetHttpsProxiesCallOptions struct {
func defaultTargetHttpsProxiesRESTCallOptions() *TargetHttpsProxiesCallOptions {
return &TargetHttpsProxiesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -70,8 +71,11 @@ func defaultTargetHttpsProxiesRESTCallOptions() *TargetHttpsProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -82,8 +86,11 @@ func defaultTargetHttpsProxiesRESTCallOptions() *TargetHttpsProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -94,12 +101,24 @@ func defaultTargetHttpsProxiesRESTCallOptions() *TargetHttpsProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
SetCertificateMap: []gax.CallOption{},
SetQuicOverride: []gax.CallOption{},
SetSslCertificates: []gax.CallOption{},
SetSslPolicy: []gax.CallOption{},
SetUrlMap: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetCertificateMap: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetQuicOverride: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetSslCertificates: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetSslPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetUrlMap: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -273,7 +292,7 @@ func defaultTargetHttpsProxiesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *targetHttpsProxiesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -361,13 +380,13 @@ func (c *targetHttpsProxiesRESTClient) AggregatedList(ctx context.Context, req *
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -445,13 +464,13 @@ func (c *targetHttpsProxiesRESTClient) Delete(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -505,13 +524,13 @@ func (c *targetHttpsProxiesRESTClient) Get(ctx context.Context, req *computepb.G
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -572,13 +591,13 @@ func (c *targetHttpsProxiesRESTClient) Insert(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -658,13 +677,13 @@ func (c *targetHttpsProxiesRESTClient) List(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -742,13 +761,13 @@ func (c *targetHttpsProxiesRESTClient) Patch(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -816,13 +835,13 @@ func (c *targetHttpsProxiesRESTClient) SetCertificateMap(ctx context.Context, re
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -890,13 +909,13 @@ func (c *targetHttpsProxiesRESTClient) SetQuicOverride(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -964,13 +983,13 @@ func (c *targetHttpsProxiesRESTClient) SetSslCertificates(ctx context.Context, r
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1038,13 +1057,13 @@ func (c *targetHttpsProxiesRESTClient) SetSslPolicy(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1112,13 +1131,13 @@ func (c *targetHttpsProxiesRESTClient) SetUrlMap(ctx context.Context, req *compu
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -54,6 +54,7 @@ type TargetInstancesCallOptions struct {
func defaultTargetInstancesRESTCallOptions() *TargetInstancesCallOptions {
return &TargetInstancesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -64,8 +65,11 @@ func defaultTargetInstancesRESTCallOptions() *TargetInstancesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -76,8 +80,11 @@ func defaultTargetInstancesRESTCallOptions() *TargetInstancesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -225,7 +232,7 @@ func defaultTargetInstancesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *targetInstancesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -313,13 +320,13 @@ func (c *targetInstancesRESTClient) AggregatedList(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -397,13 +404,13 @@ func (c *targetInstancesRESTClient) Delete(ctx context.Context, req *computepb.D
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -458,13 +465,13 @@ func (c *targetInstancesRESTClient) Get(ctx context.Context, req *computepb.GetT
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -525,13 +532,13 @@ func (c *targetInstancesRESTClient) Insert(ctx context.Context, req *computepb.I
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -612,13 +619,13 @@ func (c *targetInstancesRESTClient) List(ctx context.Context, req *computepb.Lis
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -59,9 +59,14 @@ type TargetPoolsCallOptions struct {
func defaultTargetPoolsRESTCallOptions() *TargetPoolsCallOptions {
return &TargetPoolsCallOptions{
AddHealthCheck: []gax.CallOption{},
AddInstance: []gax.CallOption{},
AddHealthCheck: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AddInstance: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -72,8 +77,11 @@ func defaultTargetPoolsRESTCallOptions() *TargetPoolsCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -84,9 +92,14 @@ func defaultTargetPoolsRESTCallOptions() *TargetPoolsCallOptions {
http.StatusServiceUnavailable)
}),
},
GetHealth: []gax.CallOption{},
Insert: []gax.CallOption{},
GetHealth: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -97,9 +110,15 @@ func defaultTargetPoolsRESTCallOptions() *TargetPoolsCallOptions {
http.StatusServiceUnavailable)
}),
},
RemoveHealthCheck: []gax.CallOption{},
RemoveInstance: []gax.CallOption{},
SetBackup: []gax.CallOption{},
RemoveHealthCheck: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RemoveInstance: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetBackup: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -273,7 +292,7 @@ func defaultTargetPoolsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *targetPoolsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -346,13 +365,13 @@ func (c *targetPoolsRESTClient) AddHealthCheck(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -421,13 +440,13 @@ func (c *targetPoolsRESTClient) AddInstance(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -511,13 +530,13 @@ func (c *targetPoolsRESTClient) AggregatedList(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -595,13 +614,13 @@ func (c *targetPoolsRESTClient) Delete(ctx context.Context, req *computepb.Delet
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -656,13 +675,13 @@ func (c *targetPoolsRESTClient) Get(ctx context.Context, req *computepb.GetTarge
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -716,13 +735,13 @@ func (c *targetPoolsRESTClient) GetHealth(ctx context.Context, req *computepb.Ge
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -783,13 +802,13 @@ func (c *targetPoolsRESTClient) Insert(ctx context.Context, req *computepb.Inser
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -870,13 +889,13 @@ func (c *targetPoolsRESTClient) List(ctx context.Context, req *computepb.ListTar
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -954,13 +973,13 @@ func (c *targetPoolsRESTClient) RemoveHealthCheck(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1029,13 +1048,13 @@ func (c *targetPoolsRESTClient) RemoveInstance(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -1107,13 +1126,13 @@ func (c *targetPoolsRESTClient) SetBackup(ctx context.Context, req *computepb.Se
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -56,8 +56,11 @@ type TargetSslProxiesCallOptions struct {
func defaultTargetSslProxiesRESTCallOptions() *TargetSslProxiesCallOptions {
return &TargetSslProxiesCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -68,8 +71,11 @@ func defaultTargetSslProxiesRESTCallOptions() *TargetSslProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -80,11 +86,21 @@ func defaultTargetSslProxiesRESTCallOptions() *TargetSslProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
SetBackendService: []gax.CallOption{},
SetCertificateMap: []gax.CallOption{},
SetProxyHeader: []gax.CallOption{},
SetSslCertificates: []gax.CallOption{},
SetSslPolicy: []gax.CallOption{},
SetBackendService: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetCertificateMap: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetProxyHeader: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetSslCertificates: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetSslPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -246,7 +262,7 @@ func defaultTargetSslProxiesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *targetSslProxiesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -312,13 +328,13 @@ func (c *targetSslProxiesRESTClient) Delete(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -372,13 +388,13 @@ func (c *targetSslProxiesRESTClient) Get(ctx context.Context, req *computepb.Get
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -439,13 +455,13 @@ func (c *targetSslProxiesRESTClient) Insert(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -525,13 +541,13 @@ func (c *targetSslProxiesRESTClient) List(ctx context.Context, req *computepb.Li
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -609,13 +625,13 @@ func (c *targetSslProxiesRESTClient) SetBackendService(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -683,13 +699,13 @@ func (c *targetSslProxiesRESTClient) SetCertificateMap(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -757,13 +773,13 @@ func (c *targetSslProxiesRESTClient) SetProxyHeader(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -831,13 +847,13 @@ func (c *targetSslProxiesRESTClient) SetSslCertificates(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -905,13 +921,13 @@ func (c *targetSslProxiesRESTClient) SetSslPolicy(ctx context.Context, req *comp
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -56,6 +56,7 @@ type TargetTcpProxiesCallOptions struct {
func defaultTargetTcpProxiesRESTCallOptions() *TargetTcpProxiesCallOptions {
return &TargetTcpProxiesCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -66,8 +67,11 @@ func defaultTargetTcpProxiesRESTCallOptions() *TargetTcpProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -78,8 +82,11 @@ func defaultTargetTcpProxiesRESTCallOptions() *TargetTcpProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,8 +97,12 @@ func defaultTargetTcpProxiesRESTCallOptions() *TargetTcpProxiesCallOptions {
http.StatusServiceUnavailable)
}),
},
SetBackendService: []gax.CallOption{},
SetProxyHeader: []gax.CallOption{},
SetBackendService: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetProxyHeader: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -241,7 +252,7 @@ func defaultTargetTcpProxiesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *targetTcpProxiesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -329,13 +340,13 @@ func (c *targetTcpProxiesRESTClient) AggregatedList(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -413,13 +424,13 @@ func (c *targetTcpProxiesRESTClient) Delete(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -473,13 +484,13 @@ func (c *targetTcpProxiesRESTClient) Get(ctx context.Context, req *computepb.Get
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -540,13 +551,13 @@ func (c *targetTcpProxiesRESTClient) Insert(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -626,13 +637,13 @@ func (c *targetTcpProxiesRESTClient) List(ctx context.Context, req *computepb.Li
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -710,13 +721,13 @@ func (c *targetTcpProxiesRESTClient) SetBackendService(ctx context.Context, req
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -784,13 +795,13 @@ func (c *targetTcpProxiesRESTClient) SetProxyHeader(ctx context.Context, req *co
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -55,6 +55,7 @@ type TargetVpnGatewaysCallOptions struct {
func defaultTargetVpnGatewaysRESTCallOptions() *TargetVpnGatewaysCallOptions {
return &TargetVpnGatewaysCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -65,8 +66,11 @@ func defaultTargetVpnGatewaysRESTCallOptions() *TargetVpnGatewaysCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -77,8 +81,11 @@ func defaultTargetVpnGatewaysRESTCallOptions() *TargetVpnGatewaysCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -89,7 +96,9 @@ func defaultTargetVpnGatewaysRESTCallOptions() *TargetVpnGatewaysCallOptions {
http.StatusServiceUnavailable)
}),
},
SetLabels: []gax.CallOption{},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -233,7 +242,7 @@ func defaultTargetVpnGatewaysRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *targetVpnGatewaysRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -321,13 +330,13 @@ func (c *targetVpnGatewaysRESTClient) AggregatedList(ctx context.Context, req *c
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -405,13 +414,13 @@ func (c *targetVpnGatewaysRESTClient) Delete(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -466,13 +475,13 @@ func (c *targetVpnGatewaysRESTClient) Get(ctx context.Context, req *computepb.Ge
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -533,13 +542,13 @@ func (c *targetVpnGatewaysRESTClient) Insert(ctx context.Context, req *computepb
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -620,13 +629,13 @@ func (c *targetVpnGatewaysRESTClient) List(ctx context.Context, req *computepb.L
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -704,13 +713,13 @@ func (c *targetVpnGatewaysRESTClient) SetLabels(ctx context.Context, req *comput
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -58,6 +58,7 @@ type UrlMapsCallOptions struct {
func defaultUrlMapsRESTCallOptions() *UrlMapsCallOptions {
return &UrlMapsCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -68,8 +69,11 @@ func defaultUrlMapsRESTCallOptions() *UrlMapsCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -80,9 +84,14 @@ func defaultUrlMapsRESTCallOptions() *UrlMapsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
InvalidateCache: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
InvalidateCache: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -93,9 +102,15 @@ func defaultUrlMapsRESTCallOptions() *UrlMapsCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{},
Update: []gax.CallOption{},
Validate: []gax.CallOption{},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Validate: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -257,7 +272,7 @@ func defaultUrlMapsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *urlMapsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -345,13 +360,13 @@ func (c *urlMapsRESTClient) AggregatedList(ctx context.Context, req *computepb.A
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -429,13 +444,13 @@ func (c *urlMapsRESTClient) Delete(ctx context.Context, req *computepb.DeleteUrl
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -489,13 +504,13 @@ func (c *urlMapsRESTClient) Get(ctx context.Context, req *computepb.GetUrlMapReq
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -556,13 +571,13 @@ func (c *urlMapsRESTClient) Insert(ctx context.Context, req *computepb.InsertUrl
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -630,13 +645,13 @@ func (c *urlMapsRESTClient) InvalidateCache(ctx context.Context, req *computepb.
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -716,13 +731,13 @@ func (c *urlMapsRESTClient) List(ctx context.Context, req *computepb.ListUrlMaps
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -800,13 +815,13 @@ func (c *urlMapsRESTClient) Patch(ctx context.Context, req *computepb.PatchUrlMa
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -874,13 +889,13 @@ func (c *urlMapsRESTClient) Update(ctx context.Context, req *computepb.UpdateUrl
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -941,13 +956,13 @@ func (c *urlMapsRESTClient) Validate(ctx context.Context, req *computepb.Validat
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -57,6 +57,7 @@ type VpnGatewaysCallOptions struct {
func defaultVpnGatewaysRESTCallOptions() *VpnGatewaysCallOptions {
return &VpnGatewaysCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -67,8 +68,11 @@ func defaultVpnGatewaysRESTCallOptions() *VpnGatewaysCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -80,6 +84,7 @@ func defaultVpnGatewaysRESTCallOptions() *VpnGatewaysCallOptions {
}),
},
GetStatus: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -90,8 +95,11 @@ func defaultVpnGatewaysRESTCallOptions() *VpnGatewaysCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -102,8 +110,12 @@ func defaultVpnGatewaysRESTCallOptions() *VpnGatewaysCallOptions {
http.StatusServiceUnavailable)
}),
},
SetLabels: []gax.CallOption{},
TestIamPermissions: []gax.CallOption{},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -259,7 +271,7 @@ func defaultVpnGatewaysRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *vpnGatewaysRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -347,13 +359,13 @@ func (c *vpnGatewaysRESTClient) AggregatedList(ctx context.Context, req *compute
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -431,13 +443,13 @@ func (c *vpnGatewaysRESTClient) Delete(ctx context.Context, req *computepb.Delet
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -492,13 +504,13 @@ func (c *vpnGatewaysRESTClient) Get(ctx context.Context, req *computepb.GetVpnGa
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -545,13 +557,13 @@ func (c *vpnGatewaysRESTClient) GetStatus(ctx context.Context, req *computepb.Ge
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -612,13 +624,13 @@ func (c *vpnGatewaysRESTClient) Insert(ctx context.Context, req *computepb.Inser
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -699,13 +711,13 @@ func (c *vpnGatewaysRESTClient) List(ctx context.Context, req *computepb.ListVpn
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -783,13 +795,13 @@ func (c *vpnGatewaysRESTClient) SetLabels(ctx context.Context, req *computepb.Se
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -851,13 +863,13 @@ func (c *vpnGatewaysRESTClient) TestIamPermissions(ctx context.Context, req *com
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -20,7 +20,7 @@ import (
"bytes"
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -55,6 +55,7 @@ type VpnTunnelsCallOptions struct {
func defaultVpnTunnelsRESTCallOptions() *VpnTunnelsCallOptions {
return &VpnTunnelsCallOptions{
AggregatedList: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -65,8 +66,11 @@ func defaultVpnTunnelsRESTCallOptions() *VpnTunnelsCallOptions {
http.StatusServiceUnavailable)
}),
},
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -77,8 +81,11 @@ func defaultVpnTunnelsRESTCallOptions() *VpnTunnelsCallOptions {
http.StatusServiceUnavailable)
}),
},
Insert: []gax.CallOption{},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -89,7 +96,9 @@ func defaultVpnTunnelsRESTCallOptions() *VpnTunnelsCallOptions {
http.StatusServiceUnavailable)
}),
},
SetLabels: []gax.CallOption{},
SetLabels: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -233,7 +242,7 @@ func defaultVpnTunnelsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *vpnTunnelsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -321,13 +330,13 @@ func (c *vpnTunnelsRESTClient) AggregatedList(ctx context.Context, req *computep
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -405,13 +414,13 @@ func (c *vpnTunnelsRESTClient) Delete(ctx context.Context, req *computepb.Delete
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -466,13 +475,13 @@ func (c *vpnTunnelsRESTClient) Get(ctx context.Context, req *computepb.GetVpnTun
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -533,13 +542,13 @@ func (c *vpnTunnelsRESTClient) Insert(ctx context.Context, req *computepb.Insert
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -620,13 +629,13 @@ func (c *vpnTunnelsRESTClient) List(ctx context.Context, req *computepb.ListVpnT
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -704,13 +713,13 @@ func (c *vpnTunnelsRESTClient) SetLabels(ctx context.Context, req *computepb.Set
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -50,8 +50,11 @@ type ZoneOperationsCallOptions struct {
func defaultZoneOperationsRESTCallOptions() *ZoneOperationsCallOptions {
return &ZoneOperationsCallOptions{
Delete: []gax.CallOption{},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -63,6 +66,7 @@ func defaultZoneOperationsRESTCallOptions() *ZoneOperationsCallOptions {
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -73,7 +77,9 @@ func defaultZoneOperationsRESTCallOptions() *ZoneOperationsCallOptions {
http.StatusServiceUnavailable)
}),
},
Wait: []gax.CallOption{},
Wait: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -192,7 +198,7 @@ func defaultZoneOperationsRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *zoneOperationsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -248,13 +254,13 @@ func (c *zoneOperationsRESTClient) Delete(ctx context.Context, req *computepb.De
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -301,13 +307,13 @@ func (c *zoneOperationsRESTClient) Get(ctx context.Context, req *computepb.GetZo
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -380,13 +386,13 @@ func (c *zoneOperationsRESTClient) List(ctx context.Context, req *computepb.List
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -450,13 +456,13 @@ func (c *zoneOperationsRESTClient) Wait(ctx context.Context, req *computepb.Wait
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -19,7 +19,7 @@ package compute
import (
"context"
"fmt"
"io/ioutil"
"io"
"math"
"net/http"
"net/url"
@ -49,6 +49,7 @@ type ZonesCallOptions struct {
func defaultZonesRESTCallOptions() *ZonesCallOptions {
return &ZonesCallOptions{
Get: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -60,6 +61,7 @@ func defaultZonesRESTCallOptions() *ZonesCallOptions {
}),
},
List: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
return gax.OnHTTPCodes(gax.Backoff{
Initial: 100 * time.Millisecond,
@ -176,7 +178,7 @@ func defaultZonesRESTClientOptions() []option.ClientOption {
// the `x-goog-api-client` header passed on each request. Intended for
// use by Google-written clients.
func (c *zonesRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", versionGo()}, keyval...)
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogMetadata = metadata.Pairs("x-goog-api-client", gax.XGoogHeader(kv...))
}
@ -232,13 +234,13 @@ func (c *zonesRESTClient) Get(ctx context.Context, req *computepb.GetZoneRequest
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil
@ -311,13 +313,13 @@ func (c *zonesRESTClient) List(ctx context.Context, req *computepb.ListZonesRequ
return err
}
buf, err := ioutil.ReadAll(httpRsp.Body)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
if err := unm.Unmarshal(buf, resp); err != nil {
return maybeUnknownEnum(err)
return err
}
return nil

View file

@ -15,4 +15,4 @@
package internal
// Version is the current tagged release of the library.
const Version = "1.19.3"
const Version = "1.22.0"

View file

@ -1,5 +1,27 @@
# Changes
## [1.1.0](https://github.com/googleapis/google-cloud-go/compare/iam/v1.0.1...iam/v1.1.0) (2023-05-30)
### Features
* **iam:** Update all direct dependencies ([b340d03](https://github.com/googleapis/google-cloud-go/commit/b340d030f2b52a4ce48846ce63984b28583abde6))
## [1.0.1](https://github.com/googleapis/google-cloud-go/compare/iam/v1.0.0...iam/v1.0.1) (2023-05-08)
### Bug Fixes
* **iam:** Update grpc to v1.55.0 ([1147ce0](https://github.com/googleapis/google-cloud-go/commit/1147ce02a990276ca4f8ab7a1ab65c14da4450ef))
## [1.0.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.13.0...iam/v1.0.0) (2023-04-04)
### Features
* **iam:** Promote to GA ([#7627](https://github.com/googleapis/google-cloud-go/issues/7627)) ([b351906](https://github.com/googleapis/google-cloud-go/commit/b351906a10e17a02d7f7e2551bc1585fd9dc3742))
## [0.13.0](https://github.com/googleapis/google-cloud-go/compare/iam/v0.12.0...iam/v0.13.0) (2023-03-15)

View file

@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.21.9
// protoc-gen-go v1.30.0
// protoc v4.23.1
// source: google/iam/v1/iam_policy.proto
package iampb
@ -342,37 +342,37 @@ var file_google_iam_v1_iam_policy_proto_rawDesc = []byte{
0x53, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d,
0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93,
0x02, 0x23, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x73, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69,
0x63, 0x79, 0x3a, 0x01, 0x2a, 0x12, 0x74, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50,
0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x73, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x74, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50,
0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x22, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69,
0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69,
0x63, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72,
0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x67, 0x65, 0x74, 0x49,
0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x3a, 0x01, 0x2a, 0x12, 0x9a, 0x01, 0x0a, 0x12,
0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31,
0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x67,
0x65, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x9a, 0x01, 0x0a, 0x12,
0x54, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x12, 0x28, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e,
0x76, 0x31, 0x2e, 0x54, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x73,
0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x22,
0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3d, 0x2a,
0x2a, 0x7d, 0x3a, 0x74, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x01, 0x2a, 0x1a, 0x1e, 0xca, 0x41, 0x1b, 0x69, 0x61, 0x6d,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2f, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x29, 0x3a,
0x01, 0x2a, 0x22, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
0x65, 0x3d, 0x2a, 0x2a, 0x7d, 0x3a, 0x74, 0x65, 0x73, 0x74, 0x49, 0x61, 0x6d, 0x50, 0x65, 0x72,
0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x1e, 0xca, 0x41, 0x1b, 0x69, 0x61, 0x6d,
0x2d, 0x6d, 0x65, 0x74, 0x61, 0x2d, 0x61, 0x70, 0x69, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x42, 0x86, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0e,
0x49, 0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x30, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e,
0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x69,
0x61, 0x6d, 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43,
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x49, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56,
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x61, 0x70, 0x69, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x42, 0x7f, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0e, 0x49,
0x61, 0x6d, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a,
0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x69,
0x61, 0x6d, 0x70, 0x62, 0x3b, 0x69, 0x61, 0x6d, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x13,
0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x49, 0x61, 0x6d,
0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f,
0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (

View file

@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.21.9
// protoc-gen-go v1.30.0
// protoc v4.23.1
// source: google/iam/v1/options.proto
package iampb
@ -111,16 +111,16 @@ var file_google_iam_v1_options_proto_rawDesc = []byte{
0x12, 0x38, 0x0a, 0x18, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x6f,
0x6c, 0x69, 0x63, 0x79, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x16, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x65, 0x64, 0x50, 0x6f, 0x6c,
0x69, 0x63, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x84, 0x01, 0x0a, 0x11, 0x63,
0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31,
0x42, 0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
0x5a, 0x30, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e,
0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x69,
0x61, 0x6d, 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43,
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x49, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56,
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x69, 0x63, 0x79, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x42, 0x7d, 0x0a, 0x11, 0x63, 0x6f,
0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42,
0x0c, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a,
0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x61, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x69,
0x61, 0x6d, 0x70, 0x62, 0x3b, 0x69, 0x61, 0x6d, 0x70, 0x62, 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x13,
0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x49, 0x61, 0x6d,
0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f,
0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
}
var (

View file

@ -14,8 +14,8 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.21.9
// protoc-gen-go v1.30.0
// protoc v4.23.1
// source: google/iam/v1/policy.proto
package iampb
@ -214,7 +214,8 @@ func (AuditConfigDelta_Action) EnumDescriptor() ([]byte, []int) {
// only if the expression evaluates to `true`. A condition can add constraints
// based on attributes of the request, the resource, or both. To learn which
// resources support conditions in their IAM policies, see the
// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
// [IAM
// documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
//
// **JSON example:**
//
@ -237,7 +238,8 @@ func (AuditConfigDelta_Action) EnumDescriptor() ([]byte, []int) {
// "condition": {
// "title": "expirable access",
// "description": "Does not grant access after Sep 2020",
// "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')",
// "expression": "request.time <
// timestamp('2020-10-01T00:00:00.000Z')",
// }
// }
// ],
@ -279,10 +281,10 @@ type Policy struct {
// Any operation that affects conditional role bindings must specify version
// `3`. This requirement applies to the following operations:
//
// - Getting a policy that includes a conditional role binding
// - Adding a conditional role binding to a policy
// - Changing a conditional role binding in a policy
// - Removing any role binding, with or without a condition, from a policy
// * Getting a policy that includes a conditional role binding
// * Adding a conditional role binding to a policy
// * Changing a conditional role binding in a policy
// * Removing any role binding, with or without a condition, from a policy
// that includes conditions
//
// **Important:** If you use IAM Conditions, you must include the `etag` field
@ -294,7 +296,8 @@ type Policy struct {
// specify any valid version or leave the field unset.
//
// To learn which resources support conditions in their IAM policies, see the
// [IAM documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
// [IAM
// documentation](https://cloud.google.com/iam/help/conditions/resource-policies).
Version int32 `protobuf:"varint,1,opt,name=version,proto3" json:"version,omitempty"`
// Associates a list of `members`, or principals, with a `role`. Optionally,
// may specify a `condition` that determines how and when the `bindings` are
@ -396,28 +399,29 @@ type Binding struct {
// Specifies the principals requesting access for a Cloud Platform resource.
// `members` can have the following values:
//
// - `allUsers`: A special identifier that represents anyone who is
// * `allUsers`: A special identifier that represents anyone who is
// on the internet; with or without a Google account.
//
// - `allAuthenticatedUsers`: A special identifier that represents anyone
// * `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 Google
// * `user:{emailid}`: An email address that represents a specific Google
// account. For example, `alice@example.com` .
//
// - `serviceAccount:{emailid}`: An email address that represents a service
//
// * `serviceAccount:{emailid}`: An email address that represents a service
// account. For example, `my-other-app@appspot.gserviceaccount.com`.
//
// - `group:{emailid}`: An email address that represents a Google group.
// * `group:{emailid}`: An email address that represents a Google group.
// For example, `admins@example.com`.
//
// - `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
// * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique
// identifier) representing a user that has been recently deleted. For
// example, `alice@example.com?uid=123456789012345678901`. If the user is
// recovered, this value reverts to `user:{emailid}` and the recovered user
// retains the role in the binding.
//
// - `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
// * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus
// unique identifier) representing a service account that has been recently
// deleted. For example,
// `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`.
@ -425,14 +429,17 @@ type Binding struct {
// `serviceAccount:{emailid}` and the undeleted service account retains the
// role in the binding.
//
// - `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
// * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique
// identifier) representing a Google group that has been recently
// deleted. For example, `admins@example.com?uid=123456789012345678901`. If
// the group is recovered, this value reverts to `group:{emailid}` and the
// recovered group retains the role in the binding.
//
// - `domain:{domain}`: The G Suite domain (primary) that represents all the
//
// * `domain:{domain}`: The G Suite domain (primary) that represents all the
// users of that domain. For example, `google.com` or `example.com`.
//
//
Members []string `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"`
// The condition that is associated with this binding.
//
@ -640,7 +647,8 @@ type AuditLogConfig struct {
LogType AuditLogConfig_LogType `protobuf:"varint,1,opt,name=log_type,json=logType,proto3,enum=google.iam.v1.AuditLogConfig_LogType" json:"log_type,omitempty"`
// Specifies the identities that do not cause logging for this type of
// permission.
// Follows the same format of [Binding.members][google.iam.v1.Binding.members].
// Follows the same format of
// [Binding.members][google.iam.v1.Binding.members].
ExemptedMembers []string `protobuf:"bytes,2,rep,name=exempted_members,json=exemptedMembers,proto3" json:"exempted_members,omitempty"`
}
@ -999,16 +1007,15 @@ var file_google_iam_v1_policy_proto_rawDesc = []byte{
0x41, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e,
0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x07,
0x0a, 0x03, 0x41, 0x44, 0x44, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x52, 0x45, 0x4d, 0x4f, 0x56,
0x45, 0x10, 0x02, 0x42, 0x83, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
0x6c, 0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x6f, 0x6c, 0x69, 0x63,
0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x67, 0x65, 0x6e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x61, 0x70, 0x69, 0x73, 0x2f,
0x69, 0x61, 0x6d, 0x2f, 0x76, 0x31, 0x3b, 0x69, 0x61, 0x6d, 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x13,
0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x49, 0x61, 0x6d,
0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f,
0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x45, 0x10, 0x02, 0x42, 0x7c, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x69, 0x61, 0x6d, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79,
0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x2f, 0x69, 0x61, 0x6d,
0x2f, 0x61, 0x70, 0x69, 0x76, 0x31, 0x2f, 0x69, 0x61, 0x6d, 0x70, 0x62, 0x3b, 0x69, 0x61, 0x6d,
0x70, 0x62, 0xf8, 0x01, 0x01, 0xaa, 0x02, 0x13, 0x47, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x43,
0x6c, 0x6f, 0x75, 0x64, 0x2e, 0x49, 0x61, 0x6d, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x13, 0x47, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x5c, 0x43, 0x6c, 0x6f, 0x75, 0x64, 0x5c, 0x49, 0x61, 0x6d, 0x5c, 0x56,
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

Some files were not shown because too many files have changed in this diff Show more