build(deps): bump the go-deps group with 10 updates

Bumps the go-deps group with 10 updates:

| Package | From | To |
| --- | --- | --- |
| [cloud.google.com/go/compute](https://github.com/googleapis/google-cloud-go) | `1.23.3` | `1.23.4` |
| [cloud.google.com/go/storage](https://github.com/googleapis/google-cloud-go) | `1.36.0` | `1.37.0` |
| [github.com/Azure/azure-sdk-for-go/sdk/azidentity](https://github.com/Azure/azure-sdk-for-go) | `1.4.0` | `1.5.1` |
| [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5](https://github.com/Azure/azure-sdk-for-go) | `5.3.0` | `5.5.0` |
| [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) | `1.50.0` | `1.50.8` |
| [github.com/google/uuid](https://github.com/google/uuid) | `1.5.0` | `1.6.0` |
| [github.com/jackc/pgtype](https://github.com/jackc/pgtype) | `1.14.0` | `1.14.1` |
| [github.com/openshift-online/ocm-sdk-go](https://github.com/openshift-online/ocm-sdk-go) | `0.1.390` | `0.1.398` |
| [github.com/osbuild/images](https://github.com/osbuild/images) | `0.33.0` | `0.34.0` |
| [google.golang.org/api](https://github.com/googleapis/google-api-go-client) | `0.160.0` | `0.161.0` |


Updates `cloud.google.com/go/compute` from 1.23.3 to 1.23.4
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/documentai/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/compute/v1.23.3...compute/v1.23.4)

Updates `cloud.google.com/go/storage` from 1.36.0 to 1.37.0
- [Release notes](https://github.com/googleapis/google-cloud-go/releases)
- [Changelog](https://github.com/googleapis/google-cloud-go/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-cloud-go/compare/pubsub/v1.36.0...spanner/v1.37.0)

Updates `github.com/Azure/azure-sdk-for-go/sdk/azidentity` from 1.4.0 to 1.5.1
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/azcore/v1.4.0...sdk/internal/v1.5.1)

Updates `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5` from 5.3.0 to 5.5.0
- [Release notes](https://github.com/Azure/azure-sdk-for-go/releases)
- [Changelog](https://github.com/Azure/azure-sdk-for-go/blob/main/documentation/release.md)
- [Commits](https://github.com/Azure/azure-sdk-for-go/compare/sdk/resourcemanager/compute/armcompute/v5.3.0...sdk/resourcemanager/compute/armcompute/v5.5.0)

Updates `github.com/aws/aws-sdk-go` from 1.50.0 to 1.50.8
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.50.0...v1.50.8)

Updates `github.com/google/uuid` from 1.5.0 to 1.6.0
- [Release notes](https://github.com/google/uuid/releases)
- [Changelog](https://github.com/google/uuid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/google/uuid/compare/v1.5.0...v1.6.0)

Updates `github.com/jackc/pgtype` from 1.14.0 to 1.14.1
- [Changelog](https://github.com/jackc/pgtype/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jackc/pgtype/compare/v1.14.0...v1.14.1)

Updates `github.com/openshift-online/ocm-sdk-go` from 0.1.390 to 0.1.398
- [Release notes](https://github.com/openshift-online/ocm-sdk-go/releases)
- [Changelog](https://github.com/openshift-online/ocm-sdk-go/blob/main/CHANGES.md)
- [Commits](https://github.com/openshift-online/ocm-sdk-go/compare/v0.1.390...v0.1.398)

Updates `github.com/osbuild/images` from 0.33.0 to 0.34.0
- [Release notes](https://github.com/osbuild/images/releases)
- [Commits](https://github.com/osbuild/images/compare/v0.33.0...v0.34.0)

Updates `google.golang.org/api` from 0.160.0 to 0.161.0
- [Release notes](https://github.com/googleapis/google-api-go-client/releases)
- [Changelog](https://github.com/googleapis/google-api-go-client/blob/main/CHANGES.md)
- [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.160.0...v0.161.0)

---
updated-dependencies:
- dependency-name: cloud.google.com/go/compute
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: cloud.google.com/go/storage
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/azidentity
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/google/uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: github.com/jackc/pgtype
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/openshift-online/ocm-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: go-deps
- dependency-name: github.com/osbuild/images
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
- dependency-name: google.golang.org/api
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: go-deps
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot] 2024-02-01 04:42:59 +00:00 committed by Tomáš Hozza
parent db0e6c9643
commit b461b1faf3
306 changed files with 80393 additions and 56486 deletions

47
go.mod
View file

@ -5,18 +5,18 @@ go 1.19
exclude github.com/mattn/go-sqlite3 v2.0.3+incompatible
require (
cloud.google.com/go/compute v1.23.3
cloud.google.com/go/storage v1.36.0
cloud.google.com/go/compute v1.23.4
cloud.google.com/go/storage v1.37.0
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.3.0
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.5.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage v1.5.0
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.1
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.3.2
github.com/aws/aws-sdk-go v1.50.0
github.com/aws/aws-sdk-go v1.50.8
github.com/coreos/go-semver v0.3.1
github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf
github.com/deepmap/oapi-codegen v1.8.2
@ -24,18 +24,18 @@ require (
github.com/gobwas/glob v0.2.3
github.com/golang-jwt/jwt/v4 v4.5.0
github.com/google/go-cmp v0.6.0
github.com/google/uuid v1.5.0
github.com/google/uuid v1.6.0
github.com/gophercloud/gophercloud v1.8.0
github.com/hashicorp/go-retryablehttp v0.7.5
github.com/jackc/pgtype v1.14.0
github.com/jackc/pgtype v1.14.1
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.11.4
github.com/labstack/gommon v0.4.2
github.com/openshift-online/ocm-sdk-go v0.1.390
github.com/openshift-online/ocm-sdk-go v0.1.398
github.com/oracle/oci-go-sdk/v54 v54.0.0
github.com/osbuild/images v0.33.0
github.com/osbuild/images v0.34.0
github.com/osbuild/osbuild-composer/pkg/splunk_logger v0.0.0-20231117174845-e969a9dc3cd1
github.com/osbuild/pulp-client v0.1.0
github.com/prometheus/client_golang v1.18.0
@ -49,11 +49,11 @@ require (
golang.org/x/oauth2 v0.16.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.16.0
google.golang.org/api v0.157.0
google.golang.org/api v0.161.0
)
require (
cloud.google.com/go v0.111.0 // indirect
cloud.google.com/go v0.112.0 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.5 // indirect
dario.cat/mergo v1.0.0 // indirect
@ -67,7 +67,7 @@ require (
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/AzureAD/microsoft-authentication-library-for-go v1.1.1 // indirect
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/hcsshim v0.12.0-rc.1 // indirect
github.com/VividCortex/ewma v1.2.0 // indirect
@ -99,7 +99,7 @@ require (
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-jose/go-jose/v3 v3.0.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-openapi/analysis v0.21.4 // indirect
github.com/go-openapi/errors v0.20.4 // indirect
@ -113,7 +113,7 @@ require (
github.com/go-openapi/validate v0.22.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt v3.2.2+incompatible // indirect
github.com/golang-jwt/jwt/v5 v5.0.0 // indirect
github.com/golang-jwt/jwt/v5 v5.2.0 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
@ -166,7 +166,7 @@ require (
github.com/opencontainers/runtime-spec v1.1.0 // indirect
github.com/opencontainers/selinux v1.11.0 // indirect
github.com/ostreedev/ostree-go v0.0.0-20210805093236-719684c64e4f // indirect
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // 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
@ -178,6 +178,7 @@ require (
github.com/sigstore/fulcio v1.4.3 // indirect
github.com/sigstore/rekor v1.2.2 // indirect
github.com/sigstore/sigstore v1.7.5 // indirect
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 // 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
@ -193,11 +194,11 @@ require (
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
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 // indirect
go.opentelemetry.io/otel v1.21.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/trace v1.21.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 // indirect
go.opentelemetry.io/otel v1.22.0 // indirect
go.opentelemetry.io/otel/metric v1.22.0 // indirect
go.opentelemetry.io/otel/trace v1.22.0 // indirect
golang.org/x/crypto v0.18.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.20.0 // indirect
@ -206,10 +207,10 @@ require (
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.14.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 // indirect
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac // indirect
google.golang.org/grpc v1.60.1 // indirect
google.golang.org/grpc v1.61.0 // indirect
google.golang.org/protobuf v1.32.0 // indirect
gopkg.in/go-jose/go-jose.v2 v2.6.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect

101
go.sum
View file

@ -1,14 +1,14 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
cloud.google.com/go v0.111.0 h1:YHLKNupSD1KqjDbQ3+LVdQ81h/UJbJyZG203cEfnQgM=
cloud.google.com/go v0.111.0/go.mod h1:0mibmpKP1TyOOFYQY5izo0LnT+ecvOQ0Sg3OdmMiNRU=
cloud.google.com/go/compute v1.23.3 h1:6sVlXXBmbd7jNX0Ipq0trII3e4n1/MsADLK6a+aiVlk=
cloud.google.com/go/compute v1.23.3/go.mod h1:VCgBUoMnIVIR0CscqQiPJLAG25E3ZRZMzcFZeQ+h8CI=
cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM=
cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4=
cloud.google.com/go/compute v1.23.4 h1:EBT9Nw4q3zyE7G45Wvv3MzolIrCJEuHys5muLY0wvAw=
cloud.google.com/go/compute v1.23.4/go.mod h1:/EJMj55asU6kAFnuZET8zqgwgJ9FvXWXOkkfQZa4ioI=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI=
cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8=
cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8=
cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8=
cloud.google.com/go/storage v1.37.0 h1:WI8CsaFO8Q9KjPVtsZ5Cmi0dXV25zMoX0FklT7c3Jm4=
cloud.google.com/go/storage v1.37.0/go.mod h1:i34TiT2IhiNDmcj65PqwCjcoUX7Z5pLzS8DEmoiFq1k=
dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk=
dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
github.com/14rcole/gopopulate v0.0.0-20180821133914-b175b219e774 h1:SCbEWT58NSt7d2mcFdvxC9uyrdcTfvBbPLThhkDmXzg=
@ -16,12 +16,12 @@ github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1 h1:lGlwhPtrX6EVml1hO0ivjkUxsSyl4dsiw9qcA1k/3IQ=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.1/go.mod h1:RKUqNu35KJYcVG/fqTRqmuXJZYNhYkBrnC/hX7yGbTA=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZMmXGkOcvfFtD0oHVZ1TIPRI=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1 h1:sO0/P7g68FrryJzljemN+6GTssUXdANk6aJ7T1ZxnsQ=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.5.1/go.mod h1:h8hyGFDsU5HMivxiS2iYFZsgDbU9OnnJ163x5UGVKYo=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1 h1:6oNBlSdi1QqM1PNW7FPA6xOGA5UNsXnkaYZz9vdPGhA=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.1/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.3.0 h1:qgs/VAMSR+9qFhwTw4OwF2NbVuw+2m83pVZJjqkKQMw=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.3.0/go.mod h1:uYt4CfhkJA9o0FN7jfE5minm/i4nUE4MjGUJkzB6Zs8=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.5.0 h1:MxA59PGoCFb+vCwRQi3PhQEwHj4+r2dhuv9HG+vM7iM=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 v5.5.0/go.mod h1:uYt4CfhkJA9o0FN7jfE5minm/i4nUE4MjGUJkzB6Zs8=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/v2 v2.0.0 h1:PTFGRSlMKCQelWwxUyYVEUqseBJVemLyqWJjvMyt0do=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/managementgroups/armmanagementgroups v1.0.0 h1:pPvTJ1dY0sA35JOeFq6TsY2xj6Z85Yo23Pj4wCCvu4o=
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.2.0 h1:Dd+RhdJn0OTtVGaeDLZpcumkIVCtA/3/Fo42+eoYvVM=
@ -57,8 +57,8 @@ github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+Z
github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8=
github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo=
github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU=
github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk=
github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1 h1:DzHpqpoJVaCgOUdVHxE8QB52S6NiVdDQvGlny1qvPqA=
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
@ -76,8 +76,8 @@ github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat6
github.com/asaskevich/govalidator v0.0.0-20200907205600-7a23bdc65eef/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 h1:DklsrG3dyBCFEj5IhUbnKptjxatkF07cF2ak3yi77so=
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2/go.mod h1:WaHUgvxTVq04UNunO+XhnAqY/wQc+bxr74GqbsZ/Jqw=
github.com/aws/aws-sdk-go v1.50.0 h1:HBtrLeO+QyDKnc3t1+5DR1RxodOHCGr8ZcrHudpv7jI=
github.com/aws/aws-sdk-go v1.50.0/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aws/aws-sdk-go v1.50.8 h1:gY0WoOW+/Wz6XmYSgDH9ge3wnAevYDSQWPxxJvqAkP4=
github.com/aws/aws-sdk-go v1.50.8/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
@ -89,7 +89,7 @@ github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj
github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=
github.com/cncf/xds/go v0.0.0-20231109132714-523115ebc101 h1:7To3pQ+pZo0i3dsWEbinPNFs5gPSBOsJtx3wTT94VBY=
github.com/cockroachdb/apd v1.1.0 h1:3LFP3629v+1aKXU5Q37mxmRxX/pIu1nijXydLShEq5I=
github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
github.com/containerd/cgroups/v3 v3.0.2 h1:f5WFqIVSgo5IZmtTT3qVBo6TzI1ON6sycSBKkymb9L0=
@ -169,8 +169,8 @@ github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxF
github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=
github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ=
github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-openapi/analysis v0.21.2/go.mod h1:HZwRk4RRisyG8vx2Oe6aqeSQcoxRp47Xkp3+K6q+LdY=
@ -250,8 +250,8 @@ github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw
github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg=
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
github.com/golang-jwt/jwt/v5 v5.0.0 h1:1n1XNM9hk7O9mnQoNBGolZvzebBQ7p93ULHRc28XJUE=
github.com/golang-jwt/jwt/v5 v5.0.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang-jwt/jwt/v5 v5.2.0 h1:d/ix8ftRUorsN+5eMIlF4T6J8CAt9rch3My2winC1Jw=
github.com/golang-jwt/jwt/v5 v5.2.0/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ=
@ -298,8 +298,8 @@ github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/enterprise-certificate-proxy v0.3.2 h1:Vie5ybvEvT75RniqhfFxPRy3Bf7vr3h0cechB90XaQs=
github.com/googleapis/enterprise-certificate-proxy v0.3.2/go.mod h1:VLSiSSBs/ksPL8kq3OBOQ6WRI2QnaFynd1DCjZ62+V0=
github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas=
@ -366,8 +366,9 @@ github.com/jackc/pgtype v0.0.0-20190421001408-4ed0de4755e0/go.mod h1:hdSHsc1V01C
github.com/jackc/pgtype v0.0.0-20190824184912-ab885b375b90/go.mod h1:KcahbBH1nCMSo2DXpzsoWOAfFkdEtEJpPbVLq8eE+mc=
github.com/jackc/pgtype v0.0.0-20190828014616-a8802b16cc59/go.mod h1:MWlu30kVJrUS8lot6TQqcg7mtthZ9T0EoIBFiJcmcyw=
github.com/jackc/pgtype v1.8.1-0.20210724151600-32e20a603178/go.mod h1:C516IlIV9NKqfsMCXTdChteoXmwgUceqaLfjg2e3NlM=
github.com/jackc/pgtype v1.14.0 h1:y+xUdabmyMkJLyApYuPj38mW+aAIqCe5uuBB51rH3Vw=
github.com/jackc/pgtype v1.14.0/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4=
github.com/jackc/pgtype v1.14.1 h1:LyDar7M2K0tShCWqzJ/ctzF1QC3Wzc9c8a6cHE0PFdc=
github.com/jackc/pgtype v1.14.1/go.mod h1:LUMuVrfsFfdKGLw+AFFVv6KtHOFMwRgDDzBt76IqCA4=
github.com/jackc/pgx/v4 v4.0.0-20190420224344-cc3461e65d96/go.mod h1:mdxmSJJuR08CZQyj1PVQBHy9XOp5p8/SHH6a0psbY9Y=
github.com/jackc/pgx/v4 v4.0.0-20190421002000-1b8f0016e912/go.mod h1:no/Y67Jkk/9WuGR0JG/JseM9irFbnEPbuWV2EELPNuM=
github.com/jackc/pgx/v4 v4.0.0-pre1.0.20190824185557-6972a5742186/go.mod h1:X+GQnOEnf1dqHGpw7JmHqHc1NxDoalibchSk9/RWuDc=
@ -495,12 +496,12 @@ github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bl
github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0=
github.com/opencontainers/selinux v1.11.0 h1:+5Zbo97w3Lbmb3PeqQtpmTkMwsW5nRI3YaLpt7tQ7oU=
github.com/opencontainers/selinux v1.11.0/go.mod h1:E5dMC3VPuVvVHDYmi78qvhJp8+M586T4DlDRYpFkyec=
github.com/openshift-online/ocm-sdk-go v0.1.390 h1:J6mqjOFiid1OQ9Gshr4hjCeJiX2UnvFIDlB1mwQxFmI=
github.com/openshift-online/ocm-sdk-go v0.1.390/go.mod h1:/+VFIw1iW2H0jEkFH4GnbL/liWareyzsL0w7mDIudB4=
github.com/openshift-online/ocm-sdk-go v0.1.398 h1:6C1mDcPxzG4jSduOaWixTTI5gSEO+Jm7OW/00jVoWGI=
github.com/openshift-online/ocm-sdk-go v0.1.398/go.mod h1:tke8vKcE7eHKyRbkJv6qo4ljo919zhx04uyQTcgF5cQ=
github.com/oracle/oci-go-sdk/v54 v54.0.0 h1:CDLjeSejv2aDpElAJrhKpi6zvT/zhZCZuXchUUZ+LS4=
github.com/oracle/oci-go-sdk/v54 v54.0.0/go.mod h1:+t+yvcFGVp+3ZnztnyxqXfQDsMlq8U25faBLa+mqCMc=
github.com/osbuild/images v0.33.0 h1:/3/eJc2awu9Tklb8hMdCyjVsYbF22UknktiS+cCjXhE=
github.com/osbuild/images v0.33.0/go.mod h1:1oM2pbLkppS3jOqMQMJAVcx1agS3sEe7vD6uSS61ZeM=
github.com/osbuild/images v0.34.0 h1:pT26WdvrLIrxBv1VxhOWALhWgE3n+6H7K/bQPhdPBb0=
github.com/osbuild/images v0.34.0/go.mod h1:1oM2pbLkppS3jOqMQMJAVcx1agS3sEe7vD6uSS61ZeM=
github.com/osbuild/osbuild-composer/pkg/splunk_logger v0.0.0-20231117174845-e969a9dc3cd1 h1:UFEJIcPa46W8gtWgOYzriRKYyy1t6SWL0BI7fPTuVvc=
github.com/osbuild/osbuild-composer/pkg/splunk_logger v0.0.0-20231117174845-e969a9dc3cd1/go.mod h1:z+WA+dX6qMwc7fqY5jCzESDIlg4WR2sBQezxsoXv9Ik=
github.com/osbuild/pulp-client v0.1.0 h1:L0C4ezBJGTamN3BKdv+rKLuq/WxXJbsFwz/Hj7aEmJ8=
@ -509,8 +510,8 @@ github.com/ostreedev/ostree-go v0.0.0-20210805093236-719684c64e4f h1:/UDgs8FGMqw
github.com/ostreedev/ostree-go v0.0.0-20210805093236-719684c64e4f/go.mod h1:J6OG6YJVEWopen4avK3VNQSnALmmjvniMmni/YFYAwc=
github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU=
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU=
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ=
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
@ -560,6 +561,8 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB
github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966 h1:JIAuq3EEf9cgbU6AtGPK4CTG3Zf6CKMNqf0MHTggAUA=
github.com/skratchdot/open-golang v0.0.0-20200116055534-eef842397966/go.mod h1:sUM3LWHvSMaG192sy56D9F7CNvL7jUJVXoqM1QKLnog=
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b h1:br+bPNZsJWKicw/5rALEo67QHs5weyD5tf8WST+4sJ0=
github.com/sony/gobreaker v0.4.2-0.20210216022020-dd874f9dd33b/go.mod h1:ZKptC7FHNvhBz7dN2LGjPVBz2sZJmc0/PkyDJOjmxWY=
github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
@ -637,17 +640,17 @@ go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352 h1:CCriYyAfq1Br1aIYettdH
go.mozilla.org/pkcs7 v0.0.0-20210826202110-33d05740a352/go.mod h1:SNgMg+EgDFwmvSmLRTNKC5fegJjB7v23qTQ0XLGUNHk=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo=
go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
go.opentelemetry.io/otel/sdk v1.19.0 h1:6USY6zH+L8uMH8L3t1enZPR3WFEmSTADlqldyHtJi3o=
go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc=
go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw=
go.opentelemetry.io/otel v1.22.0 h1:xS7Ku+7yTFvDfDraDIJVpw7XPyuHlB9MCiqqX5mcJ6Y=
go.opentelemetry.io/otel v1.22.0/go.mod h1:eoV4iAi3Ea8LkAEI9+GFT44O6T/D0GWAVFyZVCC6pMI=
go.opentelemetry.io/otel/metric v1.22.0 h1:lypMQnGyJYeuYPhOM/bgjbFM6WE44W1/T45er4d8Hhg=
go.opentelemetry.io/otel/metric v1.22.0/go.mod h1:evJGjVpZv0mQ5QBRJoBF64yMuOf4xCWdXjK8pzFvliY=
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
go.opentelemetry.io/otel/trace v1.22.0 h1:Hg6pPujv0XG9QaVbGOBVHunyuLcCC3jN7WEhPx83XD0=
go.opentelemetry.io/otel/trace v1.22.0/go.mod h1:RbbHXVqKES9QhzZq/fE5UnOSILqRt40a21sPw2He1xo=
go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/atomic v1.5.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
@ -751,11 +754,11 @@ golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
@ -809,9 +812,9 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk=
google.golang.org/api v0.157.0 h1:ORAeqmbrrozeyw5NjnMxh7peHO0UzV4wWYSwZeCUb20=
google.golang.org/api v0.157.0/go.mod h1:+z4v4ufbZ1WEpld6yMGHyggs+PmAHiaLNj5ytP3N01g=
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
google.golang.org/api v0.161.0 h1:oYzk/bs26WN10AV7iU7MVJVXBH8oCPS2hHyBiEeFoSU=
google.golang.org/api v0.161.0/go.mod h1:0mu0TpK33qnydLvWqbImq2b1eQ5FHRSDCBzAxX9ZHyw=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
@ -819,10 +822,10 @@ google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJ
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917 h1:nz5NESFLZbJGPFxDT/HCn+V1mZ8JGNoY4nUpmW/Y2eg=
google.golang.org/genproto v0.0.0-20240102182953-50ed04b92917/go.mod h1:pZqR+glSb11aJ+JQcczCvgf47+duRuzNSKqE8YAQnV0=
google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917 h1:rcS6EyEaoCO52hQDupoSfrxI3R6C2Tq741is7X8OvnM=
google.golang.org/genproto/googleapis/api v0.0.0-20240102182953-50ed04b92917/go.mod h1:CmlNWB9lSezaYELKS5Ym1r44VrrbPUa7JTvw+6MbpJ0=
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg=
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k=
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe h1:0poefMBYvYbs7g5UkjS6HcxBPaTRAmznle9jnxYoAI8=
google.golang.org/genproto/googleapis/api v0.0.0-20240125205218-1f4bbc51befe/go.mod h1:4jWUdICTdgc3Ibxmr8nAJiiLHwQBY0UI0XZcEMaFKaA=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac h1:nUQEQmH/csSvFECKYRv6HWEyypysidKl2I6Qpsglq/0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:daQN87bsDqDoe316QbbvX60nMoJQa4r6Ds0ZuoAe5yA=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
@ -830,8 +833,8 @@ google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyac
google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU=
google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM=
google.golang.org/grpc v1.61.0 h1:TOvOcuXn30kRao+gfcvsebNEa5iZIiLkisYEkf7R7o0=
google.golang.org/grpc v1.61.0/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs=
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -191,7 +191,9 @@ func NewAcceleratorTypesRESTClient(ctx context.Context, opts ...option.ClientOpt
func defaultAcceleratorTypesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -261,6 +263,9 @@ func (c *acceleratorTypesRESTClient) AggregatedList(ctx context.Context, req *co
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -479,103 +484,3 @@ func (c *acceleratorTypesRESTClient) List(ctx context.Context, req *computepb.Li
return it
}
// AcceleratorTypeIterator manages a stream of *computepb.AcceleratorType.
type AcceleratorTypeIterator struct {
items []*computepb.AcceleratorType
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.AcceleratorType, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *AcceleratorTypeIterator) 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 *AcceleratorTypeIterator) Next() (*computepb.AcceleratorType, error) {
var item *computepb.AcceleratorType
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *AcceleratorTypeIterator) bufLen() int {
return len(it.items)
}
func (it *AcceleratorTypeIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// AcceleratorTypesScopedListPair is a holder type for string/*computepb.AcceleratorTypesScopedList map entries
type AcceleratorTypesScopedListPair struct {
Key string
Value *computepb.AcceleratorTypesScopedList
}
// AcceleratorTypesScopedListPairIterator manages a stream of AcceleratorTypesScopedListPair.
type AcceleratorTypesScopedListPairIterator struct {
items []AcceleratorTypesScopedListPair
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 []AcceleratorTypesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *AcceleratorTypesScopedListPairIterator) 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 *AcceleratorTypesScopedListPairIterator) Next() (AcceleratorTypesScopedListPair, error) {
var item AcceleratorTypesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *AcceleratorTypesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *AcceleratorTypesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -241,7 +241,9 @@ func NewAddressesRESTClient(ctx context.Context, opts ...option.ClientOption) (*
func defaultAddressesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -314,6 +316,9 @@ func (c *addressesRESTClient) AggregatedList(ctx context.Context, req *computepb
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -833,103 +838,3 @@ func (c *addressesRESTClient) SetLabels(ctx context.Context, req *computepb.SetL
}
return op, nil
}
// AddressIterator manages a stream of *computepb.Address.
type AddressIterator struct {
items []*computepb.Address
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.Address, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *AddressIterator) 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 *AddressIterator) Next() (*computepb.Address, error) {
var item *computepb.Address
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *AddressIterator) bufLen() int {
return len(it.items)
}
func (it *AddressIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// AddressesScopedListPair is a holder type for string/*computepb.AddressesScopedList map entries
type AddressesScopedListPair struct {
Key string
Value *computepb.AddressesScopedList
}
// AddressesScopedListPairIterator manages a stream of AddressesScopedListPair.
type AddressesScopedListPairIterator struct {
items []AddressesScopedListPair
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 []AddressesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *AddressesScopedListPairIterator) 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 *AddressesScopedListPairIterator) Next() (AddressesScopedListPair, error) {
var item AddressesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *AddressesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *AddressesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -241,7 +241,9 @@ func NewAutoscalersRESTClient(ctx context.Context, opts ...option.ClientOption)
func defaultAutoscalersRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -314,6 +316,9 @@ func (c *autoscalersRESTClient) AggregatedList(ctx context.Context, req *compute
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -839,103 +844,3 @@ func (c *autoscalersRESTClient) Update(ctx context.Context, req *computepb.Updat
}
return op, nil
}
// AutoscalerIterator manages a stream of *computepb.Autoscaler.
type AutoscalerIterator struct {
items []*computepb.Autoscaler
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.Autoscaler, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *AutoscalerIterator) 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 *AutoscalerIterator) Next() (*computepb.Autoscaler, error) {
var item *computepb.Autoscaler
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *AutoscalerIterator) bufLen() int {
return len(it.items)
}
func (it *AutoscalerIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// AutoscalersScopedListPair is a holder type for string/*computepb.AutoscalersScopedList map entries
type AutoscalersScopedListPair struct {
Key string
Value *computepb.AutoscalersScopedList
}
// AutoscalersScopedListPairIterator manages a stream of AutoscalersScopedListPair.
type AutoscalersScopedListPairIterator struct {
items []AutoscalersScopedListPair
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 []AutoscalersScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *AutoscalersScopedListPairIterator) 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 *AutoscalersScopedListPairIterator) Next() (AutoscalersScopedListPair, error) {
var item AutoscalersScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *AutoscalersScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *AutoscalersScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

5579
vendor/cloud.google.com/go/compute/apiv1/auxiliary.go generated vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -46,10 +46,13 @@ type BackendBucketsCallOptions struct {
Delete []gax.CallOption
DeleteSignedUrlKey []gax.CallOption
Get []gax.CallOption
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetEdgeSecurityPolicy []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
@ -76,6 +79,18 @@ func defaultBackendBucketsRESTCallOptions() *BackendBucketsCallOptions {
http.StatusServiceUnavailable)
}),
},
GetIamPolicy: []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)
}),
},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
@ -97,6 +112,12 @@ func defaultBackendBucketsRESTCallOptions() *BackendBucketsCallOptions {
SetEdgeSecurityPolicy: []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),
},
@ -112,10 +133,13 @@ type internalBackendBucketsClient interface {
Delete(context.Context, *computepb.DeleteBackendBucketRequest, ...gax.CallOption) (*Operation, error)
DeleteSignedUrlKey(context.Context, *computepb.DeleteSignedUrlKeyBackendBucketRequest, ...gax.CallOption) (*Operation, error)
Get(context.Context, *computepb.GetBackendBucketRequest, ...gax.CallOption) (*computepb.BackendBucket, error)
GetIamPolicy(context.Context, *computepb.GetIamPolicyBackendBucketRequest, ...gax.CallOption) (*computepb.Policy, error)
Insert(context.Context, *computepb.InsertBackendBucketRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListBackendBucketsRequest, ...gax.CallOption) *BackendBucketIterator
Patch(context.Context, *computepb.PatchBackendBucketRequest, ...gax.CallOption) (*Operation, error)
SetEdgeSecurityPolicy(context.Context, *computepb.SetEdgeSecurityPolicyBackendBucketRequest, ...gax.CallOption) (*Operation, error)
SetIamPolicy(context.Context, *computepb.SetIamPolicyBackendBucketRequest, ...gax.CallOption) (*computepb.Policy, error)
TestIamPermissions(context.Context, *computepb.TestIamPermissionsBackendBucketRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
Update(context.Context, *computepb.UpdateBackendBucketRequest, ...gax.CallOption) (*Operation, error)
}
@ -174,6 +198,11 @@ func (c *BackendBucketsClient) Get(ctx context.Context, req *computepb.GetBacken
return c.internalClient.Get(ctx, req, opts...)
}
// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
func (c *BackendBucketsClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Policy, error) {
return c.internalClient.GetIamPolicy(ctx, req, opts...)
}
// Insert creates a BackendBucket resource in the specified project using the data included in the request.
func (c *BackendBucketsClient) Insert(ctx context.Context, req *computepb.InsertBackendBucketRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Insert(ctx, req, opts...)
@ -194,6 +223,16 @@ func (c *BackendBucketsClient) SetEdgeSecurityPolicy(ctx context.Context, req *c
return c.internalClient.SetEdgeSecurityPolicy(ctx, req, opts...)
}
// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
func (c *BackendBucketsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Policy, error) {
return c.internalClient.SetIamPolicy(ctx, req, opts...)
}
// TestIamPermissions returns permissions that a caller has on the specified resource.
func (c *BackendBucketsClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsBackendBucketRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) {
return c.internalClient.TestIamPermissions(ctx, req, opts...)
}
// Update updates the specified BackendBucket resource with the data included in the request.
func (c *BackendBucketsClient) Update(ctx context.Context, req *computepb.UpdateBackendBucketRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Update(ctx, req, opts...)
@ -251,7 +290,9 @@ func NewBackendBucketsRESTClient(ctx context.Context, opts ...option.ClientOptio
func defaultBackendBucketsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -554,6 +595,68 @@ func (c *backendBucketsRESTClient) Get(ctx context.Context, req *computepb.GetBa
return resp, nil
}
// GetIamPolicy gets the access control policy for a resource. May be empty if no such policy or resource exists.
func (c *backendBucketsRESTClient) GetIamPolicy(ctx context.Context, req *computepb.GetIamPolicyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Policy, error) {
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/backendBuckets/%v/getIamPolicy", req.GetProject(), req.GetResource())
params := url.Values{}
if req != nil && req.OptionsRequestedPolicyVersion != nil {
params.Add("optionsRequestedPolicyVersion", fmt.Sprintf("%v", req.GetOptionsRequestedPolicyVersion()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "resource", url.QueryEscape(req.GetResource()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).GetIamPolicy[0:len((*c.CallOptions).GetIamPolicy):len((*c.CallOptions).GetIamPolicy)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Policy{}
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
}
// Insert creates a BackendBucket resource in the specified project using the data included in the request.
func (c *backendBucketsRESTClient) Insert(ctx context.Context, req *computepb.InsertBackendBucketRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -879,6 +982,130 @@ func (c *backendBucketsRESTClient) SetEdgeSecurityPolicy(ctx context.Context, re
return op, nil
}
// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
func (c *backendBucketsRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyBackendBucketRequest, opts ...gax.CallOption) (*computepb.Policy, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetGlobalSetPolicyRequestResource()
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/backendBuckets/%v/setIamPolicy", req.GetProject(), req.GetResource())
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "resource", url.QueryEscape(req.GetResource()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).SetIamPolicy[0:len((*c.CallOptions).SetIamPolicy):len((*c.CallOptions).SetIamPolicy)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.Policy{}
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
}
return resp, nil
}
// TestIamPermissions returns permissions that a caller has on the specified resource.
func (c *backendBucketsRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsBackendBucketRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetTestPermissionsRequestResource()
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/backendBuckets/%v/testIamPermissions", req.GetProject(), req.GetResource())
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "resource", url.QueryEscape(req.GetResource()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.TestPermissionsResponse{}
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
}
return resp, nil
}
// Update updates the specified BackendBucket resource with the data included in the request.
func (c *backendBucketsRESTClient) Update(ctx context.Context, req *computepb.UpdateBackendBucketRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -954,50 +1181,3 @@ func (c *backendBucketsRESTClient) Update(ctx context.Context, req *computepb.Up
}
return op, nil
}
// BackendBucketIterator manages a stream of *computepb.BackendBucket.
type BackendBucketIterator struct {
items []*computepb.BackendBucket
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.BackendBucket, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *BackendBucketIterator) 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 *BackendBucketIterator) Next() (*computepb.BackendBucket, error) {
var item *computepb.BackendBucket
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *BackendBucketIterator) bufLen() int {
return len(it.items)
}
func (it *BackendBucketIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -52,10 +52,12 @@ type BackendServicesCallOptions struct {
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListUsable []gax.CallOption
Patch []gax.CallOption
SetEdgeSecurityPolicy []gax.CallOption
SetIamPolicy []gax.CallOption
SetSecurityPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
@ -124,6 +126,18 @@ func defaultBackendServicesRESTCallOptions() *BackendServicesCallOptions {
http.StatusServiceUnavailable)
}),
},
ListUsable: []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)
}),
},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
@ -136,6 +150,9 @@ func defaultBackendServicesRESTCallOptions() *BackendServicesCallOptions {
SetSecurityPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
@ -156,10 +173,12 @@ type internalBackendServicesClient interface {
GetIamPolicy(context.Context, *computepb.GetIamPolicyBackendServiceRequest, ...gax.CallOption) (*computepb.Policy, error)
Insert(context.Context, *computepb.InsertBackendServiceRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListBackendServicesRequest, ...gax.CallOption) *BackendServiceIterator
ListUsable(context.Context, *computepb.ListUsableBackendServicesRequest, ...gax.CallOption) *BackendServiceIterator
Patch(context.Context, *computepb.PatchBackendServiceRequest, ...gax.CallOption) (*Operation, error)
SetEdgeSecurityPolicy(context.Context, *computepb.SetEdgeSecurityPolicyBackendServiceRequest, ...gax.CallOption) (*Operation, error)
SetIamPolicy(context.Context, *computepb.SetIamPolicyBackendServiceRequest, ...gax.CallOption) (*computepb.Policy, error)
SetSecurityPolicy(context.Context, *computepb.SetSecurityPolicyBackendServiceRequest, ...gax.CallOption) (*Operation, error)
TestIamPermissions(context.Context, *computepb.TestIamPermissionsBackendServiceRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
Update(context.Context, *computepb.UpdateBackendServiceRequest, ...gax.CallOption) (*Operation, error)
}
@ -243,6 +262,11 @@ func (c *BackendServicesClient) List(ctx context.Context, req *computepb.ListBac
return c.internalClient.List(ctx, req, opts...)
}
// ListUsable retrieves an aggregated list of all usable backend services in the specified project.
func (c *BackendServicesClient) ListUsable(ctx context.Context, req *computepb.ListUsableBackendServicesRequest, opts ...gax.CallOption) *BackendServiceIterator {
return c.internalClient.ListUsable(ctx, req, opts...)
}
// Patch patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
func (c *BackendServicesClient) Patch(ctx context.Context, req *computepb.PatchBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Patch(ctx, req, opts...)
@ -263,6 +287,11 @@ func (c *BackendServicesClient) SetSecurityPolicy(ctx context.Context, req *comp
return c.internalClient.SetSecurityPolicy(ctx, req, opts...)
}
// TestIamPermissions returns permissions that a caller has on the specified resource.
func (c *BackendServicesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsBackendServiceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) {
return c.internalClient.TestIamPermissions(ctx, req, opts...)
}
// Update updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview.
func (c *BackendServicesClient) Update(ctx context.Context, req *computepb.UpdateBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Update(ctx, req, opts...)
@ -320,7 +349,9 @@ func NewBackendServicesRESTClient(ctx context.Context, opts ...option.ClientOpti
func defaultBackendServicesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -469,6 +500,9 @@ func (c *backendServicesRESTClient) AggregatedList(ctx context.Context, req *com
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -1027,6 +1061,103 @@ func (c *backendServicesRESTClient) List(ctx context.Context, req *computepb.Lis
return it
}
// ListUsable retrieves an aggregated list of all usable backend services in the specified project.
func (c *backendServicesRESTClient) ListUsable(ctx context.Context, req *computepb.ListUsableBackendServicesRequest, opts ...gax.CallOption) *BackendServiceIterator {
it := &BackendServiceIterator{}
req = proto.Clone(req).(*computepb.ListUsableBackendServicesRequest)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
it.InternalFetch = func(pageSize int, pageToken string) ([]*computepb.BackendService, string, error) {
resp := &computepb.BackendServiceListUsable{}
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/backendServices/listUsable", 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.
hds := append(c.xGoogHeaders, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
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
}
// Patch patches the specified BackendService resource with the data included in the request. For more information, see Backend services overview. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
func (c *backendServicesRESTClient) Patch(ctx context.Context, req *computepb.PatchBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -1317,6 +1448,68 @@ func (c *backendServicesRESTClient) SetSecurityPolicy(ctx context.Context, req *
return op, nil
}
// TestIamPermissions returns permissions that a caller has on the specified resource.
func (c *backendServicesRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsBackendServiceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetTestPermissionsRequestResource()
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/backendServices/%v/testIamPermissions", req.GetProject(), req.GetResource())
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "resource", url.QueryEscape(req.GetResource()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.TestPermissionsResponse{}
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
}
return resp, nil
}
// Update updates the specified BackendService resource with the data included in the request. For more information, see Backend services overview.
func (c *backendServicesRESTClient) Update(ctx context.Context, req *computepb.UpdateBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -1392,103 +1585,3 @@ func (c *backendServicesRESTClient) Update(ctx context.Context, req *computepb.U
}
return op, nil
}
// BackendServiceIterator manages a stream of *computepb.BackendService.
type BackendServiceIterator struct {
items []*computepb.BackendService
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.BackendService, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *BackendServiceIterator) 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 *BackendServiceIterator) Next() (*computepb.BackendService, error) {
var item *computepb.BackendService
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *BackendServiceIterator) bufLen() int {
return len(it.items)
}
func (it *BackendServiceIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// BackendServicesScopedListPair is a holder type for string/*computepb.BackendServicesScopedList map entries
type BackendServicesScopedListPair struct {
Key string
Value *computepb.BackendServicesScopedList
}
// BackendServicesScopedListPairIterator manages a stream of BackendServicesScopedListPair.
type BackendServicesScopedListPairIterator struct {
items []BackendServicesScopedListPair
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 []BackendServicesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *BackendServicesScopedListPairIterator) 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 *BackendServicesScopedListPairIterator) Next() (BackendServicesScopedListPair, error) {
var item BackendServicesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *BackendServicesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *BackendServicesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -187,7 +187,9 @@ func NewDiskTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*
func defaultDiskTypesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -257,6 +259,9 @@ func (c *diskTypesRESTClient) AggregatedList(ctx context.Context, req *computepb
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -475,103 +480,3 @@ func (c *diskTypesRESTClient) List(ctx context.Context, req *computepb.ListDiskT
return it
}
// DiskTypeIterator manages a stream of *computepb.DiskType.
type DiskTypeIterator struct {
items []*computepb.DiskType
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.DiskType, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *DiskTypeIterator) 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 *DiskTypeIterator) Next() (*computepb.DiskType, error) {
var item *computepb.DiskType
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *DiskTypeIterator) bufLen() int {
return len(it.items)
}
func (it *DiskTypeIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// DiskTypesScopedListPair is a holder type for string/*computepb.DiskTypesScopedList map entries
type DiskTypesScopedListPair struct {
Key string
Value *computepb.DiskTypesScopedList
}
// DiskTypesScopedListPairIterator manages a stream of DiskTypesScopedListPair.
type DiskTypesScopedListPairIterator struct {
items []DiskTypesScopedListPair
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 []DiskTypesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *DiskTypesScopedListPairIterator) 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 *DiskTypesScopedListPairIterator) Next() (DiskTypesScopedListPair, error) {
var item DiskTypesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *DiskTypesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *DiskTypesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -360,7 +360,9 @@ func NewDisksRESTClient(ctx context.Context, opts ...option.ClientOption) (*Disk
func defaultDisksRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -510,6 +512,9 @@ func (c *disksRESTClient) AggregatedList(ctx context.Context, req *computepb.Agg
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -1759,103 +1764,3 @@ func (c *disksRESTClient) Update(ctx context.Context, req *computepb.UpdateDiskR
}
return op, nil
}
// DiskIterator manages a stream of *computepb.Disk.
type DiskIterator struct {
items []*computepb.Disk
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.Disk, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *DiskIterator) 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 *DiskIterator) Next() (*computepb.Disk, error) {
var item *computepb.Disk
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *DiskIterator) bufLen() int {
return len(it.items)
}
func (it *DiskIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// DisksScopedListPair is a holder type for string/*computepb.DisksScopedList map entries
type DisksScopedListPair struct {
Key string
Value *computepb.DisksScopedList
}
// DisksScopedListPairIterator manages a stream of DisksScopedListPair.
type DisksScopedListPairIterator struct {
items []DisksScopedListPair
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 []DisksScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *DisksScopedListPairIterator) 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 *DisksScopedListPairIterator) Next() (DisksScopedListPair, error) {
var item DisksScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *DisksScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *DisksScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -221,7 +221,9 @@ func NewExternalVpnGatewaysRESTClient(ctx context.Context, opts ...option.Client
func defaultExternalVpnGatewaysRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -681,50 +683,3 @@ func (c *externalVpnGatewaysRESTClient) TestIamPermissions(ctx context.Context,
}
return resp, nil
}
// ExternalVpnGatewayIterator manages a stream of *computepb.ExternalVpnGateway.
type ExternalVpnGatewayIterator struct {
items []*computepb.ExternalVpnGateway
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.ExternalVpnGateway, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ExternalVpnGatewayIterator) 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 *ExternalVpnGatewayIterator) Next() (*computepb.ExternalVpnGateway, error) {
var item *computepb.ExternalVpnGateway
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ExternalVpnGatewayIterator) bufLen() int {
return len(it.items)
}
func (it *ExternalVpnGatewayIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -377,7 +377,9 @@ func NewFirewallPoliciesRESTClient(ctx context.Context, opts ...option.ClientOpt
func defaultFirewallPoliciesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -1662,50 +1664,3 @@ func (c *firewallPoliciesRESTClient) TestIamPermissions(ctx context.Context, req
}
return resp, nil
}
// FirewallPolicyIterator manages a stream of *computepb.FirewallPolicy.
type FirewallPolicyIterator struct {
items []*computepb.FirewallPolicy
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.FirewallPolicy, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *FirewallPolicyIterator) 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 *FirewallPolicyIterator) Next() (*computepb.FirewallPolicy, error) {
var item *computepb.FirewallPolicy
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *FirewallPolicyIterator) bufLen() int {
return len(it.items)
}
func (it *FirewallPolicyIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -221,7 +221,9 @@ func NewFirewallsRESTClient(ctx context.Context, opts ...option.ClientOption) (*
func defaultFirewallsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -702,50 +704,3 @@ func (c *firewallsRESTClient) Update(ctx context.Context, req *computepb.UpdateF
}
return op, nil
}
// FirewallIterator manages a stream of *computepb.Firewall.
type FirewallIterator struct {
items []*computepb.Firewall
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.Firewall, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *FirewallIterator) 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 *FirewallIterator) Next() (*computepb.Firewall, error) {
var item *computepb.Firewall
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *FirewallIterator) bufLen() int {
return len(it.items)
}
func (it *FirewallIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -251,7 +251,9 @@ func NewForwardingRulesRESTClient(ctx context.Context, opts ...option.ClientOpti
func defaultForwardingRulesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -324,6 +326,9 @@ func (c *forwardingRulesRESTClient) AggregatedList(ctx context.Context, req *com
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -920,103 +925,3 @@ func (c *forwardingRulesRESTClient) SetTarget(ctx context.Context, req *computep
}
return op, nil
}
// ForwardingRuleIterator manages a stream of *computepb.ForwardingRule.
type ForwardingRuleIterator struct {
items []*computepb.ForwardingRule
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.ForwardingRule, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ForwardingRuleIterator) 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 *ForwardingRuleIterator) Next() (*computepb.ForwardingRule, error) {
var item *computepb.ForwardingRule
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ForwardingRuleIterator) bufLen() int {
return len(it.items)
}
func (it *ForwardingRuleIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// ForwardingRulesScopedListPair is a holder type for string/*computepb.ForwardingRulesScopedList map entries
type ForwardingRulesScopedListPair struct {
Key string
Value *computepb.ForwardingRulesScopedList
}
// ForwardingRulesScopedListPairIterator manages a stream of ForwardingRulesScopedListPair.
type ForwardingRulesScopedListPairIterator struct {
items []ForwardingRulesScopedListPair
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 []ForwardingRulesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ForwardingRulesScopedListPairIterator) 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 *ForwardingRulesScopedListPairIterator) Next() (ForwardingRulesScopedListPair, error) {
var item ForwardingRulesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ForwardingRulesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *ForwardingRulesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -142,6 +142,11 @@
"Get"
]
},
"GetIamPolicy": {
"methods": [
"GetIamPolicy"
]
},
"Insert": {
"methods": [
"Insert"
@ -162,6 +167,16 @@
"SetEdgeSecurityPolicy"
]
},
"SetIamPolicy": {
"methods": [
"SetIamPolicy"
]
},
"TestIamPermissions": {
"methods": [
"TestIamPermissions"
]
},
"Update": {
"methods": [
"Update"
@ -221,6 +236,11 @@
"List"
]
},
"ListUsable": {
"methods": [
"ListUsable"
]
},
"Patch": {
"methods": [
"Patch"
@ -241,6 +261,11 @@
"SetSecurityPolicy"
]
},
"TestIamPermissions": {
"methods": [
"TestIamPermissions"
]
},
"Update": {
"methods": [
"Update"
@ -1317,6 +1342,11 @@
"SetScheduling"
]
},
"SetSecurityPolicy": {
"methods": [
"SetSecurityPolicy"
]
},
"SetServiceAccount": {
"methods": [
"SetServiceAccount"
@ -1493,6 +1523,11 @@
"GetDiagnostics"
]
},
"GetMacsecConfig": {
"methods": [
"GetMacsecConfig"
]
},
"Insert": {
"methods": [
"Insert"
@ -1683,6 +1718,11 @@
"List"
]
},
"Patch": {
"methods": [
"Patch"
]
},
"SetIamPolicy": {
"methods": [
"SetIamPolicy"
@ -2213,6 +2253,11 @@
"rest": {
"libraryClient": "PublicAdvertisedPrefixesClient",
"rpcs": {
"Announce": {
"methods": [
"Announce"
]
},
"Delete": {
"methods": [
"Delete"
@ -2237,6 +2282,11 @@
"methods": [
"Patch"
]
},
"Withdraw": {
"methods": [
"Withdraw"
]
}
}
}
@ -2252,6 +2302,11 @@
"AggregatedList"
]
},
"Announce": {
"methods": [
"Announce"
]
},
"Delete": {
"methods": [
"Delete"
@ -2276,6 +2331,11 @@
"methods": [
"Patch"
]
},
"Withdraw": {
"methods": [
"Withdraw"
]
}
}
}
@ -2355,6 +2415,11 @@
"List"
]
},
"ListUsable": {
"methods": [
"ListUsable"
]
},
"Patch": {
"methods": [
"Patch"
@ -2365,6 +2430,16 @@
"SetIamPolicy"
]
},
"SetSecurityPolicy": {
"methods": [
"SetSecurityPolicy"
]
},
"TestIamPermissions": {
"methods": [
"TestIamPermissions"
]
},
"Update": {
"methods": [
"Update"
@ -2775,11 +2850,21 @@
"rest": {
"libraryClient": "RegionNetworkEndpointGroupsClient",
"rpcs": {
"AttachNetworkEndpoints": {
"methods": [
"AttachNetworkEndpoints"
]
},
"Delete": {
"methods": [
"Delete"
]
},
"DetachNetworkEndpoints": {
"methods": [
"DetachNetworkEndpoints"
]
},
"Get": {
"methods": [
"Get"
@ -2794,6 +2879,11 @@
"methods": [
"List"
]
},
"ListNetworkEndpoints": {
"methods": [
"ListNetworkEndpoints"
]
}
}
}
@ -2956,6 +3046,11 @@
"rest": {
"libraryClient": "RegionSecurityPoliciesClient",
"rpcs": {
"AddRule": {
"methods": [
"AddRule"
]
},
"Delete": {
"methods": [
"Delete"
@ -2966,6 +3061,11 @@
"Get"
]
},
"GetRule": {
"methods": [
"GetRule"
]
},
"Insert": {
"methods": [
"Insert"
@ -2980,6 +3080,16 @@
"methods": [
"Patch"
]
},
"PatchRule": {
"methods": [
"PatchRule"
]
},
"RemoveRule": {
"methods": [
"RemoveRule"
]
}
}
}
@ -3356,6 +3466,11 @@
"Get"
]
},
"GetNatIpInfo": {
"methods": [
"GetNatIpInfo"
]
},
"GetNatMappingInfo": {
"methods": [
"GetNatMappingInfo"
@ -3547,6 +3662,25 @@
}
}
},
"SnapshotSettingsService": {
"clients": {
"rest": {
"libraryClient": "SnapshotSettingsClient",
"rpcs": {
"Get": {
"methods": [
"Get"
]
},
"Patch": {
"methods": [
"Patch"
]
}
}
}
}
},
"Snapshots": {
"clients": {
"rest": {
@ -3914,6 +4048,11 @@
"methods": [
"List"
]
},
"SetSecurityPolicy": {
"methods": [
"SetSecurityPolicy"
]
}
}
}
@ -3978,6 +4117,11 @@
"methods": [
"SetBackup"
]
},
"SetSecurityPolicy": {
"methods": [
"SetSecurityPolicy"
]
}
}
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -221,7 +221,9 @@ func NewGlobalAddressesRESTClient(ctx context.Context, opts ...option.ClientOpti
func defaultGlobalAddressesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -231,7 +231,9 @@ func NewGlobalForwardingRulesRESTClient(ctx context.Context, opts ...option.Clie
func defaultGlobalForwardingRulesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -231,7 +231,9 @@ func NewGlobalNetworkEndpointGroupsRESTClient(ctx context.Context, opts ...optio
func defaultGlobalNetworkEndpointGroupsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -809,97 +811,3 @@ func (c *globalNetworkEndpointGroupsRESTClient) ListNetworkEndpoints(ctx context
return it
}
// NetworkEndpointGroupIterator manages a stream of *computepb.NetworkEndpointGroup.
type NetworkEndpointGroupIterator struct {
items []*computepb.NetworkEndpointGroup
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.NetworkEndpointGroup, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NetworkEndpointGroupIterator) 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 *NetworkEndpointGroupIterator) Next() (*computepb.NetworkEndpointGroup, error) {
var item *computepb.NetworkEndpointGroup
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NetworkEndpointGroupIterator) bufLen() int {
return len(it.items)
}
func (it *NetworkEndpointGroupIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// NetworkEndpointWithHealthStatusIterator manages a stream of *computepb.NetworkEndpointWithHealthStatus.
type NetworkEndpointWithHealthStatusIterator struct {
items []*computepb.NetworkEndpointWithHealthStatus
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.NetworkEndpointWithHealthStatus, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NetworkEndpointWithHealthStatusIterator) 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 *NetworkEndpointWithHealthStatusIterator) Next() (*computepb.NetworkEndpointWithHealthStatus, error) {
var item *computepb.NetworkEndpointWithHealthStatus
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NetworkEndpointWithHealthStatusIterator) bufLen() int {
return len(it.items)
}
func (it *NetworkEndpointWithHealthStatusIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -207,7 +207,9 @@ func NewGlobalOperationsRESTClient(ctx context.Context, opts ...option.ClientOpt
func defaultGlobalOperationsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -277,6 +279,9 @@ func (c *globalOperationsRESTClient) AggregatedList(ctx context.Context, req *co
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -605,103 +610,3 @@ func (c *globalOperationsRESTClient) Wait(ctx context.Context, req *computepb.Wa
}
return resp, nil
}
// OperationIterator manages a stream of *computepb.Operation.
type OperationIterator struct {
items []*computepb.Operation
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.Operation, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *OperationIterator) 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 *OperationIterator) Next() (*computepb.Operation, error) {
var item *computepb.Operation
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *OperationIterator) bufLen() int {
return len(it.items)
}
func (it *OperationIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// OperationsScopedListPair is a holder type for string/*computepb.OperationsScopedList map entries
type OperationsScopedListPair struct {
Key string
Value *computepb.OperationsScopedList
}
// OperationsScopedListPairIterator manages a stream of OperationsScopedListPair.
type OperationsScopedListPairIterator struct {
items []OperationsScopedListPair
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 []OperationsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *OperationsScopedListPairIterator) 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 *OperationsScopedListPairIterator) Next() (OperationsScopedListPair, error) {
var item OperationsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *OperationsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *OperationsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -177,7 +177,9 @@ func NewGlobalOrganizationOperationsRESTClient(ctx context.Context, opts ...opti
func defaultGlobalOrganizationOperationsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -211,7 +211,9 @@ func NewGlobalPublicDelegatedPrefixesRESTClient(ctx context.Context, opts ...opt
func defaultGlobalPublicDelegatedPrefixesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -616,50 +618,3 @@ func (c *globalPublicDelegatedPrefixesRESTClient) Patch(ctx context.Context, req
}
return op, nil
}
// PublicDelegatedPrefixIterator manages a stream of *computepb.PublicDelegatedPrefix.
type PublicDelegatedPrefixIterator struct {
items []*computepb.PublicDelegatedPrefix
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.PublicDelegatedPrefix, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *PublicDelegatedPrefixIterator) 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 *PublicDelegatedPrefixIterator) Next() (*computepb.PublicDelegatedPrefix, error) {
var item *computepb.PublicDelegatedPrefix
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *PublicDelegatedPrefixIterator) bufLen() int {
return len(it.items)
}
func (it *PublicDelegatedPrefixIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -241,7 +241,9 @@ func NewHealthChecksRESTClient(ctx context.Context, opts ...option.ClientOption)
func defaultHealthChecksRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -314,6 +316,9 @@ func (c *healthChecksRESTClient) AggregatedList(ctx context.Context, req *comput
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -829,103 +834,3 @@ func (c *healthChecksRESTClient) Update(ctx context.Context, req *computepb.Upda
}
return op, nil
}
// HealthCheckIterator manages a stream of *computepb.HealthCheck.
type HealthCheckIterator struct {
items []*computepb.HealthCheck
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.HealthCheck, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *HealthCheckIterator) 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 *HealthCheckIterator) Next() (*computepb.HealthCheck, error) {
var item *computepb.HealthCheck
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *HealthCheckIterator) bufLen() int {
return len(it.items)
}
func (it *HealthCheckIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// HealthChecksScopedListPair is a holder type for string/*computepb.HealthChecksScopedList map entries
type HealthChecksScopedListPair struct {
Key string
Value *computepb.HealthChecksScopedList
}
// HealthChecksScopedListPairIterator manages a stream of HealthChecksScopedListPair.
type HealthChecksScopedListPairIterator struct {
items []HealthChecksScopedListPair
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 []HealthChecksScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *HealthChecksScopedListPairIterator) 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 *HealthChecksScopedListPairIterator) Next() (HealthChecksScopedListPair, error) {
var item HealthChecksScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *HealthChecksScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *HealthChecksScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -145,7 +145,9 @@ func NewImageFamilyViewsRESTClient(ctx context.Context, opts ...option.ClientOpt
func defaultImageFamilyViewsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -289,7 +289,9 @@ func NewImagesRESTClient(ctx context.Context, opts ...option.ClientOption) (*Ima
func defaultImagesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -1083,50 +1085,3 @@ func (c *imagesRESTClient) TestIamPermissions(ctx context.Context, req *computep
}
return resp, nil
}
// ImageIterator manages a stream of *computepb.Image.
type ImageIterator struct {
items []*computepb.Image
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.Image, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ImageIterator) 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 *ImageIterator) Next() (*computepb.Image, error) {
var item *computepb.Image
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ImageIterator) bufLen() int {
return len(it.items)
}
func (it *ImageIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -380,7 +380,9 @@ func NewInstanceGroupManagersRESTClient(ctx context.Context, opts ...option.Clie
func defaultInstanceGroupManagersRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -530,6 +532,9 @@ func (c *instanceGroupManagersRESTClient) AggregatedList(ctx context.Context, re
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -2013,244 +2018,3 @@ func (c *instanceGroupManagersRESTClient) UpdatePerInstanceConfigs(ctx context.C
}
return op, nil
}
// InstanceGroupManagerIterator manages a stream of *computepb.InstanceGroupManager.
type InstanceGroupManagerIterator struct {
items []*computepb.InstanceGroupManager
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.InstanceGroupManager, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InstanceGroupManagerIterator) 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 *InstanceGroupManagerIterator) Next() (*computepb.InstanceGroupManager, error) {
var item *computepb.InstanceGroupManager
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InstanceGroupManagerIterator) bufLen() int {
return len(it.items)
}
func (it *InstanceGroupManagerIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// InstanceGroupManagersScopedListPair is a holder type for string/*computepb.InstanceGroupManagersScopedList map entries
type InstanceGroupManagersScopedListPair struct {
Key string
Value *computepb.InstanceGroupManagersScopedList
}
// InstanceGroupManagersScopedListPairIterator manages a stream of InstanceGroupManagersScopedListPair.
type InstanceGroupManagersScopedListPairIterator struct {
items []InstanceGroupManagersScopedListPair
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 []InstanceGroupManagersScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InstanceGroupManagersScopedListPairIterator) 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 *InstanceGroupManagersScopedListPairIterator) Next() (InstanceGroupManagersScopedListPair, error) {
var item InstanceGroupManagersScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InstanceGroupManagersScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *InstanceGroupManagersScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// InstanceManagedByIgmErrorIterator manages a stream of *computepb.InstanceManagedByIgmError.
type InstanceManagedByIgmErrorIterator struct {
items []*computepb.InstanceManagedByIgmError
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.InstanceManagedByIgmError, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InstanceManagedByIgmErrorIterator) 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 *InstanceManagedByIgmErrorIterator) Next() (*computepb.InstanceManagedByIgmError, error) {
var item *computepb.InstanceManagedByIgmError
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InstanceManagedByIgmErrorIterator) bufLen() int {
return len(it.items)
}
func (it *InstanceManagedByIgmErrorIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// ManagedInstanceIterator manages a stream of *computepb.ManagedInstance.
type ManagedInstanceIterator struct {
items []*computepb.ManagedInstance
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.ManagedInstance, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ManagedInstanceIterator) 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 *ManagedInstanceIterator) Next() (*computepb.ManagedInstance, error) {
var item *computepb.ManagedInstance
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ManagedInstanceIterator) bufLen() int {
return len(it.items)
}
func (it *ManagedInstanceIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// PerInstanceConfigIterator manages a stream of *computepb.PerInstanceConfig.
type PerInstanceConfigIterator struct {
items []*computepb.PerInstanceConfig
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.PerInstanceConfig, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *PerInstanceConfigIterator) 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 *PerInstanceConfigIterator) Next() (*computepb.PerInstanceConfig, error) {
var item *computepb.PerInstanceConfig
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *PerInstanceConfigIterator) bufLen() int {
return len(it.items)
}
func (it *PerInstanceConfigIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -261,7 +261,9 @@ func NewInstanceGroupsRESTClient(ctx context.Context, opts ...option.ClientOptio
func defaultInstanceGroupsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -411,6 +413,9 @@ func (c *instanceGroupsRESTClient) AggregatedList(ctx context.Context, req *comp
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -1033,150 +1038,3 @@ func (c *instanceGroupsRESTClient) SetNamedPorts(ctx context.Context, req *compu
}
return op, nil
}
// InstanceGroupIterator manages a stream of *computepb.InstanceGroup.
type InstanceGroupIterator struct {
items []*computepb.InstanceGroup
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.InstanceGroup, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InstanceGroupIterator) 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 *InstanceGroupIterator) Next() (*computepb.InstanceGroup, error) {
var item *computepb.InstanceGroup
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InstanceGroupIterator) bufLen() int {
return len(it.items)
}
func (it *InstanceGroupIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// InstanceGroupsScopedListPair is a holder type for string/*computepb.InstanceGroupsScopedList map entries
type InstanceGroupsScopedListPair struct {
Key string
Value *computepb.InstanceGroupsScopedList
}
// InstanceGroupsScopedListPairIterator manages a stream of InstanceGroupsScopedListPair.
type InstanceGroupsScopedListPairIterator struct {
items []InstanceGroupsScopedListPair
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 []InstanceGroupsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InstanceGroupsScopedListPairIterator) 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 *InstanceGroupsScopedListPairIterator) Next() (InstanceGroupsScopedListPair, error) {
var item InstanceGroupsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InstanceGroupsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *InstanceGroupsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// InstanceWithNamedPortsIterator manages a stream of *computepb.InstanceWithNamedPorts.
type InstanceWithNamedPortsIterator struct {
items []*computepb.InstanceWithNamedPorts
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.InstanceWithNamedPorts, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InstanceWithNamedPortsIterator) 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 *InstanceWithNamedPortsIterator) Next() (*computepb.InstanceWithNamedPorts, error) {
var item *computepb.InstanceWithNamedPorts
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InstanceWithNamedPortsIterator) bufLen() int {
return len(it.items)
}
func (it *InstanceWithNamedPortsIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -260,7 +260,9 @@ func NewInstanceTemplatesRESTClient(ctx context.Context, opts ...option.ClientOp
func defaultInstanceTemplatesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -333,6 +335,9 @@ func (c *instanceTemplatesRESTClient) AggregatedList(ctx context.Context, req *c
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -882,103 +887,3 @@ func (c *instanceTemplatesRESTClient) TestIamPermissions(ctx context.Context, re
}
return resp, nil
}
// InstanceTemplateIterator manages a stream of *computepb.InstanceTemplate.
type InstanceTemplateIterator struct {
items []*computepb.InstanceTemplate
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.InstanceTemplate, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InstanceTemplateIterator) 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 *InstanceTemplateIterator) Next() (*computepb.InstanceTemplate, error) {
var item *computepb.InstanceTemplate
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InstanceTemplateIterator) bufLen() int {
return len(it.items)
}
func (it *InstanceTemplateIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// InstanceTemplatesScopedListPair is a holder type for string/*computepb.InstanceTemplatesScopedList map entries
type InstanceTemplatesScopedListPair struct {
Key string
Value *computepb.InstanceTemplatesScopedList
}
// InstanceTemplatesScopedListPairIterator manages a stream of InstanceTemplatesScopedListPair.
type InstanceTemplatesScopedListPairIterator struct {
items []InstanceTemplatesScopedListPair
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 []InstanceTemplatesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InstanceTemplatesScopedListPairIterator) 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 *InstanceTemplatesScopedListPairIterator) Next() (InstanceTemplatesScopedListPair, error) {
var item InstanceTemplatesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InstanceTemplatesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *InstanceTemplatesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -75,6 +75,7 @@ type InstancesCallOptions struct {
SetMinCpuPlatform []gax.CallOption
SetName []gax.CallOption
SetScheduling []gax.CallOption
SetSecurityPolicy []gax.CallOption
SetServiceAccount []gax.CallOption
SetShieldedInstanceIntegrityPolicy []gax.CallOption
SetTags []gax.CallOption
@ -279,6 +280,9 @@ func defaultInstancesRESTCallOptions() *InstancesCallOptions {
SetScheduling: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetSecurityPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetServiceAccount: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
@ -361,6 +365,7 @@ type internalInstancesClient interface {
SetMinCpuPlatform(context.Context, *computepb.SetMinCpuPlatformInstanceRequest, ...gax.CallOption) (*Operation, error)
SetName(context.Context, *computepb.SetNameInstanceRequest, ...gax.CallOption) (*Operation, error)
SetScheduling(context.Context, *computepb.SetSchedulingInstanceRequest, ...gax.CallOption) (*Operation, error)
SetSecurityPolicy(context.Context, *computepb.SetSecurityPolicyInstanceRequest, ...gax.CallOption) (*Operation, error)
SetServiceAccount(context.Context, *computepb.SetServiceAccountInstanceRequest, ...gax.CallOption) (*Operation, error)
SetShieldedInstanceIntegrityPolicy(context.Context, *computepb.SetShieldedInstanceIntegrityPolicyInstanceRequest, ...gax.CallOption) (*Operation, error)
SetTags(context.Context, *computepb.SetTagsInstanceRequest, ...gax.CallOption) (*Operation, error)
@ -572,6 +577,11 @@ func (c *InstancesClient) SetScheduling(ctx context.Context, req *computepb.SetS
return c.internalClient.SetScheduling(ctx, req, opts...)
}
// SetSecurityPolicy sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview
func (c *InstancesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyInstanceRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.SetSecurityPolicy(ctx, req, opts...)
}
// SetServiceAccount sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
func (c *InstancesClient) SetServiceAccount(ctx context.Context, req *computepb.SetServiceAccountInstanceRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.SetServiceAccount(ctx, req, opts...)
@ -694,7 +704,9 @@ func NewInstancesRESTClient(ctx context.Context, opts ...option.ClientOption) (*
func defaultInstancesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -922,6 +934,9 @@ func (c *instancesRESTClient) AggregatedList(ctx context.Context, req *computepb
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -3071,6 +3086,83 @@ func (c *instancesRESTClient) SetScheduling(ctx context.Context, req *computepb.
return op, nil
}
// SetSecurityPolicy sets the Google Cloud Armor security policy for the specified instance. For more information, see Google Cloud Armor Overview
func (c *instancesRESTClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyInstanceRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetInstancesSetSecurityPolicyRequestResource()
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/instances/%v/setSecurityPolicy", 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.
hds := []string{"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()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).SetSecurityPolicy[0:len((*c.CallOptions).SetSecurityPolicy):len((*c.CallOptions).SetSecurityPolicy)], 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
}
// SetServiceAccount sets the service account on the instance. For more information, read Changing the service account and access scopes for an instance.
func (c *instancesRESTClient) SetServiceAccount(ctx context.Context, req *computepb.SetServiceAccountInstanceRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -4119,150 +4211,3 @@ func (c *instancesRESTClient) UpdateShieldedInstanceConfig(ctx context.Context,
}
return op, nil
}
// InstanceIterator manages a stream of *computepb.Instance.
type InstanceIterator struct {
items []*computepb.Instance
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.Instance, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InstanceIterator) 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 *InstanceIterator) Next() (*computepb.Instance, error) {
var item *computepb.Instance
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InstanceIterator) bufLen() int {
return len(it.items)
}
func (it *InstanceIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// InstancesScopedListPair is a holder type for string/*computepb.InstancesScopedList map entries
type InstancesScopedListPair struct {
Key string
Value *computepb.InstancesScopedList
}
// InstancesScopedListPairIterator manages a stream of InstancesScopedListPair.
type InstancesScopedListPairIterator struct {
items []InstancesScopedListPair
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 []InstancesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InstancesScopedListPairIterator) 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 *InstancesScopedListPairIterator) Next() (InstancesScopedListPair, error) {
var item InstancesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InstancesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *InstancesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// ReferenceIterator manages a stream of *computepb.Reference.
type ReferenceIterator struct {
items []*computepb.Reference
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.Reference, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ReferenceIterator) 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 *ReferenceIterator) Next() (*computepb.Reference, error) {
var item *computepb.Reference
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ReferenceIterator) bufLen() int {
return len(it.items)
}
func (it *ReferenceIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -241,7 +241,9 @@ func NewInterconnectAttachmentsRESTClient(ctx context.Context, opts ...option.Cl
func defaultInterconnectAttachmentsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -314,6 +316,9 @@ func (c *interconnectAttachmentsRESTClient) AggregatedList(ctx context.Context,
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -836,103 +841,3 @@ func (c *interconnectAttachmentsRESTClient) SetLabels(ctx context.Context, req *
}
return op, nil
}
// InterconnectAttachmentIterator manages a stream of *computepb.InterconnectAttachment.
type InterconnectAttachmentIterator struct {
items []*computepb.InterconnectAttachment
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.InterconnectAttachment, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InterconnectAttachmentIterator) 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 *InterconnectAttachmentIterator) Next() (*computepb.InterconnectAttachment, error) {
var item *computepb.InterconnectAttachment
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InterconnectAttachmentIterator) bufLen() int {
return len(it.items)
}
func (it *InterconnectAttachmentIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// InterconnectAttachmentsScopedListPair is a holder type for string/*computepb.InterconnectAttachmentsScopedList map entries
type InterconnectAttachmentsScopedListPair struct {
Key string
Value *computepb.InterconnectAttachmentsScopedList
}
// InterconnectAttachmentsScopedListPairIterator manages a stream of InterconnectAttachmentsScopedListPair.
type InterconnectAttachmentsScopedListPairIterator struct {
items []InterconnectAttachmentsScopedListPair
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 []InterconnectAttachmentsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InterconnectAttachmentsScopedListPairIterator) 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 *InterconnectAttachmentsScopedListPairIterator) Next() (InterconnectAttachmentsScopedListPair, error) {
var item InterconnectAttachmentsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InterconnectAttachmentsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *InterconnectAttachmentsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -167,7 +167,9 @@ func NewInterconnectLocationsRESTClient(ctx context.Context, opts ...option.Clie
func defaultInterconnectLocationsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -348,50 +350,3 @@ func (c *interconnectLocationsRESTClient) List(ctx context.Context, req *compute
return it
}
// InterconnectLocationIterator manages a stream of *computepb.InterconnectLocation.
type InterconnectLocationIterator struct {
items []*computepb.InterconnectLocation
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.InterconnectLocation, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InterconnectLocationIterator) 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 *InterconnectLocationIterator) Next() (*computepb.InterconnectLocation, error) {
var item *computepb.InterconnectLocation
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InterconnectLocationIterator) bufLen() int {
return len(it.items)
}
func (it *InterconnectLocationIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -167,7 +167,9 @@ func NewInterconnectRemoteLocationsRESTClient(ctx context.Context, opts ...optio
func defaultInterconnectRemoteLocationsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -348,50 +350,3 @@ func (c *interconnectRemoteLocationsRESTClient) List(ctx context.Context, req *c
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

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -45,6 +45,7 @@ type InterconnectsCallOptions struct {
Delete []gax.CallOption
Get []gax.CallOption
GetDiagnostics []gax.CallOption
GetMacsecConfig []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
@ -80,6 +81,18 @@ func defaultInterconnectsRESTCallOptions() *InterconnectsCallOptions {
http.StatusServiceUnavailable)
}),
},
GetMacsecConfig: []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)
}),
},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
@ -112,6 +125,7 @@ type internalInterconnectsClient interface {
Delete(context.Context, *computepb.DeleteInterconnectRequest, ...gax.CallOption) (*Operation, error)
Get(context.Context, *computepb.GetInterconnectRequest, ...gax.CallOption) (*computepb.Interconnect, error)
GetDiagnostics(context.Context, *computepb.GetDiagnosticsInterconnectRequest, ...gax.CallOption) (*computepb.InterconnectsGetDiagnosticsResponse, error)
GetMacsecConfig(context.Context, *computepb.GetMacsecConfigInterconnectRequest, ...gax.CallOption) (*computepb.InterconnectsGetMacsecConfigResponse, error)
Insert(context.Context, *computepb.InsertInterconnectRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListInterconnectsRequest, ...gax.CallOption) *InterconnectIterator
Patch(context.Context, *computepb.PatchInterconnectRequest, ...gax.CallOption) (*Operation, error)
@ -163,11 +177,16 @@ func (c *InterconnectsClient) Get(ctx context.Context, req *computepb.GetInterco
return c.internalClient.Get(ctx, req, opts...)
}
// GetDiagnostics returns the interconnectDiagnostics for the specified Interconnect.
// GetDiagnostics returns the interconnectDiagnostics for the specified Interconnect. In the event of a global outage, do not use this API to make decisions about where to redirect your network traffic. Unlike a VLAN attachment, which is regional, a Cloud Interconnect connection is a global resource. A global outage can prevent this API from functioning properly.
func (c *InterconnectsClient) GetDiagnostics(ctx context.Context, req *computepb.GetDiagnosticsInterconnectRequest, opts ...gax.CallOption) (*computepb.InterconnectsGetDiagnosticsResponse, error) {
return c.internalClient.GetDiagnostics(ctx, req, opts...)
}
// GetMacsecConfig returns the interconnectMacsecConfig for the specified Interconnect.
func (c *InterconnectsClient) GetMacsecConfig(ctx context.Context, req *computepb.GetMacsecConfigInterconnectRequest, opts ...gax.CallOption) (*computepb.InterconnectsGetMacsecConfigResponse, error) {
return c.internalClient.GetMacsecConfig(ctx, req, opts...)
}
// Insert creates an Interconnect in the specified project using the data included in the request.
func (c *InterconnectsClient) Insert(ctx context.Context, req *computepb.InsertInterconnectRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Insert(ctx, req, opts...)
@ -240,7 +259,9 @@ func NewInterconnectsRESTClient(ctx context.Context, opts ...option.ClientOption
func defaultInterconnectsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -397,7 +418,7 @@ func (c *interconnectsRESTClient) Get(ctx context.Context, req *computepb.GetInt
return resp, nil
}
// GetDiagnostics returns the interconnectDiagnostics for the specified Interconnect.
// GetDiagnostics returns the interconnectDiagnostics for the specified Interconnect. In the event of a global outage, do not use this API to make decisions about where to redirect your network traffic. Unlike a VLAN attachment, which is regional, a Cloud Interconnect connection is a global resource. A global outage can prevent this API from functioning properly.
func (c *interconnectsRESTClient) GetDiagnostics(ctx context.Context, req *computepb.GetDiagnosticsInterconnectRequest, opts ...gax.CallOption) (*computepb.InterconnectsGetDiagnosticsResponse, error) {
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
@ -452,6 +473,61 @@ func (c *interconnectsRESTClient) GetDiagnostics(ctx context.Context, req *compu
return resp, nil
}
// GetMacsecConfig returns the interconnectMacsecConfig for the specified Interconnect.
func (c *interconnectsRESTClient) GetMacsecConfig(ctx context.Context, req *computepb.GetMacsecConfigInterconnectRequest, opts ...gax.CallOption) (*computepb.InterconnectsGetMacsecConfigResponse, error) {
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/interconnects/%v/getMacsecConfig", req.GetProject(), req.GetInterconnect())
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "interconnect", url.QueryEscape(req.GetInterconnect()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).GetMacsecConfig[0:len((*c.CallOptions).GetMacsecConfig):len((*c.CallOptions).GetMacsecConfig)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.InterconnectsGetMacsecConfigResponse{}
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
}
// Insert creates an Interconnect in the specified project using the data included in the request.
func (c *interconnectsRESTClient) Insert(ctx context.Context, req *computepb.InsertInterconnectRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -769,50 +845,3 @@ func (c *interconnectsRESTClient) SetLabels(ctx context.Context, req *computepb.
}
return op, nil
}
// InterconnectIterator manages a stream of *computepb.Interconnect.
type InterconnectIterator struct {
items []*computepb.Interconnect
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.Interconnect, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *InterconnectIterator) 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 *InterconnectIterator) Next() (*computepb.Interconnect, error) {
var item *computepb.Interconnect
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *InterconnectIterator) bufLen() int {
return len(it.items)
}
func (it *InterconnectIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -156,7 +156,9 @@ func NewLicenseCodesRESTClient(ctx context.Context, opts ...option.ClientOption)
func defaultLicenseCodesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -240,7 +240,9 @@ func NewLicensesRESTClient(ctx context.Context, opts ...option.ClientOption) (*L
func defaultLicensesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -755,50 +757,3 @@ func (c *licensesRESTClient) TestIamPermissions(ctx context.Context, req *comput
}
return resp, nil
}
// LicenseIterator manages a stream of *computepb.License.
type LicenseIterator struct {
items []*computepb.License
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.License, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *LicenseIterator) 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 *LicenseIterator) Next() (*computepb.License, error) {
var item *computepb.License
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *LicenseIterator) bufLen() int {
return len(it.items)
}
func (it *LicenseIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -240,7 +240,9 @@ func NewMachineImagesRESTClient(ctx context.Context, opts ...option.ClientOption
func defaultMachineImagesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -758,50 +760,3 @@ func (c *machineImagesRESTClient) TestIamPermissions(ctx context.Context, req *c
}
return resp, nil
}
// MachineImageIterator manages a stream of *computepb.MachineImage.
type MachineImageIterator struct {
items []*computepb.MachineImage
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.MachineImage, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *MachineImageIterator) 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 *MachineImageIterator) Next() (*computepb.MachineImage, error) {
var item *computepb.MachineImage
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *MachineImageIterator) bufLen() int {
return len(it.items)
}
func (it *MachineImageIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -187,7 +187,9 @@ func NewMachineTypesRESTClient(ctx context.Context, opts ...option.ClientOption)
func defaultMachineTypesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -257,6 +259,9 @@ func (c *machineTypesRESTClient) AggregatedList(ctx context.Context, req *comput
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -475,103 +480,3 @@ func (c *machineTypesRESTClient) List(ctx context.Context, req *computepb.ListMa
return it
}
// MachineTypeIterator manages a stream of *computepb.MachineType.
type MachineTypeIterator struct {
items []*computepb.MachineType
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.MachineType, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *MachineTypeIterator) 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 *MachineTypeIterator) Next() (*computepb.MachineType, error) {
var item *computepb.MachineType
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *MachineTypeIterator) bufLen() int {
return len(it.items)
}
func (it *MachineTypeIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// MachineTypesScopedListPair is a holder type for string/*computepb.MachineTypesScopedList map entries
type MachineTypesScopedListPair struct {
Key string
Value *computepb.MachineTypesScopedList
}
// MachineTypesScopedListPairIterator manages a stream of MachineTypesScopedListPair.
type MachineTypesScopedListPairIterator struct {
items []MachineTypesScopedListPair
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 []MachineTypesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *MachineTypesScopedListPairIterator) 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 *MachineTypesScopedListPairIterator) Next() (MachineTypesScopedListPair, error) {
var item MachineTypesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *MachineTypesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *MachineTypesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -49,6 +49,7 @@ type NetworkAttachmentsCallOptions struct {
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
SetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
@ -109,6 +110,9 @@ func defaultNetworkAttachmentsRESTCallOptions() *NetworkAttachmentsCallOptions {
http.StatusServiceUnavailable)
}),
},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
@ -129,6 +133,7 @@ type internalNetworkAttachmentsClient interface {
GetIamPolicy(context.Context, *computepb.GetIamPolicyNetworkAttachmentRequest, ...gax.CallOption) (*computepb.Policy, error)
Insert(context.Context, *computepb.InsertNetworkAttachmentRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListNetworkAttachmentsRequest, ...gax.CallOption) *NetworkAttachmentIterator
Patch(context.Context, *computepb.PatchNetworkAttachmentRequest, ...gax.CallOption) (*Operation, error)
SetIamPolicy(context.Context, *computepb.SetIamPolicyNetworkAttachmentRequest, ...gax.CallOption) (*computepb.Policy, error)
TestIamPermissions(context.Context, *computepb.TestIamPermissionsNetworkAttachmentRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
}
@ -198,6 +203,11 @@ func (c *NetworkAttachmentsClient) List(ctx context.Context, req *computepb.List
return c.internalClient.List(ctx, req, opts...)
}
// Patch patches the specified NetworkAttachment resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.
func (c *NetworkAttachmentsClient) Patch(ctx context.Context, req *computepb.PatchNetworkAttachmentRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Patch(ctx, req, opts...)
}
// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
func (c *NetworkAttachmentsClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNetworkAttachmentRequest, opts ...gax.CallOption) (*computepb.Policy, error) {
return c.internalClient.SetIamPolicy(ctx, req, opts...)
@ -260,7 +270,9 @@ func NewNetworkAttachmentsRESTClient(ctx context.Context, opts ...option.ClientO
func defaultNetworkAttachmentsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -333,6 +345,9 @@ func (c *networkAttachmentsRESTClient) AggregatedList(ctx context.Context, req *
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -761,6 +776,83 @@ func (c *networkAttachmentsRESTClient) List(ctx context.Context, req *computepb.
return it
}
// Patch patches the specified NetworkAttachment resource with the data included in the request. This method supports PATCH semantics and uses JSON merge patch format and processing rules.
func (c *networkAttachmentsRESTClient) Patch(ctx context.Context, req *computepb.PatchNetworkAttachmentRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetNetworkAttachmentResource()
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/networkAttachments/%v", req.GetProject(), req.GetRegion(), req.GetNetworkAttachment())
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.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "network_attachment", url.QueryEscape(req.GetNetworkAttachment()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).Patch[0:len((*c.CallOptions).Patch):len((*c.CallOptions).Patch)], 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("PATCH", 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
}
// SetIamPolicy sets the access control policy on the specified resource. Replaces any existing policy.
func (c *networkAttachmentsRESTClient) SetIamPolicy(ctx context.Context, req *computepb.SetIamPolicyNetworkAttachmentRequest, opts ...gax.CallOption) (*computepb.Policy, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -884,103 +976,3 @@ func (c *networkAttachmentsRESTClient) TestIamPermissions(ctx context.Context, r
}
return resp, nil
}
// NetworkAttachmentIterator manages a stream of *computepb.NetworkAttachment.
type NetworkAttachmentIterator struct {
items []*computepb.NetworkAttachment
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.NetworkAttachment, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NetworkAttachmentIterator) 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 *NetworkAttachmentIterator) Next() (*computepb.NetworkAttachment, error) {
var item *computepb.NetworkAttachment
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NetworkAttachmentIterator) bufLen() int {
return len(it.items)
}
func (it *NetworkAttachmentIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// NetworkAttachmentsScopedListPair is a holder type for string/*computepb.NetworkAttachmentsScopedList map entries
type NetworkAttachmentsScopedListPair struct {
Key string
Value *computepb.NetworkAttachmentsScopedList
}
// NetworkAttachmentsScopedListPairIterator manages a stream of NetworkAttachmentsScopedListPair.
type NetworkAttachmentsScopedListPairIterator struct {
items []NetworkAttachmentsScopedListPair
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 []NetworkAttachmentsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NetworkAttachmentsScopedListPairIterator) 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 *NetworkAttachmentsScopedListPairIterator) Next() (NetworkAttachmentsScopedListPair, error) {
var item NetworkAttachmentsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NetworkAttachmentsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *NetworkAttachmentsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -212,7 +212,9 @@ func NewNetworkEdgeSecurityServicesRESTClient(ctx context.Context, opts ...optio
func defaultNetworkEdgeSecurityServicesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -285,6 +287,9 @@ func (c *networkEdgeSecurityServicesRESTClient) AggregatedList(ctx context.Conte
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -639,56 +644,3 @@ func (c *networkEdgeSecurityServicesRESTClient) Patch(ctx context.Context, req *
}
return op, nil
}
// NetworkEdgeSecurityServicesScopedListPair is a holder type for string/*computepb.NetworkEdgeSecurityServicesScopedList map entries
type NetworkEdgeSecurityServicesScopedListPair struct {
Key string
Value *computepb.NetworkEdgeSecurityServicesScopedList
}
// NetworkEdgeSecurityServicesScopedListPairIterator manages a stream of NetworkEdgeSecurityServicesScopedListPair.
type NetworkEdgeSecurityServicesScopedListPairIterator struct {
items []NetworkEdgeSecurityServicesScopedListPair
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 []NetworkEdgeSecurityServicesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NetworkEdgeSecurityServicesScopedListPairIterator) 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 *NetworkEdgeSecurityServicesScopedListPairIterator) Next() (NetworkEdgeSecurityServicesScopedListPair, error) {
var item NetworkEdgeSecurityServicesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NetworkEdgeSecurityServicesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *NetworkEdgeSecurityServicesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -261,7 +261,9 @@ func NewNetworkEndpointGroupsRESTClient(ctx context.Context, opts ...option.Clie
func defaultNetworkEndpointGroupsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -334,6 +336,9 @@ func (c *networkEndpointGroupsRESTClient) AggregatedList(ctx context.Context, re
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -1018,56 +1023,3 @@ func (c *networkEndpointGroupsRESTClient) TestIamPermissions(ctx context.Context
}
return resp, nil
}
// NetworkEndpointGroupsScopedListPair is a holder type for string/*computepb.NetworkEndpointGroupsScopedList map entries
type NetworkEndpointGroupsScopedListPair struct {
Key string
Value *computepb.NetworkEndpointGroupsScopedList
}
// NetworkEndpointGroupsScopedListPairIterator manages a stream of NetworkEndpointGroupsScopedListPair.
type NetworkEndpointGroupsScopedListPairIterator struct {
items []NetworkEndpointGroupsScopedListPair
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 []NetworkEndpointGroupsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NetworkEndpointGroupsScopedListPairIterator) 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 *NetworkEndpointGroupsScopedListPairIterator) Next() (NetworkEndpointGroupsScopedListPair, error) {
var item NetworkEndpointGroupsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NetworkEndpointGroupsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *NetworkEndpointGroupsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -348,7 +348,9 @@ func NewNetworkFirewallPoliciesRESTClient(ctx context.Context, opts ...option.Cl
func defaultNetworkFirewallPoliciesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -289,7 +289,9 @@ func NewNetworksRESTClient(ctx context.Context, opts ...option.ClientOption) (*N
func defaultNetworksRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -1152,97 +1154,3 @@ func (c *networksRESTClient) UpdatePeering(ctx context.Context, req *computepb.U
}
return op, nil
}
// ExchangedPeeringRouteIterator manages a stream of *computepb.ExchangedPeeringRoute.
type ExchangedPeeringRouteIterator struct {
items []*computepb.ExchangedPeeringRoute
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.ExchangedPeeringRoute, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ExchangedPeeringRouteIterator) 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 *ExchangedPeeringRouteIterator) Next() (*computepb.ExchangedPeeringRoute, error) {
var item *computepb.ExchangedPeeringRoute
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ExchangedPeeringRouteIterator) bufLen() int {
return len(it.items)
}
func (it *ExchangedPeeringRouteIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// NetworkIterator manages a stream of *computepb.Network.
type NetworkIterator struct {
items []*computepb.Network
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.Network, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NetworkIterator) 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 *NetworkIterator) Next() (*computepb.Network, error) {
var item *computepb.Network
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NetworkIterator) bufLen() int {
return len(it.items)
}
func (it *NetworkIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -320,7 +320,9 @@ func NewNodeGroupsRESTClient(ctx context.Context, opts ...option.ClientOption) (
func defaultNodeGroupsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -470,6 +472,9 @@ func (c *nodeGroupsRESTClient) AggregatedList(ctx context.Context, req *computep
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -1427,150 +1432,3 @@ func (c *nodeGroupsRESTClient) TestIamPermissions(ctx context.Context, req *comp
}
return resp, nil
}
// NodeGroupIterator manages a stream of *computepb.NodeGroup.
type NodeGroupIterator struct {
items []*computepb.NodeGroup
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.NodeGroup, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NodeGroupIterator) 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 *NodeGroupIterator) Next() (*computepb.NodeGroup, error) {
var item *computepb.NodeGroup
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NodeGroupIterator) bufLen() int {
return len(it.items)
}
func (it *NodeGroupIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// NodeGroupNodeIterator manages a stream of *computepb.NodeGroupNode.
type NodeGroupNodeIterator struct {
items []*computepb.NodeGroupNode
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.NodeGroupNode, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NodeGroupNodeIterator) 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 *NodeGroupNodeIterator) Next() (*computepb.NodeGroupNode, error) {
var item *computepb.NodeGroupNode
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NodeGroupNodeIterator) bufLen() int {
return len(it.items)
}
func (it *NodeGroupNodeIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// NodeGroupsScopedListPair is a holder type for string/*computepb.NodeGroupsScopedList map entries
type NodeGroupsScopedListPair struct {
Key string
Value *computepb.NodeGroupsScopedList
}
// NodeGroupsScopedListPairIterator manages a stream of NodeGroupsScopedListPair.
type NodeGroupsScopedListPairIterator struct {
items []NodeGroupsScopedListPair
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 []NodeGroupsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NodeGroupsScopedListPairIterator) 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 *NodeGroupsScopedListPairIterator) Next() (NodeGroupsScopedListPair, error) {
var item NodeGroupsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NodeGroupsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *NodeGroupsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -260,7 +260,9 @@ func NewNodeTemplatesRESTClient(ctx context.Context, opts ...option.ClientOption
func defaultNodeTemplatesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -333,6 +335,9 @@ func (c *nodeTemplatesRESTClient) AggregatedList(ctx context.Context, req *compu
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -884,103 +889,3 @@ func (c *nodeTemplatesRESTClient) TestIamPermissions(ctx context.Context, req *c
}
return resp, nil
}
// NodeTemplateIterator manages a stream of *computepb.NodeTemplate.
type NodeTemplateIterator struct {
items []*computepb.NodeTemplate
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.NodeTemplate, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NodeTemplateIterator) 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 *NodeTemplateIterator) Next() (*computepb.NodeTemplate, error) {
var item *computepb.NodeTemplate
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NodeTemplateIterator) bufLen() int {
return len(it.items)
}
func (it *NodeTemplateIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// NodeTemplatesScopedListPair is a holder type for string/*computepb.NodeTemplatesScopedList map entries
type NodeTemplatesScopedListPair struct {
Key string
Value *computepb.NodeTemplatesScopedList
}
// NodeTemplatesScopedListPairIterator manages a stream of NodeTemplatesScopedListPair.
type NodeTemplatesScopedListPairIterator struct {
items []NodeTemplatesScopedListPair
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 []NodeTemplatesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NodeTemplatesScopedListPairIterator) 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 *NodeTemplatesScopedListPairIterator) Next() (NodeTemplatesScopedListPair, error) {
var item NodeTemplatesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NodeTemplatesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *NodeTemplatesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -187,7 +187,9 @@ func NewNodeTypesRESTClient(ctx context.Context, opts ...option.ClientOption) (*
func defaultNodeTypesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -257,6 +259,9 @@ func (c *nodeTypesRESTClient) AggregatedList(ctx context.Context, req *computepb
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -475,103 +480,3 @@ func (c *nodeTypesRESTClient) List(ctx context.Context, req *computepb.ListNodeT
return it
}
// NodeTypeIterator manages a stream of *computepb.NodeType.
type NodeTypeIterator struct {
items []*computepb.NodeType
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.NodeType, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NodeTypeIterator) 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 *NodeTypeIterator) Next() (*computepb.NodeType, error) {
var item *computepb.NodeType
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NodeTypeIterator) bufLen() int {
return len(it.items)
}
func (it *NodeTypeIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// NodeTypesScopedListPair is a holder type for string/*computepb.NodeTypesScopedList map entries
type NodeTypesScopedListPair struct {
Key string
Value *computepb.NodeTypesScopedList
}
// NodeTypesScopedListPairIterator manages a stream of NodeTypesScopedListPair.
type NodeTypesScopedListPairIterator struct {
items []NodeTypesScopedListPair
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 []NodeTypesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NodeTypesScopedListPairIterator) 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 *NodeTypesScopedListPairIterator) Next() (NodeTypesScopedListPair, error) {
var item NodeTypesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NodeTypesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *NodeTypesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -241,7 +241,9 @@ func NewPacketMirroringsRESTClient(ctx context.Context, opts ...option.ClientOpt
func defaultPacketMirroringsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -314,6 +316,9 @@ func (c *packetMirroringsRESTClient) AggregatedList(ctx context.Context, req *co
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -818,103 +823,3 @@ func (c *packetMirroringsRESTClient) TestIamPermissions(ctx context.Context, req
}
return resp, nil
}
// PacketMirroringIterator manages a stream of *computepb.PacketMirroring.
type PacketMirroringIterator struct {
items []*computepb.PacketMirroring
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.PacketMirroring, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *PacketMirroringIterator) 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 *PacketMirroringIterator) Next() (*computepb.PacketMirroring, error) {
var item *computepb.PacketMirroring
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *PacketMirroringIterator) bufLen() int {
return len(it.items)
}
func (it *PacketMirroringIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// PacketMirroringsScopedListPair is a holder type for string/*computepb.PacketMirroringsScopedList map entries
type PacketMirroringsScopedListPair struct {
Key string
Value *computepb.PacketMirroringsScopedList
}
// PacketMirroringsScopedListPairIterator manages a stream of PacketMirroringsScopedListPair.
type PacketMirroringsScopedListPairIterator struct {
items []PacketMirroringsScopedListPair
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 []PacketMirroringsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *PacketMirroringsScopedListPairIterator) 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 *PacketMirroringsScopedListPairIterator) Next() (PacketMirroringsScopedListPair, error) {
var item PacketMirroringsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *PacketMirroringsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *PacketMirroringsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -300,7 +300,9 @@ func NewProjectsRESTClient(ctx context.Context, opts ...option.ClientOption) (*P
func defaultProjectsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -1312,97 +1314,3 @@ func (c *projectsRESTClient) SetUsageExportBucket(ctx context.Context, req *comp
}
return op, nil
}
// ProjectIterator manages a stream of *computepb.Project.
type ProjectIterator struct {
items []*computepb.Project
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.Project, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ProjectIterator) 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 *ProjectIterator) Next() (*computepb.Project, error) {
var item *computepb.Project
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ProjectIterator) bufLen() int {
return len(it.items)
}
func (it *ProjectIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// XpnResourceIdIterator manages a stream of *computepb.XpnResourceId.
type XpnResourceIdIterator struct {
items []*computepb.XpnResourceId
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.XpnResourceId, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *XpnResourceIdIterator) 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 *XpnResourceIdIterator) Next() (*computepb.XpnResourceId, error) {
var item *computepb.XpnResourceId
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *XpnResourceIdIterator) bufLen() int {
return len(it.items)
}
func (it *XpnResourceIdIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -42,15 +42,20 @@ var newPublicAdvertisedPrefixesClientHook clientHook
// PublicAdvertisedPrefixesCallOptions contains the retry settings for each method of PublicAdvertisedPrefixesClient.
type PublicAdvertisedPrefixesCallOptions struct {
Announce []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
Withdraw []gax.CallOption
}
func defaultPublicAdvertisedPrefixesRESTCallOptions() *PublicAdvertisedPrefixesCallOptions {
return &PublicAdvertisedPrefixesCallOptions{
Announce: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
@ -84,6 +89,9 @@ func defaultPublicAdvertisedPrefixesRESTCallOptions() *PublicAdvertisedPrefixesC
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Withdraw: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -92,11 +100,13 @@ type internalPublicAdvertisedPrefixesClient interface {
Close() error
setGoogleClientInfo(...string)
Connection() *grpc.ClientConn
Announce(context.Context, *computepb.AnnouncePublicAdvertisedPrefixeRequest, ...gax.CallOption) (*Operation, error)
Delete(context.Context, *computepb.DeletePublicAdvertisedPrefixeRequest, ...gax.CallOption) (*Operation, error)
Get(context.Context, *computepb.GetPublicAdvertisedPrefixeRequest, ...gax.CallOption) (*computepb.PublicAdvertisedPrefix, error)
Insert(context.Context, *computepb.InsertPublicAdvertisedPrefixeRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListPublicAdvertisedPrefixesRequest, ...gax.CallOption) *PublicAdvertisedPrefixIterator
Patch(context.Context, *computepb.PatchPublicAdvertisedPrefixeRequest, ...gax.CallOption) (*Operation, error)
Withdraw(context.Context, *computepb.WithdrawPublicAdvertisedPrefixeRequest, ...gax.CallOption) (*Operation, error)
}
// PublicAdvertisedPrefixesClient is a client for interacting with Google Compute Engine API.
@ -134,6 +144,11 @@ func (c *PublicAdvertisedPrefixesClient) Connection() *grpc.ClientConn {
return c.internalClient.Connection()
}
// Announce announces the specified PublicAdvertisedPrefix
func (c *PublicAdvertisedPrefixesClient) Announce(ctx context.Context, req *computepb.AnnouncePublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Announce(ctx, req, opts...)
}
// Delete deletes the specified PublicAdvertisedPrefix
func (c *PublicAdvertisedPrefixesClient) Delete(ctx context.Context, req *computepb.DeletePublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Delete(ctx, req, opts...)
@ -159,6 +174,11 @@ func (c *PublicAdvertisedPrefixesClient) Patch(ctx context.Context, req *compute
return c.internalClient.Patch(ctx, req, opts...)
}
// Withdraw withdraws the specified PublicAdvertisedPrefix
func (c *PublicAdvertisedPrefixesClient) Withdraw(ctx context.Context, req *computepb.WithdrawPublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Withdraw(ctx, req, opts...)
}
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type publicAdvertisedPrefixesRESTClient struct {
// The http endpoint to connect to.
@ -211,7 +231,9 @@ func NewPublicAdvertisedPrefixesRESTClient(ctx context.Context, opts ...option.C
func defaultPublicAdvertisedPrefixesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -244,6 +266,75 @@ func (c *publicAdvertisedPrefixesRESTClient) Connection() *grpc.ClientConn {
return nil
}
// Announce announces the specified PublicAdvertisedPrefix
func (c *publicAdvertisedPrefixesRESTClient) Announce(ctx context.Context, req *computepb.AnnouncePublicAdvertisedPrefixeRequest, 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/global/publicAdvertisedPrefixes/%v/announce", req.GetProject(), req.GetPublicAdvertisedPrefix())
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.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "public_advertised_prefix", url.QueryEscape(req.GetPublicAdvertisedPrefix()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).Announce[0:len((*c.CallOptions).Announce):len((*c.CallOptions).Announce)], 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{
&globalOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
},
}
return op, nil
}
// Delete deletes the specified PublicAdvertisedPrefix
func (c *publicAdvertisedPrefixesRESTClient) Delete(ctx context.Context, req *computepb.DeletePublicAdvertisedPrefixeRequest, opts ...gax.CallOption) (*Operation, error) {
baseUrl, err := url.Parse(c.endpoint)
@ -617,49 +708,71 @@ func (c *publicAdvertisedPrefixesRESTClient) Patch(ctx context.Context, req *com
return op, nil
}
// PublicAdvertisedPrefixIterator manages a stream of *computepb.PublicAdvertisedPrefix.
type PublicAdvertisedPrefixIterator struct {
items []*computepb.PublicAdvertisedPrefix
pageInfo *iterator.PageInfo
nextFunc func() error
// Withdraw withdraws the specified PublicAdvertisedPrefix
func (c *publicAdvertisedPrefixesRESTClient) Withdraw(ctx context.Context, req *computepb.WithdrawPublicAdvertisedPrefixeRequest, 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/global/publicAdvertisedPrefixes/%v/withdraw", req.GetProject(), req.GetPublicAdvertisedPrefix())
// 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.PublicAdvertisedPrefix, nextPageToken string, err error)
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *PublicAdvertisedPrefixIterator) PageInfo() *iterator.PageInfo {
return it.pageInfo
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "public_advertised_prefix", url.QueryEscape(req.GetPublicAdvertisedPrefix()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).Withdraw[0:len((*c.CallOptions).Withdraw):len((*c.CallOptions).Withdraw)], 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
}
// 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 *PublicAdvertisedPrefixIterator) Next() (*computepb.PublicAdvertisedPrefix, error) {
var item *computepb.PublicAdvertisedPrefix
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
func (it *PublicAdvertisedPrefixIterator) bufLen() int {
return len(it.items)
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
func (it *PublicAdvertisedPrefixIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
return nil
}, opts...)
if e != nil {
return nil, e
}
op := &Operation{
&globalOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
},
}
return op, nil
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -44,11 +44,13 @@ var newPublicDelegatedPrefixesClientHook clientHook
// PublicDelegatedPrefixesCallOptions contains the retry settings for each method of PublicDelegatedPrefixesClient.
type PublicDelegatedPrefixesCallOptions struct {
AggregatedList []gax.CallOption
Announce []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
Withdraw []gax.CallOption
}
func defaultPublicDelegatedPrefixesRESTCallOptions() *PublicDelegatedPrefixesCallOptions {
@ -65,6 +67,9 @@ func defaultPublicDelegatedPrefixesRESTCallOptions() *PublicDelegatedPrefixesCal
http.StatusServiceUnavailable)
}),
},
Announce: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
@ -98,6 +103,9 @@ func defaultPublicDelegatedPrefixesRESTCallOptions() *PublicDelegatedPrefixesCal
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Withdraw: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -107,11 +115,13 @@ type internalPublicDelegatedPrefixesClient interface {
setGoogleClientInfo(...string)
Connection() *grpc.ClientConn
AggregatedList(context.Context, *computepb.AggregatedListPublicDelegatedPrefixesRequest, ...gax.CallOption) *PublicDelegatedPrefixesScopedListPairIterator
Announce(context.Context, *computepb.AnnouncePublicDelegatedPrefixeRequest, ...gax.CallOption) (*Operation, error)
Delete(context.Context, *computepb.DeletePublicDelegatedPrefixeRequest, ...gax.CallOption) (*Operation, error)
Get(context.Context, *computepb.GetPublicDelegatedPrefixeRequest, ...gax.CallOption) (*computepb.PublicDelegatedPrefix, error)
Insert(context.Context, *computepb.InsertPublicDelegatedPrefixeRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListPublicDelegatedPrefixesRequest, ...gax.CallOption) *PublicDelegatedPrefixIterator
Patch(context.Context, *computepb.PatchPublicDelegatedPrefixeRequest, ...gax.CallOption) (*Operation, error)
Withdraw(context.Context, *computepb.WithdrawPublicDelegatedPrefixeRequest, ...gax.CallOption) (*Operation, error)
}
// PublicDelegatedPrefixesClient is a client for interacting with Google Compute Engine API.
@ -154,6 +164,11 @@ func (c *PublicDelegatedPrefixesClient) AggregatedList(ctx context.Context, req
return c.internalClient.AggregatedList(ctx, req, opts...)
}
// Announce announces the specified PublicDelegatedPrefix in the given region.
func (c *PublicDelegatedPrefixesClient) Announce(ctx context.Context, req *computepb.AnnouncePublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Announce(ctx, req, opts...)
}
// Delete deletes the specified PublicDelegatedPrefix in the given region.
func (c *PublicDelegatedPrefixesClient) Delete(ctx context.Context, req *computepb.DeletePublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Delete(ctx, req, opts...)
@ -179,6 +194,11 @@ func (c *PublicDelegatedPrefixesClient) Patch(ctx context.Context, req *computep
return c.internalClient.Patch(ctx, req, opts...)
}
// Withdraw withdraws the specified PublicDelegatedPrefix in the given region.
func (c *PublicDelegatedPrefixesClient) Withdraw(ctx context.Context, req *computepb.WithdrawPublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Withdraw(ctx, req, opts...)
}
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type publicDelegatedPrefixesRESTClient struct {
// The http endpoint to connect to.
@ -231,7 +251,9 @@ func NewPublicDelegatedPrefixesRESTClient(ctx context.Context, opts ...option.Cl
func defaultPublicDelegatedPrefixesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -304,6 +326,9 @@ func (c *publicDelegatedPrefixesRESTClient) AggregatedList(ctx context.Context,
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -371,6 +396,76 @@ func (c *publicDelegatedPrefixesRESTClient) AggregatedList(ctx context.Context,
return it
}
// Announce announces the specified PublicDelegatedPrefix in the given region.
func (c *publicDelegatedPrefixesRESTClient) Announce(ctx context.Context, req *computepb.AnnouncePublicDelegatedPrefixeRequest, 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/publicDelegatedPrefixes/%v/announce", req.GetProject(), req.GetRegion(), req.GetPublicDelegatedPrefix())
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.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "public_delegated_prefix", url.QueryEscape(req.GetPublicDelegatedPrefix()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).Announce[0:len((*c.CallOptions).Announce):len((*c.CallOptions).Announce)], 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
}
// Delete deletes the specified PublicDelegatedPrefix in the given region.
func (c *publicDelegatedPrefixesRESTClient) Delete(ctx context.Context, req *computepb.DeletePublicDelegatedPrefixeRequest, opts ...gax.CallOption) (*Operation, error) {
baseUrl, err := url.Parse(c.endpoint)
@ -747,55 +842,72 @@ func (c *publicDelegatedPrefixesRESTClient) Patch(ctx context.Context, req *comp
return op, nil
}
// PublicDelegatedPrefixesScopedListPair is a holder type for string/*computepb.PublicDelegatedPrefixesScopedList map entries
type PublicDelegatedPrefixesScopedListPair struct {
Key string
Value *computepb.PublicDelegatedPrefixesScopedList
// Withdraw withdraws the specified PublicDelegatedPrefix in the given region.
func (c *publicDelegatedPrefixesRESTClient) Withdraw(ctx context.Context, req *computepb.WithdrawPublicDelegatedPrefixeRequest, 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/publicDelegatedPrefixes/%v/withdraw", req.GetProject(), req.GetRegion(), req.GetPublicDelegatedPrefix())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
// PublicDelegatedPrefixesScopedListPairIterator manages a stream of PublicDelegatedPrefixesScopedListPair.
type PublicDelegatedPrefixesScopedListPairIterator struct {
items []PublicDelegatedPrefixesScopedListPair
pageInfo *iterator.PageInfo
nextFunc func() error
baseUrl.RawQuery = params.Encode()
// 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{}
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "public_delegated_prefix", url.QueryEscape(req.GetPublicDelegatedPrefix()))}
// 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 []PublicDelegatedPrefixesScopedListPair, nextPageToken string, err error)
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).Withdraw[0:len((*c.CallOptions).Withdraw):len((*c.CallOptions).Withdraw)], 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
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *PublicDelegatedPrefixesScopedListPairIterator) PageInfo() *iterator.PageInfo {
return it.pageInfo
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
// 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 *PublicDelegatedPrefixesScopedListPairIterator) Next() (PublicDelegatedPrefixesScopedListPair, error) {
var item PublicDelegatedPrefixesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
func (it *PublicDelegatedPrefixesScopedListPairIterator) bufLen() int {
return len(it.items)
return nil
}, opts...)
if e != nil {
return nil, e
}
func (it *PublicDelegatedPrefixesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
op := &Operation{
&regionOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
region: req.GetRegion(),
},
}
return op, nil
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -221,7 +221,9 @@ func NewRegionAutoscalersRESTClient(ctx context.Context, opts ...option.ClientOp
func defaultRegionAutoscalersRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -48,8 +48,11 @@ type RegionBackendServicesCallOptions struct {
GetIamPolicy []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListUsable []gax.CallOption
Patch []gax.CallOption
SetIamPolicy []gax.CallOption
SetSecurityPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
Update []gax.CallOption
}
@ -100,12 +103,30 @@ func defaultRegionBackendServicesRESTCallOptions() *RegionBackendServicesCallOpt
http.StatusServiceUnavailable)
}),
},
ListUsable: []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)
}),
},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetIamPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetSecurityPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
TestIamPermissions: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Update: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
@ -123,8 +144,11 @@ type internalRegionBackendServicesClient interface {
GetIamPolicy(context.Context, *computepb.GetIamPolicyRegionBackendServiceRequest, ...gax.CallOption) (*computepb.Policy, error)
Insert(context.Context, *computepb.InsertRegionBackendServiceRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListRegionBackendServicesRequest, ...gax.CallOption) *BackendServiceIterator
ListUsable(context.Context, *computepb.ListUsableRegionBackendServicesRequest, ...gax.CallOption) *BackendServiceIterator
Patch(context.Context, *computepb.PatchRegionBackendServiceRequest, ...gax.CallOption) (*Operation, error)
SetIamPolicy(context.Context, *computepb.SetIamPolicyRegionBackendServiceRequest, ...gax.CallOption) (*computepb.Policy, error)
SetSecurityPolicy(context.Context, *computepb.SetSecurityPolicyRegionBackendServiceRequest, ...gax.CallOption) (*Operation, error)
TestIamPermissions(context.Context, *computepb.TestIamPermissionsRegionBackendServiceRequest, ...gax.CallOption) (*computepb.TestPermissionsResponse, error)
Update(context.Context, *computepb.UpdateRegionBackendServiceRequest, ...gax.CallOption) (*Operation, error)
}
@ -193,6 +217,11 @@ func (c *RegionBackendServicesClient) List(ctx context.Context, req *computepb.L
return c.internalClient.List(ctx, req, opts...)
}
// ListUsable retrieves an aggregated list of all usable backend services in the specified project in the given region.
func (c *RegionBackendServicesClient) ListUsable(ctx context.Context, req *computepb.ListUsableRegionBackendServicesRequest, opts ...gax.CallOption) *BackendServiceIterator {
return c.internalClient.ListUsable(ctx, req, opts...)
}
// Patch updates the specified regional BackendService resource with the data included in the request. For more information, see Understanding backend services This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
func (c *RegionBackendServicesClient) Patch(ctx context.Context, req *computepb.PatchRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Patch(ctx, req, opts...)
@ -203,6 +232,16 @@ func (c *RegionBackendServicesClient) SetIamPolicy(ctx context.Context, req *com
return c.internalClient.SetIamPolicy(ctx, req, opts...)
}
// SetSecurityPolicy sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview
func (c *RegionBackendServicesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.SetSecurityPolicy(ctx, req, opts...)
}
// TestIamPermissions returns permissions that a caller has on the specified resource.
func (c *RegionBackendServicesClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) {
return c.internalClient.TestIamPermissions(ctx, req, opts...)
}
// Update updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview .
func (c *RegionBackendServicesClient) Update(ctx context.Context, req *computepb.UpdateRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Update(ctx, req, opts...)
@ -260,7 +299,9 @@ func NewRegionBackendServicesRESTClient(ctx context.Context, opts ...option.Clie
func defaultRegionBackendServicesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -716,6 +757,103 @@ func (c *regionBackendServicesRESTClient) List(ctx context.Context, req *compute
return it
}
// ListUsable retrieves an aggregated list of all usable backend services in the specified project in the given region.
func (c *regionBackendServicesRESTClient) ListUsable(ctx context.Context, req *computepb.ListUsableRegionBackendServicesRequest, opts ...gax.CallOption) *BackendServiceIterator {
it := &BackendServiceIterator{}
req = proto.Clone(req).(*computepb.ListUsableRegionBackendServicesRequest)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
it.InternalFetch = func(pageSize int, pageToken string) ([]*computepb.BackendService, string, error) {
resp := &computepb.BackendServiceListUsable{}
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/regions/%v/backendServices/listUsable", req.GetProject(), req.GetRegion())
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.
hds := append(c.xGoogHeaders, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
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
}
// Patch updates the specified regional BackendService resource with the data included in the request. For more information, see Understanding backend services This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
func (c *regionBackendServicesRESTClient) Patch(ctx context.Context, req *computepb.PatchRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -855,6 +993,145 @@ func (c *regionBackendServicesRESTClient) SetIamPolicy(ctx context.Context, req
return resp, nil
}
// SetSecurityPolicy sets the Google Cloud Armor security policy for the specified backend service. For more information, see Google Cloud Armor Overview
func (c *regionBackendServicesRESTClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetSecurityPolicyReferenceResource()
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/backendServices/%v/setSecurityPolicy", req.GetProject(), req.GetRegion(), req.GetBackendService())
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.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "backend_service", url.QueryEscape(req.GetBackendService()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).SetSecurityPolicy[0:len((*c.CallOptions).SetSecurityPolicy):len((*c.CallOptions).SetSecurityPolicy)], 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
}
// TestIamPermissions returns permissions that a caller has on the specified resource.
func (c *regionBackendServicesRESTClient) TestIamPermissions(ctx context.Context, req *computepb.TestIamPermissionsRegionBackendServiceRequest, opts ...gax.CallOption) (*computepb.TestPermissionsResponse, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetTestPermissionsRequestResource()
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/backendServices/%v/testIamPermissions", req.GetProject(), req.GetRegion(), req.GetResource())
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "resource", url.QueryEscape(req.GetResource()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).TestIamPermissions[0:len((*c.CallOptions).TestIamPermissions):len((*c.CallOptions).TestIamPermissions)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.TestPermissionsResponse{}
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
}
return resp, nil
}
// Update updates the specified regional BackendService resource with the data included in the request. For more information, see Backend services overview .
func (c *regionBackendServicesRESTClient) Update(ctx context.Context, req *computepb.UpdateRegionBackendServiceRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -221,7 +221,9 @@ func NewRegionCommitmentsRESTClient(ctx context.Context, opts ...option.ClientOp
func defaultRegionCommitmentsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -294,6 +296,9 @@ func (c *regionCommitmentsRESTClient) AggregatedList(ctx context.Context, req *c
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -672,103 +677,3 @@ func (c *regionCommitmentsRESTClient) Update(ctx context.Context, req *computepb
}
return op, nil
}
// CommitmentIterator manages a stream of *computepb.Commitment.
type CommitmentIterator struct {
items []*computepb.Commitment
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.Commitment, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *CommitmentIterator) 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 *CommitmentIterator) Next() (*computepb.Commitment, error) {
var item *computepb.Commitment
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *CommitmentIterator) bufLen() int {
return len(it.items)
}
func (it *CommitmentIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// CommitmentsScopedListPair is a holder type for string/*computepb.CommitmentsScopedList map entries
type CommitmentsScopedListPair struct {
Key string
Value *computepb.CommitmentsScopedList
}
// CommitmentsScopedListPairIterator manages a stream of CommitmentsScopedListPair.
type CommitmentsScopedListPairIterator struct {
items []CommitmentsScopedListPair
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 []CommitmentsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *CommitmentsScopedListPairIterator) 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 *CommitmentsScopedListPairIterator) Next() (CommitmentsScopedListPair, error) {
var item CommitmentsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *CommitmentsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *CommitmentsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -167,7 +167,9 @@ func NewRegionDiskTypesRESTClient(ctx context.Context, opts ...option.ClientOpti
func defaultRegionDiskTypesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -340,7 +340,9 @@ func NewRegionDisksRESTClient(ctx context.Context, opts ...option.ClientOption)
func defaultRegionDisksRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -211,7 +211,9 @@ func NewRegionHealthCheckServicesRESTClient(ctx context.Context, opts ...option.
func defaultRegionHealthCheckServicesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -619,50 +621,3 @@ func (c *regionHealthCheckServicesRESTClient) Patch(ctx context.Context, req *co
}
return op, nil
}
// HealthCheckServiceIterator manages a stream of *computepb.HealthCheckService.
type HealthCheckServiceIterator struct {
items []*computepb.HealthCheckService
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.HealthCheckService, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *HealthCheckServiceIterator) 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 *HealthCheckServiceIterator) Next() (*computepb.HealthCheckService, error) {
var item *computepb.HealthCheckService
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *HealthCheckServiceIterator) bufLen() int {
return len(it.items)
}
func (it *HealthCheckServiceIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -221,7 +221,9 @@ func NewRegionHealthChecksRESTClient(ctx context.Context, opts ...option.ClientO
func defaultRegionHealthChecksRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -360,7 +360,9 @@ func NewRegionInstanceGroupManagersRESTClient(ctx context.Context, opts ...optio
func defaultRegionInstanceGroupManagersRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -201,7 +201,9 @@ func NewRegionInstanceGroupsRESTClient(ctx context.Context, opts ...option.Clien
func defaultRegionInstanceGroupsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -201,7 +201,9 @@ func NewRegionInstanceTemplatesRESTClient(ctx context.Context, opts ...option.Cl
func defaultRegionInstanceTemplatesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -150,7 +150,9 @@ func NewRegionInstancesRESTClient(ctx context.Context, opts ...option.ClientOpti
func defaultRegionInstancesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -42,17 +42,26 @@ var newRegionNetworkEndpointGroupsClientHook clientHook
// RegionNetworkEndpointGroupsCallOptions contains the retry settings for each method of RegionNetworkEndpointGroupsClient.
type RegionNetworkEndpointGroupsCallOptions struct {
AttachNetworkEndpoints []gax.CallOption
Delete []gax.CallOption
DetachNetworkEndpoints []gax.CallOption
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
ListNetworkEndpoints []gax.CallOption
}
func defaultRegionNetworkEndpointGroupsRESTCallOptions() *RegionNetworkEndpointGroupsCallOptions {
return &RegionNetworkEndpointGroupsCallOptions{
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 {
@ -80,6 +89,9 @@ func defaultRegionNetworkEndpointGroupsRESTCallOptions() *RegionNetworkEndpointG
http.StatusServiceUnavailable)
}),
},
ListNetworkEndpoints: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -88,10 +100,13 @@ type internalRegionNetworkEndpointGroupsClient interface {
Close() error
setGoogleClientInfo(...string)
Connection() *grpc.ClientConn
AttachNetworkEndpoints(context.Context, *computepb.AttachNetworkEndpointsRegionNetworkEndpointGroupRequest, ...gax.CallOption) (*Operation, error)
Delete(context.Context, *computepb.DeleteRegionNetworkEndpointGroupRequest, ...gax.CallOption) (*Operation, error)
DetachNetworkEndpoints(context.Context, *computepb.DetachNetworkEndpointsRegionNetworkEndpointGroupRequest, ...gax.CallOption) (*Operation, error)
Get(context.Context, *computepb.GetRegionNetworkEndpointGroupRequest, ...gax.CallOption) (*computepb.NetworkEndpointGroup, error)
Insert(context.Context, *computepb.InsertRegionNetworkEndpointGroupRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListRegionNetworkEndpointGroupsRequest, ...gax.CallOption) *NetworkEndpointGroupIterator
ListNetworkEndpoints(context.Context, *computepb.ListNetworkEndpointsRegionNetworkEndpointGroupsRequest, ...gax.CallOption) *NetworkEndpointWithHealthStatusIterator
}
// RegionNetworkEndpointGroupsClient is a client for interacting with Google Compute Engine API.
@ -129,11 +144,21 @@ func (c *RegionNetworkEndpointGroupsClient) Connection() *grpc.ClientConn {
return c.internalClient.Connection()
}
// AttachNetworkEndpoints attach a list of network endpoints to the specified network endpoint group.
func (c *RegionNetworkEndpointGroupsClient) AttachNetworkEndpoints(ctx context.Context, req *computepb.AttachNetworkEndpointsRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.AttachNetworkEndpoints(ctx, req, opts...)
}
// Delete deletes the specified network endpoint group. Note that the NEG cannot be deleted if it is configured as a backend of a backend service.
func (c *RegionNetworkEndpointGroupsClient) Delete(ctx context.Context, req *computepb.DeleteRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Delete(ctx, req, opts...)
}
// DetachNetworkEndpoints detach the network endpoint from the specified network endpoint group.
func (c *RegionNetworkEndpointGroupsClient) DetachNetworkEndpoints(ctx context.Context, req *computepb.DetachNetworkEndpointsRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.DetachNetworkEndpoints(ctx, req, opts...)
}
// Get returns the specified network endpoint group.
func (c *RegionNetworkEndpointGroupsClient) Get(ctx context.Context, req *computepb.GetRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroup, error) {
return c.internalClient.Get(ctx, req, opts...)
@ -149,6 +174,11 @@ func (c *RegionNetworkEndpointGroupsClient) List(ctx context.Context, req *compu
return c.internalClient.List(ctx, req, opts...)
}
// ListNetworkEndpoints lists the network endpoints in the specified network endpoint group.
func (c *RegionNetworkEndpointGroupsClient) ListNetworkEndpoints(ctx context.Context, req *computepb.ListNetworkEndpointsRegionNetworkEndpointGroupsRequest, opts ...gax.CallOption) *NetworkEndpointWithHealthStatusIterator {
return c.internalClient.ListNetworkEndpoints(ctx, req, opts...)
}
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type regionNetworkEndpointGroupsRESTClient struct {
// The http endpoint to connect to.
@ -201,7 +231,9 @@ func NewRegionNetworkEndpointGroupsRESTClient(ctx context.Context, opts ...optio
func defaultRegionNetworkEndpointGroupsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -234,6 +266,83 @@ func (c *regionNetworkEndpointGroupsRESTClient) Connection() *grpc.ClientConn {
return nil
}
// AttachNetworkEndpoints attach a list of network endpoints to the specified network endpoint group.
func (c *regionNetworkEndpointGroupsRESTClient) AttachNetworkEndpoints(ctx context.Context, req *computepb.AttachNetworkEndpointsRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetRegionNetworkEndpointGroupsAttachEndpointsRequestResource()
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/networkEndpointGroups/%v/attachNetworkEndpoints", req.GetProject(), req.GetRegion(), req.GetNetworkEndpointGroup())
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.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "network_endpoint_group", url.QueryEscape(req.GetNetworkEndpointGroup()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).AttachNetworkEndpoints[0:len((*c.CallOptions).AttachNetworkEndpoints):len((*c.CallOptions).AttachNetworkEndpoints)], 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
}
// Delete deletes the specified network endpoint group. Note that the NEG cannot be deleted if it is configured as a backend of a backend service.
func (c *regionNetworkEndpointGroupsRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error) {
baseUrl, err := url.Parse(c.endpoint)
@ -304,6 +413,83 @@ func (c *regionNetworkEndpointGroupsRESTClient) Delete(ctx context.Context, req
return op, nil
}
// DetachNetworkEndpoints detach the network endpoint from the specified network endpoint group.
func (c *regionNetworkEndpointGroupsRESTClient) DetachNetworkEndpoints(ctx context.Context, req *computepb.DetachNetworkEndpointsRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetRegionNetworkEndpointGroupsDetachEndpointsRequestResource()
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/networkEndpointGroups/%v/detachNetworkEndpoints", req.GetProject(), req.GetRegion(), req.GetNetworkEndpointGroup())
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.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "network_endpoint_group", url.QueryEscape(req.GetNetworkEndpointGroup()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).DetachNetworkEndpoints[0:len((*c.CallOptions).DetachNetworkEndpoints):len((*c.CallOptions).DetachNetworkEndpoints)], 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
}
// Get returns the specified network endpoint group.
func (c *regionNetworkEndpointGroupsRESTClient) Get(ctx context.Context, req *computepb.GetRegionNetworkEndpointGroupRequest, opts ...gax.CallOption) (*computepb.NetworkEndpointGroup, error) {
baseUrl, err := url.Parse(c.endpoint)
@ -532,3 +718,100 @@ func (c *regionNetworkEndpointGroupsRESTClient) List(ctx context.Context, req *c
return it
}
// ListNetworkEndpoints lists the network endpoints in the specified network endpoint group.
func (c *regionNetworkEndpointGroupsRESTClient) ListNetworkEndpoints(ctx context.Context, req *computepb.ListNetworkEndpointsRegionNetworkEndpointGroupsRequest, opts ...gax.CallOption) *NetworkEndpointWithHealthStatusIterator {
it := &NetworkEndpointWithHealthStatusIterator{}
req = proto.Clone(req).(*computepb.ListNetworkEndpointsRegionNetworkEndpointGroupsRequest)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
it.InternalFetch = func(pageSize int, pageToken string) ([]*computepb.NetworkEndpointWithHealthStatus, string, error) {
resp := &computepb.NetworkEndpointGroupsListNetworkEndpoints{}
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/regions/%v/networkEndpointGroups/%v/listNetworkEndpoints", req.GetProject(), req.GetRegion(), req.GetNetworkEndpointGroup())
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.
hds := append(c.xGoogHeaders, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
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.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
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -367,7 +367,9 @@ func NewRegionNetworkFirewallPoliciesRESTClient(ctx context.Context, opts ...opt
func defaultRegionNetworkFirewallPoliciesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -201,7 +201,9 @@ func NewRegionNotificationEndpointsRESTClient(ctx context.Context, opts ...optio
func defaultRegionNotificationEndpointsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -532,50 +534,3 @@ func (c *regionNotificationEndpointsRESTClient) List(ctx context.Context, req *c
return it
}
// NotificationEndpointIterator manages a stream of *computepb.NotificationEndpoint.
type NotificationEndpointIterator struct {
items []*computepb.NotificationEndpoint
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.NotificationEndpoint, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *NotificationEndpointIterator) 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 *NotificationEndpointIterator) Next() (*computepb.NotificationEndpoint, error) {
var item *computepb.NotificationEndpoint
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *NotificationEndpointIterator) bufLen() int {
return len(it.items)
}
func (it *NotificationEndpointIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -187,7 +187,9 @@ func NewRegionOperationsRESTClient(ctx context.Context, opts ...option.ClientOpt
func defaultRegionOperationsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -42,15 +42,22 @@ var newRegionSecurityPoliciesClientHook clientHook
// RegionSecurityPoliciesCallOptions contains the retry settings for each method of RegionSecurityPoliciesClient.
type RegionSecurityPoliciesCallOptions struct {
AddRule []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetRule []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
Patch []gax.CallOption
PatchRule []gax.CallOption
RemoveRule []gax.CallOption
}
func defaultRegionSecurityPoliciesRESTCallOptions() *RegionSecurityPoliciesCallOptions {
return &RegionSecurityPoliciesCallOptions{
AddRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
Delete: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
@ -66,6 +73,18 @@ func defaultRegionSecurityPoliciesRESTCallOptions() *RegionSecurityPoliciesCallO
http.StatusServiceUnavailable)
}),
},
GetRule: []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)
}),
},
Insert: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
@ -84,6 +103,12 @@ func defaultRegionSecurityPoliciesRESTCallOptions() *RegionSecurityPoliciesCallO
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
PatchRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
RemoveRule: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -92,11 +117,15 @@ type internalRegionSecurityPoliciesClient interface {
Close() error
setGoogleClientInfo(...string)
Connection() *grpc.ClientConn
AddRule(context.Context, *computepb.AddRuleRegionSecurityPolicyRequest, ...gax.CallOption) (*Operation, error)
Delete(context.Context, *computepb.DeleteRegionSecurityPolicyRequest, ...gax.CallOption) (*Operation, error)
Get(context.Context, *computepb.GetRegionSecurityPolicyRequest, ...gax.CallOption) (*computepb.SecurityPolicy, error)
GetRule(context.Context, *computepb.GetRuleRegionSecurityPolicyRequest, ...gax.CallOption) (*computepb.SecurityPolicyRule, error)
Insert(context.Context, *computepb.InsertRegionSecurityPolicyRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListRegionSecurityPoliciesRequest, ...gax.CallOption) *SecurityPolicyIterator
Patch(context.Context, *computepb.PatchRegionSecurityPolicyRequest, ...gax.CallOption) (*Operation, error)
PatchRule(context.Context, *computepb.PatchRuleRegionSecurityPolicyRequest, ...gax.CallOption) (*Operation, error)
RemoveRule(context.Context, *computepb.RemoveRuleRegionSecurityPolicyRequest, ...gax.CallOption) (*Operation, error)
}
// RegionSecurityPoliciesClient is a client for interacting with Google Compute Engine API.
@ -134,6 +163,11 @@ func (c *RegionSecurityPoliciesClient) Connection() *grpc.ClientConn {
return c.internalClient.Connection()
}
// AddRule inserts a rule into a security policy.
func (c *RegionSecurityPoliciesClient) AddRule(ctx context.Context, req *computepb.AddRuleRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.AddRule(ctx, req, opts...)
}
// Delete deletes the specified policy.
func (c *RegionSecurityPoliciesClient) Delete(ctx context.Context, req *computepb.DeleteRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Delete(ctx, req, opts...)
@ -144,6 +178,11 @@ func (c *RegionSecurityPoliciesClient) Get(ctx context.Context, req *computepb.G
return c.internalClient.Get(ctx, req, opts...)
}
// GetRule gets a rule at the specified priority.
func (c *RegionSecurityPoliciesClient) GetRule(ctx context.Context, req *computepb.GetRuleRegionSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicyRule, error) {
return c.internalClient.GetRule(ctx, req, opts...)
}
// Insert creates a new policy in the specified project using the data included in the request.
func (c *RegionSecurityPoliciesClient) Insert(ctx context.Context, req *computepb.InsertRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Insert(ctx, req, opts...)
@ -159,6 +198,16 @@ func (c *RegionSecurityPoliciesClient) Patch(ctx context.Context, req *computepb
return c.internalClient.Patch(ctx, req, opts...)
}
// PatchRule patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.
func (c *RegionSecurityPoliciesClient) PatchRule(ctx context.Context, req *computepb.PatchRuleRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.PatchRule(ctx, req, opts...)
}
// RemoveRule deletes a rule at the specified priority.
func (c *RegionSecurityPoliciesClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.RemoveRule(ctx, req, opts...)
}
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type regionSecurityPoliciesRESTClient struct {
// The http endpoint to connect to.
@ -211,7 +260,9 @@ func NewRegionSecurityPoliciesRESTClient(ctx context.Context, opts ...option.Cli
func defaultRegionSecurityPoliciesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -244,6 +295,83 @@ func (c *regionSecurityPoliciesRESTClient) Connection() *grpc.ClientConn {
return nil
}
// AddRule inserts a rule into a security policy.
func (c *regionSecurityPoliciesRESTClient) AddRule(ctx context.Context, req *computepb.AddRuleRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetSecurityPolicyRuleResource()
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/securityPolicies/%v/addRule", req.GetProject(), req.GetRegion(), req.GetSecurityPolicy())
params := url.Values{}
if req != nil && req.ValidateOnly != nil {
params.Add("validateOnly", fmt.Sprintf("%v", req.GetValidateOnly()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "security_policy", url.QueryEscape(req.GetSecurityPolicy()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).AddRule[0:len((*c.CallOptions).AddRule):len((*c.CallOptions).AddRule)], 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
}
// Delete deletes the specified policy.
func (c *regionSecurityPoliciesRESTClient) Delete(ctx context.Context, req *computepb.DeleteRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error) {
baseUrl, err := url.Parse(c.endpoint)
@ -369,6 +497,68 @@ func (c *regionSecurityPoliciesRESTClient) Get(ctx context.Context, req *compute
return resp, nil
}
// GetRule gets a rule at the specified priority.
func (c *regionSecurityPoliciesRESTClient) GetRule(ctx context.Context, req *computepb.GetRuleRegionSecurityPolicyRequest, opts ...gax.CallOption) (*computepb.SecurityPolicyRule, error) {
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/securityPolicies/%v/getRule", req.GetProject(), req.GetRegion(), req.GetSecurityPolicy())
params := url.Values{}
if req != nil && req.Priority != nil {
params.Add("priority", fmt.Sprintf("%v", req.GetPriority()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "security_policy", url.QueryEscape(req.GetSecurityPolicy()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).GetRule[0:len((*c.CallOptions).GetRule):len((*c.CallOptions).GetRule)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.SecurityPolicyRule{}
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
}
// Insert creates a new policy in the specified project using the data included in the request.
func (c *regionSecurityPoliciesRESTClient) Insert(ctx context.Context, req *computepb.InsertRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
@ -565,6 +755,9 @@ func (c *regionSecurityPoliciesRESTClient) Patch(ctx context.Context, req *compu
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
if req != nil && req.UpdateMask != nil {
params.Add("updateMask", fmt.Sprintf("%v", req.GetUpdateMask()))
}
baseUrl.RawQuery = params.Encode()
@ -623,49 +816,155 @@ func (c *regionSecurityPoliciesRESTClient) Patch(ctx context.Context, req *compu
return op, nil
}
// SecurityPolicyIterator manages a stream of *computepb.SecurityPolicy.
type SecurityPolicyIterator struct {
items []*computepb.SecurityPolicy
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.SecurityPolicy, nextPageToken string, err error)
// PatchRule patches a rule at the specified priority. To clear fields in the rule, leave the fields empty and specify them in the updateMask.
func (c *regionSecurityPoliciesRESTClient) PatchRule(ctx context.Context, req *computepb.PatchRuleRegionSecurityPolicyRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetSecurityPolicyRuleResource()
jsonReq, err := m.Marshal(body)
if err != nil {
return nil, err
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *SecurityPolicyIterator) PageInfo() *iterator.PageInfo {
return it.pageInfo
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/securityPolicies/%v/patchRule", req.GetProject(), req.GetRegion(), req.GetSecurityPolicy())
params := url.Values{}
if req != nil && req.Priority != nil {
params.Add("priority", fmt.Sprintf("%v", req.GetPriority()))
}
if req != nil && req.UpdateMask != nil {
params.Add("updateMask", fmt.Sprintf("%v", req.GetUpdateMask()))
}
if req != nil && req.ValidateOnly != nil {
params.Add("validateOnly", fmt.Sprintf("%v", req.GetValidateOnly()))
}
// 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 *SecurityPolicyIterator) Next() (*computepb.SecurityPolicy, error) {
var item *computepb.SecurityPolicy
if err := it.nextFunc(); err != nil {
return item, err
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "security_policy", url.QueryEscape(req.GetSecurityPolicy()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).PatchRule[0:len((*c.CallOptions).PatchRule):len((*c.CallOptions).PatchRule)], 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
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
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
}
func (it *SecurityPolicyIterator) bufLen() int {
return len(it.items)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
func (it *SecurityPolicyIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
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
}
// RemoveRule deletes a rule at the specified priority.
func (c *regionSecurityPoliciesRESTClient) RemoveRule(ctx context.Context, req *computepb.RemoveRuleRegionSecurityPolicyRequest, 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/securityPolicies/%v/removeRule", req.GetProject(), req.GetRegion(), req.GetSecurityPolicy())
params := url.Values{}
if req != nil && req.Priority != nil {
params.Add("priority", fmt.Sprintf("%v", req.GetPriority()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "security_policy", url.QueryEscape(req.GetSecurityPolicy()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).RemoveRule[0:len((*c.CallOptions).RemoveRule):len((*c.CallOptions).RemoveRule)], 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
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -201,7 +201,9 @@ func NewRegionSslCertificatesRESTClient(ctx context.Context, opts ...option.Clie
func defaultRegionSslCertificatesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -532,50 +534,3 @@ func (c *regionSslCertificatesRESTClient) List(ctx context.Context, req *compute
return it
}
// SslCertificateIterator manages a stream of *computepb.SslCertificate.
type SslCertificateIterator struct {
items []*computepb.SslCertificate
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.SslCertificate, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *SslCertificateIterator) 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 *SslCertificateIterator) Next() (*computepb.SslCertificate, error) {
var item *computepb.SslCertificate
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *SslCertificateIterator) bufLen() int {
return len(it.items)
}
func (it *SslCertificateIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -230,7 +230,9 @@ func NewRegionSslPoliciesRESTClient(ctx context.Context, opts ...option.ClientOp
func defaultRegionSslPoliciesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -712,50 +714,3 @@ func (c *regionSslPoliciesRESTClient) Patch(ctx context.Context, req *computepb.
}
return op, nil
}
// SslPolicyIterator manages a stream of *computepb.SslPolicy.
type SslPolicyIterator struct {
items []*computepb.SslPolicy
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.SslPolicy, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *SslPolicyIterator) 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 *SslPolicyIterator) Next() (*computepb.SslPolicy, error) {
var item *computepb.SslPolicy
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *SslPolicyIterator) bufLen() int {
return len(it.items)
}
func (it *SslPolicyIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -211,7 +211,9 @@ func NewRegionTargetHttpProxiesRESTClient(ctx context.Context, opts ...option.Cl
func defaultRegionTargetHttpProxiesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -619,50 +621,3 @@ func (c *regionTargetHttpProxiesRESTClient) SetUrlMap(ctx context.Context, req *
}
return op, nil
}
// TargetHttpProxyIterator manages a stream of *computepb.TargetHttpProxy.
type TargetHttpProxyIterator struct {
items []*computepb.TargetHttpProxy
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.TargetHttpProxy, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetHttpProxyIterator) 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 *TargetHttpProxyIterator) Next() (*computepb.TargetHttpProxy, error) {
var item *computepb.TargetHttpProxy
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetHttpProxyIterator) bufLen() int {
return len(it.items)
}
func (it *TargetHttpProxyIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -231,7 +231,9 @@ func NewRegionTargetHttpsProxiesRESTClient(ctx context.Context, opts ...option.C
func defaultRegionTargetHttpsProxiesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -793,50 +795,3 @@ func (c *regionTargetHttpsProxiesRESTClient) SetUrlMap(ctx context.Context, req
}
return op, nil
}
// TargetHttpsProxyIterator manages a stream of *computepb.TargetHttpsProxy.
type TargetHttpsProxyIterator struct {
items []*computepb.TargetHttpsProxy
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.TargetHttpsProxy, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetHttpsProxyIterator) 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 *TargetHttpsProxyIterator) Next() (*computepb.TargetHttpsProxy, error) {
var item *computepb.TargetHttpsProxy
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetHttpsProxyIterator) bufLen() int {
return len(it.items)
}
func (it *TargetHttpsProxyIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -201,7 +201,9 @@ func NewRegionTargetTcpProxiesRESTClient(ctx context.Context, opts ...option.Cli
func defaultRegionTargetTcpProxiesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -532,50 +534,3 @@ func (c *regionTargetTcpProxiesRESTClient) List(ctx context.Context, req *comput
return it
}
// TargetTcpProxyIterator manages a stream of *computepb.TargetTcpProxy.
type TargetTcpProxyIterator struct {
items []*computepb.TargetTcpProxy
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.TargetTcpProxy, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetTcpProxyIterator) 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 *TargetTcpProxyIterator) Next() (*computepb.TargetTcpProxy, error) {
var item *computepb.TargetTcpProxy
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetTcpProxyIterator) bufLen() int {
return len(it.items)
}
func (it *TargetTcpProxyIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -231,7 +231,9 @@ func NewRegionUrlMapsRESTClient(ctx context.Context, opts ...option.ClientOption
func defaultRegionUrlMapsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -778,50 +780,3 @@ func (c *regionUrlMapsRESTClient) Validate(ctx context.Context, req *computepb.V
}
return resp, nil
}
// UrlMapIterator manages a stream of *computepb.UrlMap.
type UrlMapIterator struct {
items []*computepb.UrlMap
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.UrlMap, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *UrlMapIterator) 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 *UrlMapIterator) Next() (*computepb.UrlMap, error) {
var item *computepb.UrlMap
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *UrlMapIterator) bufLen() int {
return len(it.items)
}
func (it *UrlMapIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -167,7 +167,9 @@ func NewRegionsRESTClient(ctx context.Context, opts ...option.ClientOption) (*Re
func defaultRegionsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -348,50 +350,3 @@ func (c *regionsRESTClient) List(ctx context.Context, req *computepb.ListRegions
return it
}
// RegionIterator manages a stream of *computepb.Region.
type RegionIterator struct {
items []*computepb.Region
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.Region, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *RegionIterator) 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 *RegionIterator) Next() (*computepb.Region, error) {
var item *computepb.Region
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *RegionIterator) bufLen() int {
return len(it.items)
}
func (it *RegionIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -280,7 +280,9 @@ func NewReservationsRESTClient(ctx context.Context, opts ...option.ClientOption)
func defaultReservationsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -353,6 +355,9 @@ func (c *reservationsRESTClient) AggregatedList(ctx context.Context, req *comput
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -1064,103 +1069,3 @@ func (c *reservationsRESTClient) Update(ctx context.Context, req *computepb.Upda
}
return op, nil
}
// ReservationIterator manages a stream of *computepb.Reservation.
type ReservationIterator struct {
items []*computepb.Reservation
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.Reservation, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ReservationIterator) 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 *ReservationIterator) Next() (*computepb.Reservation, error) {
var item *computepb.Reservation
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ReservationIterator) bufLen() int {
return len(it.items)
}
func (it *ReservationIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// ReservationsScopedListPair is a holder type for string/*computepb.ReservationsScopedList map entries
type ReservationsScopedListPair struct {
Key string
Value *computepb.ReservationsScopedList
}
// ReservationsScopedListPairIterator manages a stream of ReservationsScopedListPair.
type ReservationsScopedListPairIterator struct {
items []ReservationsScopedListPair
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 []ReservationsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ReservationsScopedListPairIterator) 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 *ReservationsScopedListPairIterator) Next() (ReservationsScopedListPair, error) {
var item ReservationsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ReservationsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *ReservationsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -270,7 +270,9 @@ func NewResourcePoliciesRESTClient(ctx context.Context, opts ...option.ClientOpt
func defaultResourcePoliciesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -343,6 +345,9 @@ func (c *resourcePoliciesRESTClient) AggregatedList(ctx context.Context, req *co
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -974,103 +979,3 @@ func (c *resourcePoliciesRESTClient) TestIamPermissions(ctx context.Context, req
}
return resp, nil
}
// ResourcePoliciesScopedListPair is a holder type for string/*computepb.ResourcePoliciesScopedList map entries
type ResourcePoliciesScopedListPair struct {
Key string
Value *computepb.ResourcePoliciesScopedList
}
// ResourcePoliciesScopedListPairIterator manages a stream of ResourcePoliciesScopedListPair.
type ResourcePoliciesScopedListPairIterator struct {
items []ResourcePoliciesScopedListPair
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 []ResourcePoliciesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ResourcePoliciesScopedListPairIterator) 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 *ResourcePoliciesScopedListPairIterator) Next() (ResourcePoliciesScopedListPair, error) {
var item ResourcePoliciesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ResourcePoliciesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *ResourcePoliciesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// ResourcePolicyIterator manages a stream of *computepb.ResourcePolicy.
type ResourcePolicyIterator struct {
items []*computepb.ResourcePolicy
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.ResourcePolicy, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ResourcePolicyIterator) 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 *ResourcePolicyIterator) Next() (*computepb.ResourcePolicy, error) {
var item *computepb.ResourcePolicy
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ResourcePolicyIterator) bufLen() int {
return len(it.items)
}
func (it *ResourcePolicyIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -46,6 +46,7 @@ type RoutersCallOptions struct {
AggregatedList []gax.CallOption
Delete []gax.CallOption
Get []gax.CallOption
GetNatIpInfo []gax.CallOption
GetNatMappingInfo []gax.CallOption
GetRouterStatus []gax.CallOption
Insert []gax.CallOption
@ -84,6 +85,18 @@ func defaultRoutersRESTCallOptions() *RoutersCallOptions {
http.StatusServiceUnavailable)
}),
},
GetNatIpInfo: []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)
}),
},
GetNatMappingInfo: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
gax.WithRetry(func() gax.Retryer {
@ -143,6 +156,7 @@ type internalRoutersClient interface {
AggregatedList(context.Context, *computepb.AggregatedListRoutersRequest, ...gax.CallOption) *RoutersScopedListPairIterator
Delete(context.Context, *computepb.DeleteRouterRequest, ...gax.CallOption) (*Operation, error)
Get(context.Context, *computepb.GetRouterRequest, ...gax.CallOption) (*computepb.Router, error)
GetNatIpInfo(context.Context, *computepb.GetNatIpInfoRouterRequest, ...gax.CallOption) (*computepb.NatIpInfoResponse, error)
GetNatMappingInfo(context.Context, *computepb.GetNatMappingInfoRoutersRequest, ...gax.CallOption) *VmEndpointNatMappingsIterator
GetRouterStatus(context.Context, *computepb.GetRouterStatusRouterRequest, ...gax.CallOption) (*computepb.RouterStatusResponse, error)
Insert(context.Context, *computepb.InsertRouterRequest, ...gax.CallOption) (*Operation, error)
@ -202,6 +216,11 @@ func (c *RoutersClient) Get(ctx context.Context, req *computepb.GetRouterRequest
return c.internalClient.Get(ctx, req, opts...)
}
// GetNatIpInfo retrieves runtime NAT IP information.
func (c *RoutersClient) GetNatIpInfo(ctx context.Context, req *computepb.GetNatIpInfoRouterRequest, opts ...gax.CallOption) (*computepb.NatIpInfoResponse, error) {
return c.internalClient.GetNatIpInfo(ctx, req, opts...)
}
// GetNatMappingInfo retrieves runtime Nat mapping information of VM endpoints.
func (c *RoutersClient) GetNatMappingInfo(ctx context.Context, req *computepb.GetNatMappingInfoRoutersRequest, opts ...gax.CallOption) *VmEndpointNatMappingsIterator {
return c.internalClient.GetNatMappingInfo(ctx, req, opts...)
@ -289,7 +308,9 @@ func NewRoutersRESTClient(ctx context.Context, opts ...option.ClientOption) (*Ro
func defaultRoutersRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -362,6 +383,9 @@ func (c *routersRESTClient) AggregatedList(ctx context.Context, req *computepb.A
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -554,6 +578,68 @@ func (c *routersRESTClient) Get(ctx context.Context, req *computepb.GetRouterReq
return resp, nil
}
// GetNatIpInfo retrieves runtime NAT IP information.
func (c *routersRESTClient) GetNatIpInfo(ctx context.Context, req *computepb.GetNatIpInfoRouterRequest, opts ...gax.CallOption) (*computepb.NatIpInfoResponse, error) {
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/routers/%v/getNatIpInfo", req.GetProject(), req.GetRegion(), req.GetRouter())
params := url.Values{}
if req != nil && req.NatName != nil {
params.Add("natName", fmt.Sprintf("%v", req.GetNatName()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "router", url.QueryEscape(req.GetRouter()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).GetNatIpInfo[0:len((*c.CallOptions).GetNatIpInfo):len((*c.CallOptions).GetNatIpInfo)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.NatIpInfoResponse{}
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
}
// GetNatMappingInfo retrieves runtime Nat mapping information of VM endpoints.
func (c *routersRESTClient) GetNatMappingInfo(ctx context.Context, req *computepb.GetNatMappingInfoRoutersRequest, opts ...gax.CallOption) *VmEndpointNatMappingsIterator {
it := &VmEndpointNatMappingsIterator{}
@ -1098,150 +1184,3 @@ func (c *routersRESTClient) Update(ctx context.Context, req *computepb.UpdateRou
}
return op, nil
}
// RouterIterator manages a stream of *computepb.Router.
type RouterIterator struct {
items []*computepb.Router
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.Router, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *RouterIterator) 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 *RouterIterator) Next() (*computepb.Router, error) {
var item *computepb.Router
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *RouterIterator) bufLen() int {
return len(it.items)
}
func (it *RouterIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// RoutersScopedListPair is a holder type for string/*computepb.RoutersScopedList map entries
type RoutersScopedListPair struct {
Key string
Value *computepb.RoutersScopedList
}
// RoutersScopedListPairIterator manages a stream of RoutersScopedListPair.
type RoutersScopedListPairIterator struct {
items []RoutersScopedListPair
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 []RoutersScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *RoutersScopedListPairIterator) 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 *RoutersScopedListPairIterator) Next() (RoutersScopedListPair, error) {
var item RoutersScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *RoutersScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *RoutersScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// VmEndpointNatMappingsIterator manages a stream of *computepb.VmEndpointNatMappings.
type VmEndpointNatMappingsIterator struct {
items []*computepb.VmEndpointNatMappings
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.VmEndpointNatMappings, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *VmEndpointNatMappingsIterator) 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 *VmEndpointNatMappingsIterator) Next() (*computepb.VmEndpointNatMappings, error) {
var item *computepb.VmEndpointNatMappings
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *VmEndpointNatMappingsIterator) bufLen() int {
return len(it.items)
}
func (it *VmEndpointNatMappingsIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -201,7 +201,9 @@ func NewRoutesRESTClient(ctx context.Context, opts ...option.ClientOption) (*Rou
func defaultRoutesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -530,50 +532,3 @@ func (c *routesRESTClient) List(ctx context.Context, req *computepb.ListRoutesRe
return it
}
// RouteIterator manages a stream of *computepb.Route.
type RouteIterator struct {
items []*computepb.Route
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.Route, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *RouteIterator) 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 *RouteIterator) Next() (*computepb.Route, error) {
var item *computepb.Route
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *RouteIterator) bufLen() int {
return len(it.items)
}
func (it *RouteIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -309,7 +309,9 @@ func NewSecurityPoliciesRESTClient(ctx context.Context, opts ...option.ClientOpt
func defaultSecurityPoliciesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -458,6 +460,9 @@ func (c *securityPoliciesRESTClient) AggregatedList(ctx context.Context, req *co
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -980,6 +985,9 @@ func (c *securityPoliciesRESTClient) Patch(ctx context.Context, req *computepb.P
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
if req != nil && req.UpdateMask != nil {
params.Add("updateMask", fmt.Sprintf("%v", req.GetUpdateMask()))
}
baseUrl.RawQuery = params.Encode()
@ -1056,6 +1064,9 @@ func (c *securityPoliciesRESTClient) PatchRule(ctx context.Context, req *compute
if req != nil && req.Priority != nil {
params.Add("priority", fmt.Sprintf("%v", req.GetPriority()))
}
if req != nil && req.UpdateMask != nil {
params.Add("updateMask", fmt.Sprintf("%v", req.GetUpdateMask()))
}
if req != nil && req.ValidateOnly != nil {
params.Add("validateOnly", fmt.Sprintf("%v", req.GetValidateOnly()))
}
@ -1253,56 +1264,3 @@ func (c *securityPoliciesRESTClient) SetLabels(ctx context.Context, req *compute
}
return op, nil
}
// SecurityPoliciesScopedListPair is a holder type for string/*computepb.SecurityPoliciesScopedList map entries
type SecurityPoliciesScopedListPair struct {
Key string
Value *computepb.SecurityPoliciesScopedList
}
// SecurityPoliciesScopedListPairIterator manages a stream of SecurityPoliciesScopedListPair.
type SecurityPoliciesScopedListPairIterator struct {
items []SecurityPoliciesScopedListPair
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 []SecurityPoliciesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *SecurityPoliciesScopedListPairIterator) 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 *SecurityPoliciesScopedListPairIterator) Next() (SecurityPoliciesScopedListPair, error) {
var item SecurityPoliciesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *SecurityPoliciesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *SecurityPoliciesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -270,7 +270,9 @@ func NewServiceAttachmentsRESTClient(ctx context.Context, opts ...option.ClientO
func defaultServiceAttachmentsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -343,6 +345,9 @@ func (c *serviceAttachmentsRESTClient) AggregatedList(ctx context.Context, req *
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -971,103 +976,3 @@ func (c *serviceAttachmentsRESTClient) TestIamPermissions(ctx context.Context, r
}
return resp, nil
}
// ServiceAttachmentIterator manages a stream of *computepb.ServiceAttachment.
type ServiceAttachmentIterator struct {
items []*computepb.ServiceAttachment
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.ServiceAttachment, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ServiceAttachmentIterator) 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 *ServiceAttachmentIterator) Next() (*computepb.ServiceAttachment, error) {
var item *computepb.ServiceAttachment
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ServiceAttachmentIterator) bufLen() int {
return len(it.items)
}
func (it *ServiceAttachmentIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// ServiceAttachmentsScopedListPair is a holder type for string/*computepb.ServiceAttachmentsScopedList map entries
type ServiceAttachmentsScopedListPair struct {
Key string
Value *computepb.ServiceAttachmentsScopedList
}
// ServiceAttachmentsScopedListPairIterator manages a stream of ServiceAttachmentsScopedListPair.
type ServiceAttachmentsScopedListPairIterator struct {
items []ServiceAttachmentsScopedListPair
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 []ServiceAttachmentsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ServiceAttachmentsScopedListPairIterator) 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 *ServiceAttachmentsScopedListPairIterator) Next() (ServiceAttachmentsScopedListPair, error) {
var item ServiceAttachmentsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ServiceAttachmentsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *ServiceAttachmentsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -0,0 +1,339 @@
// Copyright 2024 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 (
"bytes"
"context"
"fmt"
"io"
"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/option"
"google.golang.org/api/option/internaloption"
httptransport "google.golang.org/api/transport/http"
"google.golang.org/grpc"
"google.golang.org/protobuf/encoding/protojson"
)
var newSnapshotSettingsClientHook clientHook
// SnapshotSettingsCallOptions contains the retry settings for each method of SnapshotSettingsClient.
type SnapshotSettingsCallOptions struct {
Get []gax.CallOption
Patch []gax.CallOption
}
func defaultSnapshotSettingsRESTCallOptions() *SnapshotSettingsCallOptions {
return &SnapshotSettingsCallOptions{
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)
}),
},
Patch: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
// internalSnapshotSettingsClient is an interface that defines the methods available from Google Compute Engine API.
type internalSnapshotSettingsClient interface {
Close() error
setGoogleClientInfo(...string)
Connection() *grpc.ClientConn
Get(context.Context, *computepb.GetSnapshotSettingRequest, ...gax.CallOption) (*computepb.SnapshotSettings, error)
Patch(context.Context, *computepb.PatchSnapshotSettingRequest, ...gax.CallOption) (*Operation, error)
}
// SnapshotSettingsClient 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 SnapshotSettings API.
type SnapshotSettingsClient struct {
// The internal transport-dependent client.
internalClient internalSnapshotSettingsClient
// The call options for this service.
CallOptions *SnapshotSettingsCallOptions
}
// 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 *SnapshotSettingsClient) 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 *SnapshotSettingsClient) 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 *SnapshotSettingsClient) Connection() *grpc.ClientConn {
return c.internalClient.Connection()
}
// Get get snapshot settings.
func (c *SnapshotSettingsClient) Get(ctx context.Context, req *computepb.GetSnapshotSettingRequest, opts ...gax.CallOption) (*computepb.SnapshotSettings, error) {
return c.internalClient.Get(ctx, req, opts...)
}
// Patch patch snapshot settings.
func (c *SnapshotSettingsClient) Patch(ctx context.Context, req *computepb.PatchSnapshotSettingRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.Patch(ctx, req, opts...)
}
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type snapshotSettingsRESTClient struct {
// The http endpoint to connect to.
endpoint string
// The http client.
httpClient *http.Client
// operationClient is used to call the operation-specific management service.
operationClient *GlobalOperationsClient
// The x-goog-* headers to be sent with each request.
xGoogHeaders []string
// Points back to the CallOptions field of the containing SnapshotSettingsClient
CallOptions **SnapshotSettingsCallOptions
}
// NewSnapshotSettingsRESTClient creates a new snapshot settings service rest client.
//
// The SnapshotSettings API.
func NewSnapshotSettingsRESTClient(ctx context.Context, opts ...option.ClientOption) (*SnapshotSettingsClient, error) {
clientOpts := append(defaultSnapshotSettingsRESTClientOptions(), opts...)
httpClient, endpoint, err := httptransport.NewClient(ctx, clientOpts...)
if err != nil {
return nil, err
}
callOpts := defaultSnapshotSettingsRESTCallOptions()
c := &snapshotSettingsRESTClient{
endpoint: endpoint,
httpClient: httpClient,
CallOptions: &callOpts,
}
c.setGoogleClientInfo()
o := []option.ClientOption{
option.WithHTTPClient(httpClient),
option.WithEndpoint(endpoint),
}
opC, err := NewGlobalOperationsRESTClient(ctx, o...)
if err != nil {
return nil, err
}
c.operationClient = opC
return &SnapshotSettingsClient{internalClient: c, CallOptions: callOpts}, nil
}
func defaultSnapshotSettingsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("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 *snapshotSettingsRESTClient) setGoogleClientInfo(keyval ...string) {
kv := append([]string{"gl-go", gax.GoVersion}, keyval...)
kv = append(kv, "gapic", getVersionClient(), "gax", gax.Version, "rest", "UNKNOWN")
c.xGoogHeaders = []string{"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 *snapshotSettingsRESTClient) Close() error {
// Replace httpClient with nil to force cleanup.
c.httpClient = nil
if err := c.operationClient.Close(); err != nil {
return err
}
return nil
}
// Connection returns a connection to the API service.
//
// Deprecated: This method always returns nil.
func (c *snapshotSettingsRESTClient) Connection() *grpc.ClientConn {
return nil
}
// Get get snapshot settings.
func (c *snapshotSettingsRESTClient) Get(ctx context.Context, req *computepb.GetSnapshotSettingRequest, opts ...gax.CallOption) (*computepb.SnapshotSettings, error) {
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/global/snapshotSettings", req.GetProject())
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "project", url.QueryEscape(req.GetProject()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).Get[0:len((*c.CallOptions).Get):len((*c.CallOptions).Get)], opts...)
unm := protojson.UnmarshalOptions{AllowPartial: true, DiscardUnknown: true}
resp := &computepb.SnapshotSettings{}
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
}
// Patch patch snapshot settings.
func (c *snapshotSettingsRESTClient) Patch(ctx context.Context, req *computepb.PatchSnapshotSettingRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetSnapshotSettingsResource()
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/snapshotSettings", req.GetProject())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
if req != nil && req.UpdateMask != nil {
params.Add("updateMask", fmt.Sprintf("%v", req.GetUpdateMask()))
}
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v", "project", url.QueryEscape(req.GetProject()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).Patch[0:len((*c.CallOptions).Patch):len((*c.CallOptions).Patch)], 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("PATCH", 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
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -250,7 +250,9 @@ func NewSnapshotsRESTClient(ctx context.Context, opts ...option.ClientOption) (*
func defaultSnapshotsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -834,50 +836,3 @@ func (c *snapshotsRESTClient) TestIamPermissions(ctx context.Context, req *compu
}
return resp, nil
}
// SnapshotIterator manages a stream of *computepb.Snapshot.
type SnapshotIterator struct {
items []*computepb.Snapshot
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.Snapshot, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *SnapshotIterator) 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 *SnapshotIterator) Next() (*computepb.Snapshot, error) {
var item *computepb.Snapshot
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *SnapshotIterator) bufLen() int {
return len(it.items)
}
func (it *SnapshotIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -221,7 +221,9 @@ func NewSslCertificatesRESTClient(ctx context.Context, opts ...option.ClientOpti
func defaultSslCertificatesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -294,6 +296,9 @@ func (c *sslCertificatesRESTClient) AggregatedList(ctx context.Context, req *com
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -657,56 +662,3 @@ func (c *sslCertificatesRESTClient) List(ctx context.Context, req *computepb.Lis
return it
}
// SslCertificatesScopedListPair is a holder type for string/*computepb.SslCertificatesScopedList map entries
type SslCertificatesScopedListPair struct {
Key string
Value *computepb.SslCertificatesScopedList
}
// SslCertificatesScopedListPairIterator manages a stream of SslCertificatesScopedListPair.
type SslCertificatesScopedListPairIterator struct {
items []SslCertificatesScopedListPair
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 []SslCertificatesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *SslCertificatesScopedListPairIterator) 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 *SslCertificatesScopedListPairIterator) Next() (SslCertificatesScopedListPair, error) {
var item SslCertificatesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *SslCertificatesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *SslCertificatesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -250,7 +250,9 @@ func NewSslPoliciesRESTClient(ctx context.Context, opts ...option.ClientOption)
func defaultSslPoliciesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -323,6 +325,9 @@ func (c *sslPoliciesRESTClient) AggregatedList(ctx context.Context, req *compute
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -836,56 +841,3 @@ func (c *sslPoliciesRESTClient) Patch(ctx context.Context, req *computepb.PatchS
}
return op, nil
}
// SslPoliciesScopedListPair is a holder type for string/*computepb.SslPoliciesScopedList map entries
type SslPoliciesScopedListPair struct {
Key string
Value *computepb.SslPoliciesScopedList
}
// SslPoliciesScopedListPairIterator manages a stream of SslPoliciesScopedListPair.
type SslPoliciesScopedListPairIterator struct {
items []SslPoliciesScopedListPair
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 []SslPoliciesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *SslPoliciesScopedListPairIterator) 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 *SslPoliciesScopedListPairIterator) Next() (SslPoliciesScopedListPair, error) {
var item SslPoliciesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *SslPoliciesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *SslPoliciesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -309,7 +309,9 @@ func NewSubnetworksRESTClient(ctx context.Context, opts ...option.ClientOption)
func defaultSubnetworksRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -382,6 +384,9 @@ func (c *subnetworksRESTClient) AggregatedList(ctx context.Context, req *compute
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -1264,150 +1269,3 @@ func (c *subnetworksRESTClient) TestIamPermissions(ctx context.Context, req *com
}
return resp, nil
}
// SubnetworkIterator manages a stream of *computepb.Subnetwork.
type SubnetworkIterator struct {
items []*computepb.Subnetwork
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.Subnetwork, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *SubnetworkIterator) 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 *SubnetworkIterator) Next() (*computepb.Subnetwork, error) {
var item *computepb.Subnetwork
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *SubnetworkIterator) bufLen() int {
return len(it.items)
}
func (it *SubnetworkIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// SubnetworksScopedListPair is a holder type for string/*computepb.SubnetworksScopedList map entries
type SubnetworksScopedListPair struct {
Key string
Value *computepb.SubnetworksScopedList
}
// SubnetworksScopedListPairIterator manages a stream of SubnetworksScopedListPair.
type SubnetworksScopedListPairIterator struct {
items []SubnetworksScopedListPair
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 []SubnetworksScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *SubnetworksScopedListPairIterator) 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 *SubnetworksScopedListPairIterator) Next() (SubnetworksScopedListPair, error) {
var item SubnetworksScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *SubnetworksScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *SubnetworksScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// UsableSubnetworkIterator manages a stream of *computepb.UsableSubnetwork.
type UsableSubnetworkIterator struct {
items []*computepb.UsableSubnetwork
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.UsableSubnetwork, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *UsableSubnetworkIterator) 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 *UsableSubnetworkIterator) Next() (*computepb.UsableSubnetwork, error) {
var item *computepb.UsableSubnetwork
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *UsableSubnetworkIterator) bufLen() int {
return len(it.items)
}
func (it *UsableSubnetworkIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -211,7 +211,9 @@ func NewTargetGrpcProxiesRESTClient(ctx context.Context, opts ...option.ClientOp
func defaultTargetGrpcProxiesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -616,50 +618,3 @@ func (c *targetGrpcProxiesRESTClient) Patch(ctx context.Context, req *computepb.
}
return op, nil
}
// TargetGrpcProxyIterator manages a stream of *computepb.TargetGrpcProxy.
type TargetGrpcProxyIterator struct {
items []*computepb.TargetGrpcProxy
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.TargetGrpcProxy, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetGrpcProxyIterator) 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 *TargetGrpcProxyIterator) Next() (*computepb.TargetGrpcProxy, error) {
var item *computepb.TargetGrpcProxy
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetGrpcProxyIterator) bufLen() int {
return len(it.items)
}
func (it *TargetGrpcProxyIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -241,7 +241,9 @@ func NewTargetHttpProxiesRESTClient(ctx context.Context, opts ...option.ClientOp
func defaultTargetHttpProxiesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -314,6 +316,9 @@ func (c *targetHttpProxiesRESTClient) AggregatedList(ctx context.Context, req *c
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -829,56 +834,3 @@ func (c *targetHttpProxiesRESTClient) SetUrlMap(ctx context.Context, req *comput
}
return op, nil
}
// TargetHttpProxiesScopedListPair is a holder type for string/*computepb.TargetHttpProxiesScopedList map entries
type TargetHttpProxiesScopedListPair struct {
Key string
Value *computepb.TargetHttpProxiesScopedList
}
// TargetHttpProxiesScopedListPairIterator manages a stream of TargetHttpProxiesScopedListPair.
type TargetHttpProxiesScopedListPairIterator struct {
items []TargetHttpProxiesScopedListPair
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 []TargetHttpProxiesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetHttpProxiesScopedListPairIterator) 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 *TargetHttpProxiesScopedListPairIterator) Next() (TargetHttpProxiesScopedListPair, error) {
var item TargetHttpProxiesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetHttpProxiesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *TargetHttpProxiesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -281,7 +281,9 @@ func NewTargetHttpsProxiesRESTClient(ctx context.Context, opts ...option.ClientO
func defaultTargetHttpsProxiesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -354,6 +356,9 @@ func (c *targetHttpsProxiesRESTClient) AggregatedList(ctx context.Context, req *
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -1173,56 +1178,3 @@ func (c *targetHttpsProxiesRESTClient) SetUrlMap(ctx context.Context, req *compu
}
return op, nil
}
// TargetHttpsProxiesScopedListPair is a holder type for string/*computepb.TargetHttpsProxiesScopedList map entries
type TargetHttpsProxiesScopedListPair struct {
Key string
Value *computepb.TargetHttpsProxiesScopedList
}
// TargetHttpsProxiesScopedListPairIterator manages a stream of TargetHttpsProxiesScopedListPair.
type TargetHttpsProxiesScopedListPairIterator struct {
items []TargetHttpsProxiesScopedListPair
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 []TargetHttpsProxiesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetHttpsProxiesScopedListPairIterator) 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 *TargetHttpsProxiesScopedListPairIterator) Next() (TargetHttpsProxiesScopedListPair, error) {
var item TargetHttpsProxiesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetHttpsProxiesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *TargetHttpsProxiesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -48,6 +48,7 @@ type TargetInstancesCallOptions struct {
Get []gax.CallOption
Insert []gax.CallOption
List []gax.CallOption
SetSecurityPolicy []gax.CallOption
}
func defaultTargetInstancesRESTCallOptions() *TargetInstancesCallOptions {
@ -94,6 +95,9 @@ func defaultTargetInstancesRESTCallOptions() *TargetInstancesCallOptions {
http.StatusServiceUnavailable)
}),
},
SetSecurityPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -107,6 +111,7 @@ type internalTargetInstancesClient interface {
Get(context.Context, *computepb.GetTargetInstanceRequest, ...gax.CallOption) (*computepb.TargetInstance, error)
Insert(context.Context, *computepb.InsertTargetInstanceRequest, ...gax.CallOption) (*Operation, error)
List(context.Context, *computepb.ListTargetInstancesRequest, ...gax.CallOption) *TargetInstanceIterator
SetSecurityPolicy(context.Context, *computepb.SetSecurityPolicyTargetInstanceRequest, ...gax.CallOption) (*Operation, error)
}
// TargetInstancesClient is a client for interacting with Google Compute Engine API.
@ -169,6 +174,11 @@ func (c *TargetInstancesClient) List(ctx context.Context, req *computepb.ListTar
return c.internalClient.List(ctx, req, opts...)
}
// SetSecurityPolicy sets the Google Cloud Armor security policy for the specified target instance. For more information, see Google Cloud Armor Overview
func (c *TargetInstancesClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyTargetInstanceRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.SetSecurityPolicy(ctx, req, opts...)
}
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type targetInstancesRESTClient struct {
// The http endpoint to connect to.
@ -221,7 +231,9 @@ func NewTargetInstancesRESTClient(ctx context.Context, opts ...option.ClientOpti
func defaultTargetInstancesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -294,6 +306,9 @@ func (c *targetInstancesRESTClient) AggregatedList(ctx context.Context, req *com
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -660,102 +675,79 @@ func (c *targetInstancesRESTClient) List(ctx context.Context, req *computepb.Lis
return it
}
// TargetInstanceIterator manages a stream of *computepb.TargetInstance.
type TargetInstanceIterator struct {
items []*computepb.TargetInstance
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.TargetInstance, nextPageToken string, err error)
// SetSecurityPolicy sets the Google Cloud Armor security policy for the specified target instance. For more information, see Google Cloud Armor Overview
func (c *targetInstancesRESTClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyTargetInstanceRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetSecurityPolicyReferenceResource()
jsonReq, err := m.Marshal(body)
if err != nil {
return nil, err
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetInstanceIterator) PageInfo() *iterator.PageInfo {
return it.pageInfo
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/zones/%v/targetInstances/%v/setSecurityPolicy", req.GetProject(), req.GetZone(), req.GetTargetInstance())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
// 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 *TargetInstanceIterator) Next() (*computepb.TargetInstance, error) {
var item *computepb.TargetInstance
if err := it.nextFunc(); err != nil {
return item, err
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "zone", url.QueryEscape(req.GetZone()), "target_instance", url.QueryEscape(req.GetTargetInstance()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).SetSecurityPolicy[0:len((*c.CallOptions).SetSecurityPolicy):len((*c.CallOptions).SetSecurityPolicy)], 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
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
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
}
func (it *TargetInstanceIterator) bufLen() int {
return len(it.items)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
func (it *TargetInstanceIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
// TargetInstancesScopedListPair is a holder type for string/*computepb.TargetInstancesScopedList map entries
type TargetInstancesScopedListPair struct {
Key string
Value *computepb.TargetInstancesScopedList
return nil
}, opts...)
if e != nil {
return nil, e
}
// TargetInstancesScopedListPairIterator manages a stream of TargetInstancesScopedListPair.
type TargetInstancesScopedListPairIterator struct {
items []TargetInstancesScopedListPair
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 []TargetInstancesScopedListPair, nextPageToken string, err error)
op := &Operation{
&zoneOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
zone: req.GetZone(),
},
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetInstancesScopedListPairIterator) 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 *TargetInstancesScopedListPairIterator) Next() (TargetInstancesScopedListPair, error) {
var item TargetInstancesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetInstancesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *TargetInstancesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
return op, nil
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -54,6 +54,7 @@ type TargetPoolsCallOptions struct {
RemoveHealthCheck []gax.CallOption
RemoveInstance []gax.CallOption
SetBackup []gax.CallOption
SetSecurityPolicy []gax.CallOption
}
func defaultTargetPoolsRESTCallOptions() *TargetPoolsCallOptions {
@ -118,6 +119,9 @@ func defaultTargetPoolsRESTCallOptions() *TargetPoolsCallOptions {
SetBackup: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
SetSecurityPolicy: []gax.CallOption{
gax.WithTimeout(600000 * time.Millisecond),
},
}
}
@ -137,6 +141,7 @@ type internalTargetPoolsClient interface {
RemoveHealthCheck(context.Context, *computepb.RemoveHealthCheckTargetPoolRequest, ...gax.CallOption) (*Operation, error)
RemoveInstance(context.Context, *computepb.RemoveInstanceTargetPoolRequest, ...gax.CallOption) (*Operation, error)
SetBackup(context.Context, *computepb.SetBackupTargetPoolRequest, ...gax.CallOption) (*Operation, error)
SetSecurityPolicy(context.Context, *computepb.SetSecurityPolicyTargetPoolRequest, ...gax.CallOption) (*Operation, error)
}
// TargetPoolsClient is a client for interacting with Google Compute Engine API.
@ -229,6 +234,11 @@ func (c *TargetPoolsClient) SetBackup(ctx context.Context, req *computepb.SetBac
return c.internalClient.SetBackup(ctx, req, opts...)
}
// SetSecurityPolicy sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview
func (c *TargetPoolsClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyTargetPoolRequest, opts ...gax.CallOption) (*Operation, error) {
return c.internalClient.SetSecurityPolicy(ctx, req, opts...)
}
// Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
type targetPoolsRESTClient struct {
// The http endpoint to connect to.
@ -281,7 +291,9 @@ func NewTargetPoolsRESTClient(ctx context.Context, opts ...option.ClientOption)
func defaultTargetPoolsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -508,6 +520,9 @@ func (c *targetPoolsRESTClient) AggregatedList(ctx context.Context, req *compute
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -1170,102 +1185,79 @@ func (c *targetPoolsRESTClient) SetBackup(ctx context.Context, req *computepb.Se
return op, nil
}
// TargetPoolIterator manages a stream of *computepb.TargetPool.
type TargetPoolIterator struct {
items []*computepb.TargetPool
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.TargetPool, nextPageToken string, err error)
// SetSecurityPolicy sets the Google Cloud Armor security policy for the specified target pool. For more information, see Google Cloud Armor Overview
func (c *targetPoolsRESTClient) SetSecurityPolicy(ctx context.Context, req *computepb.SetSecurityPolicyTargetPoolRequest, opts ...gax.CallOption) (*Operation, error) {
m := protojson.MarshalOptions{AllowPartial: true}
body := req.GetSecurityPolicyReferenceResource()
jsonReq, err := m.Marshal(body)
if err != nil {
return nil, err
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetPoolIterator) PageInfo() *iterator.PageInfo {
return it.pageInfo
baseUrl, err := url.Parse(c.endpoint)
if err != nil {
return nil, err
}
baseUrl.Path += fmt.Sprintf("/compute/v1/projects/%v/regions/%v/targetPools/%v/setSecurityPolicy", req.GetProject(), req.GetRegion(), req.GetTargetPool())
params := url.Values{}
if req != nil && req.RequestId != nil {
params.Add("requestId", fmt.Sprintf("%v", req.GetRequestId()))
}
// 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 *TargetPoolIterator) Next() (*computepb.TargetPool, error) {
var item *computepb.TargetPool
if err := it.nextFunc(); err != nil {
return item, err
baseUrl.RawQuery = params.Encode()
// Build HTTP headers from client and context metadata.
hds := []string{"x-goog-request-params", fmt.Sprintf("%s=%v&%s=%v&%s=%v", "project", url.QueryEscape(req.GetProject()), "region", url.QueryEscape(req.GetRegion()), "target_pool", url.QueryEscape(req.GetTargetPool()))}
hds = append(c.xGoogHeaders, hds...)
hds = append(hds, "Content-Type", "application/json")
headers := gax.BuildHeaders(ctx, hds...)
opts = append((*c.CallOptions).SetSecurityPolicy[0:len((*c.CallOptions).SetSecurityPolicy):len((*c.CallOptions).SetSecurityPolicy)], 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
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
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
}
func (it *TargetPoolIterator) bufLen() int {
return len(it.items)
buf, err := io.ReadAll(httpRsp.Body)
if err != nil {
return err
}
func (it *TargetPoolIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
if err := unm.Unmarshal(buf, resp); err != nil {
return err
}
// TargetPoolsScopedListPair is a holder type for string/*computepb.TargetPoolsScopedList map entries
type TargetPoolsScopedListPair struct {
Key string
Value *computepb.TargetPoolsScopedList
return nil
}, opts...)
if e != nil {
return nil, e
}
// TargetPoolsScopedListPairIterator manages a stream of TargetPoolsScopedListPair.
type TargetPoolsScopedListPairIterator struct {
items []TargetPoolsScopedListPair
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 []TargetPoolsScopedListPair, nextPageToken string, err error)
op := &Operation{
&regionOperationsHandle{
c: c.operationClient,
proto: resp,
project: req.GetProject(),
region: req.GetRegion(),
},
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetPoolsScopedListPairIterator) 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 *TargetPoolsScopedListPairIterator) Next() (TargetPoolsScopedListPair, error) {
var item TargetPoolsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetPoolsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *TargetPoolsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
return op, nil
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -251,7 +251,9 @@ func NewTargetSslProxiesRESTClient(ctx context.Context, opts ...option.ClientOpt
func defaultTargetSslProxiesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -960,50 +962,3 @@ func (c *targetSslProxiesRESTClient) SetSslPolicy(ctx context.Context, req *comp
}
return op, nil
}
// TargetSslProxyIterator manages a stream of *computepb.TargetSslProxy.
type TargetSslProxyIterator struct {
items []*computepb.TargetSslProxy
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.TargetSslProxy, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetSslProxyIterator) 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 *TargetSslProxyIterator) Next() (*computepb.TargetSslProxy, error) {
var item *computepb.TargetSslProxy
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetSslProxyIterator) bufLen() int {
return len(it.items)
}
func (it *TargetSslProxyIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -241,7 +241,9 @@ func NewTargetTcpProxiesRESTClient(ctx context.Context, opts ...option.ClientOpt
func defaultTargetTcpProxiesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -314,6 +316,9 @@ func (c *targetTcpProxiesRESTClient) AggregatedList(ctx context.Context, req *co
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -829,56 +834,3 @@ func (c *targetTcpProxiesRESTClient) SetProxyHeader(ctx context.Context, req *co
}
return op, nil
}
// TargetTcpProxiesScopedListPair is a holder type for string/*computepb.TargetTcpProxiesScopedList map entries
type TargetTcpProxiesScopedListPair struct {
Key string
Value *computepb.TargetTcpProxiesScopedList
}
// TargetTcpProxiesScopedListPairIterator manages a stream of TargetTcpProxiesScopedListPair.
type TargetTcpProxiesScopedListPairIterator struct {
items []TargetTcpProxiesScopedListPair
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 []TargetTcpProxiesScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetTcpProxiesScopedListPairIterator) 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 *TargetTcpProxiesScopedListPairIterator) Next() (TargetTcpProxiesScopedListPair, error) {
var item TargetTcpProxiesScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetTcpProxiesScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *TargetTcpProxiesScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -231,7 +231,9 @@ func NewTargetVpnGatewaysRESTClient(ctx context.Context, opts ...option.ClientOp
func defaultTargetVpnGatewaysRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -304,6 +306,9 @@ func (c *targetVpnGatewaysRESTClient) AggregatedList(ctx context.Context, req *c
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -746,103 +751,3 @@ func (c *targetVpnGatewaysRESTClient) SetLabels(ctx context.Context, req *comput
}
return op, nil
}
// TargetVpnGatewayIterator manages a stream of *computepb.TargetVpnGateway.
type TargetVpnGatewayIterator struct {
items []*computepb.TargetVpnGateway
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.TargetVpnGateway, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetVpnGatewayIterator) 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 *TargetVpnGatewayIterator) Next() (*computepb.TargetVpnGateway, error) {
var item *computepb.TargetVpnGateway
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetVpnGatewayIterator) bufLen() int {
return len(it.items)
}
func (it *TargetVpnGatewayIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// TargetVpnGatewaysScopedListPair is a holder type for string/*computepb.TargetVpnGatewaysScopedList map entries
type TargetVpnGatewaysScopedListPair struct {
Key string
Value *computepb.TargetVpnGatewaysScopedList
}
// TargetVpnGatewaysScopedListPairIterator manages a stream of TargetVpnGatewaysScopedListPair.
type TargetVpnGatewaysScopedListPairIterator struct {
items []TargetVpnGatewaysScopedListPair
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 []TargetVpnGatewaysScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *TargetVpnGatewaysScopedListPairIterator) 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 *TargetVpnGatewaysScopedListPairIterator) Next() (TargetVpnGatewaysScopedListPair, error) {
var item TargetVpnGatewaysScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *TargetVpnGatewaysScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *TargetVpnGatewaysScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -261,7 +261,9 @@ func NewUrlMapsRESTClient(ctx context.Context, opts ...option.ClientOption) (*Ur
func defaultUrlMapsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -334,6 +336,9 @@ func (c *urlMapsRESTClient) AggregatedList(ctx context.Context, req *computepb.A
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -987,56 +992,3 @@ func (c *urlMapsRESTClient) Validate(ctx context.Context, req *computepb.Validat
}
return resp, nil
}
// UrlMapsScopedListPair is a holder type for string/*computepb.UrlMapsScopedList map entries
type UrlMapsScopedListPair struct {
Key string
Value *computepb.UrlMapsScopedList
}
// UrlMapsScopedListPairIterator manages a stream of UrlMapsScopedListPair.
type UrlMapsScopedListPairIterator struct {
items []UrlMapsScopedListPair
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 []UrlMapsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *UrlMapsScopedListPairIterator) 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 *UrlMapsScopedListPairIterator) Next() (UrlMapsScopedListPair, error) {
var item UrlMapsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *UrlMapsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *UrlMapsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -260,7 +260,9 @@ func NewVpnGatewaysRESTClient(ctx context.Context, opts ...option.ClientOption)
func defaultVpnGatewaysRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -333,6 +335,9 @@ func (c *vpnGatewaysRESTClient) AggregatedList(ctx context.Context, req *compute
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -892,103 +897,3 @@ func (c *vpnGatewaysRESTClient) TestIamPermissions(ctx context.Context, req *com
}
return resp, nil
}
// VpnGatewayIterator manages a stream of *computepb.VpnGateway.
type VpnGatewayIterator struct {
items []*computepb.VpnGateway
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.VpnGateway, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *VpnGatewayIterator) 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 *VpnGatewayIterator) Next() (*computepb.VpnGateway, error) {
var item *computepb.VpnGateway
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *VpnGatewayIterator) bufLen() int {
return len(it.items)
}
func (it *VpnGatewayIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// VpnGatewaysScopedListPair is a holder type for string/*computepb.VpnGatewaysScopedList map entries
type VpnGatewaysScopedListPair struct {
Key string
Value *computepb.VpnGatewaysScopedList
}
// VpnGatewaysScopedListPairIterator manages a stream of VpnGatewaysScopedListPair.
type VpnGatewaysScopedListPairIterator struct {
items []VpnGatewaysScopedListPair
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 []VpnGatewaysScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *VpnGatewaysScopedListPairIterator) 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 *VpnGatewaysScopedListPairIterator) Next() (VpnGatewaysScopedListPair, error) {
var item VpnGatewaysScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *VpnGatewaysScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *VpnGatewaysScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -231,7 +231,9 @@ func NewVpnTunnelsRESTClient(ctx context.Context, opts ...option.ClientOption) (
func defaultVpnTunnelsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -304,6 +306,9 @@ func (c *vpnTunnelsRESTClient) AggregatedList(ctx context.Context, req *computep
if req != nil && req.ReturnPartialSuccess != nil {
params.Add("returnPartialSuccess", fmt.Sprintf("%v", req.GetReturnPartialSuccess()))
}
if req != nil && req.ServiceProjectNumber != nil {
params.Add("serviceProjectNumber", fmt.Sprintf("%v", req.GetServiceProjectNumber()))
}
baseUrl.RawQuery = params.Encode()
@ -746,103 +751,3 @@ func (c *vpnTunnelsRESTClient) SetLabels(ctx context.Context, req *computepb.Set
}
return op, nil
}
// VpnTunnelIterator manages a stream of *computepb.VpnTunnel.
type VpnTunnelIterator struct {
items []*computepb.VpnTunnel
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.VpnTunnel, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *VpnTunnelIterator) 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 *VpnTunnelIterator) Next() (*computepb.VpnTunnel, error) {
var item *computepb.VpnTunnel
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *VpnTunnelIterator) bufLen() int {
return len(it.items)
}
func (it *VpnTunnelIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}
// VpnTunnelsScopedListPair is a holder type for string/*computepb.VpnTunnelsScopedList map entries
type VpnTunnelsScopedListPair struct {
Key string
Value *computepb.VpnTunnelsScopedList
}
// VpnTunnelsScopedListPairIterator manages a stream of VpnTunnelsScopedListPair.
type VpnTunnelsScopedListPairIterator struct {
items []VpnTunnelsScopedListPair
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 []VpnTunnelsScopedListPair, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *VpnTunnelsScopedListPairIterator) 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 *VpnTunnelsScopedListPairIterator) Next() (VpnTunnelsScopedListPair, error) {
var item VpnTunnelsScopedListPair
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *VpnTunnelsScopedListPairIterator) bufLen() int {
return len(it.items)
}
func (it *VpnTunnelsScopedListPairIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -187,7 +187,9 @@ func NewZoneOperationsRESTClient(ctx context.Context, opts ...option.ClientOptio
func defaultZoneOperationsRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}

View file

@ -1,4 +1,4 @@
// Copyright 2023 Google LLC
// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@ -167,7 +167,9 @@ func NewZonesRESTClient(ctx context.Context, opts ...option.ClientOption) (*Zone
func defaultZonesRESTClientOptions() []option.ClientOption {
return []option.ClientOption{
internaloption.WithDefaultEndpoint("https://compute.googleapis.com"),
internaloption.WithDefaultEndpointTemplate("https://compute.UNIVERSE_DOMAIN"),
internaloption.WithDefaultMTLSEndpoint("https://compute.mtls.googleapis.com"),
internaloption.WithDefaultUniverseDomain("googleapis.com"),
internaloption.WithDefaultAudience("https://compute.googleapis.com/"),
internaloption.WithDefaultScopes(DefaultAuthScopes()...),
}
@ -348,50 +350,3 @@ func (c *zonesRESTClient) List(ctx context.Context, req *computepb.ListZonesRequ
return it
}
// ZoneIterator manages a stream of *computepb.Zone.
type ZoneIterator struct {
items []*computepb.Zone
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.Zone, nextPageToken string, err error)
}
// PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
func (it *ZoneIterator) 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 *ZoneIterator) Next() (*computepb.Zone, error) {
var item *computepb.Zone
if err := it.nextFunc(); err != nil {
return item, err
}
item = it.items[0]
it.items = it.items[1:]
return item, nil
}
func (it *ZoneIterator) bufLen() int {
return len(it.items)
}
func (it *ZoneIterator) takeBuf() interface{} {
b := it.items
it.items = nil
return b
}

View file

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

View file

@ -29,6 +29,26 @@
"release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/ai/generativelanguage/apiv1": {
"api_shortname": "generativelanguage",
"distribution_name": "cloud.google.com/go/ai/generativelanguage/apiv1",
"description": "Generative Language API",
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/ai/latest/generativelanguage/apiv1",
"release_level": "preview",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/ai/generativelanguage/apiv1beta": {
"api_shortname": "generativelanguage",
"distribution_name": "cloud.google.com/go/ai/generativelanguage/apiv1beta",
"description": "Generative Language API",
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/ai/latest/generativelanguage/apiv1beta",
"release_level": "preview",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/ai/generativelanguage/apiv1beta2": {
"api_shortname": "generativelanguage",
"distribution_name": "cloud.google.com/go/ai/generativelanguage/apiv1beta2",
@ -179,6 +199,16 @@
"release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/apps/meet/apiv2beta": {
"api_shortname": "meet",
"distribution_name": "cloud.google.com/go/apps/meet/apiv2beta",
"description": "Google Meet API",
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/apps/latest/meet/apiv2beta",
"release_level": "preview",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/area120/tables/apiv1alpha1": {
"api_shortname": "area120tables",
"distribution_name": "cloud.google.com/go/area120/tables/apiv1alpha1",
@ -629,6 +659,16 @@
"release_level": "preview",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/cloudquotas/apiv1": {
"api_shortname": "cloudquotas",
"distribution_name": "cloud.google.com/go/cloudquotas/apiv1",
"description": "Cloud Quotas API",
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/cloudquotas/latest/apiv1",
"release_level": "preview",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/cloudtasks/apiv2": {
"api_shortname": "cloudtasks",
"distribution_name": "cloud.google.com/go/cloudtasks/apiv2",
@ -969,6 +1009,16 @@
"release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/discoveryengine/apiv1alpha": {
"api_shortname": "discoveryengine",
"distribution_name": "cloud.google.com/go/discoveryengine/apiv1alpha",
"description": "Discovery Engine API",
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/discoveryengine/latest/apiv1alpha",
"release_level": "preview",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/discoveryengine/apiv1beta": {
"api_shortname": "discoveryengine",
"distribution_name": "cloud.google.com/go/discoveryengine/apiv1beta",
@ -2099,6 +2149,16 @@
"release_level": "preview",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/securitycentermanagement/apiv1": {
"api_shortname": "securitycentermanagement",
"distribution_name": "cloud.google.com/go/securitycentermanagement/apiv1",
"description": "Security Center Management API",
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/securitycentermanagement/latest/apiv1",
"release_level": "preview",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/servicecontrol/apiv1": {
"api_shortname": "servicecontrol",
"distribution_name": "cloud.google.com/go/servicecontrol/apiv1",
@ -2159,6 +2219,16 @@
"release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/shopping/css/apiv1": {
"api_shortname": "css",
"distribution_name": "cloud.google.com/go/shopping/css/apiv1",
"description": "CSS API",
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/shopping/latest/css/apiv1",
"release_level": "preview",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/shopping/merchant/inventories/apiv1beta": {
"api_shortname": "merchantapi",
"distribution_name": "cloud.google.com/go/shopping/merchant/inventories/apiv1beta",
@ -2209,6 +2279,16 @@
"release_level": "stable",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/spanner/executor/apiv1": {
"api_shortname": "spanner-cloud-executor",
"distribution_name": "cloud.google.com/go/spanner/executor/apiv1",
"description": "Cloud Spanner Executor test API",
"language": "go",
"client_library_type": "generated",
"client_documentation": "https://cloud.google.com/go/docs/reference/cloud.google.com/go/spanner/latest/executor/apiv1",
"release_level": "preview",
"library_type": "GAPIC_AUTO"
},
"cloud.google.com/go/speech/apiv1": {
"api_shortname": "speech",
"distribution_name": "cloud.google.com/go/speech/apiv1",

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